summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--starmath/AllLangResTarget_sm.mk62
-rw-r--r--starmath/CppunitTest_starmath_qa_cppunit.mk118
-rw-r--r--starmath/JunitTest_sm_unoapi.mk (renamed from starmath/inc/makefile.mk)37
-rw-r--r--starmath/Library_sm.mk17
-rw-r--r--starmath/Library_smd.mk77
-rw-r--r--starmath/Module_starmath.mk55
-rw-r--r--starmath/Package_uiconfig.mk45
-rw-r--r--starmath/inc/applicat.hxx4
-rw-r--r--starmath/inc/caret.hxx6
-rw-r--r--starmath/inc/cursor.hxx6
-rw-r--r--starmath/inc/document.hxx4
-rw-r--r--starmath/inc/node.hxx2
-rw-r--r--starmath/inc/parse.hxx3
-rw-r--r--starmath/inc/rect.hxx3
-rw-r--r--starmath/inc/smdll.hxx20
-rw-r--r--starmath/inc/symbol.hxx1
-rw-r--r--starmath/inc/types.hxx2
-rw-r--r--starmath/inc/utility.hxx6
-rw-r--r--starmath/inc/visitors.hxx2
-rw-r--r--starmath/prj/build.lst11
-rw-r--r--starmath/prj/d.lst23
-rw-r--r--starmath/prj/gbuild.lst2
-rw-r--r--starmath/prj/makefile.mk2
-rw-r--r--starmath/qa/cppunit/makefile.mk147
-rw-r--r--starmath/qa/cppunit/test_nodetotextvisitors.cxx2
-rw-r--r--starmath/qa/cppunit/test_starmath.cxx15
-rw-r--r--starmath/qa/cppunit/version.map34
-rw-r--r--starmath/qa/unoapi/Test.java52
-rw-r--r--starmath/sdi/makefile.mk58
-rw-r--r--starmath/source/cursor.cxx6
-rw-r--r--starmath/source/detreg.cxx11
-rw-r--r--starmath/source/document.cxx6
-rw-r--r--starmath/source/edit.cxx2
-rw-r--r--starmath/source/eqnolefilehdr.cxx28
-rw-r--r--starmath/source/eqnolefilehdr.hxx26
-rwxr-xr-xstarmath/source/makefile.mk113
-rw-r--r--starmath/source/math_pch.cxx3
-rw-r--r--starmath/source/mathmlexport.cxx25
-rw-r--r--starmath/source/mathmlimport.cxx21
-rw-r--r--starmath/source/node.cxx11
-rw-r--r--starmath/source/parse.cxx10
-rw-r--r--starmath/source/register.cxx11
-rw-r--r--starmath/source/smdetect.cxx7
-rw-r--r--starmath/source/smdll.cxx104
-rw-r--r--starmath/source/symbol.cxx2
-rw-r--r--starmath/source/unodoc.cxx9
-rw-r--r--starmath/source/unomodel.cxx32
-rw-r--r--starmath/source/view.cxx8
-rw-r--r--starmath/source/visitors.cxx46
-rw-r--r--starmath/util/hidother.src116
-rw-r--r--starmath/util/makefile.mk127
-rw-r--r--starmath/util/sm.component2
-rw-r--r--starmath/util/smd.component2
-rwxr-xr-xstarmath/workben/smath-dump-watch.sh8
-rw-r--r--sw/CppunitTest_sw_swdoc_test.mk127
-rw-r--r--sw/CppunitTest_sw_test_filters.mk110
-rwxr-xr-xsw/JunitTest_sw_complex.mk10
-rwxr-xr-xsw/JunitTest_sw_unoapi.mk2
-rw-r--r--sw/Library_msword.mk20
-rw-r--r--sw/Library_sw.mk20
-rw-r--r--sw/Library_swd.mk11
-rw-r--r--sw/Library_swui.mk8
-rw-r--r--sw/Library_vbaswobj.mk15
-rw-r--r--sw/Module_sw.mk5
-rw-r--r--sw/inc/IDocumentState.hxx2
-rw-r--r--sw/inc/IDocumentStylePoolAccess.hxx10
-rw-r--r--sw/inc/PostItMgr.hxx5
-rw-r--r--sw/inc/SwNodeNum.hxx1
-rw-r--r--sw/inc/SwNumberTree.hxx4
-rw-r--r--sw/inc/SwRewriter.hxx2
-rw-r--r--sw/inc/SwStyleNameMapper.hxx4
-rw-r--r--sw/inc/accmap.hxx1
-rw-r--r--sw/inc/anchoreddrawobject.hxx4
-rw-r--r--sw/inc/anchoredobject.hxx11
-rw-r--r--sw/inc/authfld.hxx4
-rw-r--r--sw/inc/bparr.hxx4
-rw-r--r--sw/inc/cmdid.h1
-rw-r--r--sw/inc/comcore.hrc3
-rw-r--r--sw/inc/crsrsh.hxx5
-rw-r--r--sw/inc/crstate.hxx2
-rw-r--r--sw/inc/dbgoutsw.hxx4
-rw-r--r--sw/inc/doc.hxx15
-rw-r--r--sw/inc/docufld.hxx16
-rw-r--r--sw/inc/editsh.hxx4
-rw-r--r--sw/inc/extinput.hxx9
-rw-r--r--sw/inc/fesh.hxx2
-rw-r--r--sw/inc/fldbas.hxx5
-rw-r--r--sw/inc/fldui.hrc28
-rw-r--r--sw/inc/fmtfsize.hxx4
-rw-r--r--sw/inc/fmtui.hrc2
-rw-r--r--sw/inc/format.hxx4
-rw-r--r--sw/inc/frmfmt.hxx2
-rw-r--r--sw/inc/ftnidx.hxx9
-rw-r--r--sw/inc/globals.hrc8
-rw-r--r--sw/inc/helpid.h1
-rw-r--r--sw/inc/index.hrc2
-rw-r--r--sw/inc/iodetect.hxx16
-rw-r--r--sw/inc/ndgrf.hxx2
-rw-r--r--sw/inc/ndhints.hxx4
-rw-r--r--sw/inc/ndole.hxx2
-rw-r--r--sw/inc/ndtxt.hxx2
-rw-r--r--sw/inc/node.hxx6
-rw-r--r--sw/inc/paratr.hxx3
-rw-r--r--sw/inc/pch/precompiled_sw.hxx2
-rw-r--r--sw/inc/printdata.hxx2
-rw-r--r--sw/inc/rcid.hrc2
-rw-r--r--sw/inc/redline.hxx5
-rw-r--r--sw/inc/reffld.hxx17
-rw-r--r--sw/inc/ring.hxx2
-rw-r--r--sw/inc/section.hxx74
-rw-r--r--sw/inc/shellid.hxx4
-rw-r--r--sw/inc/shellio.hxx149
-rw-r--r--sw/inc/shellres.hxx22
-rw-r--r--sw/inc/sortopt.hxx4
-rw-r--r--sw/inc/splargs.hxx2
-rw-r--r--sw/inc/swabstdlg.hxx8
-rw-r--r--sw/inc/swacorr.hxx9
-rw-r--r--sw/inc/swatrset.hxx29
-rw-r--r--sw/inc/swbaslnk.hxx8
-rw-r--r--sw/inc/swcrsr.hxx26
-rw-r--r--sw/inc/swdbtoolsclient.hxx2
-rw-r--r--sw/inc/swddetbl.hxx5
-rw-r--r--sw/inc/swddllapi.h16
-rw-r--r--sw/inc/swdll.hxx28
-rw-r--r--sw/inc/swevent.hxx6
-rw-r--r--sw/inc/swgstr.hxx65
-rw-r--r--sw/inc/switerator.hxx4
-rw-r--r--sw/inc/swmodule.hxx62
-rw-r--r--sw/inc/swrect.hxx10
-rw-r--r--sw/inc/swregion.hxx10
-rw-r--r--sw/inc/swtable.hxx109
-rw-r--r--sw/inc/swtblfmt.hxx8
-rw-r--r--sw/inc/swtypes.hxx234
-rw-r--r--sw/inc/swundo.hxx9
-rw-r--r--sw/inc/tabcol.hxx29
-rw-r--r--sw/inc/tblafmt.hxx26
-rw-r--r--sw/inc/tblenum.hxx30
-rw-r--r--sw/inc/tblsel.hxx75
-rw-r--r--sw/inc/tox.hxx10
-rw-r--r--sw/inc/txatbase.hxx2
-rw-r--r--sw/inc/txtatr.hxx7
-rw-r--r--sw/inc/txtflcnt.hxx6
-rw-r--r--sw/inc/txtftn.hxx13
-rw-r--r--sw/inc/txtrfmrk.hxx2
-rw-r--r--sw/inc/txttxmrk.hxx2
-rw-r--r--sw/inc/undobj.hxx55
-rw-r--r--sw/inc/unobaseclass.hxx3
-rw-r--r--sw/inc/unocrsr.hxx14
-rw-r--r--sw/inc/unodraw.hxx15
-rw-r--r--sw/inc/unoevtlstnr.hxx6
-rw-r--r--sw/inc/unomap.hxx12
-rw-r--r--sw/inc/unoredlines.hxx2
-rw-r--r--sw/inc/unosett.hxx8
-rw-r--r--sw/inc/unotbl.hxx2
-rw-r--r--sw/inc/usrfld.hxx12
-rw-r--r--sw/inc/viewopt.hxx92
-rw-r--r--sw/inc/viewsh.hxx205
-rw-r--r--sw/inc/viscrs.hxx37
-rw-r--r--sw/inc/wdocsh.hxx4
-rw-r--r--sw/prj/build.lst2
-rw-r--r--sw/qa/complex/accessibility/makefile.mk50
-rw-r--r--sw/qa/complex/checkColor/makefile.mk50
-rw-r--r--sw/qa/core/Test-BigPtrArray.cxx45
-rw-r--r--sw/qa/core/bigpointerarray-new.cxx12
-rw-r--r--sw/qa/core/bigpointerarray-new.hxx2
-rw-r--r--sw/qa/core/data/rtf/fail/CVE-2005-2971-1.rtf11
-rw-r--r--sw/qa/core/data/rtf/fail/CVE-2010-3451-1.rtf (renamed from sw/qa/core/CVE/CVE-2010-3451-1.rtf)0
-rw-r--r--sw/qa/core/data/rtf/indeterminate/.gitignore0
-rw-r--r--sw/qa/core/data/rtf/pass/.gitignore0
-rw-r--r--sw/qa/core/data/rtf/pass/CVE-2005-2964.rtf11
-rw-r--r--sw/qa/core/data/rtf/pass/CVE-2005-2972-1.rtf57
-rw-r--r--sw/qa/core/data/rtf/pass/CVE-2005-2972-2.rtf57
-rw-r--r--sw/qa/core/data/rtf/pass/CVE-2007-0245-1.rtf (renamed from sw/qa/core/CVE/CVE-2007-0245-1.rtf)0
-rw-r--r--sw/qa/core/data/rtf/pass/CVE-2010-3333-1.rtfbin0 -> 11289 bytes
-rw-r--r--sw/qa/core/data/rtf/pass/CVE-2010-3452-1.rtf (renamed from sw/qa/core/CVE/CVE-2010-3452-1.rtf)0
-rw-r--r--sw/qa/core/data/ww8/fail/.gitignore0
-rw-r--r--sw/qa/core/data/ww8/fail/CVE-2005-0941-1.docbin0 -> 32256 bytes
-rw-r--r--sw/qa/core/data/ww8/fail/CVE-2006-2389-1.docbin0 -> 98816 bytes
-rw-r--r--sw/qa/core/data/ww8/fail/CVE-2008-0320-1.docbin0 -> 116224 bytes
-rw-r--r--sw/qa/core/data/ww8/indeterminate/.gitignore0
-rw-r--r--sw/qa/core/data/ww8/pass/.gitignore0
-rw-r--r--sw/qa/core/data/ww8/pass/CVE-2006-6561-1.docbin0 -> 26624 bytes
-rw-r--r--[l---------]sw/qa/core/data/ww8/pass/CVE-2008-4841-1.docbin19 -> 101888 bytes
-rw-r--r--sw/qa/core/data/ww8/pass/CVE-2009-0200-1.doc (renamed from sw/qa/core/CVE/CVE-2009-0200-1.doc)bin8192 -> 8192 bytes
-rw-r--r--sw/qa/core/data/ww8/pass/CVE-2009-0201-1.doc (renamed from sw/qa/core/CVE/CVE-2009-0201-1.doc)bin8192 -> 8192 bytes
-rw-r--r--sw/qa/core/data/ww8/pass/CVE-2009-3301-1.doc (renamed from sw/qa/core/CVE/CVE-2009-3301-1.doc)bin27648 -> 27648 bytes
-rw-r--r--sw/qa/core/data/ww8/pass/CVE-2009-3302-1.doc (renamed from sw/qa/core/CVE/CVE-2009-3302-1.doc)bin27648 -> 27648 bytes
-rw-r--r--sw/qa/core/data/ww8/pass/CVE-2009-3302-2.doc (renamed from sw/qa/core/CVE/CVE-2009-3302-2.doc)bin27648 -> 27648 bytes
-rw-r--r--sw/qa/core/data/ww8/pass/CVE-2010-3453-1.doc (renamed from sw/qa/core/CVE/CVE-2010-3453-1.doc)bin126464 -> 126464 bytes
-rw-r--r--sw/qa/core/data/ww8/pass/CVE-2010-3454-1.doc (renamed from sw/qa/core/CVE/CVE-2010-3454-1.doc)bin126464 -> 126464 bytes
-rw-r--r--sw/qa/core/data/xml/fail/.gitignore0
-rw-r--r--sw/qa/core/data/xml/fail/CVE-2006-3117-1.sxw (renamed from sw/qa/core/CVE/CVE-2006-3117-1.sxw)bin441416 -> 441416 bytes
-rw-r--r--sw/qa/core/data/xml/indeterminate/.gitignore0
-rw-r--r--sw/qa/core/data/xml/pass/.gitignore0
-rw-r--r--sw/qa/core/export.map34
-rw-r--r--sw/qa/core/filters-test.cxx204
-rw-r--r--sw/qa/core/swdoc-test.cxx188
-rw-r--r--sw/qa/unoapi/knownissues.xcl6
-rw-r--r--sw/sdi/_basesh.sdi4
-rw-r--r--sw/sdi/_textsh.sdi13
-rw-r--r--sw/sdi/swriter.sdi27
-rw-r--r--sw/sdi/textsh.sdi30
-rw-r--r--sw/source/core/SwNumberTree/SwNodeNum.cxx46
-rw-r--r--sw/source/core/SwNumberTree/SwNumberTree.cxx34
-rw-r--r--sw/source/core/access/acccell.cxx30
-rw-r--r--sw/source/core/access/acccontext.cxx108
-rw-r--r--sw/source/core/access/acccontext.hxx3
-rw-r--r--sw/source/core/access/accdoc.cxx20
-rw-r--r--sw/source/core/access/accembedded.cxx16
-rw-r--r--sw/source/core/access/accfootnote.cxx17
-rw-r--r--sw/source/core/access/accframebase.cxx6
-rw-r--r--sw/source/core/access/accgraphic.cxx17
-rw-r--r--sw/source/core/access/accheaderfooter.cxx17
-rw-r--r--sw/source/core/access/accmap.cxx20
-rw-r--r--sw/source/core/access/accnotextframe.cxx2
-rw-r--r--sw/source/core/access/accnotextframe.hxx1
-rw-r--r--sw/source/core/access/accpage.cxx23
-rw-r--r--sw/source/core/access/accpara.cxx85
-rw-r--r--sw/source/core/access/accpara.hxx5
-rw-r--r--sw/source/core/access/accportions.cxx100
-rw-r--r--sw/source/core/access/accportions.hxx1
-rw-r--r--sw/source/core/access/accpreview.cxx17
-rw-r--r--sw/source/core/access/accselectionhelper.cxx7
-rw-r--r--sw/source/core/access/acctable.cxx39
-rw-r--r--sw/source/core/access/acctable.hxx1
-rw-r--r--sw/source/core/access/acctextframe.cxx23
-rw-r--r--sw/source/core/access/acctextframe.hxx2
-rw-r--r--sw/source/core/access/textmarkuphelper.cxx5
-rw-r--r--sw/source/core/access/textmarkuphelper.hxx1
-rw-r--r--sw/source/core/attr/calbck.cxx2
-rw-r--r--sw/source/core/bastyp/bparr.cxx12
-rw-r--r--sw/source/core/bastyp/breakit.cxx2
-rw-r--r--sw/source/core/bastyp/calc.cxx9
-rw-r--r--sw/source/core/bastyp/index.cxx2
-rw-r--r--sw/source/core/bastyp/init.cxx48
-rw-r--r--sw/source/core/bastyp/swcache.cxx87
-rw-r--r--sw/source/core/bastyp/swregion.cxx4
-rw-r--r--sw/source/core/crsr/bookmrk.cxx2
-rw-r--r--sw/source/core/crsr/crsrsh.cxx69
-rw-r--r--sw/source/core/crsr/crstrvl.cxx3
-rw-r--r--sw/source/core/crsr/findattr.cxx31
-rw-r--r--sw/source/core/crsr/findtxt.cxx26
-rw-r--r--sw/source/core/crsr/swcrsr.cxx6
-rw-r--r--sw/source/core/crsr/trvltbl.cxx7
-rw-r--r--sw/source/core/crsr/viscrs.cxx2
-rw-r--r--sw/source/core/doc/SwStyleNameMapper.cxx1
-rw-r--r--sw/source/core/doc/acmplwrd.cxx4
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx2
-rw-r--r--sw/source/core/doc/doc.cxx36
-rw-r--r--sw/source/core/doc/docbm.cxx37
-rw-r--r--sw/source/core/doc/doccomp.cxx12
-rw-r--r--sw/source/core/doc/doccorr.cxx16
-rw-r--r--sw/source/core/doc/docdesc.cxx42
-rw-r--r--sw/source/core/doc/docedt.cxx31
-rw-r--r--sw/source/core/doc/docfld.cxx14
-rw-r--r--sw/source/core/doc/docfmt.cxx98
-rw-r--r--sw/source/core/doc/docftn.cxx4
-rw-r--r--sw/source/core/doc/docglbl.cxx516
-rw-r--r--sw/source/core/doc/docglos.cxx8
-rw-r--r--sw/source/core/doc/doclay.cxx25
-rw-r--r--sw/source/core/doc/docnum.cxx71
-rw-r--r--sw/source/core/doc/docredln.cxx47
-rw-r--r--sw/source/core/doc/docruby.cxx6
-rw-r--r--sw/source/core/doc/docsort.cxx6
-rw-r--r--sw/source/core/doc/doctxm.cxx6
-rw-r--r--sw/source/core/doc/docxforms.cxx14
-rw-r--r--sw/source/core/doc/extinput.cxx11
-rw-r--r--sw/source/core/doc/fmtcol.cxx11
-rw-r--r--sw/source/core/doc/ftnidx.cxx6
-rw-r--r--sw/source/core/doc/htmltbl.cxx1
-rw-r--r--sw/source/core/doc/notxtfrm.cxx17
-rw-r--r--sw/source/core/doc/number.cxx75
-rw-r--r--sw/source/core/doc/poolfmt.cxx11
-rw-r--r--sw/source/core/doc/sortopt.cxx2
-rw-r--r--sw/source/core/doc/tblrwcl.cxx4
-rw-r--r--sw/source/core/docnode/ndcopy.cxx17
-rwxr-xr-x[-rw-r--r--]sw/source/core/docnode/ndnotxt.cxx38
-rw-r--r--sw/source/core/docnode/ndsect.cxx3
-rw-r--r--sw/source/core/docnode/ndtbl.cxx47
-rw-r--r--sw/source/core/docnode/node.cxx28
-rw-r--r--sw/source/core/docnode/nodes.cxx5
-rw-r--r--sw/source/core/docnode/section.cxx38
-rw-r--r--sw/source/core/docnode/swbaslnk.cxx12
-rw-r--r--sw/source/core/docnode/swthreadjoiner.cxx10
-rw-r--r--sw/source/core/draw/dcontact.cxx107
-rw-r--r--sw/source/core/draw/dflyobj.cxx65
-rw-r--r--sw/source/core/draw/dpage.cxx3
-rw-r--r--sw/source/core/draw/drawdoc.cxx4
-rw-r--r--sw/source/core/draw/dview.cxx16
-rw-r--r--sw/source/core/edit/acorrect.cxx2
-rw-r--r--sw/source/core/edit/autofmt.cxx24
-rw-r--r--sw/source/core/edit/edatmisc.cxx4
-rw-r--r--sw/source/core/edit/edfcol.cxx6
-rw-r--r--sw/source/core/edit/edfmt.cxx3
-rw-r--r--sw/source/core/edit/editsh.cxx4
-rw-r--r--sw/source/core/edit/edlingu.cxx10
-rw-r--r--sw/source/core/edit/ednumber.cxx20
-rw-r--r--sw/source/core/edit/edsect.cxx8
-rw-r--r--sw/source/core/fields/authfld.cxx6
-rw-r--r--sw/source/core/fields/ddefld.cxx10
-rw-r--r--sw/source/core/fields/docufld.cxx16
-rw-r--r--sw/source/core/fields/expfld.cxx4
-rw-r--r--sw/source/core/fields/fldbas.cxx11
-rw-r--r--sw/source/core/fields/macrofld.cxx4
-rw-r--r--sw/source/core/fields/reffld.cxx193
-rw-r--r--sw/source/core/frmedt/fecopy.cxx13
-rw-r--r--sw/source/core/frmedt/fefly1.cxx17
-rw-r--r--sw/source/core/frmedt/feshview.cxx44
-rw-r--r--sw/source/core/frmedt/fetab.cxx15
-rw-r--r--sw/source/core/frmedt/fews.cxx60
-rw-r--r--sw/source/core/frmedt/tblsel.cxx17
-rw-r--r--sw/source/core/graphic/grfatr.cxx8
-rwxr-xr-x[-rw-r--r--]sw/source/core/graphic/ndgrf.cxx73
-rw-r--r--sw/source/core/inc/SwXMLBlockExport.hxx2
-rw-r--r--sw/source/core/inc/SwXMLBlockImport.hxx3
-rw-r--r--sw/source/core/inc/UndoAttribute.hxx15
-rw-r--r--sw/source/core/inc/UndoBookmark.hxx1
-rw-r--r--sw/source/core/inc/UndoCore.hxx13
-rw-r--r--sw/source/core/inc/UndoDelete.hxx2
-rw-r--r--sw/source/core/inc/UndoDraw.hxx6
-rw-r--r--sw/source/core/inc/UndoInsert.hxx11
-rw-r--r--sw/source/core/inc/UndoOverwrite.hxx1
-rw-r--r--sw/source/core/inc/UndoTable.hxx40
-rw-r--r--sw/source/core/inc/ascharanchoredobjectposition.hxx24
-rw-r--r--sw/source/core/inc/cellfrm.hxx3
-rw-r--r--sw/source/core/inc/cntfrm.hxx13
-rw-r--r--sw/source/core/inc/dbgloop.hxx77
-rw-r--r--sw/source/core/inc/doctxm.hxx4
-rw-r--r--sw/source/core/inc/dumpfilter.hxx87
-rw-r--r--sw/source/core/inc/dview.hxx13
-rw-r--r--sw/source/core/inc/flowfrm.hxx13
-rw-r--r--sw/source/core/inc/flyfrm.hxx2
-rw-r--r--sw/source/core/inc/flyfrms.hxx33
-rw-r--r--sw/source/core/inc/frame.hxx138
-rw-r--r--sw/source/core/inc/ftnfrm.hxx6
-rw-r--r--sw/source/core/inc/layact.hxx6
-rw-r--r--sw/source/core/inc/layfrm.hxx1
-rw-r--r--sw/source/core/inc/layouter.hxx15
-rw-r--r--sw/source/core/inc/movedfwdfrmsbyobjpos.hxx3
-rw-r--r--sw/source/core/inc/mvsave.hxx7
-rw-r--r--sw/source/core/inc/pagefrm.hxx2
-rw-r--r--sw/source/core/inc/rolbck.hxx18
-rw-r--r--sw/source/core/inc/rootfrm.hxx2
-rw-r--r--sw/source/core/inc/rowfrm.hxx9
-rw-r--r--sw/source/core/inc/scriptinfo.hxx25
-rw-r--r--sw/source/core/inc/sectfrm.hxx2
-rw-r--r--sw/source/core/inc/swthreadjoiner.hxx2
-rw-r--r--sw/source/core/inc/tabfrm.hxx16
-rw-r--r--sw/source/core/inc/threadmanager.hxx1
-rw-r--r--sw/source/core/inc/txtfrm.hxx7
-rwxr-xr-x[-rw-r--r--]sw/source/core/inc/viewimp.hxx10
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx58
-rw-r--r--sw/source/core/layout/anchoredobject.cxx36
-rw-r--r--sw/source/core/layout/atrfrm.cxx48
-rw-r--r--sw/source/core/layout/calcmove.cxx98
-rw-r--r--sw/source/core/layout/colfrm.cxx6
-rw-r--r--sw/source/core/layout/dbg_lay.cxx245
-rw-r--r--sw/source/core/layout/dumpfilter.cxx210
-rw-r--r--sw/source/core/layout/findfrm.cxx27
-rw-r--r--sw/source/core/layout/flowfrm.cxx162
-rwxr-xr-x[-rw-r--r--]sw/source/core/layout/fly.cxx171
-rw-r--r--sw/source/core/layout/flycnt.cxx7
-rw-r--r--sw/source/core/layout/flyincnt.cxx12
-rw-r--r--sw/source/core/layout/frmtool.cxx149
-rw-r--r--sw/source/core/layout/ftnfrm.cxx93
-rw-r--r--sw/source/core/layout/hffrm.cxx14
-rw-r--r--sw/source/core/layout/layact.cxx72
-rw-r--r--sw/source/core/layout/laycache.cxx84
-rw-r--r--sw/source/core/layout/layhelp.hxx10
-rw-r--r--sw/source/core/layout/layouter.cxx36
-rw-r--r--sw/source/core/layout/movedfwdfrmsbyobjpos.cxx6
-rw-r--r--sw/source/core/layout/newfrm.cxx8
-rw-r--r--sw/source/core/layout/objectformatter.cxx23
-rw-r--r--sw/source/core/layout/objectformatterlayfrm.cxx23
-rw-r--r--sw/source/core/layout/objectformatterlayfrm.hxx3
-rw-r--r--sw/source/core/layout/pagechg.cxx42
-rw-r--r--sw/source/core/layout/pagedesc.cxx5
-rw-r--r--sw/source/core/layout/pagefrm.src1
-rwxr-xr-x[-rw-r--r--]sw/source/core/layout/paintfrm.cxx463
-rw-r--r--sw/source/core/layout/sectfrm.cxx42
-rw-r--r--sw/source/core/layout/sortedobjsimpl.cxx12
-rw-r--r--sw/source/core/layout/ssfrm.cxx14
-rw-r--r--sw/source/core/layout/tabfrm.cxx334
-rw-r--r--sw/source/core/layout/trvlfrm.cxx92
-rw-r--r--sw/source/core/layout/virtoutp.hxx2
-rw-r--r--sw/source/core/layout/wsfrm.cxx101
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx1
-rw-r--r--sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx3
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx13
-rw-r--r--sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx9
-rw-r--r--sw/source/core/ole/ndole.cxx22
-rw-r--r--sw/source/core/sw3io/sw3convert.cxx108
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks.cxx27
-rw-r--r--sw/source/core/swg/SwXMLTextBlocks1.cxx12
-rw-r--r--sw/source/core/table/swnewtable.cxx4
-rw-r--r--sw/source/core/table/swtable.cxx36
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx36
-rw-r--r--sw/source/core/text/atrstck.cxx3
-rw-r--r--sw/source/core/text/blink.cxx2
-rwxr-xr-x[-rw-r--r--]sw/source/core/text/frmform.cxx64
-rw-r--r--sw/source/core/text/frmpaint.cxx21
-rw-r--r--sw/source/core/text/guess.cxx61
-rw-r--r--sw/source/core/text/inftxt.cxx26
-rw-r--r--sw/source/core/text/inftxt.hxx11
-rw-r--r--sw/source/core/text/itradj.cxx12
-rw-r--r--sw/source/core/text/itrcrsr.cxx69
-rw-r--r--sw/source/core/text/itrform2.cxx18
-rw-r--r--sw/source/core/text/itrpaint.cxx9
-rw-r--r--sw/source/core/text/itrtxt.hxx6
-rw-r--r--sw/source/core/text/porfld.cxx30
-rw-r--r--sw/source/core/text/porfld.hxx3
-rw-r--r--sw/source/core/text/porfly.cxx9
-rw-r--r--sw/source/core/text/porftn.hxx6
-rw-r--r--sw/source/core/text/porlay.cxx21
-rw-r--r--sw/source/core/text/porlay.hxx9
-rw-r--r--sw/source/core/text/porlin.hxx3
-rw-r--r--sw/source/core/text/pormulti.cxx10
-rw-r--r--sw/source/core/text/porrst.cxx6
-rw-r--r--sw/source/core/text/portxt.cxx6
-rw-r--r--sw/source/core/text/portxt.hxx4
-rw-r--r--sw/source/core/text/redlnitr.cxx9
-rw-r--r--sw/source/core/text/redlnitr.hxx13
-rw-r--r--sw/source/core/text/txtfld.cxx5
-rw-r--r--sw/source/core/text/txtfly.cxx263
-rw-r--r--sw/source/core/text/txtfrm.cxx77
-rw-r--r--sw/source/core/text/txtftn.cxx21
-rw-r--r--sw/source/core/text/txthyph.cxx3
-rw-r--r--sw/source/core/text/txttab.cxx25
-rwxr-xr-x[-rw-r--r--]sw/source/core/text/widorp.cxx17
-rw-r--r--sw/source/core/text/wrong.cxx5
-rw-r--r--sw/source/core/text/xmldump.cxx214
-rw-r--r--sw/source/core/tox/tox.cxx7
-rw-r--r--sw/source/core/tox/toxhlp.cxx13
-rw-r--r--sw/source/core/txtnode/atrfld.cxx6
-rw-r--r--sw/source/core/txtnode/atrflyin.cxx3
-rw-r--r--sw/source/core/txtnode/atrftn.cxx186
-rw-r--r--sw/source/core/txtnode/fmtatr2.cxx4
-rw-r--r--sw/source/core/txtnode/fntcache.cxx7
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx196
-rw-r--r--sw/source/core/txtnode/swfont.cxx2
-rw-r--r--sw/source/core/txtnode/thints.cxx34
-rw-r--r--sw/source/core/txtnode/txtedt.cxx78
-rw-r--r--sw/source/core/undo/SwUndoPageDesc.cxx16
-rw-r--r--sw/source/core/undo/docundo.cxx1
-rw-r--r--sw/source/core/undo/rolbck.cxx42
-rw-r--r--sw/source/core/undo/unattr.cxx49
-rw-r--r--sw/source/core/undo/unbkmk.cxx2
-rw-r--r--sw/source/core/undo/undo.src4
-rw-r--r--sw/source/core/undo/undobj.cxx12
-rw-r--r--sw/source/core/undo/undobj1.cxx3
-rw-r--r--sw/source/core/undo/undraw.cxx1
-rw-r--r--sw/source/core/undo/unfmco.cxx6
-rw-r--r--sw/source/core/undo/unins.cxx1
-rw-r--r--sw/source/core/undo/unnum.cxx6
-rw-r--r--sw/source/core/undo/unoutl.cxx2
-rw-r--r--sw/source/core/undo/unredln.cxx2
-rw-r--r--sw/source/core/undo/unsort.cxx14
-rw-r--r--sw/source/core/undo/untbl.cxx136
-rw-r--r--sw/source/core/unocore/SwXTextDefaults.cxx8
-rw-r--r--sw/source/core/unocore/TextCursorHelper.cxx10
-rw-r--r--sw/source/core/unocore/swunohelper.cxx7
-rw-r--r--sw/source/core/unocore/unobkm.cxx12
-rw-r--r--sw/source/core/unocore/unochart.cxx100
-rw-r--r--sw/source/core/unocore/unocoll.cxx9
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx14
-rw-r--r--sw/source/core/unocore/unodraw.cxx38
-rw-r--r--sw/source/core/unocore/unoevtlstnr.cxx1
-rw-r--r--sw/source/core/unocore/unofield.cxx37
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx24
-rwxr-xr-x[-rw-r--r--]sw/source/core/unocore/unoframe.cxx119
-rw-r--r--sw/source/core/unocore/unoftn.cxx32
-rw-r--r--sw/source/core/unocore/unoidx.cxx22
-rw-r--r--sw/source/core/unocore/unomap.cxx4
-rw-r--r--sw/source/core/unocore/unoobj.cxx91
-rw-r--r--sw/source/core/unocore/unoobj2.cxx26
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx24
-rw-r--r--sw/source/core/unocore/unoport.cxx19
-rw-r--r--sw/source/core/unocore/unoportenum.cxx40
-rw-r--r--sw/source/core/unocore/unoprnms.cxx3
-rw-r--r--sw/source/core/unocore/unoredline.cxx56
-rw-r--r--sw/source/core/unocore/unoredlines.cxx1
-rw-r--r--sw/source/core/unocore/unorefmk.cxx17
-rw-r--r--sw/source/core/unocore/unosect.cxx14
-rw-r--r--sw/source/core/unocore/unosett.cxx55
-rw-r--r--sw/source/core/unocore/unosrch.cxx17
-rw-r--r--sw/source/core/unocore/unostyle.cxx48
-rw-r--r--sw/source/core/unocore/unotbl.cxx102
-rw-r--r--sw/source/core/unocore/unotext.cxx67
-rw-r--r--sw/source/core/unocore/unotextmarkup.cxx1
-rw-r--r--sw/source/core/view/printdata.cxx19
-rwxr-xr-x[-rw-r--r--]sw/source/core/view/vdraw.cxx5
-rw-r--r--sw/source/core/view/viewpg.cxx10
-rw-r--r--sw/source/core/view/viewsh.cxx32
-rw-r--r--sw/source/core/view/vnew.cxx3
-rw-r--r--sw/source/core/view/vprint.cxx17
-rw-r--r--sw/source/filter/ascii/wrtasc.cxx2
-rw-r--r--sw/source/filter/basflt/fltini.cxx23
-rw-r--r--sw/source/filter/basflt/iodetect.cxx6
-rw-r--r--sw/source/filter/basflt/shellio.cxx4
-rw-r--r--sw/source/filter/html/SwAppletImpl.cxx6
-rw-r--r--sw/source/filter/html/css1atr.cxx218
-rw-r--r--sw/source/filter/html/css1kywd.cxx5
-rw-r--r--sw/source/filter/html/css1kywd.hxx5
-rw-r--r--sw/source/filter/html/htmlatr.cxx48
-rw-r--r--sw/source/filter/html/htmlcss1.cxx34
-rw-r--r--sw/source/filter/html/htmldraw.cxx45
-rw-r--r--sw/source/filter/html/htmlfld.cxx28
-rw-r--r--sw/source/filter/html/htmlform.cxx140
-rw-r--r--sw/source/filter/html/htmlgrin.cxx97
-rw-r--r--sw/source/filter/html/htmlnum.cxx67
-rw-r--r--sw/source/filter/html/htmlplug.cxx188
-rw-r--r--sw/source/filter/html/htmlsect.cxx59
-rw-r--r--sw/source/filter/html/htmltab.cxx328
-rw-r--r--sw/source/filter/html/parcss1.cxx29
-rw-r--r--sw/source/filter/html/parcss1.hxx14
-rw-r--r--sw/source/filter/html/svxcss1.cxx243
-rw-r--r--sw/source/filter/html/svxcss1.hxx104
-rw-r--r--sw/source/filter/html/swhtml.cxx334
-rw-r--r--sw/source/filter/html/swhtml.hxx45
-rw-r--r--sw/source/filter/html/wrthtml.cxx24
-rw-r--r--sw/source/filter/html/wrthtml.hxx8
-rw-r--r--sw/source/filter/inc/fltshell.hxx84
-rw-r--r--sw/source/filter/inc/msfilter.hxx23
-rw-r--r--sw/source/filter/inc/wrtswtbl.hxx6
-rw-r--r--sw/source/filter/rtf/rtffld.cxx12
-rw-r--r--sw/source/filter/rtf/rtffly.cxx4
-rw-r--r--sw/source/filter/rtf/rtfnum.cxx9
-rw-r--r--sw/source/filter/rtf/rtftbl.cxx17
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx89
-rw-r--r--sw/source/filter/rtf/swparrtf.hxx7
-rw-r--r--sw/source/filter/writer/writer.cxx9
-rw-r--r--sw/source/filter/writer/wrtswtbl.cxx1
-rw-r--r--sw/source/filter/ww1/fltshell.cxx380
-rw-r--r--sw/source/filter/ww1/w1class.cxx82
-rw-r--r--sw/source/filter/ww1/w1class.hxx21
-rw-r--r--sw/source/filter/ww1/w1filter.cxx76
-rw-r--r--sw/source/filter/ww8/WW8Sttbf.cxx60
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.cxx56
-rw-r--r--sw/source/filter/ww8/WW8TableInfo.hxx2
-rw-r--r--sw/source/filter/ww8/attributeoutputbase.hxx6
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx220
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx37
-rw-r--r--sw/source/filter/ww8/docxexport.cxx31
-rw-r--r--sw/source/filter/ww8/docxexport.hxx3
-rw-r--r--sw/source/filter/ww8/docxexportfilter.cxx11
-rw-r--r--sw/source/filter/ww8/escher.hxx3
-rw-r--r--sw/source/filter/ww8/hash_wrap.hxx1
-rw-r--r--sw/source/filter/ww8/needed_cast.hxx3
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx20
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx4
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx7
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.hxx6
-rw-r--r--sw/source/filter/ww8/sortedarray.hxx1
-rw-r--r--sw/source/filter/ww8/styles.cxx3
-rw-r--r--sw/source/filter/ww8/types.hxx6
-rw-r--r--sw/source/filter/ww8/typessw.hxx46
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx17
-rw-r--r--sw/source/filter/ww8/writerwordglue.cxx7
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx123
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx44
-rw-r--r--sw/source/filter/ww8/wrtw8num.cxx20
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx100
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx5
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx19
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx40
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx116
-rw-r--r--sw/source/filter/ww8/ww8graf.hxx4
-rw-r--r--sw/source/filter/ww8/ww8graf2.cxx10
-rw-r--r--sw/source/filter/ww8/ww8par.cxx297
-rw-r--r--sw/source/filter/ww8/ww8par.hxx60
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx86
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx343
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx39
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx46
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx847
-rw-r--r--sw/source/filter/ww8/ww8scan.hxx53
-rw-r--r--sw/source/filter/ww8/ww8struc.hxx4
-rw-r--r--sw/source/filter/ww8/ww8toolbar.cxx21
-rw-r--r--sw/source/filter/ww8/ww8toolbar.hxx2
-rw-r--r--sw/source/filter/xml/swxml.cxx44
-rw-r--r--sw/source/filter/xml/wrtxml.cxx12
-rw-r--r--sw/source/filter/xml/xmlbrsh.cxx1
-rw-r--r--sw/source/filter/xml/xmlbrshi.hxx8
-rw-r--r--sw/source/filter/xml/xmlexp.cxx9
-rw-r--r--sw/source/filter/xml/xmlexpit.cxx44
-rw-r--r--sw/source/filter/xml/xmlexpit.hxx6
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx1
-rw-r--r--sw/source/filter/xml/xmlfmte.cxx9
-rw-r--r--sw/source/filter/xml/xmlimp.cxx43
-rw-r--r--sw/source/filter/xml/xmlimp.hxx21
-rw-r--r--sw/source/filter/xml/xmlimpit.cxx45
-rw-r--r--sw/source/filter/xml/xmlimpit.hxx17
-rw-r--r--sw/source/filter/xml/xmlitem.cxx6
-rw-r--r--sw/source/filter/xml/xmlitem.hxx2
-rw-r--r--sw/source/filter/xml/xmlitemi.cxx158
-rw-r--r--sw/source/filter/xml/xmlitemm.cxx17
-rw-r--r--sw/source/filter/xml/xmlithlp.cxx4
-rw-r--r--sw/source/filter/xml/xmlmeta.cxx26
-rw-r--r--sw/source/filter/xml/xmltble.cxx5
-rw-r--r--sw/source/filter/xml/xmltbli.cxx8
-rw-r--r--sw/source/filter/xml/xmltexte.cxx4
-rw-r--r--sw/source/filter/xml/xmltexti.cxx2
-rw-r--r--sw/source/ui/app/app.src10
-rw-r--r--sw/source/ui/app/appenv.cxx20
-rw-r--r--sw/source/ui/app/docsh.cxx4
-rwxr-xr-x[-rw-r--r--]sw/source/ui/app/docsh2.cxx74
-rw-r--r--sw/source/ui/app/docshdrw.cxx2
-rw-r--r--sw/source/ui/app/docshini.cxx7
-rw-r--r--sw/source/ui/app/docst.cxx20
-rw-r--r--sw/source/ui/app/docstyle.cxx6
-rw-r--r--sw/source/ui/app/mn.src1
-rw-r--r--sw/source/ui/app/swdll.cxx38
-rw-r--r--sw/source/ui/app/swdllimpl.hxx42
-rw-r--r--sw/source/ui/app/swmodul1.cxx36
-rw-r--r--sw/source/ui/app/swmodule.cxx15
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx118
-rw-r--r--sw/source/ui/chrdlg/pardlg.cxx4
-rw-r--r--sw/source/ui/config/cfgitems.cxx2
-rw-r--r--sw/source/ui/config/mailconfigpage.cxx11
-rw-r--r--sw/source/ui/config/optcomp.cxx5
-rw-r--r--sw/source/ui/config/optdlg.src2
-rw-r--r--sw/source/ui/config/optload.cxx3
-rw-r--r--sw/source/ui/config/optpage.cxx10
-rw-r--r--sw/source/ui/config/uinums.cxx52
-rw-r--r--sw/source/ui/config/usrpref.cxx4
-rw-r--r--sw/source/ui/config/viewopt.cxx6
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx8
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx16
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx78
-rw-r--r--sw/source/ui/dbui/dbtree.cxx14
-rw-r--r--sw/source/ui/dbui/maildispatcher.cxx4
-rw-r--r--sw/source/ui/dbui/mailmergechildwindow.cxx4
-rw-r--r--sw/source/ui/dbui/mailmergehelper.cxx4
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx6
-rw-r--r--sw/source/ui/dbui/mmconfigitem.cxx16
-rw-r--r--sw/source/ui/dbui/mmdocselectpage.cxx2
-rw-r--r--sw/source/ui/dbui/mmgreetingspage.cxx2
-rw-r--r--sw/source/ui/dbui/mmoutputpage.cxx38
-rw-r--r--sw/source/ui/dbui/mmoutputpage.src2
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx2
-rw-r--r--sw/source/ui/dialog/docstdlg.cxx3
-rw-r--r--sw/source/ui/dialog/macassgn.cxx2
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx16
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx6
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx8
-rw-r--r--sw/source/ui/dochdl/gloshdl.cxx14
-rwxr-xr-x[-rw-r--r--]sw/source/ui/dochdl/swdtflvr.cxx55
-rw-r--r--sw/source/ui/docvw/AnnotationWin.cxx44
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx4
-rw-r--r--sw/source/ui/docvw/SidebarWin.cxx15
-rw-r--r--sw/source/ui/docvw/edtwin.cxx249
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx16
-rw-r--r--sw/source/ui/docvw/edtwin3.cxx4
-rw-r--r--sw/source/ui/docvw/extedit.cxx4
-rwxr-xr-x[-rw-r--r--]sw/source/ui/docvw/romenu.cxx6
-rw-r--r--sw/source/ui/docvw/srcedtw.cxx2
-rw-r--r--sw/source/ui/envelp/envfmt.cxx133
-rw-r--r--sw/source/ui/envelp/envfmt.hxx7
-rw-r--r--sw/source/ui/envelp/envlop1.cxx2
-rw-r--r--sw/source/ui/envelp/label1.cxx6
-rw-r--r--sw/source/ui/envelp/labfmt.cxx4
-rw-r--r--sw/source/ui/fldui/changedb.cxx2
-rw-r--r--sw/source/ui/fldui/flddb.cxx4
-rw-r--r--sw/source/ui/fldui/flddinf.cxx6
-rw-r--r--sw/source/ui/fldui/flddok.cxx16
-rw-r--r--sw/source/ui/fldui/fldedt.cxx6
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx16
-rw-r--r--sw/source/ui/fldui/fldfunc.hxx2
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx20
-rw-r--r--sw/source/ui/fldui/fldpage.cxx4
-rw-r--r--sw/source/ui/fldui/fldref.cxx67
-rw-r--r--sw/source/ui/fldui/fldref.hxx12
-rw-r--r--sw/source/ui/fldui/fldtdlg.cxx2
-rw-r--r--sw/source/ui/fldui/fldvar.cxx20
-rw-r--r--sw/source/ui/fldui/fldvar.hxx2
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx27
-rw-r--r--sw/source/ui/frmdlg/column.cxx14
-rw-r--r--sw/source/ui/frmdlg/cption.cxx4
-rw-r--r--sw/source/ui/frmdlg/frmmgr.cxx2
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx30
-rw-r--r--sw/source/ui/frmdlg/wrap.cxx4
-rw-r--r--sw/source/ui/inc/actctrl.hxx6
-rw-r--r--sw/source/ui/inc/app.hrc11
-rw-r--r--sw/source/ui/inc/autoedit.hxx2
-rw-r--r--sw/source/ui/inc/basesh.hxx12
-rw-r--r--sw/source/ui/inc/bmpwin.hxx2
-rw-r--r--sw/source/ui/inc/caption.hxx2
-rw-r--r--sw/source/ui/inc/cfgitems.hxx10
-rw-r--r--sw/source/ui/inc/changedb.hxx2
-rw-r--r--sw/source/ui/inc/chrdlg.hxx8
-rw-r--r--sw/source/ui/inc/colmgr.hxx5
-rw-r--r--sw/source/ui/inc/column.hxx2
-rw-r--r--sw/source/ui/inc/conarc.hxx4
-rw-r--r--sw/source/ui/inc/concustomshape.hxx4
-rw-r--r--sw/source/ui/inc/conform.hxx2
-rw-r--r--sw/source/ui/inc/conpoly.hxx4
-rw-r--r--sw/source/ui/inc/conrect.hxx4
-rw-r--r--sw/source/ui/inc/content.hxx33
-rw-r--r--sw/source/ui/inc/conttree.hxx12
-rw-r--r--sw/source/ui/inc/cption.hxx5
-rw-r--r--sw/source/ui/inc/dbinsdlg.hxx2
-rw-r--r--sw/source/ui/inc/docstdlg.hxx2
-rw-r--r--sw/source/ui/inc/drawbase.hxx12
-rw-r--r--sw/source/ui/inc/dselect.hxx6
-rw-r--r--sw/source/ui/inc/edtwin.hxx67
-rw-r--r--sw/source/ui/inc/envimg.hxx26
-rw-r--r--sw/source/ui/inc/fldmgr.hxx42
-rw-r--r--sw/source/ui/inc/formedt.hxx2
-rw-r--r--sw/source/ui/inc/frmdlg.hxx2
-rw-r--r--sw/source/ui/inc/frmmgr.hxx23
-rw-r--r--sw/source/ui/inc/frmpage.hxx23
-rw-r--r--sw/source/ui/inc/gloshdl.hxx6
-rw-r--r--sw/source/ui/inc/gloslst.hxx4
-rw-r--r--sw/source/ui/inc/hidfunc.h353
-rw-r--r--sw/source/ui/inc/hyp.hxx14
-rw-r--r--sw/source/ui/inc/initui.hxx2
-rw-r--r--sw/source/ui/inc/inpdlg.hxx2
-rw-r--r--sw/source/ui/inc/inputwin.hxx4
-rw-r--r--sw/source/ui/inc/insfnote.hxx4
-rw-r--r--sw/source/ui/inc/insrule.hxx7
-rw-r--r--sw/source/ui/inc/label.hxx9
-rw-r--r--sw/source/ui/inc/labimg.hxx42
-rw-r--r--sw/source/ui/inc/linenum.hxx4
-rw-r--r--sw/source/ui/inc/mailmergehelper.hxx4
-rw-r--r--sw/source/ui/inc/mailmrge.hxx6
-rw-r--r--sw/source/ui/inc/multmrk.hxx2
-rw-r--r--sw/source/ui/inc/navicfg.hxx2
-rw-r--r--sw/source/ui/inc/navicont.hxx12
-rw-r--r--sw/source/ui/inc/navipi.hxx8
-rw-r--r--sw/source/ui/inc/num.hxx2
-rw-r--r--sw/source/ui/inc/numpara.hxx5
-rw-r--r--sw/source/ui/inc/optpage.hxx14
-rw-r--r--sw/source/ui/inc/outline.hxx2
-rw-r--r--sw/source/ui/inc/pgfnote.hxx2
-rw-r--r--sw/source/ui/inc/popbox.hxx2
-rw-r--r--sw/source/ui/inc/prcntfld.hxx2
-rw-r--r--sw/source/ui/inc/pview.hxx19
-rw-r--r--sw/source/ui/inc/redlndlg.hxx12
-rw-r--r--sw/source/ui/inc/regionsw.hxx16
-rw-r--r--sw/source/ui/inc/scroll.hxx14
-rw-r--r--sw/source/ui/inc/srcview.hxx2
-rw-r--r--sw/source/ui/inc/swcont.hxx12
-rw-r--r--sw/source/ui/inc/swdtflvr.hxx4
-rw-r--r--sw/source/ui/inc/swlbox.hxx4
-rw-r--r--sw/source/ui/inc/swuiidxmrk.hxx2
-rw-r--r--sw/source/ui/inc/tabledlg.hxx2
-rw-r--r--sw/source/ui/inc/tmpdlg.hxx2
-rw-r--r--sw/source/ui/inc/toxmgr.hxx10
-rw-r--r--sw/source/ui/inc/uiitems.hxx2
-rw-r--r--sw/source/ui/inc/uinums.hxx6
-rw-r--r--sw/source/ui/inc/uitool.hxx16
-rw-r--r--sw/source/ui/inc/utlui.hrc2
-rwxr-xr-x[-rw-r--r--]sw/source/ui/inc/view.hxx81
-rw-r--r--sw/source/ui/inc/workctrl.hxx6
-rw-r--r--sw/source/ui/inc/wrap.hxx2
-rw-r--r--sw/source/ui/inc/wrtsh.hxx161
-rw-r--r--sw/source/ui/index/cntex.cxx2
-rw-r--r--sw/source/ui/index/cnttab.cxx26
-rw-r--r--sw/source/ui/index/idxmrk.cxx2
-rw-r--r--sw/source/ui/index/idxmrk.src34
-rw-r--r--sw/source/ui/index/multmrk.cxx2
-rw-r--r--sw/source/ui/index/swuiidxmrk.cxx75
-rw-r--r--sw/source/ui/index/toxmgr.cxx24
-rw-r--r--sw/source/ui/lingu/hhcwrp.cxx23
-rw-r--r--sw/source/ui/lingu/hyp.cxx6
-rw-r--r--sw/source/ui/lingu/olmenu.cxx9
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.cxx5
-rw-r--r--sw/source/ui/misc/bookmark.cxx25
-rw-r--r--sw/source/ui/misc/docfnote.cxx42
-rw-r--r--sw/source/ui/misc/glosbib.cxx21
-rw-r--r--sw/source/ui/misc/glosdoc.cxx54
-rw-r--r--sw/source/ui/misc/glossary.cxx95
-rw-r--r--sw/source/ui/misc/glossary.hrc8
-rw-r--r--sw/source/ui/misc/glshell.cxx17
-rw-r--r--sw/source/ui/misc/insfnote.cxx4
-rw-r--r--sw/source/ui/misc/insrule.cxx14
-rw-r--r--sw/source/ui/misc/linenum.cxx38
-rw-r--r--sw/source/ui/misc/num.cxx20
-rw-r--r--sw/source/ui/misc/num.src4
-rw-r--r--sw/source/ui/misc/outline.cxx71
-rw-r--r--sw/source/ui/misc/outline.src1
-rw-r--r--sw/source/ui/misc/pgfnote.cxx48
-rw-r--r--sw/source/ui/misc/pggrid.cxx11
-rw-r--r--sw/source/ui/misc/redlndlg.cxx101
-rw-r--r--sw/source/ui/misc/srtdlg.cxx14
-rw-r--r--sw/source/ui/misc/swmodalredlineacceptdlg.cxx7
-rw-r--r--sw/source/ui/misc/titlepage.cxx8
-rw-r--r--sw/source/ui/ribbar/inputwin.cxx2
-rw-r--r--sw/source/ui/shells/basesh.cxx57
-rw-r--r--sw/source/ui/shells/drawdlg.cxx2
-rw-r--r--sw/source/ui/shells/drawsh.cxx2
-rw-r--r--sw/source/ui/shells/drwbassh.cxx5
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx3
-rw-r--r--sw/source/ui/shells/drwtxtsh.cxx4
-rw-r--r--sw/source/ui/shells/frmsh.cxx12
-rw-r--r--sw/source/ui/shells/grfsh.cxx23
-rw-r--r--sw/source/ui/shells/langhelper.cxx16
-rw-r--r--sw/source/ui/shells/listsh.cxx3
-rw-r--r--sw/source/ui/shells/tabsh.cxx5
-rw-r--r--sw/source/ui/shells/textsh.cxx24
-rw-r--r--sw/source/ui/shells/textsh1.cxx78
-rw-r--r--sw/source/ui/shells/txtnum.cxx12
-rw-r--r--sw/source/ui/table/tabledlg.cxx4
-rw-r--r--sw/source/ui/table/tablepg.hxx3
-rw-r--r--sw/source/ui/uiview/srcview.cxx8
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uiview/view.cxx6
-rw-r--r--sw/source/ui/uiview/view.src1
-rw-r--r--sw/source/ui/uiview/view2.cxx16
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx76
-rw-r--r--sw/source/ui/uiview/viewtab.cxx3
-rw-r--r--sw/source/ui/uno/SwXDocumentSettings.cxx27
-rw-r--r--sw/source/ui/uno/SwXFilterOptions.cxx2
-rw-r--r--sw/source/ui/uno/detreg.cxx9
-rw-r--r--sw/source/ui/uno/dlelstnr.cxx4
-rw-r--r--sw/source/ui/uno/swdetect.cxx1
-rw-r--r--sw/source/ui/uno/unoatxt.cxx25
-rw-r--r--sw/source/ui/uno/unodefaults.cxx3
-rw-r--r--sw/source/ui/uno/unodispatch.cxx10
-rw-r--r--sw/source/ui/uno/unodoc.cxx6
-rw-r--r--sw/source/ui/uno/unofreg.cxx26
-rw-r--r--sw/source/ui/uno/unomailmerge.cxx6
-rw-r--r--sw/source/ui/uno/unomod.cxx2
-rw-r--r--sw/source/ui/uno/unomodule.cxx4
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx58
-rw-r--r--sw/source/ui/uno/unotxvw.cxx24
-rw-r--r--sw/source/ui/utlui/content.cxx16
-rw-r--r--sw/source/ui/utlui/initui.cxx3
-rw-r--r--sw/source/ui/vba/service.cxx22
-rw-r--r--sw/source/ui/vba/vbaapplication.cxx10
-rw-r--r--sw/source/ui/vba/vbacell.cxx2
-rw-r--r--sw/source/ui/vba/vbadocument.cxx4
-rw-r--r--sw/source/ui/vba/vbaeventshelper.cxx16
-rw-r--r--sw/source/ui/vba/vbaeventshelper.hxx2
-rw-r--r--sw/source/ui/vba/vbafield.cxx3
-rw-r--r--sw/source/ui/vba/vbarevisions.cxx2
-rw-r--r--sw/source/ui/vba/vbatablehelper.cxx2
-rw-r--r--sw/source/ui/vba/vbawindow.cxx7
-rw-r--r--sw/source/ui/vba/vbawindow.hxx8
-rw-r--r--sw/source/ui/wrtsh/delete.cxx31
-rw-r--r--sw/source/ui/wrtsh/select.cxx3
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx45
-rw-r--r--sw/source/ui/wrtsh/wrtsh4.cxx13
-rwxr-xr-xsw/uiconfig/sglobal/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/sglobal/toolbar/findbar.xml2
-rw-r--r--sw/uiconfig/sglobal/toolbar/standardbar.xml4
-rw-r--r--sw/uiconfig/sweb/toolbar/findbar.xml2
-rw-r--r--sw/uiconfig/sweb/toolbar/standardbar.xml4
-rwxr-xr-xsw/uiconfig/swform/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swform/toolbar/standardbar.xml4
-rwxr-xr-xsw/uiconfig/swreport/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swreport/toolbar/standardbar.xml4
-rwxr-xr-xsw/uiconfig/swriter/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swriter/toolbar/findbar.xml2
-rw-r--r--sw/uiconfig/swriter/toolbar/standardbar.xml4
-rwxr-xr-xsw/uiconfig/swxform/menubar/menubar.xml1
-rw-r--r--sw/uiconfig/swxform/toolbar/findbar.xml2
-rw-r--r--sw/uiconfig/swxform/toolbar/standardbar.xml4
-rw-r--r--sw/util/msword.component3
-rw-r--r--sw/util/sw.component6
-rw-r--r--sw/util/swd.component2
-rw-r--r--sw/util/vbaswobj.component2
864 files changed, 12155 insertions, 12663 deletions
diff --git a/.gitignore b/.gitignore
index e9cb034c10..788a39643c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
# backup and temporary files
*~
.*.sw[op]
+.gitattributes
# the build directories
/*/unxlng??
@@ -9,3 +10,7 @@
/*/wntmsc???.pro
/*/unxmac??.pro
/*/unxmac??
+/*/unxios?
+/*/unxios?.pro
+/*/unxand?
+/*/unxand?.pro
diff --git a/starmath/AllLangResTarget_sm.mk b/starmath/AllLangResTarget_sm.mk
index 5f606d97ef..61ca79f579 100644
--- a/starmath/AllLangResTarget_sm.mk
+++ b/starmath/AllLangResTarget_sm.mk
@@ -1,44 +1,48 @@
-# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#*************************************************************************
#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
+# OpenOffice.org - a multi-platform office productivity suite
#
-# The Initial Developer of the Original Code is
-# Norbert Thiebaud <nthiebaud@gmail.com> (C) 2010, All Rights Reserved.
+# This file is part of OpenOffice.org.
#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
-# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
-# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
-# instead of those above.
-
+# 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_AllLangResTarget_AllLangResTarget,sm))
-$(eval $(call gb_AllLangResTarget_set_reslocation,sm,starmath))
-
$(eval $(call gb_AllLangResTarget_add_srs,sm,\
- starmath/res \
+ sm/res \
))
-$(eval $(call gb_SrsTarget_SrsTarget,starmath/res))
+$(eval $(call gb_AllLangResTarget_set_reslocation,sm,starmath))
+
+$(eval $(call gb_SrsTarget_SrsTarget,sm/res))
-$(eval $(call gb_SrsTarget_set_include,starmath/res,\
+$(eval $(call gb_SrsTarget_set_include,sm/res,\
$$(INCLUDE) \
- -I$(OUTDIR)/inc \
- -I$(WORKDIR)/inc/starmath \
- -I$(realpath $(SRCDIR)/starmath/inc) \
+ -I$(SRCDIR)/starmath/inc \
))
-$(eval $(call gb_SrsTarget_add_files,starmath/res,\
- starmath/source/smres.src \
- starmath/source/commands.src \
- starmath/source/symbol.src \
+$(eval $(call gb_SrsTarget_add_files,sm/res,\
+ starmath/source/commands.src \
+ starmath/source/smres.src \
+ starmath/source/symbol.src \
+ starmath/source/toolbox.src \
))
diff --git a/starmath/CppunitTest_starmath_qa_cppunit.mk b/starmath/CppunitTest_starmath_qa_cppunit.mk
new file mode 100644
index 0000000000..1713710c97
--- /dev/null
+++ b/starmath/CppunitTest_starmath_qa_cppunit.mk
@@ -0,0 +1,118 @@
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# David Tardon, Red Hat Inc. <dtardon@redhat.com>
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+
+$(eval $(call gb_CppunitTest_CppunitTest,starmath_qa_cppunit))
+
+$(eval $(call gb_CppunitTest_set_include,starmath_qa_cppunit,\
+ $$(INCLUDE) \
+ -I$(realpath $(SRCDIR)/starmath/inc) \
+ -I$(realpath $(SRCDIR)/starmath/inc/pch) \
+ -I$(OUTDIR)/inc \
+))
+
+$(eval $(call gb_CppunitTest_add_api,starmath_qa_cppunit,\
+ offapi \
+ udkapi \
+))
+
+$(eval $(call gb_CppunitTest_set_defs,starmath_qa_cppunit,\
+ $$(DEFS) \
+ -DSMDLL \
+))
+
+$(eval $(call gb_CppunitTest_add_library_objects,starmath_qa_cppunit,\
+ sm \
+))
+
+$(call gb_CxxObject_get_target,starmath/qa/cppunit/test_starmath): $(WORKDIR)/AllLangRes/sm
+
+$(eval $(call gb_CppunitTest_add_linked_libs,starmath_qa_cppunit,\
+ comphelper \
+ cppu \
+ cppuhelper \
+ editeng \
+ i18nisolang1 \
+ i18npaper \
+ sal \
+ sfx \
+ sot \
+ svl \
+ svt \
+ svxcore \
+ svx \
+ tk \
+ tl \
+ utl \
+ vcl \
+ xo \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,starmath_qa_cppunit,\
+ starmath/qa/cppunit/test_nodetotextvisitors \
+ starmath/qa/cppunit/test_starmath \
+))
+
+$(eval $(call gb_CppunitTest_uses_ure,starmath_qa_cppunit))
+
+$(eval $(call gb_CppunitTest_add_type_rdbs,starmath_qa_cppunit,\
+ types \
+))
+
+$(eval $(call gb_CppunitTest_add_service_rdbs,starmath_qa_cppunit,\
+ starmath_qa_cppunit \
+))
+
+$(eval $(call gb_CppunitTest_set_args,starmath_qa_cppunit,\
+ --headless \
+ --invisible \
+ --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+))
+
+$(eval $(call gb_RdbTarget_RdbTarget,starmath_qa_cppunit))
+
+$(eval $(call gb_RdbTarget_add_components,starmath_qa_cppunit,\
+ framework/util/fwk \
+ toolkit/util/tk \
+ sfx2/util/sfx \
+))
+
+$(eval $(call gb_RdbTarget_add_old_components,starmath_qa_cppunit,\
+ component/vcl/vcl \
+ configmgr \
+ i18npool \
+ mcnttype \
+))
+
+ifeq ($(strip $(OS)),WNT)
+$(eval $(call gb_RdbTarget_add_old_components,starmath_qa_cppunit,\
+ ftransl \
+ sysdtrans \
+))
+endif
+
+# vim: set noet sw=4:
diff --git a/starmath/inc/makefile.mk b/starmath/JunitTest_sm_unoapi.mk
index 930e5281c6..5e36a7b553 100644
--- a/starmath/inc/makefile.mk
+++ b/starmath/JunitTest_sm_unoapi.mk
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
@@ -24,24 +24,29 @@
# for a copy of the LGPLv3 License.
#
#*************************************************************************
-PRJ=..
-PRJNAME=starmath
-TARGET=inc
+$(eval $(call gb_JunitTest_JunitTest,sm_unoapi,SRCDIR))
-# --- Settings -----------------------------------------------------
+$(eval $(call gb_JunitTest_set_defs,sm_unoapi,\
+ $$(DEFS) \
+ -Dorg.openoffice.test.arg.sce=$(SRCDIR)/starmath/qa/unoapi/sm.sce \
+ -Dorg.openoffice.test.arg.xcl=$(SRCDIR)/starmath/qa/unoapi/knownissues.xcl \
+))
-.INCLUDE : settings.mk
+$(eval $(call gb_JunitTest_add_jars,sm_unoapi,\
+ $(OUTDIR)/bin/OOoRunner.jar \
+ $(OUTDIR)/bin/ridl.jar \
+ $(OUTDIR)/bin/test.jar \
+ $(OUTDIR)/bin/unoil.jar \
+ $(OUTDIR)/bin/jurt.jar \
+))
-# --- Files --------------------------------------------------------
-# --- Targets -------------------------------------------------------
+$(eval $(call gb_JunitTest_add_sourcefiles,sm_unoapi,\
+ starmath/qa/unoapi/Test \
+))
-.INCLUDE : target.mk
-
-.IF "$(ENABLE_PCH)"!=""
-ALLTAR : \
- $(SLO)$/precompiled.pch \
- $(SLO)$/precompiled_ex.pch
-
-.ENDIF # "$(ENABLE_PCH)"!=""
+$(eval $(call gb_JunitTest_add_classes,sm_unoapi,\
+ org.openoffice.starmath.qa.unoapi.Test \
+))
+# vim: set noet sw=4 ts=4:
diff --git a/starmath/Library_sm.mk b/starmath/Library_sm.mk
index 1fc0a763bf..2aef3094c0 100644
--- a/starmath/Library_sm.mk
+++ b/starmath/Library_sm.mk
@@ -31,16 +31,13 @@ $(eval $(call gb_Library_set_include,sm,\
-I$(realpath $(SRCDIR)/starmath/inc/pch) \
-I$(realpath $(SRCDIR)/starmath/inc) \
-I$(WORKDIR)/SdiTarget/starmath/sdi \
- -I$(WORKDIR)/Misc/starmath/ \
$$(INCLUDE) \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
-$(eval $(call gb_Library_set_defs,sm,\
- $$(DEFS) \
- -DSMDLL \
- -DSC_INFO_OSVERSION=\"$(OS)\" \
+$(eval $(call gb_Library_add_api,sm,\
+ offapi \
+ udkapi \
))
$(eval $(call gb_Library_add_linked_libs,sm,\
@@ -60,7 +57,6 @@ $(eval $(call gb_Library_add_linked_libs,sm,\
tl \
utl \
vcl \
- ucbhelper \
xo \
))
@@ -74,7 +70,6 @@ $(eval $(call gb_Library_add_exception_objects,sm,\
starmath/source/dialog \
starmath/source/document \
starmath/source/edit \
- starmath/source/eqnolefilehdr \
starmath/source/format \
starmath/source/mathmlexport \
starmath/source/mathmlimport \
@@ -82,8 +77,8 @@ $(eval $(call gb_Library_add_exception_objects,sm,\
starmath/source/node \
starmath/source/parse \
starmath/source/rect \
- starmath/source/register \
- starmath/source/smdll \
+ starmath/source/register \
+ starmath/source/smdll \
starmath/source/smmod \
starmath/source/symbol \
starmath/source/toolbox \
@@ -105,3 +100,5 @@ $(eval $(call gb_SdiTarget_set_include,starmath/sdi/smslots,\
$$(INCLUDE) \
-I$(OUTDIR)/inc \
))
+
+# vim: set noet sw=4 ts=4:
diff --git a/starmath/Library_smd.mk b/starmath/Library_smd.mk
index 538f92104d..995cd77c1d 100644
--- a/starmath/Library_smd.mk
+++ b/starmath/Library_smd.mk
@@ -1,54 +1,59 @@
-# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#*************************************************************************
#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
+# OpenOffice.org - a multi-platform office productivity suite
#
-# The Initial Developer of the Original Code is
-# Norbert Thiebaud <nthiebaud@gmail.com> (C) 2010, All Rights Reserved.
+# This file is part of OpenOffice.org.
#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
-# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
-# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
-# instead of those above.
+# 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,smd))
-$(eval $(call gb_Library_add_precompiled_header,smd,$(SRCDIR)/starmath/inc/pch/precompiled_starmath))
+$(eval $(call gb_Library_add_precompiled_header,sm,$(SRCDIR)/starmath/inc/pch/precompiled_starmath))
$(eval $(call gb_Library_set_componentfile,smd,starmath/util/smd))
$(eval $(call gb_Library_set_include,smd,\
- -I$(realpath $(SRCDIR)/starmath/inc/pch) \
- -I$(realpath $(SRCDIR)/starmath/inc) \
- -I$(WORKDIR)/Misc/sm/ \
- $$(INCLUDE) \
- -I$(OUTDIR)/inc/offuh \
- -I$(OUTDIR)/inc \
+ $$(INCLUDE) \
+ -I$(SRCDIR)/starmath/inc \
+ -I$(SRCDIR)/starmath/inc/pch \
))
-$(eval $(call gb_Library_set_defs,smd,\
- $$(DEFS) \
+$(eval $(call gb_Library_add_api,smd,\
+ offapi \
+ udkapi \
))
$(eval $(call gb_Library_add_linked_libs,smd,\
- cppu \
- cppuhelper \
- sal \
- sfx \
- sot \
- svl \
- svt \
- tl \
- ucbhelper \
- vcl \
+ cppu \
+ cppuhelper \
+ sal \
+ sfx \
+ sot \
+ svl \
+ svt \
+ tl \
+ ucbhelper \
+ vcl \
+ $(gb_STDLIBS) \
))
$(eval $(call gb_Library_add_exception_objects,smd,\
@@ -56,3 +61,5 @@ $(eval $(call gb_Library_add_exception_objects,smd,\
starmath/source/smdetect \
starmath/source/eqnolefilehdr \
))
+
+# vim: set noet sw=4 ts=4:
diff --git a/starmath/Module_starmath.mk b/starmath/Module_starmath.mk
index 9f7de2dad0..da3addf98c 100644
--- a/starmath/Module_starmath.mk
+++ b/starmath/Module_starmath.mk
@@ -1,34 +1,41 @@
+#*************************************************************************
#
-# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
+# OpenOffice.org - a multi-platform office productivity suite
#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
+# This file is part of OpenOffice.org.
#
-# The Initial Developer of the Original Code is
-# Norbert Thiebaud <nthiebaud@gmail.com> (C) 2010, All Rights Reserved.
+# 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.
#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
-# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
-# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
-# instead of those above.
+# 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_Module_Module,sm))
+$(eval $(call gb_Module_Module,starmath))
-$(eval $(call gb_Module_add_targets,sm,\
- AllLangResTarget_sm \
- Library_sm \
- Library_smd \
- Package_uiconfig \
+$(eval $(call gb_Module_add_targets,starmath,\
+ AllLangResTarget_sm \
+ Library_sm \
+ Library_smd \
+ Package_uiconfig \
))
-$(eval $(call gb_Module_add_subsequentcheck_targets,sm,\
- JunitTest_starmath_unoapi \
+$(eval $(call gb_Module_add_subsequentcheck_targets,starmath,\
+ JunitTest_sm_unoapi \
))
+
+# vim: set noet ts=4 sw=4:
diff --git a/starmath/Package_uiconfig.mk b/starmath/Package_uiconfig.mk
index d83485ccf0..d01d857ec1 100644
--- a/starmath/Package_uiconfig.mk
+++ b/starmath/Package_uiconfig.mk
@@ -1,28 +1,33 @@
-# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#*************************************************************************
#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-# http://www.mozilla.org/MPL/
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2011 Oracle and/or its affiliates.
#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
+# OpenOffice.org - a multi-platform office productivity suite
#
-# The Initial Developer of the Original Code is
-# Norbert Thiebaud <nthiebaud@gmail.com> (C) 2010, All Rights Reserved.
+# This file is part of OpenOffice.org.
#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
-# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
-# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
-# instead of those above.
+# 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_Package_Package,sm_uiconfig,$(realpath $(SRCDIR)/starmath/uiconfig)))
+$(eval $(call gb_Package_Package,sm_uiconfig,$(SRCDIR)/starmath/uiconfig))
$(eval $(call gb_Package_add_file,sm_uiconfig,xml/uiconfig/modules/smath/menubar/menubar.xml,smath/menubar/menubar.xml))
$(eval $(call gb_Package_add_file,sm_uiconfig,xml/uiconfig/modules/smath/statusbar/statusbar.xml,smath/statusbar/statusbar.xml))
-$(eval $(call gb_Package_add_file,sm_uiconfig,xml/uiconfig/modules/smath/toolbar/toolbar.xml,smath/toolbar/toolbar.xml))
-$(eval $(call gb_Package_add_file,sm_uiconfig,xml/uiconfig/modules/smath/toolbar/standardbar.xml,smath/toolbar/standardbar.xml))
$(eval $(call gb_Package_add_file,sm_uiconfig,xml/uiconfig/modules/smath/toolbar/fullscreenbar.xml,smath/toolbar/fullscreenbar.xml))
-
+$(eval $(call gb_Package_add_file,sm_uiconfig,xml/uiconfig/modules/smath/toolbar/standardbar.xml,smath/toolbar/standardbar.xml))
+$(eval $(call gb_Package_add_file,sm_uiconfig,xml/uiconfig/modules/smath/toolbar/toolbar.xml,smath/toolbar/toolbar.xml))
diff --git a/starmath/inc/applicat.hxx b/starmath/inc/applicat.hxx
index 5876937de2..0aaaba6842 100644
--- a/starmath/inc/applicat.hxx
+++ b/starmath/inc/applicat.hxx
@@ -38,10 +38,6 @@ class SvxErrorHandler;
#define APPLICATIONNAME "smath3"
-#ifdef PM2
-#define RELEASE "PM304"
-#endif
-
#ifdef WNT
#define RELEASE "WNT304"
#endif
diff --git a/starmath/inc/caret.hxx b/starmath/inc/caret.hxx
index c0bda17574..cec8bd7224 100644
--- a/starmath/inc/caret.hxx
+++ b/starmath/inc/caret.hxx
@@ -40,7 +40,7 @@ struct SmCaretPos{
SmNode* pSelectedNode;
/** Index within the selected node
*
- * 0: Position infront of a node
+ * 0: Position in front of a node
* 1: Position after a node or after first char in SmTextNode
* n: Position after n char in SmTextNode
*
@@ -290,13 +290,13 @@ private:
*
* A caret position in OpenOffice Math is representated by an instance of SmCaretPos.
* That is a caret position is a node and an index related to this node. For most nodes the
- * index 0, means caret is infront of this node, the index 1 means caret is after this node.
+ * index 0, means caret is in front of this node, the index 1 means caret is after this node.
* For SmTextNode the index is the caret position after the specified number of characters,
* imagine an SmTextNode with the number 1337. The index 3 in such SmTextNode would mean a
* caret placed right before 7, e.g. "133|7".
*
* For SmExpressionNode, SmBinHorNode and SmUnHorNode the only legal index is 0, which means
- * infront of the node. Actually the index 0 may only because for the first caret position
+ * in front of the node. Actually the index 0 may only because for the first caret position
* in a visual line. From the example above, consider the following subtree that constitutes
* a visual line:
*
diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 0de8931673..6b6e7168a5 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -171,7 +171,7 @@ public:
/** Create sub-/super script
*
* If there's a selection, it will be move into the appropriate sub-/super scription
- * of the node infront of it. If there's no node infront of position (or the selection),
+ * of the node in front of it. If there's no node in front of position (or the selection),
* a sub-/super scription of a new SmPlaceNode will be made.
*
* If there's is an existing subscription of the node, the caret will be moved into it,
@@ -333,7 +333,7 @@ private:
/** Find an iterator pointing to the node in pLineList following aCaretPos
*
- * If aCaretPos::pSelectedNode cannot be found it is assumed that it's infront of pLineList,
+ * If aCaretPos::pSelectedNode cannot be found it is assumed that it's in front of pLineList,
* thus not an element in pLineList. In this case this method returns an iterator to the
* first element in pLineList.
*
@@ -353,7 +353,7 @@ private:
* removed.
*
* @returns A caret position equivalent to one selecting the node before aIter, the method returns
- * an invalid SmCaretPos to indicate placement infront of the line.
+ * an invalid SmCaretPos to indicate placement in front of the line.
*/
static SmCaretPos PatchLineList(SmNodeList* pLineList, SmNodeList::iterator aIter);
diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx
index 9635998030..95144fb1c7 100644
--- a/starmath/inc/document.hxx
+++ b/starmath/inc/document.hxx
@@ -100,9 +100,7 @@ public:
////////////////////////////////////////////////////////////
-void SetEditEngineDefaultFonts(
- EditEngine &rEditEngine,
- SfxItemPool &rEditEngineItemPool );
+void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool);
////////////////////////////////////////////////////////////
diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx
index 4ea622a20d..6214f60adc 100644
--- a/starmath/inc/node.hxx
+++ b/starmath/inc/node.hxx
@@ -585,7 +585,7 @@ public:
/** Root symbol node
*
- * Root symbol node used by SmRootNode to create the root symbol, infront of
+ * Root symbol node used by SmRootNode to create the root symbol, in front of
* the line with the line above. I don't think this node should be used for
* anything else.
*/
diff --git a/starmath/inc/parse.hxx b/starmath/inc/parse.hxx
index 228d3e9a41..8f6c6129f3 100644
--- a/starmath/inc/parse.hxx
+++ b/starmath/inc/parse.hxx
@@ -209,6 +209,9 @@ class SmParser
// map of used symbols (used to reduce file size by exporting only actually used symbols)
std::set< rtl::OUString > m_aUsedSymbols;
+ //! locale where '.' is decimal seperator!
+ ::com::sun::star::lang::Locale m_aDotLoc;
+
// declare copy-constructor and assignment-operator private
SmParser(const SmParser &);
SmParser & operator = (const SmParser &);
diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx
index 29940f3863..77de779234 100644
--- a/starmath/inc/rect.hxx
+++ b/starmath/inc/rect.hxx
@@ -34,7 +34,6 @@
#include <tools/gen.hxx>
#include <vcl/outdev.hxx>
#include <vcl/metric.hxx>
-#include <tools/debug.hxx>
#include "format.hxx"
@@ -234,7 +233,7 @@ inline void SmRect::CopyMBL(const SmRect &rRect)
inline long SmRect::GetBaseline() const
{
- DBG_ASSERT(HasBaseline(), "Sm: Baseline nicht vorhanden");
+ OSL_ENSURE(HasBaseline(), "Sm: Baseline nicht vorhanden");
return nBaseline;
}
diff --git a/starmath/inc/smdll.hxx b/starmath/inc/smdll.hxx
index 9c5e08d275..b1097da9d8 100644
--- a/starmath/inc/smdll.hxx
+++ b/starmath/inc/smdll.hxx
@@ -28,24 +28,10 @@
#ifndef SMDLL_HXX
#define SMDLL_HXX
-#include <tools/resid.hxx>
-#include <sfx2/sfxdefs.hxx>
-#include "smmod.hxx"
-
-class SmData;
-class SfxMedium;
-class SfxFilter;
-
-class SmDLL
+namespace SmGlobals
{
- static bool bInitialized;
-public:
- static void Init();
- static void Exit();
-
- static sal_uLong DetectFilter( SfxMedium& rMedium, const SfxFilter **ppFilter,
- SfxFilterFlags nMust, SfxFilterFlags nDont );
-};
+ void ensure();
+}
#endif
diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx
index 999fde6ba9..1074f75d97 100644
--- a/starmath/inc/symbol.hxx
+++ b/starmath/inc/symbol.hxx
@@ -30,7 +30,6 @@
#define SYMBOL_HXX
#include <vcl/font.hxx>
-#include <tools/debug.hxx>
#include <tools/dynary.hxx>
#include <svl/lstner.hxx>
#include <svl/svarray.hxx>
diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx
index d72df24d55..93514f1ee4 100644
--- a/starmath/inc/types.hxx
+++ b/starmath/inc/types.hxx
@@ -30,8 +30,6 @@
#define TYPES_HXX
#include <sal/types.h>
-#include <tools/debug.hxx>
-
#define FONTNAME_MATH "OpenSymbol"
/////////////////////////////////////////////////////////////////
diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx
index ae374da66c..f94027c560 100644
--- a/starmath/inc/utility.hxx
+++ b/starmath/inc/utility.hxx
@@ -50,7 +50,7 @@ inline long SmPtsTo100th_mm(long nNumPts)
// 72.27 [pt] = 1 [inch] = 2,54 [cm] = 2540 [100th of mm].
// result is being rounded to the nearest integer.
{
- DBG_ASSERT(nNumPts >= 0, "Sm : Ooops...");
+ OSL_ENSURE(nNumPts >= 0, "Sm : Ooops...");
// broken into multiple and fraction of 'nNumPts' to reduce chance
// of overflow
// (7227 / 2) is added in order to round to the nearest integer
@@ -70,7 +70,7 @@ inline Fraction Sm100th_mmToPts(long nNum100th_mm)
// returns the length (in points) that corresponds to the length
// 'nNum100th_mm' (in 100th of mm).
{
- DBG_ASSERT(nNum100th_mm >= 0, "Sm : Ooops...");
+ OSL_ENSURE(nNum100th_mm >= 0, "Sm : Ooops...");
Fraction aTmp (7227L, 254000L);
return aTmp *= Fraction(nNum100th_mm);
}
@@ -78,7 +78,7 @@ inline Fraction Sm100th_mmToPts(long nNum100th_mm)
inline long SmRoundFraction(const Fraction &rFrac)
{
- DBG_ASSERT(rFrac > Fraction(), "Sm : Ooops...");
+ OSL_ENSURE(rFrac > Fraction(), "Sm : Ooops...");
return (rFrac.GetNumerator() + rFrac.GetDenominator() / 2) / rFrac.GetDenominator();
}
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index 56fb0e30e0..f4855dc93c 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -316,7 +316,7 @@ private:
* pRightMost : SmCaretPosGraphEntry*
*
* Prior to a Visit call:
- * pRightMost: A pointer to right most position infront of the current line entry.
+ * pRightMost: A pointer to right most position in front of the current line entry.
*
* After a Visit call:
* pRightMost: A pointer to the right most position in the called line entry, if no there's
diff --git a/starmath/prj/build.lst b/starmath/prj/build.lst
index 4afbef9468..924ca7fd9e 100644
--- a/starmath/prj/build.lst
+++ b/starmath/prj/build.lst
@@ -1,9 +1,2 @@
-sm starmath : LIBXSLT:libxslt TRANSLATIONS:translations svx ure NULL
-sm starmath usr1 - all sm_mkout NULL
-sm starmath\inc nmake - all sm_inc NULL
-sm starmath\prj get - all sm_prj NULL
-sm starmath\res get - all sm_res NULL
-sm starmath\sdi nmake - all sm_sdi NULL
-sm starmath\source nmake - all sm_sorce sm_sdi sm_inc NULL
-sm starmath\util nmake - all sm_util sm_sorce NULL
-sm starmath\qa\cppunit nmake - u sm_qa_cppunit sm_util NULL
+sm starmath : LIBXSLT:libxslt TRANSLATIONS:translations svx configmgr dtrans ure test NULL
+sm starmath\prj nmake - all sm_prj NULL
diff --git a/starmath/prj/d.lst b/starmath/prj/d.lst
index 78bae57498..e69de29bb2 100644
--- a/starmath/prj/d.lst
+++ b/starmath/prj/d.lst
@@ -1,23 +0,0 @@
-mkdir: %COMMON_DEST%\bin%_EXT%\hid
-mkdir: %_DEST%\xml%_EXT%\uiconfig
-mkdir: %_DEST%\xml%_EXT%\uiconfig\modules
-mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\smath
-mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\smath\menubar
-mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\smath\toolbar
-mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\smath\statusbar
-
-..\%COMMON_OUTDIR%\misc\*.hid %COMMON_DEST%\bin%_EXT%\hid\*.hid
-..\%__SRC%\lib\lib*.* %_DEST%\lib%_EXT%\lib*.*
-..\%__SRC%\misc\*.map %_DEST%\bin%_EXT%\*.map
-..\xml\*.xml %_DEST%\xml%_EXT%\*.xml
-..\%__SRC%\bin\sm?????.dll %_DEST%\bin%_EXT%\sm?????.dll
-..\%__SRC%\bin\smd?????.dll %_DEST%\bin%_EXT%\smd?????.dll
-..\%__SRC%\bin\sm*.res %_DEST%\bin%_EXT%\sm*.res
-..\%__SRC%\bin\sm?????.sym %_DEST%\bin%_EXT%\sm?????.sym
-mkdir: %_DEST%\inc%_EXT%\starmath
-
-..\uiconfig\smath\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\smath\menubar\*.xml
-..\uiconfig\smath\toolbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\smath\toolbar\*.xml
-..\uiconfig\smath\statusbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\smath\statusbar\*.xml
-..\%__SRC%\misc\sm.component %_DEST%\xml%_EXT%\sm.component
-..\%__SRC%\misc\smd.component %_DEST%\xml%_EXT%\smd.component
diff --git a/starmath/prj/gbuild.lst b/starmath/prj/gbuild.lst
deleted file mode 100644
index da2383eb27..0000000000
--- a/starmath/prj/gbuild.lst
+++ /dev/null
@@ -1,2 +0,0 @@
-sm starmath : LIBXSLT:libxslt TRANSLATIONS:translations svx ure NULL
-sm starmath\prj nmake - all sm_prj NULL
diff --git a/starmath/prj/makefile.mk b/starmath/prj/makefile.mk
index e312a7ccab..88cd9dfe08 100644
--- a/starmath/prj/makefile.mk
+++ b/starmath/prj/makefile.mk
@@ -37,4 +37,4 @@ VERBOSEFLAG := -s
.ENDIF
all:
- cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
diff --git a/starmath/qa/cppunit/makefile.mk b/starmath/qa/cppunit/makefile.mk
deleted file mode 100644
index a61a13ed37..0000000000
--- a/starmath/qa/cppunit/makefile.mk
+++ /dev/null
@@ -1,147 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=../..
-PRJNAME=starmath
-TARGET=qa_cppunit
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-CFLAGSCXX += $(CPPUNIT_CFLAGS)
-
-# --- Libs ---------------------------------------------------------
-
-SHL1OBJS= \
- $(SLO)/test_starmath.obj \
- $(SLO)/test_nodetotextvisitors.obj
-
-
-SHL1STDLIBS= \
- $(CPPUNITLIB) \
- $(EDITENGLIB) \
- $(SVXCORELIB) \
- $(SVXLIB) \
- $(SFX2LIB) \
- $(XMLOFFLIB) \
- $(SVTOOLLIB) \
- $(TKLIB) \
- $(VCLLIB) \
- $(SVLLIB) \
- $(I18NPAPERLIB) \
- $(SOTLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL1LIBS=$(SLB)$/starmath.lib
-
-SHL1TARGET= test_starmath
-SHL1RPATH = NONE
-SHL1IMPLIB= i$(SHL1TARGET)
-# SHL1DEF= $(MISC)/$(SHL1TARGET).def
-DEF1NAME=$(SHL1TARGET)
-# DEF1EXPORTFILE= export.exp
-SHL1VERSIONMAP= version.map
-
-# --- All object files ---------------------------------------------
-
-SLOFILES= \
- $(SHL1OBJS) \
-
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-.IF "$(OS)" == "WNT"
-my_file = file:///
-.ELSE
-my_file = file://
-.END
-
-ALLTAR: test
-
-test_components = \
- component/framework/util/fwk \
- component/toolkit/util/tk \
- component/sfx2/util/sfx \
- configmgr \
- vcl \
- mcnttype \
- i18npool
-.IF "$(OS)" == "WNT"
-test_components += \
- sysdtrans \
- ftransl
-.ENDIF
-
-# Make a services.rdb with the services we know we need to get up and running
-$(MISC)/services.input : makefile.mk
- $(MKDIRHIER) $(@:d)
- echo \
- '<list>$(test_components:^"<filename>":+".component</filename>")</list>' \
- > $@
-
-$(MISC)/$(TARGET)/services.rdb .ERRREMOVE : makefile.mk $(MISC)/services.input
- $(MKDIRHIER) $(@:d)
- $(XSLTPROC) --nonet --stringparam prefix $(SOLARXMLDIR)/ -o $@.tmp \
- $(SOLARENV)/bin/packcomponents.xslt $(MISC)/services.input
- cat $(MISC)/$@.tmp | sed 's|/program/|/|g' > $@
-
-#Tweak things so that we use the .res files in the solver
-STAR_RESOURCEPATH:=$(PWD)/$(BIN)$(PATH_SEPERATOR)$(SOLARBINDIR)
-.EXPORT : STAR_RESOURCEPATH
-
-.IF "$(OS)" != "DRAGONFLY"
-
-test .PHONY: $(SHL1TARGETN) $(MISC)/$(TARGET)/services.rdb
- @echo ----------------------------------------------------------
- @echo - start unit test \#1 on library $(SHL1TARGETN)
- @echo ----------------------------------------------------------
- $(CPPUNITTESTER) $(SHL1TARGETN) --headless --invisible \
- '-env:UNO_TYPES=$(my_file)$(SOLARBINDIR)/udkapi.rdb $(my_file)$(SOLARBINDIR)$/types.rdb' \
- '-env:UNO_SERVICES=$(my_file)$(SOLARXMLDIR)/ure/services.rdb $(my_file)$(PWD)/$(MISC)/$(TARGET)/services.rdb'\
- -env:URE_INTERNAL_LIB_DIR="$(my_file)$(SOLARSHAREDBIN)" \
- -env:OOO_BASE_DIR="$(my_file)$(SOLARSHAREDBIN)" \
- -env:BRAND_BASE_DIR="$(my_file)$(SOLARSHAREDBIN)"
-
-.ELSE
-
-test .PHONY: $(SHL1TARGETN)
- @echo ----------------------------------------------------------
- @echo - WARNING!!, test disabled on your platform
- @echo - Please test manually, and enable if it works
- @echo ----------------------------------------------------------
-
-.ENDIF
diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
index aec9be0efa..f7b282c60e 100644
--- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx
+++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx
@@ -150,7 +150,7 @@ Test::Test()
InitVCL(xSM);
- SmDLL::Init();
+ SmGlobals::ensure();
}
void Test::setUp()
diff --git a/starmath/qa/cppunit/test_starmath.cxx b/starmath/qa/cppunit/test_starmath.cxx
index 310f0140d7..40e058bd05 100644
--- a/starmath/qa/cppunit/test_starmath.cxx
+++ b/starmath/qa/cppunit/test_starmath.cxx
@@ -28,17 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_starmath.hxx"
-#ifdef WNT
-#include <windows.h>
-#endif
-
-#include <cppunit/TestSuite.h>
-#include <cppunit/TestFixture.h>
-#include <cppunit/TestCase.h>
-#include <cppunit/plugin/TestPlugIn.h>
-#include <cppunit/extensions/HelperMacros.h>
-
#include <sal/config.h>
+#include <sal/cppunit.h>
#include <cppuhelper/bootstrap.hxx>
#include <comphelper/processfactory.hxx>
@@ -124,7 +115,7 @@ Test::Test()
InitVCL(xSM);
- SmDLL::Init();
+ SmGlobals::ensure();
}
void Test::setUp()
@@ -141,7 +132,9 @@ void Test::setUp()
m_pDispatcher = new SfxDispatcher(pViewFrame);
m_aBindings.SetDispatcher(m_pDispatcher);
+ m_aBindings.EnterRegistrations();
m_pSmCmdBoxWindow = new SmCmdBoxWindow(&m_aBindings, NULL, NULL);
+ m_aBindings.LeaveRegistrations();
m_pEditWindow = new SmEditWindow(*m_pSmCmdBoxWindow);
m_pViewShell = m_pEditWindow->GetView();
CPPUNIT_ASSERT_MESSAGE("Should have a SmViewShell", m_pViewShell);
diff --git a/starmath/qa/cppunit/version.map b/starmath/qa/cppunit/version.map
deleted file mode 100644
index 3308588ef6..0000000000
--- a/starmath/qa/cppunit/version.map
+++ /dev/null
@@ -1,34 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-UDK_3_0_0 {
- global:
- cppunitTestPlugIn;
-
- local:
- *;
-};
diff --git a/starmath/qa/unoapi/Test.java b/starmath/qa/unoapi/Test.java
new file mode 100644
index 0000000000..bd2a77d6e0
--- /dev/null
+++ b/starmath/qa/unoapi/Test.java
@@ -0,0 +1,52 @@
+/*************************************************************************
+* 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.
+************************************************************************/
+
+package org.openoffice.starmath.qa.unoapi;
+
+import org.openoffice.Runner;
+import org.openoffice.test.OfficeConnection;
+import org.openoffice.test.Argument;
+import static org.junit.Assert.*;
+
+public final class Test {
+ @org.junit.Before public void setUp() throws Exception {
+ connection.setUp();
+ }
+
+ @org.junit.After public void tearDown()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
+ @org.junit.Test public void test() {
+ assertTrue(
+ Runner.run(
+ "-sce", Argument.get("sce"), "-xcl", Argument.get("xcl"),
+ "-cs", connection.getDescription()));
+ }
+
+ private final OfficeConnection connection = new OfficeConnection();
+}
diff --git a/starmath/sdi/makefile.mk b/starmath/sdi/makefile.mk
deleted file mode 100644
index a2d965bc22..0000000000
--- a/starmath/sdi/makefile.mk
+++ /dev/null
@@ -1,58 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=starmath
-TARGET=smslots
-SDI1EXPORT=smath
-SVSDIINC=$(PRJ)$/inc
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-# --- Files --------------------------------------------------------
-
-
-SDI1NAME=$(TARGET)
-
-SVSDI1DEPEND= \
- $(SOLARINCXDIR)$/sfx2/sfx.sdi \
- $(SOLARINCXDIR)$/sfx2/sfxitems.sdi \
- $(SOLARINCXDIR)$/svx/svx.sdi \
- $(SOLARINCXDIR)$/svx/svxitems.sdi \
- $(SOLARINCXDIR)$/svx/xoitems.sdi \
- smath.sdi \
- smslots.sdi \
- $(SVSDIINC)$/starmath.hrc
-
-# --- Targets -------------------------------------------------------
-.ENDIF
-
-.INCLUDE : target.mk
-
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 9c164355d8..3375f18aba 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -376,7 +376,7 @@ SmNodeList::iterator SmCursor::FindPositionInLineList(SmNodeList* pLineList, SmC
}
}
- //If we didn't find pSelectedNode, it must be because the caret is infront of the line
+ //If we didn't find pSelectedNode, it must be because the caret is in front of the line
return pLineList->begin();
}
@@ -416,7 +416,7 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a
--aIter;
aIter = pLineList->erase(aIter);
delete prev;
- //Return caret pos infront of aIter
+ //Return caret pos in front of aIter
if(aIter != pLineList->begin())
--aIter; //Thus find node before aIter
if(aIter == pLineList->begin())
@@ -434,7 +434,7 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a
}
//If we didn't do anything return
- if(!prev) //return an invalid to indicate we're infront of line
+ if(!prev) //return an invalid to indicate we're in front of line
return SmCaretPos();
if(prev->GetType() == NTEXT)
return SmCaretPos(prev, ((SmTextNode*)prev)->GetText().Len());
diff --git a/starmath/source/detreg.cxx b/starmath/source/detreg.cxx
index 1ff28a5ecf..b3bfd5be61 100644
--- a/starmath/source/detreg.cxx
+++ b/starmath/source/detreg.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -42,14 +42,7 @@ using namespace ::com::sun::star::lang;
extern "C" {
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char** ppEnvironmentTypeName,
- uno_Environment** /*ppEnvironment*/ )
-{
- *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName,
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL smd_component_getFactory( const sal_Char* pImplementationName,
void* pServiceManager,
void* /*pRegistryKey*/ )
{
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 2ebf536dff..d836114fea 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -325,9 +325,7 @@ void SmDocShell::ArrangeFormula()
}
-void SetEditEngineDefaultFonts(
- EditEngine &/*rEditEngine*/,
- SfxItemPool &rEditEngineItemPool )
+void SetEditEngineDefaultFonts(SfxItemPool &rEditEngineItemPool)
{
//
// set fonts to be used
@@ -394,7 +392,7 @@ EditEngine& SmDocShell::GetEditEngine()
pEditEngineItemPool = EditEngine::CreatePool();
- SetEditEngineDefaultFonts( *pEditEngine, *pEditEngineItemPool );
+ SetEditEngineDefaultFonts(*pEditEngineItemPool);
pEditEngine = new EditEngine( pEditEngineItemPool );
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index f0e0e03fbd..7313ae6c7f 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -250,7 +250,7 @@ void SmEditWindow::DataChanged( const DataChangedEvent& )
pEditEngine->SetDefTab( sal_uInt16( GetTextWidth( C2S("XXXX") ) ) );
- SetEditEngineDefaultFonts( *pEditEngine, *pEditEngineItemPool );
+ SetEditEngineDefaultFonts(*pEditEngineItemPool);
// forces new settings to be used
// unfortunately this resets the whole edit engine
diff --git a/starmath/source/eqnolefilehdr.cxx b/starmath/source/eqnolefilehdr.cxx
index a1086e1837..efcdcf5f2e 100644
--- a/starmath/source/eqnolefilehdr.cxx
+++ b/starmath/source/eqnolefilehdr.cxx
@@ -33,30 +33,6 @@
//////////////////////////////////////////////////////////////////////
-void EQNOLEFILEHDR::Read(SvStorageStream *pS)
-{
- *pS >> nCBHdr;
- *pS >> nVersion;
- *pS >> nCf;
- *pS >> nCBObject;
- *pS >> nReserved1;
- *pS >> nReserved2;
- *pS >> nReserved3;
- *pS >> nReserved4;
-}
-
-
-void EQNOLEFILEHDR::Write(SvStorageStream *pS)
-{
- *pS << nCBHdr;
- *pS << nVersion;
- *pS << nCf;
- *pS << nCBObject;
- *pS << nReserved1;
- *pS << nReserved2;
- *pS << nReserved3;
- *pS << nReserved4;
-}
sal_Bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion )
@@ -65,7 +41,7 @@ sal_Bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion )
sal_Bool bSuccess = sal_False;
//
- // code sniplet copied from MathType::Parse
+ // code snippet copied from MathType::Parse
//
SvStorageStreamRef xSrc = pStor->OpenSotStream(
String::CreateFromAscii("Equation Native"),
@@ -78,7 +54,7 @@ sal_Bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion )
EQNOLEFILEHDR aHdr;
aHdr.Read(pS);
*pS >> nVer;
-
+
if (!pS->GetError())
{
nVersion = nVer;
diff --git a/starmath/source/eqnolefilehdr.hxx b/starmath/source/eqnolefilehdr.hxx
index cca3c4938f..365e50aece 100644
--- a/starmath/source/eqnolefilehdr.hxx
+++ b/starmath/source/eqnolefilehdr.hxx
@@ -54,11 +54,31 @@ public:
sal_uInt32 nReserved3; // not used
sal_uInt32 nReserved4; // not used
- void Read(SvStorageStream *pS);
- void Write(SvStorageStream *pS);
+ inline void Read(SvStorageStream *pS)
+ {
+ *pS >> nCBHdr;
+ *pS >> nVersion;
+ *pS >> nCf;
+ *pS >> nCBObject;
+ *pS >> nReserved1;
+ *pS >> nReserved2;
+ *pS >> nReserved3;
+ *pS >> nReserved4;
+ }
+ inline void Write(SvStorageStream *pS)
+ {
+ *pS << nCBHdr;
+ *pS << nVersion;
+ *pS << nCf;
+ *pS << nCBObject;
+ *pS << nReserved1;
+ *pS << nReserved2;
+ *pS << nReserved3;
+ *pS << nReserved4;
+ }
};
-sal_Bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion );
+SAL_DLLPUBLIC_EXPORT sal_Bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion );
#endif
diff --git a/starmath/source/makefile.mk b/starmath/source/makefile.mk
deleted file mode 100755
index 520708b555..0000000000
--- a/starmath/source/makefile.mk
+++ /dev/null
@@ -1,113 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=starmath
-TARGET=starmath
-
-LIBTARGET=NO
-
-# --- Settings -----------------------------------------------------
-
-ENABLE_EXCEPTIONS=TRUE
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-SMDLL=TRUE
-
-SRS2NAME =smres
-SRC2FILES = smres.src \
- symbol.src \
- toolbox.src \
- commands.src
-
-SLO1FILES = \
- $(SLO)$/accessibility.obj \
- $(SLO)$/caret.obj \
- $(SLO)$/cursor.obj \
- $(SLO)$/edit.obj \
- $(SLO)$/eqnolefilehdr.obj \
- $(SLO)$/mathmlexport.obj \
- $(SLO)$/mathmlimport.obj \
- $(SLO)$/symbol.obj \
- $(SLO)$/types.obj \
- $(SLO)$/unodoc.obj \
- $(SLO)$/action.obj \
- $(SLO)$/cfgitem.obj \
- $(SLO)$/config.obj \
- $(SLO)$/dialog.obj \
- $(SLO)$/document.obj \
- $(SLO)$/format.obj \
- $(SLO)$/mathtype.obj \
- $(SLO)$/node.obj \
- $(SLO)$/parse.obj \
- $(SLO)$/register.obj \
- $(SLO)$/smdll.obj \
- $(SLO)$/toolbox.obj \
- $(SLO)$/typemap.obj \
- $(SLO)$/smmod.obj \
- $(SLO)$/utility.obj \
- $(SLO)$/rect.obj \
- $(SLO)$/unomodel.obj \
- $(SLO)$/view.obj \
- $(SLO)$/visitors.obj
-
-SLO2FILES = \
- $(SLO)$/register.obj \
- $(SLO)$/detreg.obj
-
-SLOFILES = \
- $(SLO)$/smdetect.obj \
- $(SLO1FILES) \
- $(SLO2FILES)
-
-LIB1TARGET = \
- $(SLB)$/$(TARGET).lib
-
-LIB1OBJFILES = \
- $(SLO1FILES)
-
-# --- Targets -------------------------------------------------------
-
-.INCLUDE : target.mk
-
-$(INCCOM)$/dllname.hxx: makefile.mk
-.IF "$(GUI)"=="UNX"
- $(RM) $@
- echo \#define DLL_NAME \"$(DLLPRE)sm$(DLLPOSTFIX)$(DLLPOST)\" >$@
-.ELSE
- echo $(EMQ)#define DLL_NAME $(EMQ)"$(DLLPRE)sm$(DLLPOSTFIX)$(DLLPOST)$(EMQ)" >$@
-.ENDIF
-
-$(SRS)$/smres.srs: $(SOLARINCDIR)$/svx$/globlmn.hrc
-
-
-$(SRS)$/$(SRS2NAME).srs : $(LOCALIZE_ME_DEST)
-
diff --git a/starmath/source/math_pch.cxx b/starmath/source/math_pch.cxx
index 61df2d6784..7eb7acfb8d 100644
--- a/starmath/source/math_pch.cxx
+++ b/starmath/source/math_pch.cxx
@@ -66,7 +66,6 @@
#include <sal/types.h>
#include <sal/config.h>
#include <tools/date.hxx>
-#include <tools/ownlist.hxx>
#include <vcl/accel.hxx>
#include <tools/resid.hxx>
#include <tools/rc.hxx>
@@ -130,7 +129,6 @@
#include <basic/sbxprop.hxx>
#include <basic/sbxmeth.hxx>
#include <tools/unqid.hxx>
-#include <tools/unqidx.hxx>
#include <svl/poolitem.hxx>
#include <svtools/args.hxx>
#include <smmod.hxx>
@@ -358,7 +356,6 @@
#include <vcl/metric.hxx>
#include <sfx2/inimgr.hxx>
#include <node.hxx>
-#include <tools/pstm.hxx>
#include <tools/table.hxx>
#include <sfx2/docfac.hxx>
#include <svl/ownlist.hxx>
diff --git a/starmath/source/mathmlexport.cxx b/starmath/source/mathmlexport.cxx
index 1335012960..52258cf20f 100644
--- a/starmath/source/mathmlexport.cxx
+++ b/starmath/source/mathmlexport.cxx
@@ -72,6 +72,7 @@
#include <xmloff/xmlmetai.hxx>
#include <osl/mutex.hxx>
#include <comphelper/genericpropertyset.hxx>
+#include <comphelper/servicehelper.hxx>
#include <memory>
@@ -408,20 +409,14 @@ throw(uno::RuntimeException)
return SvXMLExport::getSomething( rId );
}
+namespace
+{
+ class theSmXMLExportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSmXMLExportUnoTunnelId> {};
+}
+
const uno::Sequence< sal_Int8 > & SmXMLExport::getUnoTunnelId() throw()
{
- static uno::Sequence< sal_Int8 > * pSeq = 0;
- if ( !pSeq )
- {
- osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
- if ( !pSeq )
- {
- static uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
+ return theSmXMLExportUnoTunnelId::get().getSeq();
}
OUString SAL_CALL SmXMLExport_getImplementationName() throw()
@@ -843,7 +838,7 @@ void SmXMLExport::ExportMath(const SmNode *pNode, int /*nLevel*/)
sal_Unicode cTmp = ConvertMathToMathML( nArse[0] );
if (cTmp != 0)
nArse[0] = cTmp;
- OSL_ENSURE(nArse[0] != 0xffff,"Non existant symbol");
+ OSL_ENSURE(nArse[0] != 0xffff,"Non existent symbol");
nArse[1] = 0;
GetDocHandler()->characters(nArse);
}
@@ -1046,11 +1041,11 @@ void SmXMLExport::ExportBrace(const SmNode *pNode, int nLevel)
nArse[1] = 0;
nArse[0] = static_cast<
const SmMathSymbolNode* >(pLeft)->GetText().GetChar(0);
- OSL_ENSURE(nArse[0] != 0xffff,"Non existant symbol");
+ OSL_ENSURE(nArse[0] != 0xffff,"Non existent symbol");
AddAttribute(XML_NAMESPACE_MATH, XML_OPEN,nArse);
nArse[0] = static_cast<
const SmMathSymbolNode* >(pRight)->GetText().GetChar(0);
- OSL_ENSURE(nArse[0] != 0xffff,"Non existant symbol");
+ OSL_ENSURE(nArse[0] != 0xffff,"Non existent symbol");
AddAttribute(XML_NAMESPACE_MATH, XML_CLOSE,nArse);
pFences = new SvXMLElementExport(*this, XML_NAMESPACE_MATH, XML_MFENCED,
sal_True,sal_True);
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index e28d8e820c..b84ebce01b 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -68,6 +68,7 @@ one go*/
#include <xmloff/xmlmetai.hxx>
#include <osl/mutex.hxx>
#include <comphelper/genericpropertyset.hxx>
+#include <comphelper/servicehelper.hxx>
#include <memory>
@@ -436,20 +437,14 @@ SmXMLImport::SmXMLImport(
{
}
+namespace
+{
+ class theSmXMLImportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSmXMLImportUnoTunnelId> {};
+}
+
const uno::Sequence< sal_Int8 > & SmXMLImport::getUnoTunnelId() throw()
{
- static uno::Sequence< sal_Int8 > * pSeq = 0;
- if ( !pSeq )
- {
- osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
- if ( !pSeq )
- {
- static uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- pSeq = &aSeq;
- }
- }
- return *pSeq;
+ return theSmXMLImportUnoTunnelId::get().getSeq();
}
OUString SAL_CALL SmXMLImport_getImplementationName() throw()
@@ -1840,7 +1835,7 @@ SvXMLImportContext *SmXMLOfficeContext_Impl::CreateChildContext(sal_uInt16 nPref
if ( XML_NAMESPACE_OFFICE == nPrefix &&
rLocalName == GetXMLToken(XML_META) )
{
- DBG_WARNING("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
+ OSL_FAIL("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
}
else if ( XML_NAMESPACE_OFFICE == nPrefix &&
rLocalName == GetXMLToken(XML_SETTINGS) )
diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx
index 6bceda4193..f4709a26f6 100644
--- a/starmath/source/node.cxx
+++ b/starmath/source/node.cxx
@@ -564,7 +564,7 @@ void SmNode::DumpAsDot(std::ostream &out, String* label, int number, int& id, in
eq.SearchAndReplaceAll(String::CreateFromAscii("\\"), String::CreateFromAscii("\\\\"));
eq.SearchAndReplaceAll(String::CreateFromAscii("\""), String::CreateFromAscii("\\\""));
out<<"label= \"Equation: \\\"";
- out<<ByteString( eq, RTL_TEXTENCODING_UTF8).GetBuffer();
+ out<< rtl::OUStringToOString(eq, RTL_TEXTENCODING_UTF8).getStr();
out<<"\\\"\";"<<std::endl;
}
}
@@ -605,13 +605,13 @@ void SmNode::DumpAsDot(std::ostream &out, String* label, int number, int& id, in
case NPLACE: out<<"SmPlaceNode"; break;
case NTEXT:
out<<"SmTextNode: ";
- out<< ByteString( ((SmTextNode*)this)->GetText(), RTL_TEXTENCODING_UTF8).GetBuffer();
+ out<< rtl::OUStringToOString(((SmTextNode*)this)->GetText(), RTL_TEXTENCODING_UTF8).getStr();
break;
case NSPECIAL: out<<"SmSpecialNode"; break;
case NGLYPH_SPECIAL: out<<"SmGlyphSpecialNode"; break;
case NMATH:
out<<"SmMathSymbolNode: ";
- out<< ByteString( ((SmMathSymbolNode*)this)->GetText(), RTL_TEXTENCODING_UTF8).GetBuffer();
+ out<< rtl::OUStringToOString(((SmMathSymbolNode*)this)->GetText(), RTL_TEXTENCODING_UTF8).getStr();
break;
case NBLANK: out<<"SmBlankNode"; break;
case NERROR: out<<"SmErrorNode"; break;
@@ -646,7 +646,7 @@ void SmNode::DumpAsDot(std::ostream &out, String* label, int number, int& id, in
long SmNode::GetFormulaBaseline() const
{
- DBG_ASSERT( 0, "This dummy implementation should not have been called." );
+ OSL_FAIL( "This dummy implementation should not have been called." );
return 0;
}
@@ -859,7 +859,7 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
ExtendBy(rNodeRect, nSize > 1 ? RCP_NONE : RCP_ARG);
}
}
- // --> 4.7.2010 #i972#
+ // #i972#
if (HasBaseline())
nFormulaBaseline = GetBaseline();
else
@@ -874,7 +874,6 @@ void SmTableNode::Arrange(const OutputDevice &rDev, const SmFormat &rFormat)
// between middle and baseline for single letter
nFormulaBaseline += aRect.GetBaseline() - aRect.GetAlignM();
}
- // <--
}
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 5d7fc2bfbe..2a678d0ff5 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -430,12 +430,9 @@ void SmParser::NextToken()
// (note that #i11752# remains fixed)
if ((aRes.TokenType & KParseType::IDENTNAME) && IsDigit( cFirstChar ))
{
- //! locale where '.' is decimal seperator!
- static lang::Locale aDotLoc( SvxCreateLocale( LANGUAGE_ENGLISH_US ) );
-
ParseResult aTmpRes;
lang::Locale aOldLoc( aCC.getLocale() );
- aCC.setLocale( aDotLoc );
+ aCC.setLocale( m_aDotLoc );
aTmpRes = aCC.parsePredefinedToken(
KParseType::ASC_NUMBER,
m_aBufferString, m_nBufferIndex,
@@ -504,7 +501,7 @@ void SmParser::NextToken()
#if OSL_DEBUG_LEVEL > 1
if (!IsDelimiter( m_aBufferString, static_cast< xub_StrLen >(aRes.EndPos) ))
{
- DBG_WARNING( "identifier really finished? (compatibility!)" );
+ OSL_FAIL( "identifier really finished? (compatibility!)" );
}
#endif
}
@@ -544,7 +541,7 @@ void SmParser::NextToken()
#if OSL_DEBUG_LEVEL > 1
if (!IsDelimiter( m_aBufferString, static_cast< xub_StrLen >(aRes.EndPos) ))
{
- DBG_WARNING( "identifier really finished? (compatibility!)" );
+ OSL_FAIL( "identifier really finished? (compatibility!)" );
}
#endif
}
@@ -2396,6 +2393,7 @@ void SmParser::Error(SmParseError eError)
SmParser::SmParser()
+ : m_aDotLoc( SvxCreateLocale( LANGUAGE_ENGLISH_US ) )
{
m_eConversion = CONVERT_NONE;
bImportSymNames = m_bExportSymNames = false;
diff --git a/starmath/source/register.cxx b/starmath/source/register.cxx
index 71ba9f4424..2fc6dafa0d 100644
--- a/starmath/source/register.cxx
+++ b/starmath/source/register.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -112,14 +112,7 @@ extern Reference< XInterface > SAL_CALL
extern "C" {
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char** ppEnvironmentTypeName,
- uno_Environment** /*ppEnvironment*/ )
-{
- *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName,
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL sm_component_getFactory( const sal_Char* pImplementationName,
void* pServiceManager,
void* /*pRegistryKey*/ )
{
diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx
index ca50ad3147..ccf23ef65a 100644
--- a/starmath/source/smdetect.cxx
+++ b/starmath/source/smdetect.cxx
@@ -30,8 +30,6 @@
#include "precompiled_starmath.hxx"
#include "smdetect.hxx"
-
-//#include <framework/interaction.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/XFrame.hpp>
@@ -46,10 +44,8 @@
#include <com/sun/star/ucb/InteractiveAppException.hpp>
#include <com/sun/star/ucb/XContent.hpp>
#include <com/sun/star/packages/zip/ZipIOException.hpp>
-
#include <toolkit/helper/vclunohelper.hxx>
#include <ucbhelper/simpleinteractionrequest.hxx>
-
#include <rtl/ustring.h>
#include <rtl/logfile.hxx>
#include <svl/itemset.hxx>
@@ -71,8 +67,8 @@
#include <sfx2/brokenpackageint.hxx>
#include "document.hxx"
-#include "eqnolefilehdr.hxx"
+extern sal_Bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion );
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -455,7 +451,6 @@ UNOSEQUENCE< UNOOUSTRING > SAL_CALL SmFilterDetect::getSupportedServiceNames() t
/* Helper for XServiceInfo */
UNOSEQUENCE< UNOOUSTRING > SmFilterDetect::impl_getStaticSupportedServiceNames()
{
- UNOMUTEXGUARD aGuard( UNOMUTEX::getGlobalMutex() );
UNOSEQUENCE< UNOOUSTRING > seqServiceNames( 1 );
seqServiceNames.getArray() [0] = UNOOUSTRING(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ExtendedTypeDetection" ));
return seqServiceNames ;
diff --git a/starmath/source/smdll.cxx b/starmath/source/smdll.cxx
index f9f07c414a..b519b48726 100644
--- a/starmath/source/smdll.cxx
+++ b/starmath/source/smdll.cxx
@@ -50,59 +50,65 @@
#include <svx/xmlsecctrl.hxx>
-
-
-bool SmDLL::bInitialized = false;
-
-
-// Initialization
-
-void SmDLL::Init()
+namespace
{
- if ( bInitialized )
- return;
-
- bInitialized = true;
-
- SfxObjectFactory& rFactory = SmDocShell::Factory();
-
- SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
- *ppShlPtr = new SmModule( &rFactory );
-
- SfxModule *p = SM_MOD();
- SmModule *pp = (SmModule *) p;
-
- rFactory.SetDocumentServiceName( String::CreateFromAscii("com.sun.star.formula.FormulaProperties") );
-
- SmModule::RegisterInterface(pp);
- SmDocShell::RegisterInterface(pp);
- SmViewShell::RegisterInterface(pp);
-
- SmViewShell::RegisterFactory(1);
-
- SvxZoomStatusBarControl::RegisterControl( SID_ATTR_ZOOM, pp );
- SvxModifyControl::RegisterControl( SID_TEXTSTATUS, pp );
- SvxUndoRedoControl::RegisterControl( SID_UNDO, pp );
- SvxUndoRedoControl::RegisterControl( SID_REDO, pp );
- XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pp );
-
- SmToolBoxWrapper::RegisterChildWindow(true);
- SmCmdBoxWrapper::RegisterChildWindow(true);
-
- ::sfx2::TaskPaneWrapper::RegisterChildWindow( false, pp );
+ class SmDLL
+ {
+ public:
+ SmDLL();
+ ~SmDLL();
+ };
+
+ SmDLL::SmDLL()
+ {
+ SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
+ if ( *ppShlPtr )
+ return;
+
+ SfxObjectFactory& rFactory = SmDocShell::Factory();
+ SmModule *pModule = new SmModule( &rFactory );
+ *ppShlPtr = pModule;
+
+ rFactory.SetDocumentServiceName( String::CreateFromAscii("com.sun.star.formula.FormulaProperties") );
+
+ SmModule::RegisterInterface(pModule);
+ SmDocShell::RegisterInterface(pModule);
+ SmViewShell::RegisterInterface(pModule);
+
+ SmViewShell::RegisterFactory(1);
+
+ SvxZoomStatusBarControl::RegisterControl(SID_ATTR_ZOOM, pModule);
+ SvxModifyControl::RegisterControl(SID_TEXTSTATUS, pModule);
+ SvxUndoRedoControl::RegisterControl(SID_UNDO, pModule);
+ SvxUndoRedoControl::RegisterControl(SID_REDO, pModule);
+ XmlSecStatusBarControl::RegisterControl(SID_SIGNATURE, pModule);
+
+ SmToolBoxWrapper::RegisterChildWindow(true);
+ SmCmdBoxWrapper::RegisterChildWindow(true);
+
+ ::sfx2::TaskPaneWrapper::RegisterChildWindow(false, pModule);
+ }
+
+ SmDLL::~SmDLL()
+ {
+#if 0
+ // the SdModule must be destroyed
+ SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
+ delete (*ppShlPtr);
+ (*ppShlPtr) = NULL;
+ *GetAppData(SHL_SM) = 0;
+#endif
+ }
+
+ struct theSmDLLInstance : public rtl::Static<SmDLL, theSmDLLInstance> {};
}
-
-// Deinitialization
-
-void SmDLL::Exit()
+namespace SmGlobals
{
- // the SdModule must be destroyed
- SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
- delete (*ppShlPtr);
- (*ppShlPtr) = NULL;
-
- *GetAppData(SHL_SM) = 0;
+ void ensure()
+ {
+ theSmDLLInstance::get();
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx
index 0b87b39f9b..ea5d0e95d2 100644
--- a/starmath/source/symbol.cxx
+++ b/starmath/source/symbol.cxx
@@ -218,7 +218,7 @@ bool SmSymbolManager::AddOrReplaceSymbol( const SmSym &rSymbol, bool bForceChang
OSL_ENSURE( bAdded, "failed to add symbol" );
if (bAdded)
m_bModified = true;
- DBG_ASSERT( bAdded || (pFound && !bSymbolConflict), "AddOrReplaceSymbol: unresolved symbol conflict" );
+ OSL_ENSURE( bAdded || (pFound && !bSymbolConflict), "AddOrReplaceSymbol: unresolved symbol conflict" );
}
return bAdded;
diff --git a/starmath/source/unodoc.cxx b/starmath/source/unodoc.cxx
index 9fae49f782..2e4eae8bc7 100644
--- a/starmath/source/unodoc.cxx
+++ b/starmath/source/unodoc.cxx
@@ -59,14 +59,9 @@ uno::Reference< uno::XInterface > SAL_CALL SmDocument_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & /*rSMgr*/, const sal_uInt64 _nCreationFlags ) throw( uno::Exception )
{
SolarMutexGuard aGuard;
- if ( !SM_MOD() )
- SmDLL::Init();
-
+ SmGlobals::ensure();
SfxObjectShell* pShell = new SmDocShell( _nCreationFlags );
- if( pShell )
- return uno::Reference< uno::XInterface >( pShell->GetModel() );
-
- return uno::Reference< uno::XInterface >();
+ return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 736203a16a..6da429c00f 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -49,6 +49,7 @@
#include <xmloff/xmluconv.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/propertysetinfo.hxx>
+#include <comphelper/servicehelper.hxx>
#include <unotools/moduleoptions.hxx>
#include <unomodel.hxx>
@@ -303,12 +304,10 @@ PropertySetInfo * lcl_createModelPropertyInfo ()
{ RTL_CONSTASCII_STRINGPARAM( "Symbols" ), HANDLE_SYMBOLS , &::getCppuType((const Sequence < SymbolDescriptor > *)0), PROPERTY_NONE, 0 },
{ RTL_CONSTASCII_STRINGPARAM( "UserDefinedSymbolsInUse" ), HANDLE_USED_SYMBOLS , &::getCppuType((const Sequence < SymbolDescriptor > *)0), PropertyAttribute::READONLY, 0 },
{ RTL_CONSTASCII_STRINGPARAM( "TopMargin" ), HANDLE_TOP_MARGIN , &::getCppuType((const sal_Int16*)0), PROPERTY_NONE, DIS_TOPSPACE },
- // --> PB 2004-08-25 #i33095# Security Options
+ // #i33095# Security Options
{ RTL_CONSTASCII_STRINGPARAM( "LoadReadonly" ), HANDLE_LOAD_READONLY, &::getBooleanCppuType(), PROPERTY_NONE, 0 },
- // <--
- // --> 3.7.2010 #i972#
+ // #i972#
{ RTL_CONSTASCII_STRINGPARAM( "BaseLine"), HANDLE_BASELINE, &::getCppuType((const sal_Int16*)0), PROPERTY_NONE, 0},
- // <--
{ NULL, 0, 0, NULL, 0, 0 }
};
PropertySetInfo *pInfo = new PropertySetInfo ( aModelPropertyInfoMap );
@@ -371,18 +370,14 @@ uno::Sequence< uno::Type > SAL_CALL SmModel::getTypes( ) throw(uno::RuntimeExce
return aTypes;
}
-const uno::Sequence< sal_Int8 > & SmModel::getUnoTunnelId()
+namespace
{
- static osl::Mutex aCreateMutex;
- osl::Guard<osl::Mutex> aGuard( aCreateMutex );
+ class theSmModelUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSmModelUnoTunnelId> {};
+}
- static uno::Sequence< sal_Int8 > aSeq;
- if(!aSeq.getLength())
- {
- aSeq.realloc( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- }
- return aSeq;
+const uno::Sequence< sal_Int8 > & SmModel::getUnoTunnelId()
+{
+ return theSmModelUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SmModel::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -709,7 +704,7 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
throw IllegalArgumentException();
}
break;
- // --> PB 2004-08-25 #i33095# Security Options
+ // #i33095# Security Options
case HANDLE_LOAD_READONLY :
{
if ( (*pValues).getValueType() != ::getBooleanCppuType() )
@@ -719,7 +714,6 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
pDocSh->SetLoadReadonly( bReadonly );
break;
}
- // <--
}
}
@@ -927,14 +921,13 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu
case HANDLE_RUNTIME_UID:
*pValue <<= getRuntimeUID();
break;
- // --> PB 2004-08-25 #i33095# Security Options
+ // #i33095# Security Options
case HANDLE_LOAD_READONLY :
{
*pValue <<= pDocSh->IsLoadReadonly();
break;
}
- // <--
- // --> 3.7.2010 #i972#
+ // #i972#
case HANDLE_BASELINE:
{
if ( !pDocSh->pTree )
@@ -948,7 +941,6 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu
}
}
break;
- // <--
}
}
}
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index c924e31e75..9b644ceae5 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -171,7 +171,7 @@ void SmGraphicWindow::MouseButtonDown(const MouseEvent& rMEvt)
// set formula-cursor and selection of edit window according to the
// position clicked at
//
- DBG_ASSERT(rMEvt.GetClicks() > 0, "Sm : 0 clicks");
+ OSL_ENSURE(rMEvt.GetClicks() > 0, "Sm : 0 clicks");
if ( rMEvt.IsLeft() )
{
// get click position relativ to formula
@@ -557,7 +557,7 @@ void SmGraphicWindow::Command(const CommandEvent& rCEvt)
aPos = rCEvt.GetMousePosPixel();
OSL_ENSURE( pViewShell, "view shell missing" );
- // added for replaceability of context menus
+ // added for replaceability of context menus
pViewShell->GetViewFrame()->GetBindings().GetDispatcher()
->ExecutePopup( aResId, this, &aPos );
@@ -855,7 +855,7 @@ IMPL_LINK( SmCmdBoxWindow, InitialFocusTimerHdl, Timer *, EMPTYARG /*pTimer*/ )
if (xSMGR.is())
{
xDesktop = uno::Reference< frame::XDesktop >(
- xSMGR->createInstance( rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" )), uno::UNO_QUERY_THROW );
+ xSMGR->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), uno::UNO_QUERY_THROW );
}
aEdit.GrabFocus();
@@ -881,7 +881,7 @@ IMPL_LINK( SmCmdBoxWindow, InitialFocusTimerHdl, Timer *, EMPTYARG /*pTimer*/ )
}
catch (uno::Exception &)
{
- DBG_ASSERT( 0, "failed to properly set initial focus to edit window" );
+ OSL_FAIL( "failed to properly set initial focus to edit window" );
}
return 0;
}
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 78e5adcbed..f342b3dbb7 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -486,7 +486,7 @@ public:
void SetFillColor( const Color& rColor ) { rOutDev.SetFillColor( Impl_GetColor( rColor ) ); }
void SetTextColor( const Color& rColor ) { rOutDev.SetTextColor( Impl_GetColor( rColor ) ); }
- operator OutputDevice & ( ) { return rOutDev; }
+ operator OutputDevice & ( ) const { return rOutDev; }
};
SmTmpDevice2::SmTmpDevice2( OutputDevice &rTheDev, bool bUseMap100th_mm ) :
@@ -679,7 +679,7 @@ void SmDrawingVisitor::Visit( SmRootSymbolNode* pNode )
Rectangle aBar( aBarPos, Size( nBarWidth, nBarHeight ) );
//! avoid GROWING AND SHRINKING of drawn rectangle when constantly
//! increasing zoomfactor.
- // This is done by shifting it's output-position to a point that
+ // This is done by shifting its output-position to a point that
// corresponds exactly to a pixel on the output device.
Point aDrawPos( rDev.PixelToLogic( rDev.LogicToPixel( aBar.TopLeft( ) ) ) );
aBar.SetPos( aDrawPos );
@@ -727,12 +727,12 @@ void SmDrawingVisitor::Visit( SmRectangleNode* pNode )
aTmp.Top( ) += nTmpBorderWidth;
aTmp.Bottom( ) -= nTmpBorderWidth;
- DBG_ASSERT( aTmp.GetHeight( ) > 0 && aTmp.GetWidth( ) > 0,
+ OSL_ENSURE( aTmp.GetHeight( ) > 0 && aTmp.GetWidth( ) > 0,
"Sm: leeres Rechteck" );
//! avoid GROWING AND SHRINKING of drawn rectangle when constantly
//! increasing zoomfactor.
- // This is done by shifting it's output-position to a point that
+ // This is done by shifting its output-position to a point that
// corresponds exactly to a pixel on the output device.
Point aPos ( rDev.PixelToLogic( rDev.LogicToPixel( aTmp.TopLeft( ) ) ) );
aTmp.SetPos( aPos );
@@ -790,12 +790,12 @@ SmSetSelectionVisitor::SmSetSelectionVisitor( SmCaretPos startPos, SmCaretPos en
//Assume that pTree is a SmTableNode
OSL_ENSURE(pTree->GetType() == NTABLE, "pTree should be a SmTableNode!");
- //Visit root node, this is special as this node cannot be selected, but it's children can!
+ //Visit root node, this is special as this node cannot be selected, but its children can!
if(pTree->GetType() == NTABLE){
- //Change state if StartPos is infront of this node
+ //Change state if StartPos is in front of this node
if( StartPos.pSelectedNode == pTree && StartPos.Index == 0 )
IsSelecting = !IsSelecting;
- //Change state if EndPos is infront of this node
+ //Change state if EndPos is in front of this node
if( EndPos.pSelectedNode == pTree && EndPos.Index == 0 )
IsSelecting = !IsSelecting;
OSL_ENSURE(!IsSelecting, "Caret positions needed to set IsSelecting about, shouldn't be possible!");
@@ -832,10 +832,10 @@ void SmSetSelectionVisitor::SetSelectedOnAll( SmNode* pSubTree, bool IsSelected
}
void SmSetSelectionVisitor::DefaultVisit( SmNode* pNode ) {
- //Change state if StartPos is infront of this node
+ //Change state if StartPos is in front of this node
if( StartPos.pSelectedNode == pNode && StartPos.Index == 0 )
IsSelecting = !IsSelecting;
- //Change state if EndPos is infront of this node
+ //Change state if EndPos is in front of this node
if( EndPos.pSelectedNode == pNode && EndPos.Index == 0 )
IsSelecting = !IsSelecting;
@@ -857,7 +857,7 @@ void SmSetSelectionVisitor::DefaultVisit( SmNode* pNode ) {
//If state changed
if( ChangedState )
{
- //Select this node and all of it's children
+ //Select this node and all of its children
//(Make exception for SmBracebodyNode)
if( pNode->GetType() != NBRACEBODY ||
!pNode->GetParent() ||
@@ -887,10 +887,10 @@ void SmSetSelectionVisitor::DefaultVisit( SmNode* pNode ) {
}
void SmSetSelectionVisitor::VisitCompositionNode( SmNode* pNode ) {
- //Change state if StartPos is infront of this node
+ //Change state if StartPos is in front of this node
if( StartPos.pSelectedNode == pNode && StartPos.Index == 0 )
IsSelecting = !IsSelecting;
- //Change state if EndPos is infront of this node
+ //Change state if EndPos is in front of this node
if( EndPos.pSelectedNode == pNode && EndPos.Index == 0 )
IsSelecting = !IsSelecting;
@@ -995,8 +995,8 @@ SmCaretPosGraphBuildingVisitor::SmCaretPosGraphBuildingVisitor( SmNode* pRootNod
while( it.Next( ) ){
//There's a special invariant between this method and the Visit( SmLineNode* )
//Usually pRightMost may not be NULL, to avoid this pRightMost should here be
- //set to a new SmCaretPos infront of it.Current( ), however, if it.Current( ) is
- //an instance of SmLineNode we let SmLineNode create this position infront of
+ //set to a new SmCaretPos in front of it.Current( ), however, if it.Current( ) is
+ //an instance of SmLineNode we let SmLineNode create this position in front of
//the visual line.
//The argument for doing this is that we now don't have to worry about SmLineNode
//being a visual line composition node. Thus, no need for yet another special case
@@ -1162,7 +1162,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmSubSupNode* pNode )
/** Build caret position for SmOperNode
*
- * If first child is an SmSubSupNode we will ignore it's
+ * If first child is an SmSubSupNode we will ignore its
* body, as this body is a SmMathSymbol, for SUM, INT or similar
* that shouldn't be subject to modification.
* If first child is not a SmSubSupNode, ignore it completely
@@ -1225,7 +1225,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
SmNode* pChild;
SmCaretPosGraphEntry *childLeft;
if( pSubSup && ( pChild = pSubSup->GetSubSup( LSUP ) ) ) {
- //Create position infront of pChild
+ //Create position in front of pChild
childLeft = pGraph->Add( SmCaretPos( pChild, 0 ), left );
//Visit pChild
pRightMost = childLeft;
@@ -1234,7 +1234,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
pRightMost->SetRight( bodyLeft );
}
if( pSubSup && ( pChild = pSubSup->GetSubSup( LSUB ) ) ) {
- //Create position infront of pChild
+ //Create position in front of pChild
childLeft = pGraph->Add( SmCaretPos( pChild, 0 ), left );
//Visit pChild
pRightMost = childLeft;
@@ -1243,7 +1243,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
pRightMost->SetRight( bodyLeft );
}
if( pSubSup && ( pChild = pSubSup->GetSubSup( CSUP ) ) ) {//TO
- //Create position infront of pChild
+ //Create position in front of pChild
childLeft = pGraph->Add( SmCaretPos( pChild, 0 ), left );
//Visit pChild
pRightMost = childLeft;
@@ -1252,7 +1252,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
pRightMost->SetRight( bodyLeft );
}
if( pSubSup && ( pChild = pSubSup->GetSubSup( CSUB ) ) ) { //FROM
- //Create position infront of pChild
+ //Create position in front of pChild
childLeft = pGraph->Add( SmCaretPos( pChild, 0 ), left );
//Visit pChild
pRightMost = childLeft;
@@ -1261,7 +1261,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
pRightMost->SetRight( bodyLeft );
}
if( pSubSup && ( pChild = pSubSup->GetSubSup( RSUP ) ) ) {
- //Create position infront of pChild
+ //Create position in front of pChild
childLeft = pGraph->Add( SmCaretPos( pChild, 0 ), left );
//Visit pChild
pRightMost = childLeft;
@@ -1270,7 +1270,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmOperNode* pNode )
pRightMost->SetRight( bodyLeft );
}
if( pSubSup && ( pChild = pSubSup->GetSubSup( RSUB ) ) ) {
- //Create position infront of pChild
+ //Create position in front of pChild
childLeft = pGraph->Add( SmCaretPos( pChild, 0 ), left );
//Visit pChild
pRightMost = childLeft;
@@ -1370,7 +1370,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmBinVerNode* pNode )
//Set left
left = pRightMost;
- OSL_ENSURE( pRightMost, "There must be a position infront of this" );
+ OSL_ENSURE( pRightMost, "There must be a position in front of this" );
//Create right
right = pGraph->Add( SmCaretPos( pNode, 1 ) );
@@ -1617,7 +1617,7 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmRootNode* pNode )
*bodyRight;
//Get left and save it
- OSL_ENSURE( pRightMost, "There must be a position infront of this" );
+ OSL_ENSURE( pRightMost, "There must be a position in front of this" );
left = pRightMost;
//Create body left
diff --git a/starmath/util/hidother.src b/starmath/util/hidother.src
deleted file mode 100644
index 0b2ff54898..0000000000
--- a/starmath/util/hidother.src
+++ /dev/null
@@ -1,116 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "../inc/helpids.h"
-
-hidspecial HID_SMA_OPTIONSDIALOG { HelpId = HID_SMA_OPTIONSDIALOG; };
-hidspecial HID_SMA_FONTDIALOG { HelpId = HID_SMA_FONTDIALOG; };
-hidspecial HID_SMA_FONTSIZEDIALOG { HelpId = HID_SMA_FONTSIZEDIALOG; };
-hidspecial HID_SMA_FONTTYPEDIALOG { HelpId = HID_SMA_FONTTYPEDIALOG; };
-hidspecial HID_SMA_DISTANCEDIALOG { HelpId = HID_SMA_DISTANCEDIALOG; };
-hidspecial HID_SMA_ALIGNDIALOG { HelpId = HID_SMA_ALIGNDIALOG; };
-hidspecial HID_SMA_PRINTOPTIONPAGE { HelpId = HID_SMA_PRINTOPTIONPAGE; };
-hidspecial HID_SMA_SYMBOLDIALOG { HelpId = HID_SMA_SYMBOLDIALOG; };
-hidspecial HID_SMA_SYMDEFINEDIALOG { HelpId = HID_SMA_SYMDEFINEDIALOG; };
-hidspecial HID_SMA_EXTRAOPTIONPAGE { HelpId = HID_SMA_EXTRAOPTIONPAGE; };
-hidspecial HID_SMA_DOCSAVEQUERY { HelpId = HID_SMA_DOCSAVEQUERY; };
-hidspecial HID_SMA_OBJECTSAVEQUERY { HelpId = HID_SMA_OBJECTSAVEQUERY; };
-hidspecial HID_SMA_DEFAULTSAVEQUERY { HelpId = HID_SMA_DEFAULTSAVEQUERY; };
-hidspecial HID_SMA_ILLEGALOBJECTERROR { HelpId = HID_SMA_ILLEGALOBJECTERROR; };
-hidspecial HID_SMA_ILLEGALFILEERROR { HelpId = HID_SMA_ILLEGALFILEERROR; };
-hidspecial HID_SMA_WRITESYMBOLERROR { HelpId = HID_SMA_WRITESYMBOLERROR; };
-hidspecial HID_SMA_READSYMBOLERROR { HelpId = HID_SMA_READSYMBOLERROR; };
-hidspecial HID_SMA_NOMATHTYPEFACEWARNING { HelpId = HID_SMA_NOMATHTYPEFACEWARNING; };
-hidspecial HID_SMA_OBJECTNAME { HelpId = HID_SMA_OBJECTNAME; };
-hidspecial HID_SMA_VIEWNAME { HelpId = HID_SMA_VIEWNAME; };
-hidspecial HID_SMA_UNDOEDITNAME { HelpId = HID_SMA_UNDOEDITNAME; };
-hidspecial HID_SMA_UNDOFORMATNAME { HelpId = HID_SMA_UNDOFORMATNAME; };
-hidspecial HID_SMA_APPICO { HelpId = HID_SMA_APPICO; };
-hidspecial HID_SMA_DOCICO { HelpId = HID_SMA_DOCICO; };
-hidspecial HID_SMA_TMPICO { HelpId = HID_SMA_TMPICO; };
-hidspecial HID_SMA_COMMANDMENU { HelpId = HID_SMA_COMMANDMENU; };
-hidspecial HID_SMA_VIEWMENU { HelpId = HID_SMA_VIEWMENU; };
-hidspecial HID_SMA_DISTANCEMENU { HelpId = HID_SMA_DISTANCEMENU; };
-hidspecial HID_SMA_FONTMENU { HelpId = HID_SMA_FONTMENU; };
-hidspecial HID_SMA_STARTUPWINDOW { HelpId = HID_SMA_STARTUPWINDOW; };
-hidspecial HID_SMA_TOOLBOXWINDOW { HelpId = HID_SMA_TOOLBOXWINDOW; };
-hidspecial HID_SMA_CMDBOXWINDOW { HelpId = HID_SMA_CMDBOXWINDOW; };
-hidspecial HID_SMA_UPDATEOBJECT { HelpId = HID_SMA_UPDATEOBJECT; };
-hidspecial HID_SMA_FONTREGULAR { HelpId = HID_SMA_FONTREGULAR; };
-hidspecial HID_SMA_FONTITALIC { HelpId = HID_SMA_FONTITALIC; };
-hidspecial HID_SMA_FONTBOLD { HelpId = HID_SMA_FONTBOLD; };
-hidspecial HID_SMA_PRINTOPTION { HelpId = HID_SMA_PRINTOPTION; };
-hidspecial HID_SMA_DOCUMENTSTR { HelpId = HID_SMA_DOCUMENTSTR; };
-hidspecial HID_SMA_SYMBOLFILESSTR { HelpId = HID_SMA_SYMBOLFILESSTR; };
-hidspecial HID_SMA_ALLFILESSTR { HelpId = HID_SMA_ALLFILESSTR; };
-hidspecial HID_SMA_CREATORSTR { HelpId = HID_SMA_CREATORSTR; };
-hidspecial HID_SMA_FILESMFTYP { HelpId = HID_SMA_FILESMFTYP; };
-hidspecial HID_SMA_FILESYMTYP { HelpId = HID_SMA_FILESYMTYP; };
-hidspecial HID_SMA_WIN_DOCUMENT { HelpId = HID_SMA_WIN_DOCUMENT; };
-hidspecial HID_SMA_COMMAND_WIN_EDIT { HelpId = HID_SMA_COMMAND_WIN_EDIT; };
-
-hidspecial HID_SMA_DEFAULT_DIST { HelpId = HID_SMA_DEFAULT_DIST; };
-hidspecial HID_SMA_LINE_DIST { HelpId = HID_SMA_LINE_DIST; };
-hidspecial HID_SMA_ROOT_DIST { HelpId = HID_SMA_ROOT_DIST; };
-hidspecial HID_SMA_SUP_DIST { HelpId = HID_SMA_SUP_DIST; };
-hidspecial HID_SMA_SUB_DIST { HelpId = HID_SMA_SUB_DIST; };
-hidspecial HID_SMA_NUMERATOR_DIST { HelpId = HID_SMA_NUMERATOR_DIST; };
-hidspecial HID_SMA_DENOMINATOR_DIST { HelpId = HID_SMA_DENOMINATOR_DIST; };
-hidspecial HID_SMA_FRACLINE_EXCWIDTH { HelpId = HID_SMA_FRACLINE_EXCWIDTH; };
-hidspecial HID_SMA_FRACLINE_LINEWIDTH { HelpId = HID_SMA_FRACLINE_LINEWIDTH; };
-hidspecial HID_SMA_UPPERLIMIT_DIST { HelpId = HID_SMA_UPPERLIMIT_DIST; };
-hidspecial HID_SMA_LOWERLIMIT_DIST { HelpId = HID_SMA_LOWERLIMIT_DIST; };
-hidspecial HID_SMA_BRACKET_EXCHEIGHT { HelpId = HID_SMA_BRACKET_EXCHEIGHT; };
-hidspecial HID_SMA_BRACKET_DIST { HelpId = HID_SMA_BRACKET_DIST; };
-hidspecial HID_SMA_BRACKET_EXCHEIGHT2 { HelpId = HID_SMA_BRACKET_EXCHEIGHT2; };
-hidspecial HID_SMA_MATRIXROW_DIST { HelpId = HID_SMA_MATRIXROW_DIST; };
-hidspecial HID_SMA_MATRIXCOL_DIST { HelpId = HID_SMA_MATRIXCOL_DIST; };
-hidspecial HID_SMA_ATTRIBUT_DIST { HelpId = HID_SMA_ATTRIBUT_DIST; };
-hidspecial HID_SMA_INTERATTRIBUT_DIST { HelpId = HID_SMA_INTERATTRIBUT_DIST; };
-hidspecial HID_SMA_OPERATOR_EXCHEIGHT { HelpId = HID_SMA_OPERATOR_EXCHEIGHT; };
-hidspecial HID_SMA_OPERATOR_DIST { HelpId = HID_SMA_OPERATOR_DIST; };
-hidspecial HID_SMA_LEFTBORDER_DIST { HelpId = HID_SMA_LEFTBORDER_DIST; };
-hidspecial HID_SMA_RIGHTBORDER_DIST { HelpId = HID_SMA_RIGHTBORDER_DIST; };
-hidspecial HID_SMA_UPPERBORDER_DIST { HelpId = HID_SMA_UPPERBORDER_DIST; };
-hidspecial HID_SMA_LOWERBORDER_DIST { HelpId = HID_SMA_LOWERBORDER_DIST; };
-
-//! this shouldn't have been necessary!
-hidspecial HID_SMA_ALEPH { HelpId = HID_SMA_ALEPH; };
-hidspecial HID_SMA_EMPTYSET { HelpId = HID_SMA_EMPTYSET; };
-hidspecial HID_SMA_RE { HelpId = HID_SMA_RE; };
-hidspecial HID_SMA_IM { HelpId = HID_SMA_IM; };
-hidspecial HID_SMA_INFINITY { HelpId = HID_SMA_INFINITY; };
-hidspecial HID_SMA_PARTIAL { HelpId = HID_SMA_PARTIAL; };
-hidspecial HID_SMA_WP { HelpId = HID_SMA_WP; };
-hidspecial HID_SMA_DOTSAXIS { HelpId = HID_SMA_DOTSAXIS; };
-hidspecial HID_SMA_DOTSUP { HelpId = HID_SMA_DOTSUP; };
-hidspecial HID_SMA_DOTSDOWN { HelpId = HID_SMA_DOTSDOWN; };
-hidspecial HID_SMA_DOTSLOW { HelpId = HID_SMA_DOTSLOW; };
-hidspecial HID_SMA_DOTSVERT { HelpId = HID_SMA_DOTSVERT; };
-hidspecial HID_SMA_NABLA { HelpId = HID_SMA_NABLA; };
-hidspecial HID_SMA_EXISTS { HelpId = HID_SMA_EXISTS; };
-hidspecial HID_SMA_FORALL { HelpId = HID_SMA_FORALL; };
-
diff --git a/starmath/util/makefile.mk b/starmath/util/makefile.mk
deleted file mode 100644
index 09fedb57fb..0000000000
--- a/starmath/util/makefile.mk
+++ /dev/null
@@ -1,127 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-PRJ=..
-
-PRJNAME=starmath
-TARGET=smath3
-LIBTARGET=NO
-GEN_HID=TRUE
-GEN_HID_OTHER=TRUE
-
-# --- Settings -----------------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# --- Files --------------------------------------------------------
-
-RESLIB1NAME=sm
-RESLIB1IMAGES=$(PRJ)$/res
-RESLIB1SRSFILES=\
- $(SRS)$/smres.srs
-
-SHL1TARGET= sm$(DLLPOSTFIX)
-SHL1IMPLIB= smimp
-
-SHL1VERSIONMAP=$(SOLARENV)/src/component.map
-SHL1DEF=$(MISC)$/$(SHL1TARGET).def
-DEF1NAME= $(SHL1TARGET)
-
-SHL1STDLIBS= \
- $(EDITENGLIB) \
- $(SVXCORELIB) \
- $(SVXLIB) \
- $(SFX2LIB) \
- $(XMLOFFLIB) \
- $(SVTOOLLIB) \
- $(TKLIB) \
- $(VCLLIB) \
- $(SVLLIB) \
- $(I18NPAPERLIB) \
- $(SOTLIB) \
- $(UNOTOOLSLIB) \
- $(TOOLSLIB) \
- $(COMPHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL2TARGET= smd$(DLLPOSTFIX)
-SHL2IMPLIB= smdimp
-SHL2VERSIONMAP=$(SOLARENV)/src/component.map
-SHL2DEF=$(MISC)$/$(SHL2TARGET).def
-DEF2NAME= $(SHL2TARGET)
-
-SHL2STDLIBS= \
- $(SFX2LIB) \
- $(SVTOOLLIB) \
- $(SVLLIB) \
- $(VCLLIB) \
- $(SOTLIB) \
- $(TOOLSLIB) \
- $(UCBHELPERLIB) \
- $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
-
-SHL2DEPN= makefile.mk
-SHL2VERSIONMAP=$(SOLARENV)/src/component.map
-SHL2OBJS= $(SLO)$/smdetect.obj \
- $(SLO)$/detreg.obj \
- $(SLO)$/eqnolefilehdr.obj
-
-SHL1DEPN= makefile.mk
-SHL1LIBS= $(SLB)$/starmath.lib
-
-.IF "$(GUI)" != "UNX"
-.IF "$(GUI)$(COM)" != "WNTGCC"
-SHL1OBJS= $(SLO)$/smdll.obj
-.ENDIF
-.ENDIF # ! UNX
-
-.IF "$(GUI)" == "WNT"
-SHL1RES= $(RCTARGET)
-.ENDIF # WNT
-
-# --- Targets -------------------------------------------------------------
-
-.INCLUDE : target.mk
-
-
-ALLTAR : $(MISC)/sm.component $(MISC)/smd.component
-
-$(MISC)/sm.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- sm.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt sm.component
-
-$(MISC)/smd.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \
- smd.component
- $(XSLTPROC) --nonet --stringparam uri \
- '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \
- $(SOLARENV)/bin/createcomponent.xslt smd.component
diff --git a/starmath/util/sm.component b/starmath/util/sm.component
index 8047662e29..407f0676a1 100644
--- a/starmath/util/sm.component
+++ b/starmath/util/sm.component
@@ -26,7 +26,7 @@
*
**********************************************************************-->
-<component loader="com.sun.star.loader.SharedLibrary"
+<component loader="com.sun.star.loader.SharedLibrary" prefix="sm"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.Math.FormulaDocument">
<service name="com.sun.star.formula.FormulaProperties"/>
diff --git a/starmath/util/smd.component b/starmath/util/smd.component
index 9f56686448..70adf5a127 100644
--- a/starmath/util/smd.component
+++ b/starmath/util/smd.component
@@ -26,7 +26,7 @@
*
**********************************************************************-->
-<component loader="com.sun.star.loader.SharedLibrary"
+<component loader="com.sun.star.loader.SharedLibrary" prefix="smd"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.math.FormatDetector">
<service name="com.sun.star.frame.ExtendedTypeDetection"/>
diff --git a/starmath/workben/smath-dump-watch.sh b/starmath/workben/smath-dump-watch.sh
index 6ca1b0c703..21ec5f14ad 100755
--- a/starmath/workben/smath-dump-watch.sh
+++ b/starmath/workben/smath-dump-watch.sh
@@ -1,7 +1,7 @@
#!/bin/bash
-# Watches for formula dumps by starmath and renders them
+# Watches for formula dumps by starmath and renders them
# If starmath is compiled with the macro DEBUG_ENABLE_DUMPASDOT defined.
# shift+enter, in the visual formula editor will make starmath dump a
# graphviz graph of the formula tree structure. This is very useful when
@@ -20,7 +20,7 @@
touch /tmp/smath-dump.gv;
while inotifywait -q -e close_write /tmp/smath-dump.gv;
do
- dot -Tpng < /tmp/smath-dump.gv > /tmp/smath-dump.png; > /dev/null
- kill `pidof -s feh`; > /dev/null
- feh /tmp/smath-dump.png & > /dev/null
+ dot -Tpng < /tmp/smath-dump.gv > /tmp/smath-dump.png; > /dev/null
+ kill `pidof -s feh`; > /dev/null
+ feh /tmp/smath-dump.png & > /dev/null
done
diff --git a/sw/CppunitTest_sw_swdoc_test.mk b/sw/CppunitTest_sw_swdoc_test.mk
new file mode 100644
index 0000000000..c6e186f339
--- /dev/null
+++ b/sw/CppunitTest_sw_swdoc_test.mk
@@ -0,0 +1,127 @@
+#*************************************************************************
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# Caolán McNamara, Red Hat, Inc. <caolanm@redhat.com>
+# Portions created by the Initial Developer are Copyright (C) 2011 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_swdoc_test))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_swdoc_test, \
+ sw/qa/core/swdoc-test \
+ sw/qa/core/Test-BigPtrArray \
+))
+
+$(eval $(call gb_CppunitTest_add_library_objects,sw_swdoc_test,sw))
+
+$(eval $(call gb_CppunitTest_add_linked_libs,sw_swdoc_test, \
+ avmedia \
+ basegfx \
+ comphelper \
+ cppu \
+ cppuhelper \
+ drawinglayer \
+ editeng \
+ i18nisolang1 \
+ i18nutil \
+ lng \
+ sal \
+ salhelper \
+ sb \
+ sfx \
+ sot \
+ svl \
+ svt \
+ svx \
+ svxcore \
+ swd \
+ tk \
+ tl \
+ ucbhelper \
+ utl \
+ vbahelper \
+ vcl \
+ xo \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_swdoc_test,\
+ icuuc \
+ libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_swdoc_test,\
+ -I$(realpath $(SRCDIR)/sw/inc/pch) \
+ -I$(realpath $(SRCDIR)/sw/source/ui/inc) \
+ -I$(realpath $(SRCDIR)/sw/inc) \
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc \
+))
+
+$(eval $(call gb_CppunitTest_add_api,sw_swdoc_test,\
+ offapi \
+ udkapi \
+))
+
+$(eval $(call gb_CppunitTest_uses_ure,sw_swdoc_test))
+
+$(eval $(call gb_CppunitTest_add_type_rdbs,sw_swdoc_test,\
+ types \
+))
+
+$(eval $(call gb_CppunitTest_add_service_rdbs,sw_swdoc_test,\
+ sw_swdoc_test \
+))
+
+$(call gb_CppunitTest_get_target,sw_swdoc_test) : \
+ $(call gb_AllLangResTarget_get_target,sw)
+
+$(eval $(call gb_CppunitTest_set_args,sw_swdoc_test,\
+ --headless \
+ --invisible \
+ --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+))
+
+$(eval $(call gb_RdbTarget_RdbTarget,sw_swdoc_test))
+
+$(eval $(call gb_RdbTarget_add_components,sw_swdoc_test,\
+ sfx2/util/sfx \
+ framework/util/fwk \
+ unoxml/source/service/unoxml \
+ fileaccess/source/fileacc \
+ comphelper/util/comphelp \
+))
+
+$(eval $(call gb_RdbTarget_add_old_components,sw_swdoc_test,\
+ i18npool \
+ ucb1 \
+ ucpfile1 \
+))
+
+# we need to explicitly depend on the sw resource files needed at unit-test
+# runtime
+$(call gb_CppunitTest_get_target,sw_swdoc_test) : $(WORKDIR)/AllLangRes/sw
+
+# vim: set noet sw=4:
diff --git a/sw/CppunitTest_sw_test_filters.mk b/sw/CppunitTest_sw_test_filters.mk
new file mode 100644
index 0000000000..cc49fa6772
--- /dev/null
+++ b/sw/CppunitTest_sw_test_filters.mk
@@ -0,0 +1,110 @@
+#*************************************************************************
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Initial Developer of the Original Code is
+# Caolán McNamara, Red Hat, Inc. <caolanm@redhat.com>
+# Portions created by the Initial Developer are Copyright (C) 2011 the
+# Initial Developer. All Rights Reserved.
+#
+# Major Contributor(s):
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_filters_test))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_filters_test, \
+ sw/qa/core/filters-test \
+))
+
+$(call gb_CxxObject_get_target,sw/qa/core/filters-test): $(WORKDIR)/AllLangRes/sw
+
+$(eval $(call gb_CppunitTest_add_linked_libs,sw_filters_test, \
+ sw \
+ sfx \
+ svl \
+ svt \
+ vcl \
+ tl \
+ ucbhelper \
+ utl \
+ i18nisolang1 \
+ comphelper \
+ cppu \
+ cppuhelper \
+ sal \
+ $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_filters_test,\
+ -I$(realpath $(SRCDIR)/sw/inc/pch) \
+ -I$(realpath $(SRCDIR)/sw/source/ui/inc) \
+ -I$(realpath $(SRCDIR)/sw/inc) \
+ $$(INCLUDE) \
+ -I$(OUTDIR)/inc \
+))
+
+$(eval $(call gb_CppunitTest_add_api,sw_filters_test,\
+ offapi \
+ udkapi \
+))
+
+$(eval $(call gb_CppunitTest_uses_ure,sw_filters_test))
+
+$(eval $(call gb_CppunitTest_add_type_rdbs,sw_filters_test,\
+ types \
+))
+
+$(eval $(call gb_CppunitTest_add_service_rdbs,sw_filters_test,\
+ sw_filters_test \
+))
+
+$(eval $(call gb_CppunitTest_set_args,sw_filters_test,\
+ --headless \
+ --invisible \
+ --protector unoexceptionprotector$(gb_Library_DLLEXT) unoexceptionprotector \
+))
+
+$(eval $(call gb_RdbTarget_RdbTarget,sw_filters_test))
+
+$(eval $(call gb_RdbTarget_add_components,sw_filters_test,\
+ sw/util/sw \
+ sw/util/msword \
+ forms/util/frm \
+ dbaccess/util/dba \
+ sfx2/util/sfx \
+ framework/util/fwk \
+ toolkit/util/tk \
+ unoxml/source/service/unoxml \
+ fileaccess/source/fileacc \
+ comphelper/util/comphelp \
+))
+
+$(eval $(call gb_RdbTarget_add_old_components,sw_filters_test,\
+ i18npool \
+ package2 \
+ ucb1 \
+ ucpfile1 \
+))
+
+# we need to explicitly depend on library msword because it is not implied
+# by a link relation
+$(call gb_CppunitTest_get_target,sw_filters_test) : $(call gb_Library_get_target,msword)
+
+# vim: set noet sw=4:
diff --git a/sw/JunitTest_sw_complex.mk b/sw/JunitTest_sw_complex.mk
index 84356e4c9f..f740014ef6 100755
--- a/sw/JunitTest_sw_complex.mk
+++ b/sw/JunitTest_sw_complex.mk
@@ -25,7 +25,7 @@
#
#*************************************************************************
-$(eval $(call gb_JunitTest_JunitTest,sw_complex))
+$(eval $(call gb_JunitTest_JunitTest,sw_complex,SRCDIR))
$(eval $(call gb_JunitTest_set_defs,sw_complex,\
$$(DEFS) \
@@ -65,7 +65,11 @@ $(eval $(call gb_JunitTest_add_classes,sw_complex,\
# fd#35657 test disabled - reenable if fixed
# complex.writer.TextPortionEnumerationTest \
-# currently fails (should run again in os146) (except on windows)
-# complex.writer.CheckBookmarks \
+# CheckBookmarks currently fails on windows because the hashes are different
+ifneq ($(OS),WNT)
+$(eval $(call gb_JunitTest_add_classes,sw_complex,\
+ complex.writer.CheckBookmarks \
+))
+endif
# vim: set noet sw=4 ts=4:
diff --git a/sw/JunitTest_sw_unoapi.mk b/sw/JunitTest_sw_unoapi.mk
index 8366c20226..d148319a58 100755
--- a/sw/JunitTest_sw_unoapi.mk
+++ b/sw/JunitTest_sw_unoapi.mk
@@ -25,7 +25,7 @@
#
#*************************************************************************
-$(eval $(call gb_JunitTest_JunitTest,sw_unoapi))
+$(eval $(call gb_JunitTest_JunitTest,sw_unoapi,SRCDIR))
$(eval $(call gb_JunitTest_set_defs,sw_unoapi,\
$$(DEFS) \
diff --git a/sw/Library_msword.mk b/sw/Library_msword.mk
index 35ceb2d1f7..5ca4115ba6 100644
--- a/sw/Library_msword.mk
+++ b/sw/Library_msword.mk
@@ -38,12 +38,12 @@ $(eval $(call gb_Library_set_include,msword,\
-I$(WORKDIR)/inc/sw/sdi \
-I$(WORKDIR)/Misc/sw/ \
$$(INCLUDE) \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc/sw \
))
-$(eval $(call gb_Library_set_defs,msword,\
- $$(DEFS) \
+$(eval $(call gb_Library_add_api,msword,\
+ udkapi \
+ offapi \
))
$(eval $(call gb_Library_add_linked_libs,msword,\
@@ -54,7 +54,6 @@ $(eval $(call gb_Library_add_linked_libs,msword,\
editeng \
i18nisolang1 \
i18nutil \
- icuuc \
msfilter \
sal \
sax \
@@ -65,7 +64,6 @@ $(eval $(call gb_Library_add_linked_libs,msword,\
svl \
svt \
svx \
- svx \
svxcore \
sw \
tk \
@@ -76,6 +74,11 @@ $(eval $(call gb_Library_add_linked_libs,msword,\
$(gb_STDLIBS) \
))
+$(eval $(call gb_Library_use_externals,msword,\
+ icuuc \
+ libxml2 \
+))
+
$(eval $(call gb_Library_add_exception_objects,msword,\
sw/source/filter/rtf/rtffld \
sw/source/filter/rtf/rtffly \
@@ -119,4 +122,11 @@ $(eval $(call gb_Library_add_exception_objects,msword,\
sw/source/filter/ww8/ww8toolbar \
))
+# TODO: This should be really fixed in writerfilter so the header is
+# delivered before compilation starts.
+$(call gb_CxxObject_get_target,sw/source/filter/ww8/wrtw8nds) \
+$(call gb_CxxObject_get_target,sw/source/filter/ww8/wrtww8gr) \
+$(call gb_CxxObject_get_target,sw/source/filter/ww8/ww8atr) \
+ : $(OUTDIR)/inc/writerfilter/doctok/sprmids.hxx
+
# vim: set noet sw=4 ts=4:
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 1ccedbd1ee..84471a3bca 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -42,13 +42,15 @@ $(eval $(call gb_Library_set_include,sw,\
-I$(WORKDIR)/SdiTarget/sw/sdi \
-I$(WORKDIR)/Misc/sw/ \
$$(INCLUDE) \
- $(if $(filter YES,$(SYSTEM_LIBXML)),$(LIBXML_CFLAGS)) \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc \
))
-$(eval $(call gb_Library_set_defs,sw,\
- $$(DEFS) \
+$(eval $(call gb_Library_add_api,sw,\
+ udkapi \
+ offapi \
+))
+
+$(eval $(call gb_Library_add_defs,sw,\
-DSW_DLLIMPLEMENTATION \
))
@@ -62,7 +64,6 @@ $(eval $(call gb_Library_add_linked_libs,sw,\
editeng \
i18nisolang1 \
i18nutil \
- icuuc \
lng \
sal \
salhelper \
@@ -73,6 +74,7 @@ $(eval $(call gb_Library_add_linked_libs,sw,\
svt \
svx \
svxcore \
+ swd \
tk \
tl \
ucbhelper \
@@ -80,10 +82,14 @@ $(eval $(call gb_Library_add_linked_libs,sw,\
vbahelper \
vcl \
xo \
- xml2 \
$(gb_STDLIBS) \
))
+$(eval $(call gb_Library_use_externals,sw,\
+ icuuc \
+ libxml2 \
+))
+
$(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/core/SwNumberTree/SwNodeNum \
sw/source/core/SwNumberTree/SwNumberTree \
@@ -282,6 +288,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/core/layout/calcmove \
sw/source/core/layout/colfrm \
sw/source/core/layout/dbg_lay \
+ sw/source/core/layout/dumpfilter \
sw/source/core/layout/findfrm \
sw/source/core/layout/flowfrm \
sw/source/core/layout/fly \
@@ -471,7 +478,6 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
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/html/SwAppletImpl \
sw/source/filter/html/css1atr \
diff --git a/sw/Library_swd.mk b/sw/Library_swd.mk
index 97edee8da0..52988841c6 100644
--- a/sw/Library_swd.mk
+++ b/sw/Library_swd.mk
@@ -38,11 +38,16 @@ $(eval $(call gb_Library_set_include,swd,\
-I$(realpath $(SRCDIR)/sw/source/core/inc) \
-I$(realpath $(SRCDIR)/sw/source/filter/inc) \
-I$(realpath $(SRCDIR)/sw/source/ui/inc) \
- -I$(OUTDIR)/inc/offuh \
))
-$(eval $(call gb_Library_set_defs,swd,\
- $$(DEFS) \
+$(eval $(call gb_Library_add_api,swd,\
+ udkapi \
+ offapi \
+))
+
+$(eval $(call gb_Library_add_defs,swd,\
+ -DSWD_DLLIMPLEMENTATION \
+ -DSWD_DLLIMPLEMENTATION \
))
$(eval $(call gb_Library_add_linked_libs,swd,\
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index aee68142ea..91a89034fb 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -36,11 +36,11 @@ $(eval $(call gb_Library_set_include,swui,\
-I$(WORKDIR)/SdiTarget/sw/sdi \
-I$(WORKDIR)/Misc/sw \
$$(INCLUDE) \
- -I$(OUTDIR)/inc/offuh \
))
-$(eval $(call gb_Library_set_defs,swui,\
- $$(DEFS) \
+$(eval $(call gb_Library_add_api,swui,\
+ udkapi \
+ offapi \
))
$(eval $(call gb_Library_add_linked_libs,swui,\
@@ -59,6 +59,7 @@ $(eval $(call gb_Library_add_linked_libs,swui,\
svx \
svxcore \
sw \
+ swd \
tk \
tl \
ucbhelper \
@@ -68,7 +69,6 @@ $(eval $(call gb_Library_add_linked_libs,swui,\
))
$(eval $(call gb_Library_add_exception_objects,swui,\
- sw/source/core/undo/SwRewriter \
sw/source/ui/chrdlg/break \
sw/source/ui/chrdlg/chardlg \
sw/source/ui/chrdlg/drpcps \
diff --git a/sw/Library_vbaswobj.mk b/sw/Library_vbaswobj.mk
index b233ed89c0..41ee17cd9a 100644
--- a/sw/Library_vbaswobj.mk
+++ b/sw/Library_vbaswobj.mk
@@ -37,10 +37,15 @@ $(eval $(call gb_Library_set_include,vbaswobj,\
-I$(realpath $(SRCDIR)/sw/inc) \
-I$(WORKDIR)/Misc/sw/ \
$$(INCLUDE) \
- -I$(OUTDIR)/inc/offuh \
-I$(OUTDIR)/inc/ \
))
+$(eval $(call gb_Library_add_api,vbaswobj,\
+ udkapi \
+ offapi \
+ oovbaapi \
+))
+
$(eval $(call gb_Library_add_linked_libs,vbaswobj,\
comphelper \
cppu \
@@ -136,12 +141,4 @@ $(eval $(call gb_Library_add_exception_objects,vbaswobj,\
sw/source/ui/vba/wordvbahelper \
))
-ifneq (,$(filter LINUX DRAGONFLY OPENBSD FREEBSD NETBSD, $(OS)))
-$(eval $(call gb_Library_set_ldflags,vbaswobj,\
- $$(LDFLAGS) \
- -Wl$(COMMA)-O1 \
- -Wl$(COMMA)-z$(COMMA)noexecstack \
-))
-endif
-
# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index c6257e22fc..527c8ea1c1 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -39,6 +39,11 @@ $(eval $(call gb_Module_add_targets,sw,\
Package_xml \
))
+$(eval $(call gb_Module_add_check_targets,sw,\
+ CppunitTest_sw_test_filters \
+ CppunitTest_sw_swdoc_test \
+))
+
$(eval $(call gb_Module_add_subsequentcheck_targets,sw,\
JunitTest_sw_complex \
JunitTest_sw_unoapi \
diff --git a/sw/inc/IDocumentState.hxx b/sw/inc/IDocumentState.hxx
index 913a5a413a..4a1d66fdcc 100644
--- a/sw/inc/IDocumentState.hxx
+++ b/sw/inc/IDocumentState.hxx
@@ -36,7 +36,7 @@
class IDocumentState
{
public:
- /** Must be called manually at changes of format.
+ /** Must be called manually at changes of format.
*/
virtual void SetModified() = 0;
diff --git a/sw/inc/IDocumentStylePoolAccess.hxx b/sw/inc/IDocumentStylePoolAccess.hxx
index 77ea7c9c24..ec469f0665 100644
--- a/sw/inc/IDocumentStylePoolAccess.hxx
+++ b/sw/inc/IDocumentStylePoolAccess.hxx
@@ -47,24 +47,24 @@
{
public:
- /** Return "Auto-Collection with ID.
+ /** Return "Auto-Collection with ID.
Create, if it does not yet exist.
- If string pointer is defined request only description
+ If string pointer is defined request only description
of attributes, do not create style sheet!
*/
virtual SwTxtFmtColl* GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage = true ) = 0;
- /** Return required automatic format base class.
+ /** Return required automatic format base class.
*/
virtual SwFmt* GetFmtFromPool( sal_uInt16 nId ) = 0;
- /** Return required automatic format.
+ /** Return required automatic format.
*/
virtual SwFrmFmt* GetFrmFmtFromPool( sal_uInt16 nId ) = 0;
virtual SwCharFmt* GetCharFmtFromPool( sal_uInt16 nId ) = 0;
- /** Return required automatic page style.
+ /** Return required automatic page style.
*/
virtual SwPageDesc* GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage = true ) = 0;
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index f3e20bcdad..120e66b71d 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -34,7 +34,6 @@
#include <editeng/outlobj.hxx>
#include <tools/string.hxx>
#include <tools/link.hxx>
-#include <tools/debug.hxx>
#include <swrect.hxx>
#include <unotools/configitem.hxx>
#include <unotools/options.hxx>
@@ -84,7 +83,7 @@ struct SwPostItPageItem
long lOffset;
SwRect mPageRect;
SwSidebarItem_list* mList;
- SwPostItPageItem(): bScrollbar(false),lOffset(0)
+ SwPostItPageItem(): bScrollbar(false), eSidebarPosition( sw::sidebarwindows::SIDEBAR_LEFT ), lOffset(0)
{
mList = new SwSidebarItem_list;
}
@@ -118,7 +117,7 @@ class SwNoteProps: public utl::ConfigItem
const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames = GetPropertyNames();
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aValues = GetProperties(rNames);
const ::com::sun::star::uno::Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed");
+ OSL_ENSURE(aValues.getLength() == rNames.getLength(), "GetProperties failed");
if (aValues.getLength())
pValues[0]>>=bIsShowAnchor;
}
diff --git a/sw/inc/SwNodeNum.hxx b/sw/inc/SwNodeNum.hxx
index 51964e303a..ddd0e6b5b8 100644
--- a/sw/inc/SwNodeNum.hxx
+++ b/sw/inc/SwNodeNum.hxx
@@ -85,7 +85,6 @@ protected:
// --> #i64010#
virtual bool HasCountedChildren() const;
virtual bool IsCountedForNumbering() const;
- // <--
// method called before this tree node has been added to the list tree
virtual void PreAdd();
diff --git a/sw/inc/SwNumberTree.hxx b/sw/inc/SwNumberTree.hxx
index f57103fc4a..c9a8979aea 100644
--- a/sw/inc/SwNumberTree.hxx
+++ b/sw/inc/SwNumberTree.hxx
@@ -93,13 +93,13 @@ struct compSwNumberTreeNodeLessThan
Uncounted Phantoms
0.1. dljflskjlasf
- 5. ödsöfkaös
+ 5. abcdagaha
5.1.
+ R (nStart = 5)
+ 0 (phantom, not counted)
| + 1 dljflskjlasf
- + 5 ödsöfkaös
+ + 5 abcdagaha
+ 1
The phantom gets numbered with 0. The first non-phantom node gets
diff --git a/sw/inc/SwRewriter.hxx b/sw/inc/SwRewriter.hxx
index 0d56e3923b..efd81113ef 100644
--- a/sw/inc/SwRewriter.hxx
+++ b/sw/inc/SwRewriter.hxx
@@ -39,7 +39,7 @@ extern SW_DLLPUBLIC String const UNDO_ARG3;
typedef std::pair<String, String> SwRewriteRule;
-class SwRewriter
+class SW_DLLPUBLIC SwRewriter
{
std::vector<SwRewriteRule> mRules;
diff --git a/sw/inc/SwStyleNameMapper.hxx b/sw/inc/SwStyleNameMapper.hxx
index 03db252163..894621c31e 100644
--- a/sw/inc/SwStyleNameMapper.hxx
+++ b/sw/inc/SwStyleNameMapper.hxx
@@ -39,7 +39,7 @@
#endif
#include <stringhash.hxx>
-/* This class holds all data about the names of styles used in the user
+/** This class holds all data about the names of styles used in the user
* interface (UI names...these are localised into different languages).
* These UI names are loaded from the resource files on demand.
*
@@ -67,7 +67,7 @@
* 5. Numbering Rule contains the NumRule name array.
*/
-/*
+/**
* There is a further complication that came to light later. If someone enters
* a user-defined style name which is the same as a programmatic name, this
* name clash must be handled.
diff --git a/sw/inc/accmap.hxx b/sw/inc/accmap.hxx
index 0bffbcb34e..315ba24461 100644
--- a/sw/inc/accmap.hxx
+++ b/sw/inc/accmap.hxx
@@ -34,7 +34,6 @@
#include <osl/mutex.hxx>
#include <svx/IAccessibleViewForwarder.hxx>
#include <svx/IAccessibleParent.hxx>
-#include <tools/debug.hxx>
#include <tools/fract.hxx>
#include <vector>
diff --git a/sw/inc/anchoreddrawobject.hxx b/sw/inc/anchoreddrawobject.hxx
index ae3a3b1592..85e3911c8c 100644
--- a/sw/inc/anchoreddrawobject.hxx
+++ b/sw/inc/anchoreddrawobject.hxx
@@ -193,6 +193,10 @@ class SW_DLLPUBLIC SwAnchoredDrawObject : public SwAnchoredObject
// new Loop control
void ValidateThis() { mbValidPos = true; }
+
+ /** The element name to show in the XML dump.
+ */
+ virtual const char* getElementName( ) { return "SwAnchoredDrawObject"; }
};
#endif
diff --git a/sw/inc/anchoredobject.hxx b/sw/inc/anchoredobject.hxx
index 286561b171..27fe59d322 100644
--- a/sw/inc/anchoredobject.hxx
+++ b/sw/inc/anchoredobject.hxx
@@ -31,6 +31,7 @@
#include <tools/rtti.hxx>
#include <swtypes.hxx>
#include <swrect.hxx>
+#include <libxml/xmlwriter.h>
class SdrObject;
class SwFrm;
@@ -180,7 +181,6 @@ class SW_DLLPUBLIC SwAnchoredObject
const RndStdIds _eAnchorType,
const xub_StrLen _nObjAnchorPos,
SwAnchoredObject* _pAnchoredObj );
- // <--
protected:
SwAnchoredObject();
@@ -551,6 +551,15 @@ class SW_DLLPUBLIC SwAnchoredObject
@return Point - determined relative position
*/
Point GetRelPosToLine() const;
+
+ /** Dump a bunch of useful data to an XML representation to ease
+ layout understanding, debugging and testing.
+ */
+ virtual void dumpAsXml( xmlTextWriterPtr pWriter );
+
+ /** The element name to show in the XML dump.
+ */
+ virtual const char* getElementName( ) { return "SwAnchoredObject"; }
};
// ============================================================================
diff --git a/sw/inc/authfld.hxx b/sw/inc/authfld.hxx
index ac1b50a6f3..1a1830f335 100644
--- a/sw/inc/authfld.hxx
+++ b/sw/inc/authfld.hxx
@@ -183,12 +183,12 @@ public:
// --- inlines -----------------------------------------------------------
inline const String& SwAuthEntry::GetAuthorField(ToxAuthorityField ePos)const
{
- DBG_ASSERT(AUTH_FIELD_END > ePos, "wrong index");
+ OSL_ENSURE(AUTH_FIELD_END > ePos, "wrong index");
return aAuthFields[ePos];
}
inline void SwAuthEntry::SetAuthorField(ToxAuthorityField ePos, const String& rField)
{
- DBG_ASSERT(AUTH_FIELD_END > ePos, "wrong index");
+ OSL_ENSURE(AUTH_FIELD_END > ePos, "wrong index");
if(AUTH_FIELD_END > ePos)
aAuthFields[ePos] = rField;
}
diff --git a/sw/inc/bparr.hxx b/sw/inc/bparr.hxx
index a9550aeb44..9cd9f1e515 100644
--- a/sw/inc/bparr.hxx
+++ b/sw/inc/bparr.hxx
@@ -30,7 +30,7 @@
#define _BPARR_HXX
#include <tools/solar.h>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
#include <swdllapi.h>
struct BlockInfo;
@@ -113,7 +113,7 @@ public:
inline sal_uLong BigPtrEntry::GetPos() const
{
- DBG_ASSERT( this == pBlock->pData[ nOffset ], "element not in the block" );
+ OSL_ENSURE( this == pBlock->pData[ nOffset ], "element not in the block" );
return pBlock->nStart + nOffset;
}
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index a97a48df46..501c721499 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -215,6 +215,7 @@ included in c-context files, so c++ style stuff will cause problems.
#define FN_SELECT_INDEX (FN_EDIT + 85) /**/
#define FN_UP (FN_EDIT + 86) /**/
+#define FN_EDIT_HEADER_FOOTER (FN_EDIT + 95) /* Toggle headers/footers edition*/
#define FN_SELECT_PARA (FN_EDIT + 97) /* select paragraph*/
#define FN_SELECT_CONTENT (FN_EDIT + 99) /* Navigator - Content Type */
diff --git a/sw/inc/comcore.hrc b/sw/inc/comcore.hrc
index d92a2c33c9..e102a83df2 100644
--- a/sw/inc/comcore.hrc
+++ b/sw/inc/comcore.hrc
@@ -84,6 +84,9 @@
#define STR_TABLE_NAME (RC_COMCORE_BEGIN + 46)
#define STR_PARAGRAPH_UNDO (RC_COMCORE_BEGIN + 47)
+#define STR_HEADER (RC_COMCORE_BEGIN + 48)
+#define STR_FOOTER (RC_COMCORE_BEGIN + 49)
+
// defines for the Autoformat Redline Comments
#define STR_AUTOFMTREDL_DEL_EMPTY_PARA 0
#define STR_AUTOFMTREDL_USE_REPLACE 1
diff --git a/sw/inc/crsrsh.hxx b/sw/inc/crsrsh.hxx
index b24d29742d..3dc677e81e 100644
--- a/sw/inc/crsrsh.hxx
+++ b/sw/inc/crsrsh.hxx
@@ -190,6 +190,7 @@ private:
SwShellCrsr* pCurCrsr; // current cursor
SwShellCrsr* pCrsrStk; // stack for the cursor
SwVisCrsr *pVisCrsr; // the visible cursor
+ SwShellCrsr* pCrsrBack; // Backup cursor for header/footer edit mode
IBlockCursor *pBlockCrsr; // interface of cursor for block (=rectangular) selection
@@ -495,6 +496,8 @@ public:
void SetReadOnlyAvailable( sal_Bool bFlag );
sal_Bool IsOverReadOnlyPos( const Point& rPt ) const;
+ sal_Bool IsOverHeaderFooterPos( const Point& rPt ) const;
+
// Methods for aFlyMacroLnk.
void SetFlyMacroLnk( const Link& rLnk ) { aFlyMacroLnk = rLnk; }
const Link& GetFlyMacroLnk() const { return aFlyMacroLnk; }
@@ -848,6 +851,8 @@ public:
String GetCrsrDescr() const;
SwRect GetRectOfCurrentChar();
+
+ virtual void ToggleHeaderFooterEdit( );
};
// Cursor Inlines:
diff --git a/sw/inc/crstate.hxx b/sw/inc/crstate.hxx
index ff1dddf9f2..bf0ed23664 100644
--- a/sw/inc/crstate.hxx
+++ b/sw/inc/crstate.hxx
@@ -156,7 +156,7 @@ struct SwCrsrMoveState
// position if screen position is inside second
// have of bound rect
- sal_Bool bCntntCheck :1; // --> FME 2005-05-13 #i43742# Cursor position over content? <--
+ sal_Bool bCntntCheck :1; // #i43742# Cursor position over content?
// #i27615#
/**
diff --git a/sw/inc/dbgoutsw.hxx b/sw/inc/dbgoutsw.hxx
index dad9e50abb..b111808109 100644
--- a/sw/inc/dbgoutsw.hxx
+++ b/sw/inc/dbgoutsw.hxx
@@ -28,7 +28,7 @@
#ifndef __DBGOUTSW_HXX
#define __DBGOUTSW_HXX
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
#include <boost/unordered_map.hpp>
#include <tox.hxx>
@@ -124,7 +124,7 @@ const char * dbg_out(const boost::unordered_map<tKey, tMember, fHashFunction> &
}
SW_DLLPUBLIC const char * dbg_out(const SwFormToken & rToken);
SW_DLLPUBLIC const char * dbg_out(const SwFormTokens & rTokens);
-#endif // DEBUG
+#endif // OSL_DEBUG_LEVEL > 1
#endif // __DBGOUTSW_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 72df51d048..cdb53b0bf4 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -110,8 +110,6 @@ class VirtualDevice;
class SfxPrinter;
class SvNumberFormatter;
class SvStringsSort;
-class SvUShorts;
-class SvUShortsSort;
class SvxMacro;
class SvxMacroTableDtor;
class SwAutoCompleteWord;
@@ -669,9 +667,8 @@ private:
// Create sub-documents according to the given collection.
// If no collection is given, take chapter style of the 1st level.
- sal_Bool SplitDoc( sal_uInt16 eDocType, const String& rPath,
- const SwTxtFmtColl* pSplitColl );
- sal_Bool SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutlineLevel = 0 );
+ bool SplitDoc( sal_uInt16 eDocType, const String& rPath, bool bOutline,
+ const SwTxtFmtColl* pSplitColl, int nOutlineLevel = 0 );
// Update charts of given table.
void _UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const;
@@ -1154,7 +1151,7 @@ public:
// control, if the side effect "send data changed events" is triggered or not.
void ResetAttrs( const SwPaM &rRg,
sal_Bool bTxtAttr = sal_True,
- const SvUShortsSort* = 0,
+ const std::set<sal_uInt16> &rAttrs = std::set<sal_uInt16>(),
const bool bSendDataChangedEvents = true );
void RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark = sal_False );
@@ -1570,7 +1567,7 @@ public:
const SwPosition& rPos, sal_uInt16 nRows,
sal_uInt16 nCols, short eAdjust,
const SwTableAutoFmt* pTAFmt = 0,
- const SvUShorts* pColArr = 0,
+ const std::vector<sal_uInt16> *pColArr = 0,
sal_Bool bCalledFromShell = sal_False,
sal_Bool bNewModel = sal_True );
@@ -1810,10 +1807,10 @@ public:
// If no collection is given, use chapter styles for 1st level.
sal_Bool GenerateGlobalDoc( const String& rPath,
const SwTxtFmtColl* pSplitColl = 0 );
- sal_Bool GenerateGlobalDoc( const String& rPath, int nOutlineLevel = 0 );
+ sal_Bool GenerateGlobalDoc( const String& rPath, int nOutlineLevel = 0 );
sal_Bool GenerateHTMLDoc( const String& rPath,
const SwTxtFmtColl* pSplitColl = 0 );
- sal_Bool GenerateHTMLDoc( const String& rPath, int nOutlineLevel = 0 );
+ sal_Bool GenerateHTMLDoc( const String& rPath, int nOutlineLevel = 0 );
// Compare two documents.
long CompareDoc( const SwDoc& rDoc );
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 1818bec9d1..47e3d1ea01 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -352,16 +352,16 @@ public:
class SwHiddenTxtField : public SwField
{
- String aTRUETxt; // Text wenn Bedingung sal_True
- String aFALSETxt; // Wenn Bedingung falsch
- String aContent; // Ausgewerteter DB-Text
+ String aTRUETxt; // Text if condition sal_True.
+ String aFALSETxt; // If condition false.
+ String aContent; // Evaluated DB-text.
- String aCond; // Bedingung
+ String aCond; // Condition.
sal_uInt16 nSubType;
- sal_Bool bCanToggle : 1; // kann das Feld einzeln getoggelt werden?
- sal_Bool bIsHidden : 1; // ist es nicht sichtbar?
- sal_Bool bValid : 1; // DB-Feld evaluiert?
+ sal_Bool bCanToggle : 1; // Can field be toggled alone?
+ sal_Bool bIsHidden : 1; // Is it not visible?
+ sal_Bool bValid : 1; // Is DB-field evaluated?
virtual String Expand() const;
virtual SwField* Copy() const;
@@ -398,7 +398,7 @@ public:
virtual sal_uInt16 GetSubType() const;
-
+
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const;
virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich );
};
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 6b845b1c3c..cb62642e85 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -45,6 +45,7 @@
#include <IMark.hxx>
#include <vector>
+#include <set>
#include <swundo.hxx>
#include <svtools/embedhlp.hxx>
@@ -53,7 +54,6 @@ class SwDoc;
class DateTime;
class CommandExtTextInputData;
-class SvUShortsSort;
class SvNumberFormatter;
class SfxPoolItem;
class SfxItemSet;
@@ -258,7 +258,7 @@ public:
// Query default attribute of document.
const SfxPoolItem& GetDefault( sal_uInt16 nFmtHint ) const;
- void ResetAttr( const SvUShortsSort* pAttrs = 0 );
+ void ResetAttr( const std::set<sal_uInt16> &attrs = std::set<sal_uInt16>() );
void GCAttr();
// Returns the scripttpye of the selection.
diff --git a/sw/inc/extinput.hxx b/sw/inc/extinput.hxx
index e669b32723..d7cd8aa257 100644
--- a/sw/inc/extinput.hxx
+++ b/sw/inc/extinput.hxx
@@ -28,18 +28,15 @@
#ifndef _EXTINPUT_HXX
#define _EXTINPUT_HXX
-#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
-#endif
#include <pam.hxx>
#include <i18npool/lang.h>
+#include <vector>
class CommandExtTextInputData;
class SwExtTextInput : public SwPaM
{
- SvUShorts aAttrs;
+ std::vector<sal_uInt16> aAttrs;
String sOverwriteText;
sal_Bool bInsText : 1;
sal_Bool bIsOverwriteCursor : 1;
@@ -49,7 +46,7 @@ public:
virtual ~SwExtTextInput();
void SetInputData( const CommandExtTextInputData& rData );
- const SvUShorts& GetAttrs() const { return aAttrs; }
+ const std::vector<sal_uInt16>& GetAttrs() const { return aAttrs; }
void SetInsText( sal_Bool bFlag ) { bInsText = bFlag; }
sal_Bool IsOverwriteCursor() const { return bIsOverwriteCursor; }
void SetOverwriteCursor( sal_Bool bFlag );
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 7cd094f5f9..fa2008c2f3 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -549,7 +549,6 @@ public:
// aligns all formulas with anchor 'as char' to baseline
void AlignAllFormulasToBaseline();
- // <--
@@ -773,6 +772,7 @@ public:
bool IsVerticalModeAtNdAndPos( const SwTxtNode& _rTxtNode,
const Point& _rDocPos ) const;
+ virtual void ToggleHeaderFooterEdit( );
};
#endif
diff --git a/sw/inc/fldbas.hxx b/sw/inc/fldbas.hxx
index 23ce78332b..8267a95395 100644
--- a/sw/inc/fldbas.hxx
+++ b/sw/inc/fldbas.hxx
@@ -29,7 +29,6 @@
#define SW_FLDBAS_HXX
#include <i18npool/lang.h>
-#include <tools/debug.hxx>
#include <tools/string.hxx>
#include "swdllapi.h"
#include <calbck.hxx>
@@ -237,7 +236,6 @@ String FormatNumber(sal_uInt16 nNum, sal_uInt32 nFormat);
// Instances of SwFields and those derived from it occur 0 to n times.
// For each class there is one instance of the associated type class.
// Base class of all field types is SwFieldType.
-DBG_NAMEEX(SwFieldType)
class SW_DLLPUBLIC SwFieldType : public SwModify
{
@@ -254,9 +252,6 @@ protected:
public:
-#if OSL_DEBUG_LEVEL > 1
- virtual ~SwFieldType();
-#endif
static const String& GetTypeStr( sal_uInt16 nTypeId );
// Only in derived classes.
diff --git a/sw/inc/fldui.hrc b/sw/inc/fldui.hrc
index 7ebaf11c14..e0fcdccf23 100644
--- a/sw/inc/fldui.hrc
+++ b/sw/inc/fldui.hrc
@@ -45,7 +45,7 @@
#define DLG_FLD_DROPDOWN (RC_FLDDLG_BEGIN + 12)
/*--------------------------------------------------------------------
- Beschreibung: TypeId
+ TypeId
--------------------------------------------------------------------*/
#define STR_TYPE_BEGIN RC_FLDDLG_BEGIN
@@ -95,7 +95,7 @@
#define STR_TYPE_END (STR_TYPE_BEGIN + 44)
/*--------------------------------------------------------------------
- Beschreibung: SubTypes
+ SubTypes
--------------------------------------------------------------------*/
#define FLD_DATE_BEGIN STR_TYPE_END
@@ -151,7 +151,7 @@
// Text
#define FMT_TEXT FLD_PAGEREF_END
-// Nummern
+// Numbers
#define FMT_NUM_BEGIN (FMT_TEXT + 1)
#define FMT_NUM_ABC FMT_NUM_BEGIN
#define FMT_NUM_SABC (FMT_NUM_BEGIN + 1)
@@ -170,32 +170,32 @@
#define FMT_AUTHOR_SCUT (FMT_AUTHOR_BEGIN + 1)
#define FMT_AUTHOR_END (FMT_AUTHOR_BEGIN + 2)
-// Variable setzen
+// Set variable
#define FMT_SETVAR_BEGIN FMT_AUTHOR_END
#define FMT_SETVAR_SYS (FMT_SETVAR_BEGIN + 0)
#define FMT_SETVAR_TEXT (FMT_SETVAR_BEGIN + 1)
#define FMT_SETVAR_END (FMT_SETVAR_BEGIN + 2)
-// Variable einfuegen
+// Get variable
#define FMT_GETVAR_BEGIN FMT_SETVAR_END
#define FMT_GETVAR_TEXT (FMT_GETVAR_BEGIN + 0)
#define FMT_GETVAR_NAME (FMT_GETVAR_BEGIN + 1)
#define FMT_GETVAR_END (FMT_GETVAR_BEGIN + 2)
-// Userfeld einfuegen
+// Userfield
#define FMT_USERVAR_BEGIN FMT_GETVAR_END
#define FMT_USERVAR_TEXT (FMT_USERVAR_BEGIN + 0)
#define FMT_USERVAR_CMD (FMT_USERVAR_BEGIN + 1)
#define FMT_USERVAR_END (FMT_USERVAR_BEGIN + 2)
-// Datenbankfeld einfuegen
+// Database field
#define FMT_DBFLD_BEGIN FMT_USERVAR_END
#define FMT_DBFLD_DB (FMT_DBFLD_BEGIN + 0)
#define FMT_DBFLD_SYS (FMT_DBFLD_BEGIN + 1)
#define FMT_DBFLD_END (FMT_DBFLD_BEGIN + 2)
//FileNameFormat
-// Achtung die letzten 4 Formate gibt es in RTF nicht (Verlust!)
+// Attention, the last 4 formats do not exist in RTF (loss!)
#define FMT_FF_BEGIN FMT_DBFLD_END
#define FMT_FF_NAME FMT_FF_BEGIN
#define FMT_FF_PATHNAME (FMT_FF_BEGIN + 1)
@@ -212,7 +212,7 @@
#define FMT_REG_DATE (FMT_REG_BEGIN + 2)
#define FMT_REG_END (FMT_REG_BEGIN + 3)
-// Kapitel
+// Chapter
#define FMT_CHAPTER_BEGIN FMT_REG_END
#define FMT_CHAPTER_NO FMT_CHAPTER_BEGIN
#define FMT_CHAPTER_NAME (FMT_CHAPTER_BEGIN + 1)
@@ -220,7 +220,7 @@
#define FMT_CHAPTER_NO_NOSEPARATOR (FMT_CHAPTER_BEGIN + 3)
#define FMT_CHAPTER_END (FMT_CHAPTER_BEGIN + 4)
-// DDE-Formate
+// DDE-Formats
#define FMT_DDE_BEGIN FMT_CHAPTER_END
#define FMT_DDE_NORMAL FMT_DDE_BEGIN
#define FMT_DDE_HOT (FMT_DDE_BEGIN + 1)
@@ -240,7 +240,7 @@
#define FMT_REF_NUMBER_FULL_CONTEXT (FMT_REF_BEGIN + 10)
#define FMT_REF_END (FMT_REF_BEGIN + 11)
-// Platzhalter
+// Placeholder
#define FMT_MARK_BEGIN FMT_REF_END
#define FMT_MARK_TEXT FMT_MARK_BEGIN
#define FMT_MARK_TABLE (FMT_MARK_BEGIN + 1)
@@ -250,7 +250,7 @@
#define FMT_MARK_END (FMT_MARK_BEGIN + 5)
/*--------------------------------------------------------------------
- Beschreibung: globale String-Ressourcen
+ Global String-Resources
--------------------------------------------------------------------*/
#define STR_FLDUI FMT_MARK_END
@@ -259,7 +259,7 @@
#define STR_EXTRA (STR_FLDUI + 2)
/*--------------------------------------------------------------------
- Beschreibung: Buttons fuer Field-Edit-Dlg
+ Buttons for Field-Edit-Dlg
--------------------------------------------------------------------*/
#define BTN_FLDEDT_PREV STR_EXTRA
@@ -267,7 +267,7 @@
#define PB_FLDEDT_ADDRESS (STR_EXTRA + 2)
/*--------------------------------------------------------------------
- Beschreibung: Zusaetzliche Strings
+ Additional Strings
--------------------------------------------------------------------*/
#define STR_COND STR_EXTRA
diff --git a/sw/inc/fmtfsize.hxx b/sw/inc/fmtfsize.hxx
index d33c00ff2c..2e8f4b1724 100644
--- a/sw/inc/fmtfsize.hxx
+++ b/sw/inc/fmtfsize.hxx
@@ -52,8 +52,8 @@ class SW_DLLPUBLIC SwFmtFrmSize: public SfxPoolItem
Size aSize;
SwFrmSize eFrmHeightType;
SwFrmSize eFrmWidthType;
- sal_uInt8 nWidthPercent; //Fuer Tabellen kann die Breite in Prozent
- sal_uInt8 nHeightPercent; //angegeben sein.
+ sal_uInt8 nWidthPercent;
+ sal_uInt8 nHeightPercent;
// For tables: width can be given in percent.
diff --git a/sw/inc/fmtui.hrc b/sw/inc/fmtui.hrc
index 4b2e0c513b..04d914534b 100644
--- a/sw/inc/fmtui.hrc
+++ b/sw/inc/fmtui.hrc
@@ -60,7 +60,7 @@
#define STR_OVERWRITE (RC_FMTUI_BEGIN + 32)
#define ST_CUSTOMIZE 1
-// die Abstaende zur Basis 2 nicht aendern !!!!
+// Do not change relations to base 2!!!
#define DLG_TEMPLATE_BASE (RC_FMTUI_BEGIN + 40)
#define DLG_TEMPLATE_1 (RC_FMTUI_BEGIN + 41)
#define DLG_TEMPLATE_2 (RC_FMTUI_BEGIN + 42)
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index 08ec419863..b1ad412019 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -292,7 +292,7 @@ public:
inline const SwTblBoxFormula &GetTblBoxFormula( sal_Bool = sal_True ) const;
inline const SwTblBoxValue &GetTblBoxValue( sal_Bool = sal_True ) const;
- /** SwFmt::IsBackgroundTransparent
+ /** SwFmt::IsBackgroundTransparent
Virtual method to determine, if background of format is transparent.
Default implementation returns false. Thus, subclasses have to overload
@@ -304,7 +304,7 @@ public:
*/
virtual sal_Bool IsBackgroundTransparent() const;
- /** SwFmt::IsShadowTransparent
+ /** SwFmt::IsShadowTransparent
Virtual method to determine, if shadow of format is transparent.
Default implementation returns false. Thus, subclasses have to overload
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 5d2761d42e..5cd6ae7a2a 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -204,7 +204,7 @@ public:
*/
virtual sal_Bool IsBackgroundTransparent() const;
- /** SwFlyFrmFmt::IsBackgroundBrushInherited
+ /** SwFlyFrmFmt::IsBackgroundBrushInherited
Method to determine, if the brush for drawing the
background is "inherited" from its parent/grandparent.
diff --git a/sw/inc/ftnidx.hxx b/sw/inc/ftnidx.hxx
index a3e755a0d5..87a7e40261 100644
--- a/sw/inc/ftnidx.hxx
+++ b/sw/inc/ftnidx.hxx
@@ -28,9 +28,8 @@
#ifndef _FTNIDX_HXX
#define _FTNIDX_HXX
-
-#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
+#include <vector>
class SwTxtFtn;
class SwNodeIndex;
@@ -60,12 +59,10 @@ public:
class SwUpdFtnEndNtAtEnd
{
SvPtrarr aFtnSects, aEndSects;
- SvUShorts aFtnNums, aEndNums;
+ std::vector<sal_uInt16> aFtnNums, aEndNums;
public:
- SwUpdFtnEndNtAtEnd() : aFtnSects( 0, 4 ), aEndSects( 0, 4 ),
- aFtnNums( 0, 4 ), aEndNums( 0, 4 )
- {}
+ SwUpdFtnEndNtAtEnd() : aFtnSects( 0, 4 ), aEndSects( 0, 4 ) {}
static const SwSectionNode* FindSectNdWithEndAttr(
const SwTxtFtn& rTxtFtn );
diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc
index a30ff4f1c7..1956e3906a 100644
--- a/sw/inc/globals.hrc
+++ b/sw/inc/globals.hrc
@@ -67,7 +67,7 @@
#define STR_EVENT_FRM_RESIZE ( RC_GLOBALS_BEGIN + 28 )
#define STR_EVENT_FRM_MOVE ( RC_GLOBALS_BEGIN + 29 )
-// Strings fuer Rahmenausrichtungen im Popup
+// Strings for frame alignment in Popup
#define STR_TOP_BASE (RC_GLOBALS_BEGIN + 30)
#define STR_BOTTOM_BASE (RC_GLOBALS_BEGIN + 31)
#define STR_CENTER_BASE (RC_GLOBALS_BEGIN + 32)
@@ -92,7 +92,7 @@
#define RES_TABD (RC_GLOBALS_BEGIN + 3)
#define RES_TABC (RC_GLOBALS_BEGIN + 4)
-// DIALOGE -----------------------------------------------------------
+// DIALOGS -----------------------------------------------------------
#define DLG_LISTBOX (RC_GLOBALS_BEGIN + 1)
#define DLG_THESAURUS (RC_GLOBALS_BEGIN + 2)
@@ -171,11 +171,11 @@
#define TP_FOOTER_PAGE (RC_GLOBALS_BEGIN + 17)
#define TP_FOOTNOTE_PAGE (RC_GLOBALS_BEGIN + 18)
-#define TP_OPTGENERAL_PAGE (RC_GLOBALS_BEGIN + 19) //Sfx-Seiten
+#define TP_OPTGENERAL_PAGE (RC_GLOBALS_BEGIN + 19) // Sfx-pages
#define TP_OPTSAVE_PAGE (RC_GLOBALS_BEGIN + 20)
#define TP_OPTPATH_PAGE (RC_GLOBALS_BEGIN + 21)
#define TP_OPTSPELL_PAGE (RC_GLOBALS_BEGIN + 22)
- //Sw-Seiten
+// Sw-pages
#define SW_EDIT_OPTIONS_TDLG (RC_GLOBALS_BEGIN + 23)
#define SW_BROWSER_OPTIONS_TDLG (RC_GLOBALS_BEGIN + 24)
#define TP_OPTTEST_PAGE (RC_GLOBALS_BEGIN + 25)
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 15ed1bc5fc..621e2d916a 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -497,7 +497,6 @@
#define HID_REFRESH_VIEW "SW_HID_REFRESH_VIEW"
#define HID_RIBBON "SW_HID_RIBBON"
#define HID_RULER "SW_HID_RULER"
-#define HID_STATUSBAR "SW_HID_STATUSBAR"
#define HID_TOOLBOX "SW_HID_TOOLBOX"
#define HID_VIEW_BOUNDS "SW_HID_VIEW_BOUNDS"
#define HID_VIEW_FIELDS "SW_HID_VIEW_FIELDS"
diff --git a/sw/inc/index.hrc b/sw/inc/index.hrc
index 235277402a..a057c6c31c 100644
--- a/sw/inc/index.hrc
+++ b/sw/inc/index.hrc
@@ -25,7 +25,7 @@
*
************************************************************************/
-/* fuer den DesignEditor
+/* For DesignEditor
#define RC_INDEX_BEGIN 256
*/
diff --git a/sw/inc/iodetect.hxx b/sw/inc/iodetect.hxx
index 1d6827fa98..7ac99aea44 100644
--- a/sw/inc/iodetect.hxx
+++ b/sw/inc/iodetect.hxx
@@ -34,7 +34,7 @@
#include <sfx2/fcontnr.hxx>
#include <osl/endian.h>
#include <tools/string.hxx>
-#include <swdllapi.h>
+#include <swddllapi.h>
#define FILTER_RTF "RTF" // RTF filter
#define sRtfWH "WH_RTF"
@@ -86,7 +86,7 @@ enum ReaderWriterEnum {
MAXFILTER
};
-extern SwIoDetect aFilterDetect[];
+extern SWD_DLLPUBLIC SwIoDetect aFilterDetect[];
// The following class is a wrapper for basic i/o functions of Writer 3.0.
// Everything is static. All filter names mentioned are Writer-internal
@@ -97,13 +97,15 @@ class SwIoSystem
{
public:
// find for an internal format name the corresponding filter entry
- SW_DLLPUBLIC static const SfxFilter* GetFilterOfFormat( const String& rFormat,
+ SWD_DLLPUBLIC static const SfxFilter*
+ GetFilterOfFormat( const String& rFormat,
const SfxFilterContainer* pCnt = 0 );
// Detect for the given file which filter should be used. The filter name
// is returned. If no filter could be found, the name of the ASCII filter
// is returned!
- static const SfxFilter* GetFileFilter( const String& rFileName,
+ SWD_DLLPUBLIC static const SfxFilter*
+ GetFileFilter( const String& rFileName,
const String& rPrefFltName,
SfxMedium* pMedium = 0 );
@@ -115,12 +117,14 @@ public:
static sal_Bool IsValidStgFilter( SotStorage& , const SfxFilter& );
static sal_Bool IsValidStgFilter( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rStg, const SfxFilter& rFilter);
- static bool IsDetectableText( const sal_Char* pBuf, sal_uLong &rLen,
+ SWD_DLLPUBLIC static bool
+ IsDetectableText( const sal_Char* pBuf, sal_uLong &rLen,
CharSet *pCharSet=0, bool *pSwap=0, LineEnd *pLineEnd=0, bool bEncodedFilter = false );
static const SfxFilter* GetTextFilter( const sal_Char* pBuf, sal_uLong nLen );
- static const String GetSubStorageName( const SfxFilter& rFltr );
+ SWD_DLLPUBLIC static const String
+ GetSubStorageName( const SfxFilter& rFltr );
};
#endif
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index dcf69f4481..1ac591510d 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -197,7 +197,7 @@ public:
sal_Bool GetFileFilterNms( String* pFileNm, String* pFilterNm ) const;
void ReleaseLink();
- // Scale an image-map: the image-map becomes zoomed in / out by
+ // Scale an image-map: the image-map becomes zoomed in / out by
// factor between graphic-size and border-size.
void ScaleImageMap();
diff --git a/sw/inc/ndhints.hxx b/sw/inc/ndhints.hxx
index 319102ad92..9a33978f40 100644
--- a/sw/inc/ndhints.hxx
+++ b/sw/inc/ndhints.hxx
@@ -62,11 +62,11 @@ SW_DLLPRIVATE SwTxtAttr*
MakeRedlineTxtAttr( SwDoc & rDoc, SfxPoolItem& rAttr );
-// Class SwpHints is derived indirectly via SwpHts, because only the
+// Class SwpHints is derived indirectly via SwpHts, because only the
// class SwTxtNode should be allowed to insert and remove attributes.
// Other classes like the Frames are given only reading access via
// the index-operator.
-// Size when created is 1 because an array is created only if
+// Size when created is 1 because an array is created only if
// also a hint is inserted.
// Class SwpHtStart/End
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index 2ba60155f4..f5ef2483ae 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -168,4 +168,4 @@ inline const SwOLENode *SwNode::GetOLENode() const
#endif // _NDOLE_HXX
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index f5c2610d1d..0b8f9f7a0e 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -242,7 +242,7 @@ public:
virtual sal_Bool SetAttr( const SfxPoolItem& );
virtual sal_Bool SetAttr( const SfxItemSet& rSet );
virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
- virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr );
+ virtual sal_Bool ResetAttr( const std::vector<sal_uInt16>& rWhichArr );
virtual sal_uInt16 ResetAllAttr();
/// insert text content
diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 0492feec14..53141d4ee6 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -276,7 +276,7 @@ public:
sal_Bool IsInVisibleArea( ViewShell* pSh = 0 ) const;
// Is node in an protected area?
sal_Bool IsInProtectSect() const;
- // Is node in something that is protected (range, frame,
+ // Is node in something that is protected (range, frame,
// table cells ... including anchor in case of frames or footnotes)?
sal_Bool IsProtect() const;
@@ -434,7 +434,7 @@ public:
// frames are removed from the respective layout.
void DelFrms();
- // Returns count of elements of node content. Default is 1.
+ // Returns count of elements of node content. Default is 1.
// There are differences between text node and formula node.
virtual xub_StrLen Len() const;
@@ -452,7 +452,7 @@ public:
virtual sal_Bool SetAttr( const SfxPoolItem& );
virtual sal_Bool SetAttr( const SfxItemSet& rSet );
virtual sal_Bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
- virtual sal_Bool ResetAttr( const SvUShorts& rWhichArr );
+ virtual sal_Bool ResetAttr( const std::vector<sal_uInt16>& rWhichArr );
virtual sal_uInt16 ResetAllAttr();
// Obtains attribute that is not delivered via conditional style!
diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx
index cfbbf06f46..7bda10100e 100644
--- a/sw/inc/paratr.hxx
+++ b/sw/inc/paratr.hxx
@@ -35,6 +35,7 @@
#include <swatrset.hxx>
#include <format.hxx>
#include <swtypes.hxx>
+#include <editeng/adjitem.hxx>
class SwCharFmt;
class IntlWrapper;
@@ -43,7 +44,7 @@ class IntlWrapper;
// If SwFmtDrop is a Client, it is the CharFmt that describes the font for the
// DropCaps. If it is not a Client, formating uses the CharFmt of the paragraph.
-// If the CharFmt is modified, this change is propagated to the paragraphs
+// If the CharFmt is modified, this change is propagated to the paragraphs
// via the Modify of SwFmtDrop.
class SW_DLLPUBLIC SwFmtDrop: public SfxPoolItem, public SwClient
{
diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx
index 63fef819d1..d577822dc8 100644
--- a/sw/inc/pch/precompiled_sw.hxx
+++ b/sw/inc/pch/precompiled_sw.hxx
@@ -844,7 +844,6 @@
#include "tools/color.hxx"
#include "tools/date.hxx"
#include "tools/datetime.hxx"
-#include "tools/debug.hxx"
#include "tools/errcode.hxx"
#include "tools/errinf.hxx"
#include "tools/fract.hxx"
@@ -854,7 +853,6 @@
#include "tools/mempool.hxx"
#include "tools/multisel.hxx"
#include "tools/poly.hxx"
-#include "tools/pstm.hxx"
#include "tools/rc.hxx"
#include "tools/ref.hxx"
#include "tools/resary.hxx"
diff --git a/sw/inc/printdata.hxx b/sw/inc/printdata.hxx
index f7ecb55fa9..14dc680ec7 100644
--- a/sw/inc/printdata.hxx
+++ b/sw/inc/printdata.hxx
@@ -73,7 +73,7 @@ public:
bPrintSingleJobs, bPaperFromSetup,
// Print empty pages
bPrintEmptyPages,
-
+
// #i56195# no field update while printing mail merge documents
bUpdateFieldsInPrinting,
bModified;
diff --git a/sw/inc/rcid.hrc b/sw/inc/rcid.hrc
index f3b15289b7..4a4abe9e97 100644
--- a/sw/inc/rcid.hrc
+++ b/sw/inc/rcid.hrc
@@ -36,7 +36,7 @@
// Bereiche fuer die UI-Verzeichnisse
// ----------------------------------------------------------------
-#define RC_BASE RID_SW_START // aus solar.hrc
+#define RC_BASE RID_SW_START // From solar.hrc
#define RC_APP RC_BASE
#define RC_DIALOG (RC_BASE + 200)
diff --git a/sw/inc/redline.hxx b/sw/inc/redline.hxx
index 7b5ac15cd2..45cd65c468 100644
--- a/sw/inc/redline.hxx
+++ b/sw/inc/redline.hxx
@@ -31,13 +31,12 @@
#include <tools/datetime.hxx>
#include <tools/string.hxx>
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
#include <pam.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <svl/smplhint.hxx>
+#include <vector>
class SfxItemSet;
class SwView;
@@ -77,7 +76,7 @@ public:
class SwRedlineExtraData_Format : public SwRedlineExtraData
{
- SvUShorts aWhichIds;
+ std::vector<sal_uInt16> aWhichIds;
SwRedlineExtraData_Format( const SwRedlineExtraData_Format& rCpy );
diff --git a/sw/inc/reffld.hxx b/sw/inc/reffld.hxx
index f27efb4c6b..7226d8379a 100644
--- a/sw/inc/reffld.hxx
+++ b/sw/inc/reffld.hxx
@@ -61,20 +61,17 @@ enum REFERENCEMARK
REF_NUMBER,
REF_NUMBER_NO_CONTEXT,
REF_NUMBER_FULL_CONTEXT,
- // <--
REF_END
};
-/*--------------------------------------------------------------------
- Beschreibung: Referenz holen
- --------------------------------------------------------------------*/
+// Get reference.
class SwGetRefFieldType : public SwFieldType
{
SwDoc* pDoc;
protected:
- // ueberlagert, um alle Ref-Felder zu updaten
+ // Overlay in order to update all ref-fields.
virtual void Modify( const SfxPoolItem*, const SfxPoolItem * );
public:
SwGetRefFieldType(SwDoc* pDoc );
@@ -89,9 +86,6 @@ public:
sal_uInt16* pStt, sal_uInt16* pEnd = 0 );
};
-/*--------------------------------------------------------------------
- Beschreibung: Referenzfeld
- --------------------------------------------------------------------*/
class SW_DLLPUBLIC SwGetRefField : public SwField
{
@@ -130,7 +124,7 @@ public:
void SetExpand( const String& rStr ) { sTxt = rStr; }
- // SubType erfragen/setzen
+ // Get/set sub type.
virtual sal_uInt16 GetSubType() const;
virtual void SetSubType( sal_uInt16 n );
@@ -138,16 +132,15 @@ public:
bool IsRefToHeadingCrossRefBookmark() const;
bool IsRefToNumItemCrossRefBookmark() const;
const SwTxtNode* GetReferencedTxtNode() const;
- // <--
// #i85090#
String GetExpandedTxtOfReferencedTxtNode() const;
- // SequenceNo erfragen/setzen (nur fuer REF_SEQUENCEFLD interressant)
+ // Get/set SequenceNo (of interest only for REF_SEQUENCEFLD).
sal_uInt16 GetSeqNo() const { return nSeqNo; }
void SetSeqNo( sal_uInt16 n ) { nSeqNo = n; }
- // Name der Referenz
+ // Name of reference.
virtual const String& GetPar1() const;
virtual void SetPar1(const String& rStr);
diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx
index 238067c229..8249e45643 100644
--- a/sw/inc/ring.hxx
+++ b/sw/inc/ring.hxx
@@ -34,7 +34,7 @@
class SW_DLLPUBLIC Ring
{
Ring *pNext;
- Ring* pPrev; // zur Optimierung, damit das ein/ausketten schneller geht!
+ Ring* pPrev; // In order to speed up inserting and deleting.
protected:
Ring() { pNext = this; pPrev = this; }
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 678e5df484..bc0ccb83e3 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -47,7 +47,7 @@ namespace com { namespace sun { namespace star {
namespace text { class XTextSection; }
} } }
-// Forward Deklaration
+
class SwSectionFmt;
class SwDoc;
class SwSection;
@@ -70,9 +70,9 @@ enum SectionType { CONTENT_SECTION,
enum LinkCreateType
{
- CREATE_NONE, // nichts weiter tun
- CREATE_CONNECT, // Link gleich connecten
- CREATE_UPDATE // Link connecten und updaten
+ CREATE_NONE, // Do nothing.
+ CREATE_CONNECT, // Connect created link.
+ CREATE_UPDATE // Connect created link and update it.
};
class SW_DLLPUBLIC SwSectionData
@@ -83,22 +83,22 @@ private:
String m_sSectionName;
String m_sCondition;
String m_sLinkFileName;
- String m_sLinkFilePassword; // must be changed to Sequence
+ String m_sLinkFilePassword; // Must be changed to Sequence.
::com::sun::star::uno::Sequence <sal_Int8> m_Password;
- /// it seems this flag caches the current final "hidden" state
+ /// It seems this flag caches the current final "hidden" state.
bool m_bHiddenFlag : 1;
- /// flags that correspond to attributes in the format:
+ /// Flags that correspond to attributes in the format:
/// may have different value than format attribute:
/// format attr has value for this section, while flag is
/// effectively ORed with parent sections!
bool m_bProtectFlag : 1;
- // edit in readonly sections
+ // Edit in readonly sections.
bool m_bEditInReadonlyFlag : 1;
- bool m_bHidden : 1; // all paragraphs hidden?
- bool m_bCondHiddenFlag : 1; // Hiddenflag for condition
- bool m_bConnectFlag : 1; // connected to server?
+ bool m_bHidden : 1; // All paragraphs hidden?
+ bool m_bCondHiddenFlag : 1; // Hiddenflag for condition.
+ bool m_bConnectFlag : 1; // Connected to server?
public:
@@ -156,15 +156,15 @@ public:
class SW_DLLPUBLIC SwSection
: public SwClient
{
- // damit beim Anlegen/Loeschen von Frames das Flag richtig gepflegt wird!
+ // In order to correctly maintain the flag when creating/deleting frames.
friend class SwSectionNode;
- // the "read CTOR" of SwSectionFrm have to change the Hiddenflag
+ // The "read CTOR" of SwSectionFrm have to change the Hiddenflag.
friend class SwSectionFrm;
private:
SwSectionData m_Data;
- SwServerObjectRef m_RefObj; // set if DataServer
+ SwServerObjectRef m_RefObj; // Set if DataServer.
::sfx2::SvBaseLinkRef m_RefLink;
SW_DLLPRIVATE void ImplSetHiddenFlag(
@@ -192,8 +192,8 @@ public:
SwSectionFmt* GetFmt() { return (SwSectionFmt*)GetRegisteredIn(); }
SwSectionFmt* GetFmt() const { return (SwSectionFmt*)GetRegisteredIn(); }
- // setze die Hidden/Protected -> gesamten Baum updaten !
- // (Attribute/Flags werden gesetzt/erfragt)
+ // Set hidden/protected -> update the whole tree!
+ // (Attributes/flags are set/get.)
bool IsHidden() const { return m_Data.IsHidden(); }
void SetHidden (bool const bFlag = true);
bool IsProtect() const;
@@ -201,15 +201,15 @@ public:
bool IsEditInReadonly() const;
void SetEditInReadonly(bool const bFlag = true);
- // erfrage die internen Flags (Zustand inklusive Parents nicht, was
- // aktuell an der Section gesetzt ist!!)
+ // Get internal flags (state including parents, not what is
+ // currently set at section!).
bool IsHiddenFlag() const { return m_Data.IsHiddenFlag(); }
bool IsProtectFlag() const { return m_Data.IsProtectFlag(); }
bool IsEditInReadonlyFlag() const { return m_Data.IsEditInReadonlyFlag(); }
void SetCondHidden(bool const bFlag = true);
bool IsCondHidden() const { return m_Data.IsCondHidden(); }
- // erfrage (auch ueber die Parents), ob diese Section versteckt sein soll.
+ // Query (also for parents) if this section is to be hidden.
sal_Bool CalcHiddenFlag() const;
@@ -220,25 +220,25 @@ public:
const String& GetLinkFileName() const;
void SetLinkFileName(String const& rNew, String const*const pPassWd = 0);
- // password of linked file (only valid during runtime!)
+ // Password of linked file (only valid during runtime!)
String const& GetLinkFilePassword() const
{ return m_Data.GetLinkFilePassword(); }
void SetLinkFilePassword(String const& rS)
{ m_Data.SetLinkFilePassword(rS); }
- // get / set password of this section
+ // Get / set password of this section
::com::sun::star::uno::Sequence<sal_Int8> const& GetPassword() const
{ return m_Data.GetPassword(); }
void SetPassword(::com::sun::star::uno::Sequence <sal_Int8> const& rNew)
{ m_Data.SetPassword(rNew); }
- // Daten Server-Methoden
+ // Data server methods.
void SetRefObject( SwServerObject* pObj );
const SwServerObject* GetObject() const { return & m_RefObj; }
SwServerObject* GetObject() { return & m_RefObj; }
bool IsServer() const { return m_RefObj.Is(); }
- // Methoden fuer gelinkte Bereiche
+ // Methods for linked ranges.
sal_uInt16 GetUpdateType() const { return m_RefLink->GetUpdateMode(); }
void SetUpdateType(sal_uInt16 const nType )
{ m_RefLink->SetUpdateMode(nType); }
@@ -256,12 +256,12 @@ public:
bool IsLinkType() const { return m_Data.IsLinkType(); }
- // Flags fuer UI - Verbindung geklappt?
+ // Flags for UI. Did connection work?
bool IsConnectFlag() const { return m_Data.IsConnectFlag(); }
void SetConnectFlag(bool const bFlag = true)
{ m_Data.SetConnectFlag(bFlag); }
- // return the TOX base class if the section is a TOX section
+ // Return the TOX base class if the section is a TOX section
const SwTOXBase* GetTOXBase() const;
void BreakLink();
@@ -299,45 +299,45 @@ class SW_DLLPUBLIC SwSectionFmt
{
friend class SwDoc;
- /** why does this exist in addition to the m_wXObject in SwFrmFmt?
+ /** Why does this exist in addition to the m_wXObject in SwFrmFmt?
in case of an index, both a SwXDocumentIndex and a SwXTextSection
register at this SwSectionFmt, so we need to have two refs.
*/
::com::sun::star::uno::WeakReference<
::com::sun::star::text::XTextSection> m_wXTextSection;
- SW_DLLPRIVATE void UpdateParent(); // Parent wurde veraendert
+ SW_DLLPRIVATE void UpdateParent(); // Parent has been changed.
protected:
SwSectionFmt( SwSectionFmt* pDrvdFrm, SwDoc *pDoc );
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew );
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
+ TYPEINFO(); // Already contained in base class client.
~SwSectionFmt();
- //Vernichtet alle Frms in aDepend (Frms werden per PTR_CAST erkannt).
+ // Deletes all Frms in aDepend (Frms are recognized via PTR_CAST).
virtual void DelFrms();
- //Erzeugt die Ansichten
+ // Creates views.
virtual void MakeFrms();
- // erfrage vom Format Informationen
+ // Get information from Format.
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
SwSection* GetSection() const;
inline SwSectionFmt* GetParent() const;
inline SwSection* GetParentSection() const;
- // alle Sections, die von dieser abgeleitet sind
- // - sortiert nach : Name oder Position oder unsortiert
- // - alle oder nur die, die sich im normalten Nodes-Array befinden
+ // All sections that are derived from this one:
+ // - sorted according to name or position or unsorted
+ // - all of them or only those that are in the normal Nodes-array.
sal_uInt16 GetChildSections( SwSections& rArr,
SectionSort eSort = SORTSECT_NOT,
sal_Bool bAllSections = sal_True ) const;
- // erfrage, ob sich die Section im Nodes-Array oder UndoNodes-Array
- // befindet.
+
+ // Query whether section is in Nodes-array or in UndoNodes-array.
sal_Bool IsInNodesArr() const;
SwSectionNode* GetSectionNode(bool const bEvenIfInUndo = false);
@@ -345,7 +345,7 @@ public:
{ return const_cast<SwSectionFmt *>(this)
->GetSectionNode(bEvenIfInUndo); }
- // ist die Section eine gueltige fuers GlobalDocument?
+ // Is section a valid one for global document?
const SwSection* GetGlobalDocSection() const;
SW_DLLPRIVATE ::com::sun::star::uno::WeakReference<
diff --git a/sw/inc/shellid.hxx b/sw/inc/shellid.hxx
index 9794ebf848..ee5ec2b6a0 100644
--- a/sw/inc/shellid.hxx
+++ b/sw/inc/shellid.hxx
@@ -30,9 +30,7 @@
#include <sfx2/shell.hxx>
-/*--------------------------------------------------------------------
- Beschreibung: Mapping fuer UI-Parameter
- --------------------------------------------------------------------*/
+// Mapping for UI-parameters
#define SW_BASESHELL (SFX_INTERFACE_SW_START + 1)
#define SW_TEXTSHELL (SFX_INTERFACE_SW_START + 2)
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 05d247c306..21aeb984dd 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -49,7 +49,6 @@
#include <docfac.hxx> // SwDocFac
#include <iodetect.hxx>
-// einige Forward - Deklarationen
class SfxFilterContainer;
class SfxFilter;
class SfxItemPool;
@@ -68,8 +67,8 @@ class SwTextBlocks;
struct SwPosition;
struct Writer_Impl;
-// ab so vielen chars wird ein mit einem ASCII/W4W-Reader eingelesener
-// Absatz zwangsweise umgebrochen. Muss immer groesser als 200 sein !!!
+// Defines the count of chars at which a paragraph read via ASCII/W4W-Reader
+// is forced to wrap. It has to be always greater than 200!!!
#define MAX_ASCII_PARA 10000
@@ -109,11 +108,11 @@ public:
};
/**************** SwReader/Reader ************************/
-// Basisklasse der moeglichen Optionen fuer einen speziellen Reader
+// Base class of possible options for a special reader.
class Reader;
-// Ruft den Reader mit seinen Optionen, Dokument, Cursor etc.
+// Calls reader with its options, document, cursor etc.
class SwReader;
-// SwRead ist der Pointer auf die Read-Optionen-Basisklasse
+// SwRead is pointer to the read-options base class.
typedef Reader *SwRead;
class SwgReaderOption
@@ -164,35 +163,31 @@ class SwReader: public SwDocFac
SvStream* pStrm;
SotStorageRef pStg;
com::sun::star::uno::Reference < com::sun::star::embed::XStorage > xStg;
- SfxMedium* pMedium; // wer ein Medium haben will (W4W)
+ SfxMedium* pMedium; // Who wants to obtain a Medium (W4W).
SwPaM* pCrsr;
String aFileName;
String sBaseURL;
public:
- /*
- * Initiales Einlesen. Dokument wird erst beim Read(..) angelegt.
- * oder falls es mitgegeben wird, in dieses.
- * Sonderfall fuer Load mit Sw3Reader
- */
+
+ // Initial reading. Document is created only at Read(...)
+ // or in case it is given, into that.
+ // Special case for Load with Sw3Reader.
SwReader( SfxMedium&, const String& rFilename, SwDoc *pDoc = 0 );
- /*
- * In ein existierendes Dokument einlesen, Dokument und
- * Position im Dokument werden aus dem SwPaM uebernommen.
- */
+
+ // Read into existing document.
+ // Document and position in document are taken from SwPaM.
SwReader( SvStream&, const String& rFilename, const String& rBaseURL, SwPaM& );
SwReader( SfxMedium&, const String& rFilename, SwPaM& );
SwReader( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const String& rFilename, SwPaM& );
- /*
- * Nur SwReader::Read(...) ist die Export-Schnittstelle!!!
- */
+ // The only export interface is SwReader::Read(...)!!!
sal_Bool NeedsPasswd( const Reader& );
sal_Bool CheckPasswd( const String&, const Reader& );
sal_uLong Read( const Reader& );
- // ask for glossaries
+ // Ask for glossaries.
sal_Bool HasGlossaries( const Reader& );
sal_Bool ReadGlossaries( const Reader&, SwTextBlocks&, sal_Bool bSaveRelFiles );
@@ -204,9 +199,9 @@ protected:
-/**************** SPEZIELLE Reader ************************/
+/**************** Special Readers ************************/
-// spezielle - Reader koennen beides sein !! (Excel, W4W, .. )
+// Special Readers can be both!! (Excel, W4W, .. ).
#define SW_STREAM_READER 1
#define SW_STORAGE_READER 2
@@ -224,12 +219,12 @@ protected:
SvStream* pStrm;
SotStorageRef pStg;
com::sun::star::uno::Reference < com::sun::star::embed::XStorage > xStg;
- SfxMedium* pMedium; // wer ein Medium haben will (W4W)
+ SfxMedium* pMedium; // Who wants to obtain a Medium (W4W).
SwgReaderOption aOpt;
sal_Bool bInsertMode : 1;
sal_Bool bTmplBrowseMode : 1;
- sal_Bool bReadUTF8: 1; // Stream als UTF-8 interpretieren
+ sal_Bool bReadUTF8: 1; // Interprete stream as UTF-8.
sal_Bool bBlockMode: 1;
sal_Bool bOrganizerMode : 1;
sal_Bool bHasAskTemplateName : 1;
@@ -247,14 +242,14 @@ public:
virtual void SetFltName( const String& rFltNm );
static void SetNoOutlineNum( SwDoc& rDoc );
- // den Item-Set eines Frm-Formats an das alte Format anpassen
+ // Adapt item-set of a Frm-Format to the old format.
static void ResetFrmFmtAttrs( SfxItemSet &rFrmSet );
- // die Rahmen-/Grafik-/OLE-Vorlagen an das alte Format (ohne
- // Umrandung etc.) anpassen
+ // Adapt Frame-/Graphics-/OLE- styles to the old format
+ // (without borders etc.).
static void ResetFrmFmts( SwDoc& rDoc );
- // Die Filter-Vorlage laden, setzen und wieder freigeben
+ // Load filter template, set it and release it again.
SwDoc* GetTemplateDoc();
sal_Bool SetTemplate( SwDoc& rDoc );
void ClearTemplate();
@@ -275,8 +270,8 @@ public:
virtual sal_Bool HasGlossaries() const;
virtual sal_Bool ReadGlossaries( SwTextBlocks&, sal_Bool bSaveRelFiles ) const;
- // read the sections of the document, which is equal to the medium.
- // returns the count of it
+ // Read the sections of the document, which is equal to the medium.
+ // Returns the count of it
virtual sal_uInt16 GetSectionList( SfxMedium& rMedium,
SvStrings& rStrings ) const;
@@ -286,8 +281,8 @@ public:
private:
virtual sal_uLong Read(SwDoc &, const String& rBaseURL, SwPaM &,const String &)=0;
- // alle die die Streams / Storages nicht geoeffnet brauchen,
- // muessen die Methode ueberladen (W4W!!)
+ // Everyone who does not need the streams / storages open
+ // has to overload the method (W4W!!).
virtual int SetStrmStgPtr();
};
@@ -312,11 +307,8 @@ public:
};
-////////////////////////////////////////////////////////////////////////////
-
-// Der uebergebene Stream muss dynamisch angelegt werden und
-// vor dem Loeschen der Instanz per Stream() angefordert
-// und geloescht werden!
+// The given stream has to be created dynamically and must
+// be requested via Stream() before the instance is deleted!
class SwImpBlocks;
@@ -332,7 +324,7 @@ public:
void Flush(){}
SwDoc* GetDoc();
- void ClearDoc(); // Doc-Inhalt loeschen
+ void ClearDoc(); // Delete Doc-contents.
const String& GetName();
void SetName( const String& );
sal_uLong GetError() const { return nErr; }
@@ -341,32 +333,32 @@ public:
void SetBaseURL( const String& rURL );
sal_Bool IsOld() const;
- sal_uLong ConvertToNew(); // Textbausteine konvertieren
+ sal_uLong ConvertToNew(); // Convert text modules.
- sal_uInt16 GetCount() const; // Anzahl Textbausteine ermitteln
- sal_uInt16 GetIndex( const String& ) const; // Index fuer Kurznamen ermitteln
- sal_uInt16 GetLongIndex( const String& ) const; //Index fuer Langnamen ermitteln
- const String& GetShortName( sal_uInt16 ) const; // Kurzname fuer Index zurueck
- const String& GetLongName( sal_uInt16 ) const; // Langname fuer Index zurueck
+ sal_uInt16 GetCount() const; // Get count text modules.
+ sal_uInt16 GetIndex( const String& ) const; // Get index of short names.
+ sal_uInt16 GetLongIndex( const String& ) const; // Get index of long names.
+ const String& GetShortName( sal_uInt16 ) const; // Get short name for index.
+ const String& GetLongName( sal_uInt16 ) const; // Get long name for index.
- sal_Bool Delete( sal_uInt16 ); // Loeschen
- sal_uInt16 Rename( sal_uInt16, const String*, const String* ); // Umbenennen
+ sal_Bool Delete( sal_uInt16 );
+ sal_uInt16 Rename( sal_uInt16, const String*, const String* );
sal_uLong CopyBlock( SwTextBlocks& rSource, String& rSrcShort,
- const String& rLong ); // Block kopieren
+ const String& rLong );
- sal_Bool BeginGetDoc( sal_uInt16 ); // Textbaustein einlesen
- void EndGetDoc(); // Textbaustein wieder loslassen
+ sal_Bool BeginGetDoc( sal_uInt16 ); // Read text modules.
+ void EndGetDoc(); // Release text modules.
- sal_Bool BeginPutDoc( const String&, const String& ); // Speichern Beginn
- sal_uInt16 PutDoc(); // Speichern Ende
+ sal_Bool BeginPutDoc( const String&, const String& ); // Begin save.
+ sal_uInt16 PutDoc(); // End save.
- sal_uInt16 PutText( const String&, const String&, const String& ); // Speichern( Kurzn., Text)
+ sal_uInt16 PutText( const String&, const String&, const String& ); // Save (short name, text).
sal_Bool IsOnlyTextBlock( sal_uInt16 ) const;
sal_Bool IsOnlyTextBlock( const String& rShort ) const;
- const String& GetFileName() const; // Dateiname von pImp
- sal_Bool IsReadOnly() const; // ReadOnly-Flag von pImp
+ const String& GetFileName() const; // Filename of pImp.
+ sal_Bool IsReadOnly() const; // ReadOnly-flag of pImp.
sal_Bool GetMacroTable( sal_uInt16 nIdx, SvxMacroTableDtor& rMacroTbl );
sal_Bool SetMacroTable( sal_uInt16 nIdx, const SvxMacroTableDtor& rMacroTbl );
@@ -387,17 +379,13 @@ SW_DLLPUBLIC SwRead SwGetReaderXML();
// END source/filter/basflt/fltini.cxx
-extern sal_Bool SetHTMLTemplate( SwDoc &rDoc ); //Fuer Vorlagen aus HTML.vor laden shellio.cxx
+extern sal_Bool SetHTMLTemplate( SwDoc &rDoc ); //For templates from HTML before loading shellio.cxx.
-/////////////////////////////////////////////////////////////////////////////
-/*
- * Schreiben, Writer
- */
-/* Basis-Klasse aller Writer */
+// Base-class of all writers.
class IDocumentSettingAccess;
class IDocumentStylePoolAccess;
@@ -416,7 +404,7 @@ class SW_DLLPUBLIC Writer
protected:
- SwPaM* pOrigPam; // der letze zu bearbeitende Pam
+ SwPaM* pOrigPam; // Last Pam that has to be processed.
const String* pOrigFileName;
void ResetWriter();
@@ -424,7 +412,6 @@ protected:
void PutNumFmtFontsInAttrPool();
void PutEditEngFontsInAttrPool( sal_Bool bIncl_CJK_CTL = sal_True );
- void PutCJKandCTLFontsInAttrPool();
virtual sal_uLong WriteStream() = 0;
void SetBaseURL( const String& rURL ) { sBaseURL = rURL; }
@@ -472,32 +459,33 @@ public:
const String& GetBaseURL() const { return sBaseURL;}
- // suche die naechste Bookmark-Position aus der Bookmark-Tabelle
+ // Look up next bookmark position from bookmark-table.
sal_Int32 FindPos_Bkmk( const SwPosition& rPos ) const;
- // build a bookmark table, which is sort by the node position. The
+ // Build a bookmark table, which is sort by the node position. The
// OtherPos of the bookmarks also inserted.
void CreateBookmarkTbl();
- // search alle Bookmarks in the range and return it in the Array
+ // Search alle Bookmarks in the range and return it in the Array.
sal_uInt16 GetBookmarks( const SwCntntNode& rNd,
xub_StrLen nStt, xub_StrLen nEnd,
SvPtrarr& rArr );
- // lege einen neuen PaM an der Position an
+ // Create new PaM at position.
static SwPaM * NewSwPaM(SwDoc & rDoc,
sal_uLong const nStartIdx, sal_uLong const nEndIdx);
- // kopiere ggfs. eine lokale Datei ins Internet
+ // If applicable copy a local file into internet.
sal_Bool CopyLocalFileToINet( String& rFileNm );
- // Stream-spezifische Routinen, im Storage-Writer NICHT VERWENDEN!
- // Optimierung der Ausgabe auf den Stream.
+ // Stream-specific routines. Do not use in storage-writer!
+
+ // Optimizing output on stream.
SvStream& OutLong( SvStream& rStrm, long nVal );
SvStream& OutULong( SvStream& rStrm, sal_uLong nVal );
- // Hex-Zahl ausgeben, default ist 2.stellige Zahl
+ // Output hex number; default is two-digit number.
SvStream& OutHex( SvStream& rStrm, sal_uLong nHex, sal_uInt8 nLen = 2 );
- // 4-st. Hex-Zahl ausgeben
+ // Output four-digit hex number.
inline SvStream& OutHex4( SvStream& rStrm, sal_uInt16 nHex )
{ return OutHex( rStrm, nHex, 4 ); }
@@ -518,7 +506,7 @@ SV_DECL_REF(Writer)
#endif
SV_IMPL_REF(Writer)
-// Basisklasse fuer alle Storage-Writer
+// Base class for all storage writers.
class SW_DLLPUBLIC StgWriter : public Writer
{
protected:
@@ -526,7 +514,7 @@ protected:
SotStorageRef pStg;
com::sun::star::uno::Reference < com::sun::star::embed::XStorage > xStg;
- // Fehler beim Aufruf erzeugen
+ // Create error at call.
virtual sal_uLong WriteStream();
virtual sal_uLong WriteStorage() = 0;
virtual sal_uLong WriteMedium( SfxMedium& ) = 0;
@@ -544,8 +532,8 @@ public:
SotStorage& GetStorage() const { return *pStg; }
};
-// Schnittstellenklasse fuer den allgemeinen Zugriff auf die
-// speziellen Writer
+
+// Interface class for general access on special writers.
class SwWriter
{
@@ -574,7 +562,6 @@ public:
};
-/////////////////////////////////////////////////////////////////////////////
typedef Reader* (*FnGetReader)();
typedef void (*FnGetWriter)(const String&, const String& rBaseURL, WriterRef&);
@@ -592,22 +579,22 @@ struct SwReaderWriterEntry
: pReader( NULL ), fnGetReader( fnReader ), fnGetWriter( fnWriter ), bDelReader( bDel )
{}
- /// Get access to the reader
+ /// Get access to the reader.
Reader* GetReader();
- /// Get access to the writer
+ /// Get access to the writer.
void GetWriter( const String& rNm, const String& rBaseURL, WriterRef& xWrt ) const;
};
namespace SwReaderWriter
{
- /// Return reader based on ReaderWriterEnum
+ /// Return reader based on ReaderWriterEnum.
Reader* GetReader( ReaderWriterEnum eReader );
- /// Return reader based on the name
+ /// Return reader based on the name.
Reader* GetReader( const String& rFltName );
- /// Return writer based on the name
+ /// Return writer based on the name.
void GetWriter( const String& rFltName, const String& rBaseURL, WriterRef& xWrt );
}
diff --git a/sw/inc/shellres.hxx b/sw/inc/shellres.hxx
index 3f341df605..80f1235d76 100644
--- a/sw/inc/shellres.hxx
+++ b/sw/inc/shellres.hxx
@@ -44,7 +44,7 @@ struct SW_DLLPUBLIC ShellResource : public Resource
String aPostItPage;
String aPostItLine;
- // Calc Fehlerstrings
+ // Calc error-strings.
String aCalc_Syntax;
String aCalc_ZeroDiv;
String aCalc_Brack;
@@ -55,21 +55,21 @@ struct SW_DLLPUBLIC ShellResource : public Resource
String aCalc_Default;
String aCalc_Error;
- // fuers GetRefFeld - oben/unten
+ // For GetRefField - up/down.
String aGetRefFld_Up;
String aGetRefFld_Down;
- // for GetRefField - referenced item not found
+ // For GetRefField - referenced item not found.
String aGetRefFld_RefItemNotFound;
- // fuer dynamisches Menu - String "alle"
+ // For dynamic menu - string "all".
String aStrAllPageHeadFoot;
- // fuer einige Listboxen - String "keine"
+ // For some list boxes - string "none"
String aStrNone;
- // fuer Felder, die Fixiert sind
+ // For fixed fields.
String aFixedStr;
- // custom fields of type css::util::Duration
+ // Custom fields of type css::util::Duration.
String sDurationFormat;
- //names of TOXs
+ //Names of TOXs.
String aTOXIndexName;
String aTOXUserName;
String aTOXContentName;
@@ -82,7 +82,7 @@ struct SW_DLLPUBLIC ShellResource : public Resource
SvStringsDtor aDocInfoLst;
- // die AutoFormat-Redline-Kommentare
+ // The autoFormat-Redline comments.
inline const SvStringsDtor& GetAutoFmtNameLst() const;
enum PageNameMode
@@ -91,9 +91,9 @@ struct SW_DLLPUBLIC ShellResource : public Resource
FIRST_PAGE,
FOLLOW_PAGE
};
- // returns for the specific filter the new names of pagedescs
+ // Returns for the specific filter the new names of pagedescs
// This method is for the old code of the specific filters with
- // now localized names
+ // now localized names.
String GetPageDescName( sal_uInt16 nNo, PageNameMode eMode );
ShellResource();
diff --git a/sw/inc/sortopt.hxx b/sw/inc/sortopt.hxx
index f010a6cbe1..12066e2db1 100644
--- a/sw/inc/sortopt.hxx
+++ b/sw/inc/sortopt.hxx
@@ -36,9 +36,7 @@
enum SwSortOrder { SRT_ASCENDING, SRT_DESCENDING };
enum SwSortDirection { SRT_COLUMNS, SRT_ROWS };
-/*--------------------------------------------------------------------
- Beschreibung: SortierSchluessel
- --------------------------------------------------------------------*/
+
struct SW_DLLPUBLIC SwSortKey
{
SwSortKey();
diff --git a/sw/inc/splargs.hxx b/sw/inc/splargs.hxx
index 0b7f6b2de6..678a8d336b 100644
--- a/sw/inc/splargs.hxx
+++ b/sw/inc/splargs.hxx
@@ -130,7 +130,7 @@ struct SwSpellArgs : SwArgsBase
* class SwInterHyphInfo
*************************************************************************/
-// Parameter-Klasse fuer Hyphenate
+// Parameter-class for Hyphenate.
// docedt.cxx: SwDoc::Hyphenate()
// txtedt.cxx: SwTxtNode::Hyphenate()
// txthyph.cxx: SwTxtFrm::Hyphenate()
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 4d8428485d..2902fc4202 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -28,7 +28,6 @@
#ifndef _SW_ABSTDLG_HXX
#define _SW_ABSTDLG_HXX
-// include ---------------------------------------------------------------
#include <tools/solar.h>
#include <tools/string.hxx>
@@ -163,6 +162,11 @@ public:
virtual const ::rtl::OUString& GetSaveFilter() const = 0;
virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const = 0;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const = 0;
+ virtual bool IsSaveIndividualDocs() const = 0;
+ virtual bool IsGenerateFromDataBase() const = 0;
+ virtual String GetColumnName() const = 0;
+ virtual String GetPath() const = 0;
+
};
class AbstractMailMergeCreateFromDlg : public VclAbstractDialog //add for SwMailMergeCreateFromDlg
{
@@ -338,7 +342,7 @@ public:
};
-//-------Swabstract fractory
+// Swabstract fractory
class SwAbstractDialogFactory
{
public:
diff --git a/sw/inc/swacorr.hxx b/sw/inc/swacorr.hxx
index 06589a8675..af11eb4aa8 100644
--- a/sw/inc/swacorr.hxx
+++ b/sw/inc/swacorr.hxx
@@ -38,13 +38,12 @@ class SwAutoCorrect : public SvxAutoCorrect
using SvxAutoCorrect::PutText;
protected:
- // - return den Ersetzungstext (nur fuer SWG-Format, alle anderen
- // koennen aus der Wortliste herausgeholt werden!)
- // rShort ist der Stream-Name - gecryptet!
+ // Return replacement text (only for SWG-format, all others can be obtained from wordlist!).
+ // rShort is stream-name - encrypted!
virtual sal_Bool GetLongText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& , const String& rFileName, const String& rShort, String& rLong );
- // - Text mit Attributierung (kann nur der SWG - SWG-Format!)
- // rShort ist der Stream-Name - gecryptet!
+ // Text with attributes (only SWG-format!).
+ // rShort is stream-name - encrypted!
virtual sal_Bool PutText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const String& rFileName, const String& rShort, SfxObjectShell& ,
String& );
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index 911dbb02d1..bebda02aef 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -65,7 +65,7 @@ class SvxCharRotateItem;
class SvxCharReliefItem;
class SvxCharHiddenItem;
-// Frame-Attribute
+// Frame attributes
class SwFmtFillOrder;
class SwFmtFrmSize;
class SvxPaperBinItem;
@@ -143,8 +143,8 @@ class SwTblBoxValue;
class SwAttrPool : public SfxItemPool
{
- friend void _InitCore(); // fuers anlegen/zerstoeren der
- friend void _FinitCore(); // Versionsmaps
+ friend void _InitCore(); // For creating/deleting of version maps.
+ friend void _FinitCore();
static sal_uInt16* pVersionMap1;
static sal_uInt16* pVersionMap2;
static sal_uInt16* pVersionMap3;
@@ -191,7 +191,7 @@ public:
int Put_BC( const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew );
int Put_BC( const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew );
- // ein Item oder einen Bereich loeschen
+ // Delete an item or a range.
sal_uInt16 ClearItem_BC( sal_uInt16 nWhich, SwAttrSet* pOld, SwAttrSet* pNew );
sal_uInt16 ClearItem_BC( sal_uInt16 nWhich1, sal_uInt16 nWhich2,
SwAttrSet* pOld = 0, SwAttrSet* pNew = 0 );
@@ -203,27 +203,24 @@ public:
SwAttrPool* GetPool() const { return (SwAttrPool*)SfxItemSet::GetPool(); }
- // kopiere die Attribute ggfs. ueber Dokumentgrenzen
+ // Copy attributes, if necessary across documents.
void CopyToModify( SwModify& rMod ) const;
- // ----------------------------------------------------------------
- // Sonderbehandlung fuer einige Attribute
- // Setze den Modify-Pointer (alten pDefinedIn) bei folgenden Attributen:
+ // Special treatment for some attributes.
+ // Set Modify-pointer (the old pDefinedIn) at the following attributes:
// - SwFmtDropCaps
// - SwFmtPageDesc
- // (Wird beim Einfuegen in Formate/Nodes gerufen)
+ // (Is called at insert in formats/nodes.)
// Second version is for the SwAttrSet handles of SwCntntNode.
bool SetModifyAtAttr( const SwModify* pModify );
- // Das Doc wird jetzt am SwAttrPool gesetzt. Dadurch hat man es immer
- // im Zugriff.
+ // Document is set at SwAttrPool. Therefore it is always accessible.
const SwDoc *GetDoc() const { return GetPool()->GetDoc(); }
SwDoc *GetDoc() { return GetPool()->GetDoc(); }
- // GetMethoden: das Bool gibt an, ob nur im Set (sal_False) oder auch in
- // den Parents gesucht werden soll. Wird nichts gefunden,
- // wird das deflt. Attribut returnt.
- // Charakter-Attribute - impl. steht im charatr.hxx
+ // Get methods: bool indicates whether to search only in Set (sal_False)
+ // or also in parents. If nothing is found then default attribute is returned.
+ // Character attributes. Implementation in charatr.hxx.
inline const SvxPostureItem &GetPosture( sal_Bool = sal_True ) const;
inline const SvxWeightItem &GetWeight( sal_Bool = sal_True ) const;
inline const SvxShadowedItem &GetShadowed( sal_Bool = sal_True ) const;
@@ -263,7 +260,7 @@ public:
inline const SvxCharReliefItem &GetCharRelief( sal_Bool = sal_True ) const;
inline const SvxCharHiddenItem &GetCharHidden( sal_Bool = sal_True ) const;
- // Frame-Attribute - impl. steht im frmatr.hxx
+ // Frame attributes. Implementation in frmatr.hxx.
inline const SwFmtFillOrder &GetFillOrder( sal_Bool = sal_True ) const;
inline const SwFmtFrmSize &GetFrmSize( sal_Bool = sal_True ) const;
inline const SvxPaperBinItem &GetPaperBin( sal_Bool = sal_True ) const;
diff --git a/sw/inc/swbaslnk.hxx b/sw/inc/swbaslnk.hxx
index 213b536c79..bc21f95818 100644
--- a/sw/inc/swbaslnk.hxx
+++ b/sw/inc/swbaslnk.hxx
@@ -65,8 +65,8 @@ public:
{}
virtual ~SwBaseLink();
- virtual void DataChanged( const String& rMimeType,
- const ::com::sun::star::uno::Any & rValue );
+ virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
+ const String& rMimeType, const ::com::sun::star::uno::Any & rValue );
virtual void Closed();
@@ -74,12 +74,12 @@ public:
SwCntntNode *GetCntntNode() { return pCntntNode; }
- // nur fuer Grafiken
+ // For graphics only.
sal_Bool SwapIn( sal_Bool bWaitForData = sal_False, sal_Bool bNativFormat = sal_False );
sal_Bool Connect() { return 0 != SvBaseLink::GetRealObject(); }
- // nur fuer Grafik-Links ( zum Umschalten zwischen DDE / Grf-Link)
+ // Only for graphics-links (for switching between DDE / Grf-link).
void SetObjType( sal_uInt16 nType ) { SvBaseLink::SetObjType( nType ); }
sal_Bool IsRecursion( const SwBaseLink* pChkLnk ) const;
diff --git a/sw/inc/swcrsr.hxx b/sw/inc/swcrsr.hxx
index 3d4d14a055..203c7e0d89 100644
--- a/sw/inc/swcrsr.hxx
+++ b/sw/inc/swcrsr.hxx
@@ -42,8 +42,8 @@ namespace com { namespace sun { namespace star { namespace util {
} } } }
-// ein Basis-Struktur fuer die Parameter der Find-Methoden
-// return - Werte vom Found-Aufruf.
+// Base structure for parameters of the find-methods.
+// Returns values of found-call.
const int FIND_NOT_FOUND = 0;
const int FIND_FOUND = 1;
const int FIND_NO_RING = 2;
@@ -192,9 +192,8 @@ public:
sal_Bool MoveTable( SwWhichTable, SwPosTable );
sal_Bool MoveRegion( SwWhichRegion, SwPosRegion );
-
- // gibt es eine Selection vom Content in die Tabelle
- // Return Wert gibt an, ob der Crsr auf der alten Position verbleibt
+ // Is there a selection of content in table?
+ // Return value indicates if cursor remains at its old position.
virtual sal_Bool IsSelOvr( int eFlags =
( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE |
@@ -206,10 +205,10 @@ public:
/** Restore cursor state to the one saved by SwCrsrSaveState **/
void RestoreSavePos();
- // sal_True: an die Position kann der Cursor gesetzt werden
+ // sal_True: cursor can be set at this position.
virtual sal_Bool IsAtValidPos( sal_Bool bPoint = sal_True ) const;
- // darf der Cursor in ReadOnlyBereiche?
+ // Is cursor allowed in ready only ranges?
virtual bool IsReadOnlyAvailable() const;
virtual sal_Bool IsSkipOverProtectSections() const;
@@ -270,7 +269,7 @@ protected:
xub_StrLen nTblPtCnt, nTblMkCnt;
SwSelBoxes aSelBoxes;
sal_Bool bChg : 1;
- sal_Bool bParked : 1; // Tabellen-Cursor wurde geparkt
+ sal_Bool bParked : 1; // Table-cursor was parked.
virtual bool IsSelOvrCheck(int eFlags);
@@ -288,15 +287,14 @@ public:
sal_uInt16 GetBoxesCount() const { return aSelBoxes.Count(); }
const SwSelBoxes& GetBoxes() const { return aSelBoxes; }
- // Baut fuer alle Boxen die Cursor auf
+ // Creates cursor for all boxes.
SwCursor* MakeBoxSels( SwCursor* pAktCrsr );
- // sind irgendwelche Boxen mit einem Schutz versehen?
+ // Any boxes protected?
sal_Bool HasReadOnlyBoxSel() const;
- // wurde der TabelleCursor veraendert ? Wenn ja speicher gleich
- // die neuen Werte.
+ // Has table cursor been changed? If so, save new values immediately.
sal_Bool IsCrsrMovedUpdt();
- // wurde der TabelleCursor veraendert ?
+ // Has table cursor been changed?
sal_Bool IsCrsrMoved() const
{
return nTblMkNd != GetMark()->nNode.GetIndex() ||
@@ -307,7 +305,7 @@ public:
sal_Bool IsChgd() const { return bChg; }
- // Parke den Tabellen-Cursor auf dem StartNode der Boxen.
+ // Park table cursor at start node of boxes.
void ParkCrsr();
bool NewTableSelection();
diff --git a/sw/inc/swdbtoolsclient.hxx b/sw/inc/swdbtoolsclient.hxx
index 7efaf0e791..02aad4af04 100644
--- a/sw/inc/swdbtoolsclient.hxx
+++ b/sw/inc/swdbtoolsclient.hxx
@@ -33,7 +33,7 @@
#include <osl/module.h>
#include "swdllapi.h"
-/*
+/*
Client to use the dbtools library as load-on-call
*/
class SW_DLLPUBLIC SwDbtoolsClient
diff --git a/sw/inc/swddetbl.hxx b/sw/inc/swddetbl.hxx
index 962a7514a7..7a0c0c5778 100644
--- a/sw/inc/swddetbl.hxx
+++ b/sw/inc/swddetbl.hxx
@@ -37,8 +37,9 @@ class SwDDETable : public SwTable
SwDepend aDepend;
public:
TYPEINFO();
- // Constructor movet alle Lines/Boxen aus der SwTable zu sich.
- // Die SwTable ist danach Leer und muss geloescht werden.
+
+ // Ctor moves all lines/boxes from SwTable to it.
+ // After that SwTable is empty and has to be deleted.
SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType,
sal_Bool bUpdate = sal_True );
~SwDDETable();
diff --git a/sw/inc/swddllapi.h b/sw/inc/swddllapi.h
new file mode 100644
index 0000000000..c967c08ce6
--- /dev/null
+++ b/sw/inc/swddllapi.h
@@ -0,0 +1,16 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+#ifndef INCLUDED_SWDDLLAPI_H
+#define INCLUDED_SWDDLLAPI_H
+
+#include "sal/types.h"
+
+#if defined(SWD_DLLIMPLEMENTATION)
+#define SWD_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define SWD_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define SWD_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_SWDDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/swdll.hxx b/sw/inc/swdll.hxx
index ee4f5d59e6..67c11e9446 100644
--- a/sw/inc/swdll.hxx
+++ b/sw/inc/swdll.hxx
@@ -28,40 +28,18 @@
#ifndef SW_SWDLL_HXX
#define SW_SWDLL_HXX
-class StatusBar;
-
#include <sfx2/sfxdefs.hxx>
#include <sfx2/module.hxx>
-#include <tools/shl.hxx>
-
-//-------------------------------------------------------------------------
-
-class SwDLL
-
/**
* This class is a wrapper for a Load-On-Demand-DLL. One instance
* per SfxApplication will be created for the runtime of
* SfxApplication-subclass::Main().
- *
- * Remember: Do export this class! It is used by the application.
*/
-
+namespace SwGlobals
{
-
- static void RegisterFactories();
- static void RegisterInterfaces();
- static void RegisterControls();
-public:
- // Ctor/Dtor must be linked to the application
- SwDLL();
- ~SwDLL();
-
- static void Init(); // called directly after loading the DLL
- static void Exit(); // called directly befor unloading the DLL
-};
-
-//-------------------------------------------------------------------------
+ void ensure();
+}
#define SW_DLL() ( *(SwModule**) GetAppData(SHL_WRITER) )
diff --git a/sw/inc/swevent.hxx b/sw/inc/swevent.hxx
index 322ba61f1e..8c6e8967a1 100644
--- a/sw/inc/swevent.hxx
+++ b/sw/inc/swevent.hxx
@@ -64,17 +64,17 @@ class SwFrmFmt;
class SwFmtINetFmt;
class IMapObject;
-// enum fuer Objecte die Events ins Basic oder in JavaScript Callen
+// Enum for objects that call events into Basic or JavaScript.
enum SwCallEventObjectType
{
- EVENT_OBJECT_NONE = 0, // Null ist garnichts
+ EVENT_OBJECT_NONE = 0, // Null is nothing at all.
EVENT_OBJECT_IMAGE,
EVENT_OBJECT_INETATTR,
EVENT_OBJECT_URLITEM,
EVENT_OBJECT_IMAGEMAP
};
-// structur fuer den Austausch zwischen UI/CORE
+// Structure for the exchange between UI/CORE.
struct SwCallMouseEvent
{
diff --git a/sw/inc/swgstr.hxx b/sw/inc/swgstr.hxx
index 035d1e6031..3152d577e0 100644
--- a/sw/inc/swgstr.hxx
+++ b/sw/inc/swgstr.hxx
@@ -30,38 +30,38 @@
#include <tools/stream.hxx>
-typedef long long3; // Zur Dokumentation: 3-byte-Longs
+typedef long long3; // For documentation: 3-byte-longs.
-#define MAX_BEGIN 64 // Maximale Blockschachtelung
-#define PASSWDLEN 16 // Maximale Passwortlaenge
+#define MAX_BEGIN 64 // Maximum block nesting.
+#define PASSWDLEN 16 // Maximum password length.
-// Neue Version mit SvStreams
+// New version with SvStreams.
-// Passwort- und Codierungs-Funktionalitaet
+// Functionality for passwords and encoding.
class swcrypter {
protected:
- sal_Char cPasswd[ PASSWDLEN ]; // Passwort-Puffer
- sal_Bool bPasswd; // sal_True wenn mit Passwort
- void encode( sal_Char*, sal_uInt16 ); // Puffer codieren/decodieren
+ sal_Char cPasswd[ PASSWDLEN ]; // Password buffer.
+ sal_Bool bPasswd; // sal_True if with password.
+ void encode( sal_Char*, sal_uInt16 ); // Encode/decode buffer.
public:
swcrypter();
- sal_Bool setpasswd( const String& ); // Passwort setzen
- void copypasswd( const sal_Char* ); // Passwort direkt setzen
+ sal_Bool setpasswd( const String& ); // Set password.
+ void copypasswd( const sal_Char* ); // Set password directly.
const sal_Char* getpasswd() { return cPasswd; }
};
-// Reader/Writer-Stream-Basisklasse mit Pufferverwaltung fuer Texte
-// und Spezial-I/O fuer 3-Byte-Longs
+// Reader/Writer-stream base class with buffer administration for texts
+// ans special I/O for 3-byte-longs.
class swstreambase : public swcrypter {
protected:
- SvStream* pStrm; // eigentlicher Stream
- sal_Char* pBuf; // Zwischenpuffer
- sal_uInt16 nBuflen; // Laenge des Zwischenpuffers
- short nLong; // Long-Laenge (3 oder 4)
- sal_Bool bTempStrm; // sal_True: Stream loeschen
- void checkbuf( sal_uInt16 ); // Testen der Pufferlaenge
+ SvStream* pStrm; // The actual stream.
+ sal_Char* pBuf; // Temporary buffer.
+ sal_uInt16 nBuflen; // Length of temporary buffer.
+ short nLong; // Long-length (3 or 4).
+ sal_Bool bTempStrm; // sal_True: delete stream.
+ void checkbuf( sal_uInt16 ); // Test buffer length.
swstreambase( SvStream& );
@@ -70,18 +70,19 @@ protected:
public:
~swstreambase();
SvStream& Strm() { return *pStrm; }
- void clear(); // Puffer loeschen
+ void clear(); // Delete buffer.
- // Zusatzfunktionen zur I/O von LONGs als 3-Byte-Zahlen
+ // Supplementary functions for I/O of LONGs as 3-byte numbers.
void long3() { nLong = 3; }
void long4() { nLong = 4; }
- // Alias- und Hilfsfunktionen
+
+ // Alias and helper functions.
void seek( long nPos ) { pStrm->Seek( nPos ); }
long tell() { return pStrm->Tell(); }
- long filesize(); // Dateigroesse
+ long filesize();
void setbad();
int good() { return ( pStrm->GetError() == SVSTREAM_OK ); }
@@ -125,20 +126,20 @@ inline swstreambase& swstreambase::operator>>( sal_uLong& c )
}
class swistream : public swstreambase {
- sal_uInt8 cType; // Record-Typ
- sal_uLong nOffset; // Record-Offset-Portion
+ sal_uInt8 cType; // Record type.
+ sal_uLong nOffset; // Record offset portion.
public:
swistream( SvStream& );
- sal_uInt8 peek(); // 1 Byte testen
- sal_uInt8 next(); // Blockstart
- sal_uInt8 cur() { return cType; } // aktueller Block
- sal_uInt8 skipnext(); // Record ueberspringen
- void undonext(); // next() rueckgaengig machen
+ sal_uInt8 peek(); // Test 1 byte.
+ sal_uInt8 next(); // Block start.
+ sal_uInt8 cur() { return cType; } // Current block.
+ sal_uInt8 skipnext(); // Skip record.
+ void undonext(); // Undo next().
long getskip() { return nOffset; }
- void skip( long = -1L ); // Block ueberspringen
- sal_Char* text(); // Textstring lesen (nach BEGIN)
- long size(); // aktuelle Record-Laenge
+ void skip( long = -1L ); // Skip block.
+ sal_Char* text(); // Read text string (after BEGIN).
+ long size(); // Current record length.
private:
swistream( const swistream& );
diff --git a/sw/inc/switerator.hxx b/sw/inc/switerator.hxx
index cbdc0b5231..963a13ce3b 100644
--- a/sw/inc/switerator.hxx
+++ b/sw/inc/switerator.hxx
@@ -28,14 +28,14 @@
#define _SWITERATOR_HXX
#include <calbck.hxx>
-#include <tools/debug.hxx>
+#include <osl/diagnose.h>
template< class TElementType, class TSource > class SwIterator
{
SwClientIter aClientIter;
public:
- SwIterator( const TSource& rSrc ) : aClientIter(rSrc) { DBG_ASSERT( TElementType::IsOf( TYPE(SwClient) ), "Incompatible types!" ); }
+ SwIterator( const TSource& rSrc ) : aClientIter(rSrc) { OSL_ENSURE( TElementType::IsOf( TYPE(SwClient) ), "Incompatible types!" ); }
TElementType* First() { SwClient* p = aClientIter.First(TYPE(TElementType)); return PTR_CAST(TElementType,p); }
TElementType* Last() { SwClient* p = aClientIter.Last( TYPE(TElementType)); return PTR_CAST(TElementType,p); }
TElementType* Next() { SwClient* p = aClientIter.Next(); return PTR_CAST(TElementType,p); }
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 423c930676..7828e8de48 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -69,7 +69,7 @@ struct SwDBData;
#define VIEWOPT_DEST_VIEW 0
#define VIEWOPT_DEST_TEXT 1
#define VIEWOPT_DEST_WEB 2
-#define VIEWOPT_DEST_VIEW_ONLY 3 //ViewOptions werden nur an der ::com::sun::star::sdbcx::View, nicht an der Appl. gesetzt
+#define VIEWOPT_DEST_VIEW_ONLY 3 //ViewOptions are set only at ::com::sun::star::sdbcx::View, not at the appl.
namespace com{ namespace sun{ namespace star{ namespace scanner{
class XScannerManager;
@@ -88,8 +88,8 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::C
SwChapterNumRules* pChapterNumRules;
SwStdFontConfig* pStdFontConfig;
SwNavigationConfig* pNavigationConfig;
- SwToolbarConfigItem*pToolbarConfig; //fuer gestackte Toolbars, welche
- SwToolbarConfigItem*pWebToolbarConfig; //war sichtbar?
+ SwToolbarConfigItem*pToolbarConfig; //For stacked toolbars. Which one was visible?
+ SwToolbarConfigItem*pWebToolbarConfig;
SwDBConfig* pDBConfig;
svtools::ColorConfig* pColorConfig;
SvtAccessibilityOptions* pAccessibilityOptions;
@@ -101,13 +101,12 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::C
SwAttrPool *pAttrPool;
- // Die aktuelle View wird hier gehalten um nicht ueber
- // GetActiveView arbeiten zu muessen
- // Die View ist solange gueltig bis Sie im Activate
- // zerstoert oder ausgetauscht wird
+ // Current view is held here in order to avoid one's being forced
+ // to work via GetActiveView.
+ // View is valid until destroyed in Activate or exchanged.
SwView* pView;
- // Liste aller Redline-Autoren
+ // List of all Redline-authors.
SvStringsDtor* pAuthorNames;
// DictionaryList listener to trigger spellchecking or hyphenation
@@ -121,13 +120,13 @@ class SW_DLLPUBLIC SwModule: public SfxModule, public SfxListener, public utl::C
sal_Bool bAuthorInitialised : 1;
sal_Bool bEmbeddedLoadSave : 1;
- // Hint abfangen fuer DocInfo
+ // Catch hint for DocInfo.
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
protected:
- // Briefumschlaege, Etiketten
+ // Envelopes, labels.
void InsertEnv(SfxRequest&);
void InsertLab(SfxRequest&, sal_Bool bLabel);
@@ -138,25 +137,23 @@ public:
TYPEINFO();
SFX_DECL_INTERFACE(SW_INTERFACE_MODULE)
- // dieser Ctor nur fuer SW-Dll
+ // This Ctor only for SW-Dll.
SwModule( SfxObjectFactory* pFact,
SfxObjectFactory* pWebFact,
SfxObjectFactory* pGlobalFact );
~SwModule();
- // View setzen nur fuer internen Gebrauch,
- // aus techn. Gruenden public
- //
+ // Set view for internal use only. It is public only for technical reasons.
inline void SetView(SwView* pVw) { pView = pVw; }
inline SwView* GetView() { return pView; }
- //Die Handler fuer die Slots
- void StateOther(SfxItemSet &); // andere
+ // Handler for slots.
+ void StateOther(SfxItemSet &);
- void ExecOther(SfxRequest &); // Felder, Formel ..
+ void ExecOther(SfxRequest &); // Fields, formula...
- // Benutzereinstellungen modifizieren
+ // Modify user settings.
const SwMasterUsrPref *GetUsrPref(sal_Bool bWeb) const;
const SwViewOption* GetViewOption(sal_Bool bWeb);
void ApplyUsrPref(const SwViewOption &, SwView*,
@@ -166,12 +163,12 @@ public:
void ApplyFldUpdateFlags(SwFldUpdateFlags eFldFlags);
void ApplyLinkMode(sal_Int32 nNewLinkMode);
- //default page mode for text grid
+ // Default page mode for text grid.
void ApplyDefaultPageMode(sal_Bool bIsSquaredPageMode);
void ApplyUserCharUnit(sal_Bool bApplyChar, sal_Bool bWeb); // apply_char_unit
- // ConfigItems erzeugen
+ // Create ConfigItems.
SwModuleOptions* GetModuleConfig() { return pModuleConfig;}
SwPrintOptions* GetPrtOptions(sal_Bool bWeb);
SwChapterNumRules* GetChapterNumRules();
@@ -186,7 +183,7 @@ public:
SvtUserOptions& GetUserOptions();
SvtUndoOptions& GetUndoOptions();
- // Ueber Sichten iterieren
+ // Iterate over views.
static SwView* GetFirstView();
static SwView* GetNextView(SwView*);
@@ -195,15 +192,16 @@ public:
void ShowDBObj( SwView& rView, const SwDBData& rData, sal_Bool bOnlyIfAvailable = sal_False);
- // Tabellenmodi
+ // Table modi.
sal_Bool IsInsTblFormatNum(sal_Bool bHTML) const;
sal_Bool IsInsTblChangeNumFormat(sal_Bool bHTML) const;
sal_Bool IsInsTblAlignNum(sal_Bool bHTML) const;
- // Redlining
+ // Redlining.
sal_uInt16 GetRedlineAuthor();
const String& GetRedlineAuthor(sal_uInt16 nPos);
sal_uInt16 InsertRedlineAuthor(const String& rAuthor);
+ void SetRedlineAuthor(const String& rAuthor); // for unit tests
void GetInsertAuthorAttr(sal_uInt16 nAuthor, SfxItemSet &rSet);
void GetDeletedAuthorAttr(sal_uInt16 nAuthor, SfxItemSet &rSet);
@@ -212,27 +210,27 @@ public:
sal_uInt16 GetRedlineMarkPos();
const Color& GetRedlineMarkColor();
- // returne den definierten DocStat - WordDelimiter
+ // Return defined DocStat - WordDelimiter.
const String& GetDocStatWordDelim() const;
- // Durchreichen der Metric von der ModuleConfig (fuer HTML-Export)
+ // Pass metric of ModuleConfig (for HTML-export).
sal_uInt16 GetMetric( sal_Bool bWeb ) const;
- // Update-Stati durchreichen
+ // Pass update-statuses.
sal_uInt16 GetLinkUpdMode( sal_Bool bWeb ) const;
SwFldUpdateFlags GetFldUpdateFlags( sal_Bool bWeb ) const;
- //virtuelle Methoden fuer den Optionendialog
+ // Virtual methods for options dialog.
virtual SfxItemSet* CreateItemSet( sal_uInt16 nId );
virtual void ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet );
virtual SfxTabPage* CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxItemSet& rSet );
- //hier wird der Pool angelegt und an der SfxShell gesetzt
+ // Pool is created here and set at SfxShell.
void InitAttrPool();
- //Pool loeschen bevor es zu spaet ist
+ // Delete pool before it is too late.
void RemoveAttrPool();
- // Invalidiert ggf. OnlineSpell-WrongListen
+ // Invalidates online spell-wrong-lists if necessary.
void CheckSpellChanges( sal_Bool bOnlineSpelling,
sal_Bool bIsSpellWrongAgain, sal_Bool bIsSpellAllAgain, sal_Bool bSmartTags );
@@ -268,9 +266,7 @@ inline void SwModule::SetLngSvcEvtListener(
}
-/*
- Zugriff auf das SwModule, die ::com::sun::star::sdbcx::View und die Shell
-*/
+// Access to SwModule, the ::com::sun::star::sdbcx::View and the shell.
#define SW_MOD() ( *(SwModule**) GetAppData(SHL_WRITER))
diff --git a/sw/inc/swrect.hxx b/sw/inc/swrect.hxx
index 4fa5fe4e64..3edf310e1b 100644
--- a/sw/inc/swrect.hxx
+++ b/sw/inc/swrect.hxx
@@ -44,7 +44,7 @@ public:
inline SwRect( const Point& rLT, const Point& rRB );
inline SwRect( long X, long Y, long Width, long Height );
- //SV-SS e.g. SwRect( pWin->GetClipRect() );
+ //SV-SS e.g. SwRect( pWin->GetClipRect() );
SwRect( const Rectangle &rRect );
//Set-Methods
@@ -70,8 +70,7 @@ public:
inline long Top() const;
inline long Bottom() const;
- //Damit Layoutseitig per Memberpointer auf die Member von Pos und SSize
- //zugegriffen werden kann.
+ // In order to be able to access the members of Pos and SSize from the layout side.
inline Point &Pos();
inline Size &SSize();
@@ -81,7 +80,8 @@ public:
SwRect &Union( const SwRect& rRect );
SwRect &Intersection( const SwRect& rRect );
- //Wie Intersection nur wird davon ausgegangen, dass die Rects ueberlappen!
+
+ // Same as Intersection, only assume that Rects are overlapping!
SwRect &_Intersection( const SwRect &rRect );
inline SwRect GetIntersection( const SwRect& rRect ) const;
@@ -107,7 +107,7 @@ public:
//SV-SS e.g. pWin->DrawRect( aSwRect.SVRect() );
inline Rectangle SVRect() const;
- // Ausgabeoperator fuer die Debugging-Gemeinde
+ // Output operator for debugging.
friend SvStream &operator<<( SvStream &rStream, const SwRect &rRect );
diff --git a/sw/inc/swregion.hxx b/sw/inc/swregion.hxx
index 83ccf67ac3..51cc17ae38 100644
--- a/sw/inc/swregion.hxx
+++ b/sw/inc/swregion.hxx
@@ -36,19 +36,21 @@ SV_DECL_VARARR( SwRects, SwRect, 20, 8 )
class SwRegionRects : public SwRects
{
- SwRect aOrigin; // die Kopie des StartRects
+ SwRect aOrigin; // Copy of StartRect.
inline void InsertRect( const SwRect &rRect, const sal_uInt16 nPos, sal_Bool &rDel);
public:
SwRegionRects( const SwRect& rStartRect, sal_uInt16 nInit = 20,
sal_uInt16 nGrow = 8 );
- // Zum Ausstanzen aus aOrigin.
+
+ // For punching from aOrigin.
void operator-=( const SwRect& rRect );
- // Aus Loechern werden Flaechen, aus Flaechen werden Loecher.
+ // From holes to areas, from areas to holes.
void Invert();
- // Benachbarte Rechtecke zusammenfassen.
+
+ // Combine adjacent rectangles.
void Compress( sal_Bool bFuzzy = sal_True );
inline const SwRect &GetOrigin() const { return aOrigin; }
diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx
index 6632cb6d3e..bd2dafeee6 100644
--- a/sw/inc/swtable.hxx
+++ b/sw/inc/swtable.hxx
@@ -40,7 +40,7 @@ class SwStartNode;
#include <memory>
#include <boost/noncopyable.hpp>
#else
-#include <node.hxx> // fuer StartNode->GetMyIndex
+#include <node.hxx> // For StartNode->GetMyIndex.
#endif
class SwFmt;
@@ -79,20 +79,20 @@ SV_DECL_REF( SwServerObject )
SV_DECL_PTRARR_DEL(SwTableLines, SwTableLine*, 10, 20)
SV_DECL_PTRARR_DEL(SwTableBoxes, SwTableBox*, 25, 50)
-// speicher die Inhaltstragenden Box-Pointer zusaetzlich in einem
-// sortierten Array (fuers rechnen in der Tabelle)
+// Save content-bearing box-pointers additionally in a sorted array
+// (for calculation in table).
typedef SwTableBox* SwTableBoxPtr;
SV_DECL_PTRARR_SORT( SwTableSortBoxes, SwTableBoxPtr, 25, 50 )
typedef SwTableLine* SwTableLinePtr;
-class SW_DLLPUBLIC SwTable: public SwClient //Client vom FrmFmt
+class SW_DLLPUBLIC SwTable: public SwClient //Client of FrmFmt.
{
protected:
SwTableLines aLines;
SwTableSortBoxes aSortCntBoxes;
- SwServerObjectRef refObj; // falls DataServer -> Pointer gesetzt
+ SwServerObjectRef refObj; // In case DataServer -> pointer is set.
SwHTMLTableLayout *pHTMLLayout;
@@ -102,17 +102,17 @@ protected:
// boxes have been build (SwTableNode::MakeCopy with tables in tables).
SwTableNode* pTableNode;
-//SOLL das fuer jede Tabelle einstellbar sein?
+ // Should that be adjustable for every table?
TblChgMode eTblChgMode;
- sal_uInt16 nGrfsThatResize; // Anzahl der Grfs, die beim HTML-Import
- // noch ein Resize der Tbl. anstossen
- sal_uInt16 nRowsToRepeat; // number of rows to repeat on every page
+ sal_uInt16 nGrfsThatResize; // Count of Grfs that initiate a resize of table
+ // at HTML-import.
+ sal_uInt16 nRowsToRepeat; // Number of rows to repeat on every page.
sal_Bool bModifyLocked :1;
sal_Bool bNewModel :1; // sal_False: old SubTableModel; sal_True: new RowSpanModel
#if OSL_DEBUG_LEVEL > 1
- bool bDontChangeModel; // This is set by functions (like Merge()) to forbid a laet model change
+ bool bDontChangeModel; // This is set by functions (like Merge()) to forbid a laet model change.
#endif
sal_Bool IsModifyLocked(){ return bModifyLocked;}
@@ -158,13 +158,13 @@ public:
SwHTMLTableLayout *GetHTMLTableLayout() { return pHTMLLayout; }
const SwHTMLTableLayout *GetHTMLTableLayout() const { return pHTMLLayout; }
- void SetHTMLTableLayout( SwHTMLTableLayout *p ); //Eigentumsuebergang!
+ void SetHTMLTableLayout( SwHTMLTableLayout *p ); //Change of property!
sal_uInt16 IncGrfsThatResize() { return ++nGrfsThatResize; }
sal_uInt16 DecGrfsThatResize() { return nGrfsThatResize ? --nGrfsThatResize : 0; }
- void LockModify() { bModifyLocked = sal_True; } //Muessen _immer_ paarig
- void UnlockModify() { bModifyLocked = sal_False;} //benutzt werden!
+ void LockModify() { bModifyLocked = sal_True; } // Must be used always
+ void UnlockModify() { bModifyLocked = sal_False;} // in pairs!
void SetTableModel( sal_Bool bNew ){ bNewModel = bNew; }
sal_Bool IsNewModel() const { return bNewModel; }
@@ -250,69 +250,72 @@ public:
SwTableSortBoxes& GetTabSortBoxes() { return aSortCntBoxes; }
const SwTableSortBoxes& GetTabSortBoxes() const { return aSortCntBoxes; }
- // lese die 1. Nummer und loesche sie aus dem String
- // (wird von GetTblBox und SwTblFld benutzt)
+ // Read 1st number and delete it from string (used by GetTblBox and SwTblFld).
+
// #i80314#
// add 3rd parameter in order to control validation check on <rStr>
static sal_uInt16 _GetBoxNum( String& rStr,
sal_Bool bFirst = sal_False,
const bool bPerformValidCheck = false );
- // suche die Inhaltstragende Box mit dem Namen
+
+ // Search content-bearing box with that name.
+
// #i80314#
// add 2nd parameter in order to control validation check in called method
// <_GetBoxNum(..)>
const SwTableBox* GetTblBox( const String& rName,
const bool bPerformValidCheck = false ) const;
- // kopiere die selektierten Boxen in ein anderes Dokument.
+ // Copy selected boxes to another document.
sal_Bool MakeCopy( SwDoc*, const SwPosition&, const SwSelBoxes&,
sal_Bool bCpyNds = sal_True, sal_Bool bCpyName = sal_False ) const;
- // kopiere die Tabelle in diese. (die Logik steht im TBLRWCL.CXX)
+ // Copy table in this (implemented in TBLRWCL.CXX).
sal_Bool InsTable( const SwTable& rCpyTbl, const SwNodeIndex&,
SwUndoTblCpyTbl* pUndo = 0 );
sal_Bool InsTable( const SwTable& rCpyTbl, const SwSelBoxes&,
SwUndoTblCpyTbl* pUndo = 0 );
sal_Bool InsNewTable( const SwTable& rCpyTbl, const SwSelBoxes&,
SwUndoTblCpyTbl* pUndo );
- // kopiere die Headline (mit Inhalt!) der Tabelle in eine andere
+ // Copy headline of table (with content!) into an other one.
sal_Bool CopyHeadlineIntoTable( SwTableNode& rTblNd );
- // erfrage die Box, dessen Start-Index auf nBoxStt steht
+ // Get box, whose start index is set on nBoxStt.
SwTableBox* GetTblBox( sal_uLong nSttIdx );
const SwTableBox* GetTblBox( sal_uLong nSttIdx ) const
{ return ((SwTable*)this)->GetTblBox( nSttIdx ); }
- // returnt sal_True wenn sich in der Tabelle Verschachtelungen befinden
+ // Returns sal_True if table contains nestings.
sal_Bool IsTblComplex() const;
- //returnt sal_True wenn die Tabelle oder Selektion ausgeglichen ist
+ // Returns sal_True if table or selection is balanced.
sal_Bool IsTblComplexForChart( const String& rSel,
SwChartLines* pGetCLines = 0 ) const;
- // suche alle Inhaltstragenden-Boxen der Grundline in der diese Box
+ // Search all content-bearing boxes of the base line on which this box stands.
+ // rBoxes as a return value for immediate use.
// steht. rBoxes auch als Return-Wert, um es gleich weiter zu benutzen
- //JP 31.01.97: bToTop = sal_True -> hoch bis zur Grundline,
- // sal_False-> sonst nur die Line der Box
+ // bToTop = sal_True -> up to base line, sal_False-> else only line of box.
SwSelBoxes& SelLineFromBox( const SwTableBox* pBox,
SwSelBoxes& rBoxes, sal_Bool bToTop = sal_True ) const;
- // erfrage vom Client Informationen
+
+ // Get information from client.
virtual sal_Bool GetInfo( SfxPoolItem& ) const;
- // suche im Format nach der angemeldeten Tabelle
+ // Search in format for registered table.
static SwTable * FindTable( SwFrmFmt const*const pFmt );
- // Struktur ein wenig aufraeumen
+ // Clean up structure a bit.
void GCLines();
- // returns the table node via aSortCntBoxes or pTableNode
+ // Returns the table node via aSortCntBoxes or pTableNode.
SwTableNode* GetTableNode() const;
void SetTableNode( SwTableNode* pNode ) { pTableNode = pNode; }
- // Daten Server-Methoden
+ // Data server methods.
void SetRefObject( SwServerObject* );
const SwServerObject* GetObject() const { return &refObj; }
SwServerObject* GetObject() { return &refObj; }
- //Daten fuer das Chart fuellen.
+ // Fill data for chart.
void UpdateCharts() const;
TblChgMode GetTblChgMode() const { return eTblChgMode; }
@@ -328,7 +331,7 @@ public:
#endif
};
-class SW_DLLPUBLIC SwTableLine: public SwClient // Client vom FrmFmt
+class SW_DLLPUBLIC SwTableLine: public SwClient // Client of FrmFmt.
{
SwTableBoxes aBoxes;
SwTableBox *pUpper;
@@ -352,11 +355,11 @@ public:
SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)GetRegisteredIn(); }
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
- //Macht ein eingenes FrmFmt wenn noch mehr Lines von ihm abhaengen.
+ // Creates a own FrmFmt if more lines depend on it.
SwFrmFmt* ClaimFrmFmt();
void ChgFrmFmt( SwTableLineFmt* pNewFmt );
- // suche nach der naechsten/vorherigen Box mit Inhalt
+ // Search next/previous box with content.
SwTableBox* FindNextBox( const SwTable&, const SwTableBox* =0,
sal_Bool bOvrTblLns=sal_True ) const;
SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* =0,
@@ -368,23 +371,23 @@ public:
void RegisterToFormat( SwFmt& rFmt );
};
-class SW_DLLPUBLIC SwTableBox: public SwClient //Client vom FrmFmt
+class SW_DLLPUBLIC SwTableBox: public SwClient //Client of FrmFmt.
{
- friend class SwNodes; // um den Index umzusetzen !
- friend void DelBoxNode(SwTableSortBoxes&); // um den StartNode* zu loeschen !
+ friend class SwNodes; // Transpose index.
+ friend void DelBoxNode(SwTableSortBoxes&); // Delete StartNode* !
friend class SwXMLTableContext;
- //nicht (mehr) implementiert.
+ // Not implemented (any more).
SwTableBox( const SwTableBox & );
- SwTableBox &operator=( const SwTableBox &); //gibts nicht.
+ SwTableBox &operator=( const SwTableBox &); // Does not exist.
SwTableLines aLines;
const SwStartNode * pSttNd;
SwTableLine *pUpper;
SwTableBox_Impl* pImpl;
- // falls das Format schon Formeln/Values enthaelt, muss ein neues
- // fuer die neue Box erzeugt werden.
+ // In case Format contains formulas/values already,
+ // a new one must be created for the new box.
SwTableBoxFmt* CheckBoxFmt( SwTableBoxFmt* );
public:
@@ -407,7 +410,7 @@ public:
SwFrmFmt* GetFrmFmt() { return (SwFrmFmt*)GetRegisteredIn(); }
SwFrmFmt* GetFrmFmt() const { return (SwFrmFmt*)GetRegisteredIn(); }
- //Macht ein eingenes FrmFmt wenn noch mehr Boxen von ihm abhaengen.
+ // Creates its own FrmFmt if more boxes depend on it.
SwFrmFmt* ClaimFrmFmt();
void ChgFrmFmt( SwTableBoxFmt *pNewFmt );
@@ -419,30 +422,30 @@ public:
{ return pSttNd ? pSttNd->GetIndex() : 0; }
#endif
- // suche nach der naechsten/vorherigen Box mit Inhalt
+ // Search next/previous box with content.
SwTableBox* FindNextBox( const SwTable&, const SwTableBox* =0,
sal_Bool bOvrTblLns=sal_True ) const;
SwTableBox* FindPreviousBox( const SwTable&, const SwTableBox* =0,
sal_Bool bOvrTblLns=sal_True ) const;
- // gebe den Namen dieser Box zurueck. Dieser wird dynamisch bestimmt
- // und ergibt sich aus der Position in den Lines/Boxen/Tabelle
+ // Return name of this box. It is determined dynamically and
+ // is calculated from the position in the lines/boxes/table.
String GetName() const;
- // gebe den "Wert" der Box zurueck (fuers rechnen in der Tabelle)
+ // Return "value" of box (for calculating in table).
double GetValue( SwTblCalcPara& rPara ) const;
sal_Bool IsInHeadline( const SwTable* pTbl = 0 ) const;
- // enthaelt die Box Inhalt, der als Nummer formatiert werden kann?
+ // Contains box contents, that can be formated as a number?
sal_Bool HasNumCntnt( double& rNum, sal_uInt32& rFmtIndex,
sal_Bool& rIsEmptyTxtNd ) const;
sal_uLong IsValidNumTxtNd( sal_Bool bCheckAttr = sal_True ) const;
- // teste ob der BoxInhalt mit der Nummer uebereinstimmt, wenn eine
- // Tabellenformel gesetzt ist. (fuers Redo des Change vom NumFormat!)
+ // If a table formula is set, test if box contents is congruent with number.
+ // (For Redo of change of NumFormat!).
sal_Bool IsNumberChanged() const;
- // ist das eine FormelBox oder eine Box mit numerischen Inhalt (AutoSum)
- // Was es ist, besagt der ReturnWert - die WhichId des Attributes
- // Leere Boxen haben den ReturnWert USHRT_MAX !!
+ // Is that a formula box or a box with numeric contents (AutoSum)?
+ // What it is is indicated by the return value - the WhichId of the attribute.
+ // Empty boxes have the return value USHRT_MAX !!
sal_uInt16 IsFormulaOrValueBox() const;
// Loading of a document requires an actualisation of cells with values
@@ -450,7 +453,7 @@ public:
DECL_FIXEDMEMPOOL_NEWDEL(SwTableBox)
- // zugriff auf interne Daten - z.Z. benutzt fuer den NumFormatter
+ // Access on internal data - currently used for the NumFormatter.
inline const Color* GetSaveUserColor() const;
inline const Color* GetSaveNumFmtColor() const;
inline void SetSaveUserColor(const Color* p );
diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index eb93754427..e723563738 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -48,7 +48,7 @@ protected:
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
+ TYPEINFO(); // Already in base class Content.
DECL_FIXEDMEMPOOL_NEWDEL(SwTableFmt)
};
@@ -68,7 +68,7 @@ protected:
{}
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
+ TYPEINFO(); // Already in base class Content.
DECL_FIXEDMEMPOOL_NEWDEL(SwTableLineFmt)
};
@@ -87,11 +87,11 @@ protected:
: SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
{}
- // zum Erkennen von Veraenderungen (haupts. TableBoxAttribute)
+ // For recognition of changes (especially TableBoxAttribute).
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue );
public:
- TYPEINFO(); //Bereits in Basisklasse Client drin.
+ TYPEINFO(); // Already in base class Content.
DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt)
};
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 6229fc4f7f..a820e85532 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -31,13 +31,10 @@
#include <SwGetPoolIdFromName.hxx>
#ifndef INCLUDED_LIMITS_H
-#include <limits.h> //fuer LONG_MAX
+#include <limits.h> //For LONG_MAX.
#define INCLUDED_LIMITS_H
#endif
-#ifdef PM20
-#include <stdlib.h>
-#endif
#include <com/sun/star/uno/Reference.h>
#include "swdllapi.h"
#include <i18npool/lang.h>
@@ -72,74 +69,72 @@ typedef long SwTwips;
#define INVALID_TWIPS LONG_MAX
#define TWIPS_MAX (LONG_MAX - 1)
-#define MM50 283 // 1/2 cm in TWIPS
+#define MM50 283 // 1/2 cm in TWIPS.
const SwTwips cMinHdFtHeight = 56;
-#define MINFLY 23 //Minimalgroesse fuer FlyFrms
-#define MINLAY 23 //Minimalgroesse anderer Frms
+#define MINFLY 23 // Minimal size for FlyFrms.
+#define MINLAY 23 // Minimal size for other Frms.
-// Default-Spaltenabstand zweier Textspalten entspricht 0.3 cm
+// Default column distance of two text columns corresponds to 0.3 cm.
#define DEF_GUTTER_WIDTH (MM50 / 5 * 3)
-//Minimale Distance (Abstand zum Text) fuer das BorderAttribut, damit
-//die aligned'en Linien nicht geplaettet werden.
-//28 Twips == 0,4mm
+// Minimal distance (distance to text) for border attribute
+// in order not to crock up aligned lines.
+// 28 Twips == 0,4mm
#define MIN_BORDER_DIST 28
- /* minimaler Dokmentrand */
+// Minimal document border.
const SwTwips lMinBorder = 1134;
-//Die Wiesenbreite links neben und ueber dem Dokument.
-//Die halbe Wiesenbreite ist der Abstand zwischen den Seiten.
+// Margin left and above document.
+// Half of it is gap between the pages.
#define DOCUMENTBORDER 568L
#define GAPBETWEENPAGES 284L
-//initiale UndoActionCount
#define UNDO_ACTION_COUNT 20
-// Konstante Strings
-SW_DLLPUBLIC extern UniString aEmptyStr; // ""
-extern ByteString aEmptyByteStr; // ""
-SW_DLLPUBLIC extern UniString aDotStr; // '.'
+// Constant strings.
+SW_DLLPUBLIC extern UniString aEmptyStr; // ""
+extern ByteString aEmptyByteStr; // ""
+SW_DLLPUBLIC extern UniString aDotStr; // '.'
-//Zum Einfuegen von Beschriftungen (wie bzw. wo soll eingefuegt werden).
-//Hier weil ein eigenes hxx nicht lohnt und es sonst nirgendwo so recht
-//hinpasst.
+// For inserting of captions (what and where to insert).
+// It's here because it is not big enough to justify its own hxx
+// and does not seem to fit somewhere else.
enum SwLabelType
{
- LTYPE_TABLE, //Beschriftung einer Tabelle
- LTYPE_OBJECT, //Beschriftung von Grafik oder OLE
- LTYPE_FLY, //Beschriftung eines (Text-)Rahmens
- LTYPE_DRAW //Beschriftung eines Zeichen-Objektes
+ LTYPE_TABLE, // Caption for a table.
+ LTYPE_OBJECT, // Caption for a graphic or OLE.
+ LTYPE_FLY, // Caption for a text frame.
+ LTYPE_DRAW // Caption for a draw object.
};
const sal_uInt8 OLD_MAXLEVEL = 5;
-const sal_uInt8 MAXLEVEL = 10; //Ehemals numrule.hxx
-const sal_uInt8 NO_NUM = 200; //Ehemals numrule.hxx
+const sal_uInt8 MAXLEVEL = 10; // Was: numrule.hxx.
+const sal_uInt8 NO_NUM = 200; // Was: numrule.hxx.
+
-// fuer Absaetze mit NO_NUM aber auf unterschiedlichen Leveln
-// DAMIT entfaellt das NO_NUM !!!!
-const sal_uInt8 NO_NUMLEVEL = 0x20; // wird mit den Levels verodert
+// For paragraphs with NO_NUM but on different levels.
+// This makes the NO_NUM inapplicable.
+const sal_uInt8 NO_NUMLEVEL = 0x20; // "or" with the levels.
-/*
- * Nette Funktionen als MACRO oder inline
- */
+// Some helper functions as macros or inlines.
-/* ein KiloByte sind 1024 Byte */
+// One kilobyte is 1024 bytes:
#define KB 1024
#define SET_CURR_SHELL( shell ) CurrShell aCurr( shell )
-// pPathFinder wird von der UI initialisiert. Die Klasse liefert alle
-// benoetigten Pfade.
+// pPathFinder is initialized by the UI.
+// The class delivers all paths needed.
extern SwPathFinder *pPathFinder;
-// Werte fuer die Einzuege an der Nummerierung und BulletListe
-// (fuer die weiteren Ebenen sind die Werte mit den Ebenen+1 zu
-// multiplizieren; Ebenen 0..4 !!!)
+// Values for indents at numbering and bullet lists.
+// (For more levels the values have to be multiplied with the levels+1;
+// levels 0 ..4!)
const sal_uInt16 lBullIndent = 1440/4;
const short lBullFirstLineOffset = -lBullIndent;
@@ -147,23 +142,24 @@ const sal_uInt16 lNumIndent = 1440/4;
const short lNumFirstLineOffset = -lNumIndent;
const short lOutlineMinTextDistance = 216; // 0.15 inch = 0.38 cm
-// Anzahl der SystemField-Types vom SwDoc
+// Count of SystemField-types of SwDoc.
#define INIT_FLDTYPES 32
-// Anzahl der vordefinierten Seq-Feldtypen. Es handelt sich dabei
-// immer um die letzen Felder vor INIT_FLDTYPES
+
+// Count of predefined Seq-field types. It is always the last
+// fields before INIT_FLDTYPES.
#define INIT_SEQ_FLDTYPES 4
-//Die ehemaligen Rendevouz-Ids leben weiter:
-//Es gibt Ids fuer die Anker (SwFmtAnchor) und ein paar weitere die nur fuer
-//Schnittstellen Bedeutung haben (SwDoc).
+// The former Rendevouz-IDs live on:
+// There are IDs for the anchors (SwFmtAnchor) and some others
+// that are only of importance for interfaces (SwDoc).
enum RndStdIds
{
- FLY_AT_PARA, // anchored at paragraph
- FLY_AS_CHAR, // anchored as character
- FLY_AT_PAGE, // anchored at page
- FLY_AT_FLY, // anchored at frame
- FLY_AT_CHAR, // anchored at character
- //Der Rest wird nur fuer SS benutzt.
+ FLY_AT_PARA, // Anchored at paragraph.
+ FLY_AS_CHAR, // Anchored as character.
+ FLY_AT_PAGE, // Anchored at page.
+ FLY_AT_FLY, // Anchored at frame.
+ FLY_AT_CHAR, // Anchored at character.
+
RND_STD_HEADER,
RND_STD_FOOTER,
RND_STD_HEADERL,
@@ -171,11 +167,11 @@ enum RndStdIds
RND_STD_FOOTERL,
RND_STD_FOOTERR,
- RND_DRAW_OBJECT // ein Draw-Object !! nur fuer die SwDoc-Schnittstelle!
+ RND_DRAW_OBJECT // A draw-Object! For the SwDoc-interface only!
};
-extern ResMgr* pSwResMgr; // steht in swapp0.cxx
+extern ResMgr* pSwResMgr; // Is in swapp0.cxx.
#define SW_RES(i) ResId(i,*pSwResMgr)
#define SW_RESSTR(i) UniString(ResId(i,*pSwResMgr))
@@ -188,22 +184,22 @@ extern ResMgr* pSwResMgr; // steht in swapp0.cxx
::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > GetLinguPropertySet();
-// reutns the twip size of this graphic
+// Returns the twip size of this graphic.
SW_DLLPUBLIC Size GetGraphicSizeTwip( const Graphic&, OutputDevice* pOutDev );
-// Seperator fuer Sprunge im Dokument auf verschiedene Inhalttype
+// Separator for jumps to different content types in document.
const sal_Unicode cMarkSeperator = '|';
-extern const sal_Char* pMarkToTable; // Strings stehen
-extern const sal_Char* pMarkToFrame; // im Init.cxx
+extern const sal_Char* pMarkToTable; // Strings are
+extern const sal_Char* pMarkToFrame; // in Init.cxx.
extern const sal_Char* pMarkToRegion;
SW_DLLPUBLIC extern const sal_Char* pMarkToOutline;
extern const sal_Char* pMarkToText;
extern const sal_Char* pMarkToGraphic;
extern const sal_Char* pMarkToOLE;
-#ifndef DB_DELIM // Ist in OFA definiert!!!
-#define DB_DELIM ((sal_Unicode)0xff) // Datenbank <-> Tabellen-Trenner
+#ifndef DB_DELIM // This is defined in OFA!
+#define DB_DELIM ((sal_Unicode)0xff) // Database <-> table separator.
#endif
@@ -211,23 +207,23 @@ typedef sal_uInt16 SetAttrMode;
namespace nsSetAttrMode
{
- const SetAttrMode SETATTR_DEFAULT = 0x0000; // default
- const SetAttrMode SETATTR_DONTEXPAND = 0x0001; // TextAttribute nicht weiter expand.
- const SetAttrMode SETATTR_DONTREPLACE = 0x0002; // kein anderes TextAttrib verdraengen
-
- const SetAttrMode SETATTR_NOTXTATRCHR = 0x0004; // bei Attr ohne Ende kein 0xFF einfuegen
- const SetAttrMode SETATTR_NOHINTADJUST = 0x0008; // keine Zusammenfassung von Bereichen.
- const SetAttrMode SETATTR_NOFORMATATTR = 0x0010; // nicht zum FormatAttribut umwandeln
- const SetAttrMode SETATTR_DONTCHGNUMRULE = 0x0020; // nicht die NumRule veraendern
- const SetAttrMode SETATTR_APICALL = 0x0040; // called from API (all UI related
- // functionality will be disabled)
- /// force hint expand (only matters for hints with CH_TXTATR)
+ const SetAttrMode SETATTR_DEFAULT = 0x0000; // Default.
+ const SetAttrMode SETATTR_DONTEXPAND = 0x0001; // Don't expand text attribute any further.
+ const SetAttrMode SETATTR_DONTREPLACE = 0x0002; // Don't replace another text attribute.
+
+ const SetAttrMode SETATTR_NOTXTATRCHR = 0x0004; // Don't insert 0xFF at attributes with no end.
+ const SetAttrMode SETATTR_NOHINTADJUST = 0x0008; // No merging of ranges.
+ const SetAttrMode SETATTR_NOFORMATATTR = 0x0010; // Do not change into format attribute.
+ const SetAttrMode SETATTR_DONTCHGNUMRULE = 0x0020; // Do not change NumRule.
+ const SetAttrMode SETATTR_APICALL = 0x0040; // Called from API (all UI related
+ // functionality will be disabled).
+ /// Force hint expand (only matters for hints with CH_TXTATR).
const SetAttrMode SETATTR_FORCEHINTEXPAND= 0x0080;
- /// the inserted item is a copy -- intended for use in ndtxt.cxx
+ /// The inserted item is a copy -- intended for use in ndtxt.cxx.
const SetAttrMode SETATTR_IS_COPY = 0x0100;
}
-//Umrechnung Twip<-> 1/100 mm fuer UNO
+// Conversion Twip <-> 1/100 mm for UNO
#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
#define MM100_TO_TWIP(MM100) ((MM100) >= 0 ? (((MM100)*72L+63L)/127L) : (((MM100)*72L-63L)/127L))
@@ -253,7 +249,7 @@ namespace nsSetAttrMode
#define CHAR_ZWNBSP ((sal_Unicode)0x2060)
-// returns the APP - CharClass instance - used for all ToUpper/ToLower/...
+// Returns the APP - CharClass instance - used for all ToUpper/ToLower/...
SW_DLLPUBLIC CharClass& GetAppCharClass();
SW_DLLPUBLIC LanguageType GetAppLanguage();
@@ -274,60 +270,50 @@ SW_DLLPUBLIC CollatorWrapper& GetAppCaseCollator();
SW_DLLPUBLIC const ::utl::TransliterationWrapper& GetAppCmpStrIgnore();
-//fuer Prepare() zur Benachrichtigung des Inhaltes durch das Layout auf
-//dem kurzen Dienstweg.
-//Der Inhalt sorgt dafuer, dass beim naechsten Aufruf von ::Format() das
-//minimal notwendige berechnet wird.
+// Official shortcut for Prepare() regarding notification of Content by the Layout.
+// Content provides for calculation of minimal requirements at the next call of ::Format().
enum PrepareHint
{
- PREP_BEGIN, //BEGIN
- PREP_CLEAR = PREP_BEGIN,//Komplett neuformatieren.
- PREP_WIDOWS_ORPHANS, //Nur Witwen- und Waisen-Regelung pruefen und ggf.
- //Aufspalten.
- PREP_FIXSIZE_CHG, //Die FixSize hat sich veraendert.
- PREP_FOLLOW_FOLLOWS, //Follow ist jetzt moeglicherweise direkter
- //Nachbar.
- PREP_ADJUST_FRM, //Groesse per Grow/Shrink Ausrichten ohne zu
- //Formatieren.
- PREP_FLY_CHGD, //Ein FlyFrm hat sich (Groesse) veraendert.
- PREP_FLY_ATTR_CHG, //Ein FlyFrm hat seine Attribute veraendert
- //(z.B. Umlauf)
- PREP_FLY_ARRIVE, //Ein FlyFrm ueberlappt den Bereich jetzt neu.
- PREP_FLY_LEAVE, //Ein FlyFrm hat den Bereich verlassen.
- PREP_FTN, //Fussnoten-Invalidierung
- PREP_POS_CHGD, //Position des Frm hat sich verandert
- //(Zum Fly-Umbruch pruefen). Im void* des Prepare()
- //wird ein sal_Bool& uebergeben, dieser zeigt mit sal_True,
- //dass ein Format ausgefuehrt wurde.
- PREP_UL_SPACE, //UL-Space hat sich veraendert, TxtFrms muessen
- //den Zeilenabstand neu kalkulieren.
- PREP_MUST_FIT, //Frm passen machen (aufspalten) auch wenn die
- //Attribute es nicht erlauben (z.B. zusammenhalten).
- PREP_WIDOWS, // Ein Follow stellt fest, dass in ihm die Orphans-
- // regel zuschlaegt und verschickt an seinen
- // Vorgaenger (Master/Follow) ein PREP_WIDOWS
- PREP_QUOVADIS, // Wenn eine Fussnote _zwischen_ zwei Absaetzen
- // aufgespalten werden muss, dann muss der
- // letzte auf der Seite noch ein QUOVADIS bekommen
- // damit er den Text hineinformatiert.
- PREP_BOSS_CHGD, // Wenn ein Frm die Spalte/Seite wechselt, wird dieses
- // Zusatzprepare zum POS_CHGD im MoveFwd/Bwd
- // verschickt (Ftn-Nummern joinen etc.)
- // Die Richtung wird ueber pVoid mitgeteilt:
+ PREP_BEGIN, // BEGIN.
+ PREP_CLEAR = PREP_BEGIN,// Reformat completely.
+ PREP_WIDOWS_ORPHANS, // Only check for widows and orphans and split in case of need.
+ PREP_FIXSIZE_CHG, // FixSize has changed.
+ PREP_FOLLOW_FOLLOWS, // Follow is now possibly adjacent.
+ PREP_ADJUST_FRM, // Adjust size via grow/shrink without formating.
+ PREP_FLY_CHGD, // A FlyFrm has changed its size.
+ PREP_FLY_ATTR_CHG, // A FlyFrm hat has changed its attributes
+ // (e. g. wrap).
+ PREP_FLY_ARRIVE, // A FlyFrm now overlaps range.
+ PREP_FLY_LEAVE, // A FlyFrm has left range.
+ PREP_FTN, // Invalidation of footnotes.
+ PREP_POS_CHGD, // Position of Frm has changed.
+ // (Check for Fly-break). In void* of Prepare()
+ // a sal_Bool& is passed. If this is sal_True,
+ // it indicateds that a format has been executed.
+ PREP_UL_SPACE, // UL-Space has changed, TxtFrms have to
+ // re-calculate line space.
+ PREP_MUST_FIT, // Make frm fit (split) even if the attributes do
+ // not allow that (e.g. "keep together").
+ PREP_WIDOWS, // A follow realizes that the orphan rule will be applied
+ // for it and sends a PREP_WIDOWS to its predecessor
+ // (Master/Follow).
+ PREP_QUOVADIS, // If a footnote has to be split between two paragraphs
+ // the last on the page has to receive a QUOVADIS in or-
+ // der to format the text into it.
+ PREP_BOSS_CHGD, // If a Frm changes its column/page this additional
+ // Prepare is sended to POS_CHGD in MoveFwd/Bwd
+ // (join Ftn-numbers etc.)
+ // Direction is communicated via pVoid:
// MoveFwd: pVoid == 0
// MoveBwd: pVoid == pOldPage
- PREP_SWAP, //Grafiken Swappen, fuer Grafiken im sichtbaren
- //Bereich.
- PREP_REGISTER, //Registerhaltige Frames invalidieren
- PREP_FTN_GONE, //Ein Follow verliert eine Fussnote, ggf. kann seine erste
- //Zeile hochrutschen
- PREP_MOVEFTN, //eine Fussnote wechselt die Seite, der Inhalt bekommt
- //zunaechst eine Hoehe von Null, damit nicht zuviel
- //Unruhe entsteht. Beim Formatieren prueft er, ob er
- //ueberhaupt passt und wechselt ggf. unbemerkt wieder
- //die Seite.
- PREP_ERGOSUM, //wg. Bewegung in FtnFrms QuoVadis/ErgoSum pruefen
- PREP_END //END
+ PREP_SWAP, // Swap graphic; for graphics in visible area.
+ PREP_REGISTER, // Invalidate frames with registers.
+ PREP_FTN_GONE, // A Follow loses its footnote, possibly its first line can move up.
+ PREP_MOVEFTN, // A footnote changes its page. Its contents receives at first a
+ // height of zero in order to avoid too much noise. At formating
+ // it checks whether it fits and if necessary changes its page again.
+ PREP_ERGOSUM, // Needed because of movement in FtnFrms. Check QuoVadis/ErgoSum.
+ PREP_END // END.
};
#endif
diff --git a/sw/inc/swundo.hxx b/sw/inc/swundo.hxx
index 3d7715c8ec..68b29d06f8 100644
--- a/sw/inc/swundo.hxx
+++ b/sw/inc/swundo.hxx
@@ -36,15 +36,15 @@
typedef ::std::vector< ::rtl::OUString > SwUndoComments_t;
-// die Ids fuer StdAktionen
+// The IDs for StdActions.
enum SwUndoId
{
UNDO_EMPTY = 0,
UNDO_STD_BEGIN = 1,
UNDO_START = UNDO_STD_BEGIN, // 1
UNDO_END, // 2
- REPEAT_START, // alle UndoIds zwischen REPEAT_START und
- // REPEAT_END sind Repeat-Faehig !!
+ REPEAT_START, // All UndoIDs between REPEAT_START and
+ // REPEAT_END are Repeat-enabled !!
UNDO_DELETE = REPEAT_START, // 3
UNDO_INSERT, // 4
UNDO_OVERWRITE, // 5
@@ -138,7 +138,7 @@ enum SwUndoId
UNDO_CHANGE_PAGEDESC, // 89
UNDO_DELETE_PAGEDESC, // 90
UNDO_HEADER_FOOTER, // 91 #i7983#
- UNDO_FIELD, // 92
+ UNDO_FIELD, // 92
UNDO_TXTFMTCOL_CREATE, // 93
UNDO_TXTFMTCOL_DELETE, // 94
UNDO_TXTFMTCOL_RENAME, // 95
@@ -161,7 +161,6 @@ enum SwUndoId
// --> #i73249#
UNDO_FLYFRMFMT_TITLE, // 112
UNDO_FLYFRMFMT_DESCRIPTION, // 113
- // <--
UNDO_STD_END= UNDO_FLYFRMFMT_DESCRIPTION,
// UI undo ID's...
diff --git a/sw/inc/tabcol.hxx b/sw/inc/tabcol.hxx
index bc9e8b9a14..c873cba9df 100644
--- a/sw/inc/tabcol.hxx
+++ b/sw/inc/tabcol.hxx
@@ -41,31 +41,30 @@ struct SwTabColsEntry
long nPos;
long nMin;
long nMax;
- sal_Bool bHidden; //Fuer jeden Eintrag ein Flag, Hidden oder nicht.
- //Wenn das Flag Hidden sal_True ist liegt der Spalten-
- //trenner nicht in der aktuellen Zeile; er muss
- //mit gepflegt werden, darf aber nicht angezeigt
- //werden.
+ sal_Bool bHidden; // For each entry a flag, hidden or not.
+ // If the flag bHidden is sal_True column separator
+ // is not in current line. It must maintained
+ // but it may not be displayed.
};
typedef std::vector< SwTabColsEntry > SwTabColsEntries;
class SW_DLLPUBLIC SwTabCols
{
- long nLeftMin, //Linker aeusserer Rand (Bezugspunkt) in
- //Dokumentkordinaten.
- //Alle anderen Werte relativ zu diesem Punkt!
- nLeft, //Linker Rand der Tabelle.
- nRight, //Rechter Rand der Tabelle.
- nRightMax; //Maximaler rechter Rand der Tabelle.
-
- bool bLastRowAllowedToChange; // if the last row of the table frame
+ long nLeftMin, // Leftmost border (reference point) for
+ // document coordinates.
+ // All other values are relative to this point!
+ nLeft, // Left border of table.
+ nRight, // Right border of table.
+ nRightMax; // Maximum right border of table.
+
+ bool bLastRowAllowedToChange; // If the last row of the table frame
// is split across pages, it may not
- // change its size
+ // change its size.
SwTabColsEntries aData;
- //fuer den CopyCTor
+ //For the CopyCTor.
const SwTabColsEntries& GetData() const { return aData; }
public:
diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 69829db492..7e091d853a 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -30,15 +30,7 @@
/*************************************************************************
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-
- Die akt. Struktur der Autoformatierung darf nicht mehr veraendert werden.
- Diese wird durch unterschiedlichen Code vom StartWriter und vom StarCalc
- eingelesen/geschrieben.
- Sollte sich doch mal eine Aenderung nicht vermeiden lassen, dann auf
- jedenfall in beiden Applikationen aendern.
-
- The structure of table auto formatting should not changed. It is used
+ The structure of table auto formatting should not be changed. It is used
by different code of Writer and Calc. If a change is necessary, the
source code of both applications must be changed!
@@ -46,7 +38,7 @@
**************************************************************************/
#include <svl/svarray.hxx>
-#include "hintids.hxx" //_immmer_ vor den solar-items!
+#include "hintids.hxx" // _Always_ before the solar-items!
#include <svx/algitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/fhgtitem.hxx>
@@ -124,7 +116,7 @@ public:
int operator==( const SwBoxAutoFmt& rCmp ) const;
SwBoxAutoFmt& operator=( const SwBoxAutoFmt& rNew );
- // die Get-Methoden
+ // The get-methods.
const SvxFontItem &GetFont() const { return aFont; }
const SvxFontHeightItem &GetHeight() const { return aHeight; }
const SvxWeightItem &GetWeight() const { return aWeight; }
@@ -151,7 +143,7 @@ public:
void GetValueFormat( String& rFmt, LanguageType& rLng, LanguageType& rSys ) const
{ rFmt = sNumFmtString; rLng = eNumFmtLanguage; rSys = eSysLanguage; }
- // die SetMethoden
+ // The set-methods.
void SetFont( const SvxFontItem& rNew ) { aFont = rNew; }
void SetHeight( const SvxFontHeightItem& rNew ) { aHeight = rNew; }
void SetWeight( const SvxWeightItem& rNew ) { aWeight = rNew; }
@@ -186,27 +178,27 @@ public:
sal_Bool SaveVerionNo( SvStream& rStream ) const;
#ifdef READ_OLDVERS
- // lade alte Version
+ // load old version.
sal_Bool LoadOld( SvStream& rStream, sal_uInt16 aLoadVer[] );
#endif
};
class SW_DLLPUBLIC SwTableAutoFmt
{
- friend void _FinitCore(); // zum Zerstoeren des dflt. Pointers
+ friend void _FinitCore(); // To destroy dflt. pointer.
static SwBoxAutoFmt* pDfltBoxAutoFmt;
String aName;
sal_uInt16 nStrResId;
- // common flags of Calc and Writer
+ // Common flags of Calc and Writer.
sal_Bool bInclFont : 1;
sal_Bool bInclJustify : 1;
sal_Bool bInclFrame : 1;
sal_Bool bInclBackground : 1;
sal_Bool bInclValueFormat : 1;
- // Calc specific flags
+ // Calc specific flags.
sal_Bool bInclWidthHeight : 1;
SwBoxAutoFmt* aBoxAutoFmt[ 16 ];
@@ -247,7 +239,7 @@ public:
sal_Bool Save( SvStream& rStream ) const;
#ifdef READ_OLDVERS
- // load old versions
+ // Load old versions.
sal_Bool LoadOld( SvStream& rStream, sal_uInt16 aLoadVer[] );
#endif
};
diff --git a/sw/inc/tblenum.hxx b/sw/inc/tblenum.hxx
index 7fbe46ca7b..ecd5b14ae5 100644
--- a/sw/inc/tblenum.hxx
+++ b/sw/inc/tblenum.hxx
@@ -28,7 +28,8 @@
#ifndef _TBLENUM_HXX
#define _TBLENUM_HXX
-//fuers aendern der Tabellen/Spalten/Zeilen Breiten/Hoehen
+
+// For changing table columns/rows widths/heights.
typedef sal_uInt16 TblChgWidthHeightType;
namespace nsTblChgWidthHeightType
@@ -43,30 +44,29 @@ namespace nsTblChgWidthHeightType
const TblChgWidthHeightType WH_CELL_BOTTOM = 7;
- // folgende koennen hinein verodert werden
- const TblChgWidthHeightType WH_FLAG_INSDEL = 0x4000; // Insert/Del-Modus: das Bigger-Flag
- // besagt was passiert:
- // bBigger -> Box wird entfernt
- // !bBigger-> Box wird eingefuegt
- const TblChgWidthHeightType WH_FLAG_BIGGER = 0x8000; // Box wird groesser -> sonst kleiner
+ // The following can "or"ed into.
+ const TblChgWidthHeightType WH_FLAG_INSDEL = 0x4000; // Insert/Del-mode: the Bigger-Flag
+ // tells what happens:
+ // bBigger -> box gets removed.
+ // !bBigger-> box gets inserted.
+ const TblChgWidthHeightType WH_FLAG_BIGGER = 0x8000; // Box becomes larger -> else smaller.
}
enum TblChgMode
{
- TBLFIX_CHGABS, // Tabelle feste Breite, den Nachbar andern
- TBLFIX_CHGPROP, // Tabelle feste Breite, alle Nachbarn aendern
- TBLVAR_CHGABS // Tabelle variable, alle Nachbarn aendern
+ TBLFIX_CHGABS, // Table fixed width, change neighbour.
+ TBLFIX_CHGPROP, // Table fixed width, change all neighbours.
+ TBLVAR_CHGABS // Table variable, change all neighbours.
};
enum SplitTbl_HeadlineOption
{
- HEADLINE_NONE = 0, // lasse alles wie es ist
+ HEADLINE_NONE = 0, // Leave everything in place.
HEADLINE_BORDERCOPY, // von der davor obere Line der vorhergehen Line
- HEADLINE_CNTNTCOPY, // kopiere die 1. Line komplett mit Inhalt
- HEADLINE_BOXATTRCOPY, // kopiere von der 1. Line die Box Attribute
- HEADLINE_BOXATRCOLLCOPY // kopiere von der 1. Line die Box Attribute
- // und die Absatzvorlagen
+ HEADLINE_CNTNTCOPY, // Copy 1st line with all contents.
+ HEADLINE_BOXATTRCOPY, // Copy box attributs of 1st line.
+ HEADLINE_BOXATRCOLLCOPY // Copy box attributes and paragraph styles of 1st line.
};
enum TableMergeErr
diff --git a/sw/inc/tblsel.hxx b/sw/inc/tblsel.hxx
index 9c59cfb356..037736ec65 100644
--- a/sw/inc/tblsel.hxx
+++ b/sw/inc/tblsel.hxx
@@ -51,21 +51,20 @@ SV_DECL_PTRARR( SwCellFrms, SwCellFrm*, 16, 16 )
SV_DECL_PTRARR_SORT( SwSelBoxes, SwTableBoxPtr, 10, 20 )
-//Sucht alle Boxen zusammen, die in der Tabelle selektiert sind.
-//Je nach enum-Parameter wird die Selektion in der angegebenen Richtung
-//erweitert.
-//Die Boxen werden ueber das Layout zusammengsucht, es wird auch bei
-//aufgespaltenen Tabellen korrekt gearbeitet (siehe: MakeSelUnions()).
+// Collects all boxes in table that are selected.
+// Selection gets extended in given direction according to enum-parameter.
+// Boxes are collected via the Layout; works correctly if tables are split.
+// (Cf. MakeSelUnions().)
typedef sal_uInt16 SwTblSearchType;
namespace nsSwTblSearchType
{
- const SwTblSearchType TBLSEARCH_NONE = 0x1; // keine Erweiterung
- const SwTblSearchType TBLSEARCH_ROW = 0x2; // erweiter auf Zeilen
- const SwTblSearchType TBLSEARCH_COL = 0x3; // erweiter auf Spalten
+ const SwTblSearchType TBLSEARCH_NONE = 0x1; // No extension.
+ const SwTblSearchType TBLSEARCH_ROW = 0x2; // Extend to rows.
+ const SwTblSearchType TBLSEARCH_COL = 0x3; // Extend to columns.
- // als Flag zu den anderen Werten!!
- const SwTblSearchType TBLSEARCH_PROTECT = 0x8; // auch geschuetzte Boxen einsammeln
- const SwTblSearchType TBLSEARCH_NO_UNION_CORRECT = 0x10; // die zusammenges. Union nicht korrigieren
+ // As flag to the other values!
+ const SwTblSearchType TBLSEARCH_PROTECT = 0x8; // Collect protected boxes too.
+ const SwTblSearchType TBLSEARCH_NO_UNION_CORRECT = 0x10; // Do not correct collected Union.
}
SW_DLLPUBLIC void GetTblSel( const SwCrsrShell& rShell, SwSelBoxes& rBoxes,
@@ -74,60 +73,58 @@ SW_DLLPUBLIC void GetTblSel( const SwCrsrShell& rShell, SwSelBoxes& rBoxes,
void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
const SwTblSearchType = nsSwTblSearchType::TBLSEARCH_NONE );
-//wie vor, jedoch wird nicht von der Selektion sondern von den
-//Start- EndFrms ausgegangen.
+
+// As before, but don't start from selection but from Start- EndFrms.
void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
SwSelBoxes& rBoxes, SwCellFrms* pCells,
const SwTblSearchType = nsSwTblSearchType::TBLSEARCH_NONE );
-// Desgleichen nocheinmal direkt per PaM's
+// As before but directly via PaMs.
void GetTblSelCrs( const SwCrsrShell& rShell, SwSelBoxes& rBoxes );
void GetTblSelCrs( const SwTableCursor& rTblCrsr, SwSelBoxes& rBoxes );
-// suche fuer eine AutoSumme die beteiligten Boxen zusammen
+// Collect boxes relevant for auto sum.
sal_Bool GetAutoSumSel( const SwCrsrShell&, SwCellFrms& );
-// check if the SelBoxes contains protected Boxes
+// Check if the SelBoxes contains protected Boxes.
sal_Bool HasProtectedCells( const SwSelBoxes& rBoxes );
-// teste, ob die Selektion ausgeglichen ist
+// Check if selection is balanced.
SV_DECL_PTRARR( SwChartBoxes, SwTableBoxPtr, 16, 16)
SV_DECL_PTRARR_DEL( SwChartLines, SwChartBoxes*, 25, 50)
sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
SwChartLines* pGetCLines = 0 );
-// teste ob die Celle in die SSelection gehoert
-// (wurde eine Funktion, damit GetTblSel() und MakeTblCrsr() immer
-// das "gleiche Verstaendnis" fuer die Selektion haben)
+// Check if cell is part of SSelection.
+// (Became a function, in order to make sure that GetTblSel() and MakeTblCrsr()
+// have always the same concept of the selection.
sal_Bool IsFrmInTblSel( const SwRect& rUnion, const SwFrm* pCell );
-// bestimme die Boxen, die zusammen gefasst werden sollen.
-// Dabei wird auf Layout Basis das Rechteck "angepasst". D.H. es
-// werden Boxen zugefuegt wenn welche an den Seiten ueberlappen
-// Zusaetzlich wird die neue Box erzeugt und mit dem entsprechenden
-// Inhalt gefuellt.
+// Determine boxes to be merged.
+// In this process the rectangle gets "adapted" on the base of the layout,
+// i.e. boxes are added if some overlap at the sides.
+// Additionally a new box is created and filled with the relevant content.
void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
SwTableBox** ppMergeBox, SwUndoTblMerge* pUndo = 0 );
-// teste ob die selektierten Boxen ein gueltiges Merge erlauben
+// Check if selected boxes allow for a valid merge.
sal_uInt16 CheckMergeSel( const SwPaM& rPam );
sal_uInt16 CheckMergeSel( const SwSelBoxes& rBoxes );
sal_Bool IsEmptyBox( const SwTableBox& rBox, SwPaM& rPam );
-// teste ob ein Split oder InsertCol dazu fuehrt, das eine Box
-// kleiner als MINLAY wird.
+// Check if Split or InsertCol lead to a box becoming smaller than MINLAY.
sal_Bool CheckSplitCells( const SwCrsrShell& rShell, sal_uInt16 nDiv,
const SwTblSearchType = nsSwTblSearchType::TBLSEARCH_NONE );
sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
const SwTblSearchType = nsSwTblSearchType::TBLSEARCH_NONE );
-//Fuer das Arbeiten auf TabSelektion auch fuer aufgespaltene Tabellen.
+// For working on tab selection also for split tables.
class SwSelUnion
{
- SwRect aUnion; //Das die Sel umschliessende Rechteck.
- SwTabFrm *pTable; //Die (Follow-)Table zu der Union.
+ SwRect aUnion; // The rectangle enclosing the selection.
+ SwTabFrm *pTable; // The (Follow-)Table for the Union.
public:
SwSelUnion( const SwRect &rRect, SwTabFrm *pTab ) :
@@ -141,18 +138,18 @@ public:
SV_DECL_PTRARR_DEL( SwSelUnions, SwSelUnion*, 10, 20 )
-//Ermittelt die von einer Tabellenselektion betroffenen Tabellen und die
-//Union-Rechteckte der Selektionen - auch fuer aufgespaltene Tabellen.
-//Wenn ein Parameter != nsSwTblSearchType::TBLSEARCH_NONE uebergeben wird, so wird die
-//Selektion in der angegebenen Richtung erweitert.
+// Gets the tables involved in a table selection and the union-rectangles of the selections
+// - also for split tables.
+// If a parameter is passed that != nsSwTblSearchType::TBLSEARCH_NONE
+// the selection is extended in the given direction.
void MakeSelUnions( SwSelUnions&, const SwLayoutFrm *pStart,
const SwLayoutFrm *pEnd,
const SwTblSearchType = nsSwTblSearchType::TBLSEARCH_NONE );
-// -------------------------------------------------------------------
-// Diese Klassen kopieren die aktuelle Tabellen-Selektion (rBoxes)
-// unter Beibehaltung der Tabellen-Strubktur in eine eigene Struktur
+
+// These classes copy the current table selections (rBoxes) into a
+// separate structure while keeping the table structure.
class _FndBox;
class _FndLine;
@@ -166,7 +163,7 @@ class _FndBox
_FndLines aLines;
_FndLine* pUpper;
- SwTableLine *pLineBefore; //Zum Loeschen/Restaurieren des Layouts.
+ SwTableLine *pLineBefore; // For deleting/restoring the layout.
SwTableLine *pLineBehind;
public:
diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx
index 93b83a6d67..b3ec8371d5 100644
--- a/sw/inc/tox.hxx
+++ b/sw/inc/tox.hxx
@@ -73,7 +73,7 @@ class SW_DLLPUBLIC SwTOXMark
friend void _InitCore();
friend class SwTxtTOXMark;
- String aAltText; // Der Text des Eintrages ist unterschiedlich
+ String aAltText; // Text of caption is different.
String aPrimaryKey, aSecondaryKey;
// three more strings for phonetic sorting
@@ -459,7 +459,7 @@ namespace nsSwTOOElements
const SwTOOElements TOO_OTHER = 0x80;
}
-#define TOX_STYLE_DELIMITER ((sal_Unicode)0x01)
+#define TOX_STYLE_DELIMITER ((sal_Unicode)0x01)
/*--------------------------------------------------------------------
Description: Class for all indexes
@@ -543,12 +543,12 @@ public:
const String& GetStyleNames(sal_uInt16 nLevel) const
{
- DBG_ASSERT( nLevel < MAXLEVEL, "Which level?");
+ OSL_ENSURE( nLevel < MAXLEVEL, "Which level?");
return aStyleNames[nLevel];
}
void SetStyleNames(const String& rSet, sal_uInt16 nLevel)
{
- DBG_ASSERT( nLevel < MAXLEVEL, "Which level?");
+ OSL_ENSURE( nLevel < MAXLEVEL, "Which level?");
aStyleNames[nLevel] = rSet;
}
sal_Bool IsFromChapter() const { return bFromChapter;}
@@ -760,7 +760,7 @@ inline sal_uInt16 SwTOXBase::GetLevel() const
inline void SwTOXBase::SetTemplateName(const String& rName)
{
- DBG_WARNING("SwTOXBase::SetTemplateName obsolete");
+ OSL_FAIL("SwTOXBase::SetTemplateName obsolete");
aStyleNames[0] = rName;
}
diff --git a/sw/inc/txatbase.hxx b/sw/inc/txatbase.hxx
index 77de654c1b..ac16b48fe2 100644
--- a/sw/inc/txatbase.hxx
+++ b/sw/inc/txatbase.hxx
@@ -136,7 +136,7 @@ public:
};
-// --------------- Inline Implementierungen ------------------------
+// --------------- Inline Implementations ------------------------
inline const xub_StrLen* SwTxtAttr::GetEnd() const
{
diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx
index fbfcec6e4b..f8be8c39ba 100644
--- a/sw/inc/txtatr.hxx
+++ b/sw/inc/txtatr.hxx
@@ -32,7 +32,7 @@
#include <calbck.hxx>
-class SwTxtNode; // fuer SwTxtFld
+class SwTxtNode; // For SwTxtFld.
class SwCharFmt;
namespace sw {
@@ -51,7 +51,7 @@ public:
SwTxtCharFmt( SwFmtCharFmt& rAttr, xub_StrLen nStart, xub_StrLen nEnd );
virtual ~SwTxtCharFmt( );
- // werden vom SwFmtCharFmt hierher weitergeleitet (no derivation from SwClient!)
+ // Passed from SwFmtCharFmt (no derivation from SwClient!).
void ModifyNotification( const SfxPoolItem*, const SfxPoolItem* );
bool GetInfo( SfxPoolItem& rInfo ) const;
@@ -109,7 +109,7 @@ public:
SW_DLLPRIVATE void InitRuby(SwTxtNode & rNode);
- /// get and set TxtNode pointer
+ /// Get and set TxtNode pointer.
const SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
inline const SwTxtNode& GetTxtNode() const;
void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
@@ -119,7 +119,6 @@ public:
{ return (const_cast<SwTxtRuby*>(this))->GetCharFmt(); }
};
-// --------------- Inline Implementierungen ------------------------
inline const SwTxtNode& SwTxtRuby::GetTxtNode() const
{
diff --git a/sw/inc/txtflcnt.hxx b/sw/inc/txtflcnt.hxx
index b8c9543d68..ddde9a5527 100644
--- a/sw/inc/txtflcnt.hxx
+++ b/sw/inc/txtflcnt.hxx
@@ -36,7 +36,7 @@ class SwTxtNode;
class SwDoc;
// SWTXT_FLYCNT ********************************
-// Attribut fuer zeilengebundene Frames (ohne Endindex)
+// Attribute for line-bound frames (without end index).
class SwTxtFlyCnt : public SwTxtAttr
{
@@ -45,13 +45,13 @@ class SwTxtFlyCnt : public SwTxtAttr
public:
SwTxtFlyCnt( SwFmtFlyCnt& rAttr, xub_StrLen nStart );
- // Setzt den Anker im pFmt und
+ // Sets anchor in pFmt and
void SetAnchor( const SwTxtNode *pNode );
inline SwFlyInCntFrm *GetFlyFrm( const SwFrm *pCurrFrm );
inline const SwFlyInCntFrm *GetFlyFrm( const SwFrm *pCurrFrm ) const;
- // erzeugt sich ein neues FlyFrameFormat
+ // creates for itself a new FlyFrameFormat.
void CopyFlyFmt( SwDoc* pDoc );
};
diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx
index f126f95c5f..216ef34242 100644
--- a/sw/inc/txtftn.hxx
+++ b/sw/inc/txtftn.hxx
@@ -53,21 +53,22 @@ public:
void SetNumber( const sal_uInt16 nNumber, const String* = 0 );
void CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const;
- // get and set TxtNode pointer
+ // Get and set TxtNode pointer.
inline const SwTxtNode& GetTxtNode() const;
void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
- // lege eine neue leere TextSection fuer diese Fussnote an
+ // Create a new empty TextSection for this footnote.
void MakeNewTextSection( SwNodes& rNodes );
- // loesche die FtnFrame aus der Seite
+ // Delete the FtnFrame from page.
void DelFrms( const SwFrm* );
- // bedingten Absatzvorlagen checken
+
+ // Check conditional paragraph styles.
void CheckCondColl();
- // fuer die Querverweise auf Fussnoten
+ // For references to footnotes.
sal_uInt16 SetSeqRefNo();
- void SetSeqNo( sal_uInt16 n ) { m_nSeqNo = n; } // for Readers
+ void SetSeqNo( sal_uInt16 n ) { m_nSeqNo = n; } // For Readers.
sal_uInt16 GetSeqRefNo() const { return m_nSeqNo; }
static void SetUniqueSeqRefNo( SwDoc& rDoc );
diff --git a/sw/inc/txtrfmrk.hxx b/sw/inc/txtrfmrk.hxx
index fb4cda2cc8..a359ce6c88 100644
--- a/sw/inc/txtrfmrk.hxx
+++ b/sw/inc/txtrfmrk.hxx
@@ -33,7 +33,7 @@
class SwTxtNode;
// SWTXT_REFMARK *************************************
-// Attribut fuer Inhalts-/Positions-Referenzen im Text
+// Attribute for content-/position references in text.
class SwTxtRefMark : public SwTxtAttrEnd
{
diff --git a/sw/inc/txttxmrk.hxx b/sw/inc/txttxmrk.hxx
index cd2e690129..a864dfa107 100644
--- a/sw/inc/txttxmrk.hxx
+++ b/sw/inc/txttxmrk.hxx
@@ -34,7 +34,7 @@ class SwTxtNode;
class SwDoc;
// SWTXT_TOXMARK *******************************
-// Attribut fuer die Verzeichnisse
+// Attribute for indices/tables of contents.
class SwTxtTOXMark : public SwTxtAttrEnd
{
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 229d167369..a2e9cf8829 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -114,14 +114,14 @@ public:
*/
virtual String GetComment() const;
- // das UndoObject merkt sich, welcher Mode eingeschaltet war.
- // In Undo/Redo/Repeat wird dann immer auf diesen zurueck geschaltet
+ // UndoObject remembers which mode was turned on.
+ // In Undo/Redo/Repeat this remembered mode is switched on.
sal_uInt16 GetRedlineMode() const { return nOrigRedlineMode; }
void SetRedlineMode( sal_uInt16 eMode ) { nOrigRedlineMode = eMode; }
bool IsDelBox() const;
- // sicher und setze die RedlineDaten
+ // Save and set Redline data.
static sal_Bool FillSaveData( const SwPaM& rRange, SwRedlineSaveDatas& rSData,
sal_Bool bDelRange = sal_True, sal_Bool bCopyNext = sal_True );
static sal_Bool FillSaveDataForFmt( const SwPaM& , SwRedlineSaveDatas& );
@@ -145,20 +145,20 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
SwPosition const & rStart, SwPosition const & rEnd,
DelCntntType const nDelCntntType = nsDelCntntType::DELCNT_ALL);
-// diese Klasse muss in ein Undo-Object vererbt werden, wenn dieses Inhalt
-// fuers Redo/Undo ... speichert
+
+// This class has to be inherited into an Undo-object if it saves content
+// for Redo/Undo...
class SwUndoSaveCntnt
{
protected:
SwHistory* pHistory;
- // wird fuer das loeschen von Inhalt benoetigt. Fuer das ReDo werden
- // Inhalte in das UndoNodesArray verschoben. Diese Methoden fuegen
- // am Ende eines TextNodes ein Trenner fuer die Attribute. Damit werden
- // Attribute nicht expandiert.
- // MoveTo.. verschiebt aus dem NodesArray in das UndoNodesArray
- // MoveFrom.. verschiebt aus dem UndoNodesArray in das NodesArray
+ // Needed for deletion of content. For Redo content is moved into the
+ // UndoNodesArray. These methods insert a separator for the attributes
+ // at the end of a TextNode. So the attributes do not get expanded.
+ // MoveTo: moves from the NodesArray into the UndoNodesArray.
+ // MoveFrom: moves from the UndoNodesArray into the NodesArray.
void MoveToUndoNds( SwPaM& rPam,
SwNodeIndex* pNodeIdx = 0, SwIndex* pCntIdx = 0,
sal_uLong* pEndNdIdx = 0, xub_StrLen * pEndCntIdx = 0 );
@@ -166,15 +166,15 @@ protected:
SwPosition& rInsPos,
sal_uLong* pEndNdIdx = 0, xub_StrLen * pEndCntIdx = 0 );
- // diese beiden Methoden bewegen den SPoint vom Pam zurueck/vor. Damit
- // kann fuer ein Undo/Redo ein Bereich aufgespannt werden. (Der
- // SPoint liegt dann vor dem manipuliertem Bereich !!)
- // Das Flag gibt an, ob noch vorm SPoint Inhalt steht.
+ // These two methods move the SPoint back/forth from PaM. With it
+ // a range can be spanned for Undo/Redo. (In this case the SPoint
+ // is before the manipulated range!!)
+ // The flag indicates if there is content before the SPoint.
sal_Bool MovePtBackward( SwPaM& rPam );
void MovePtForward( SwPaM& rPam, sal_Bool bMvBkwrd );
- // vor dem Move ins UndoNodes-Array muss dafuer gesorgt werden, das
- // die Inhaltstragenden Attribute aus dem Nodes-Array entfernt werden.
+ // Before moving stuff into UndoNodes-Array care has to be taken that
+ // the content-bearing attributes are removed from the nodes-array.
void DelCntntIndex( const SwPosition& pMark, const SwPosition& pPoint,
DelCntntType nDelCntntType = nsDelCntntType::DELCNT_ALL );
@@ -183,12 +183,12 @@ public:
~SwUndoSaveCntnt();
};
-// sicher eine vollstaendige Section im Nodes-Array
+// Save a complete section in nodes-array.
class SwUndoSaveSection : private SwUndoSaveCntnt
{
SwNodeIndex *pMvStt;
SwRedlineSaveDatas* pRedlSaveData;
- sal_uLong nMvLen; // Index ins UndoNodes-Array
+ sal_uLong nMvLen; // Index into UndoNodes-Array.
sal_uLong nStartPos;
protected:
@@ -208,8 +208,9 @@ public:
SwHistory* GetHistory() { return pHistory; }
};
-// Diese Klasse speichert den Pam als sal_uInt16's und kann diese wieder zu
-// einem PaM zusammensetzen
+
+// This class saves the PaM as sal_uInt16's and is able to restore it
+// into a PaM.
class SwUndRng
{
public:
@@ -238,8 +239,8 @@ class SwUndoInserts : public SwUndo, public SwUndRng, private SwUndoSaveCntnt
sal_Bool bSttWasTxtNd;
protected:
sal_uLong nNdDiff;
- SwPosition *pPos; // Inhalt fuers Redo
- sal_uInt16 nSetPos; // Start in der History-Liste
+ SwPosition *pPos; // Content for Redo.
+ sal_uInt16 nSetPos; // Start in the history list.
SwUndoInserts( SwUndoId nUndoId, const SwPaM& );
public:
@@ -249,7 +250,7 @@ public:
virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual void RepeatImpl( ::sw::RepeatContext & );
- // setze den Destination-Bereich nach dem Einlesen.
+ // Set destination range after reading.
void SetInsertRange( const SwPaM&, sal_Bool bScanFlys = sal_True,
sal_Bool bSttWasTxtNd = sal_True );
};
@@ -271,11 +272,11 @@ public:
class SwUndoFlyBase : public SwUndo, private SwUndoSaveSection
{
protected:
- SwFrmFmt* pFrmFmt; // das gespeicherte FlyFormat
+ SwFrmFmt* pFrmFmt; // The saved FlyFormat.
sal_uLong nNdPgPos;
- xub_StrLen nCntPos; // Seite/am Absatz/im Absatz
+ xub_StrLen nCntPos; // Page at/in paragraph.
sal_uInt16 nRndId;
- sal_Bool bDelFmt; // loesche das gespeicherte Format
+ sal_Bool bDelFmt; // Delete saved format.
void InsFly(::sw::UndoRedoContext & rContext, bool bShowSel = true);
void DelFly( SwDoc* );
diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx
index 954a3282d5..85a864e92b 100644
--- a/sw/inc/unobaseclass.hxx
+++ b/sw/inc/unobaseclass.hxx
@@ -91,9 +91,6 @@ class UnoActionRemoveContext
~UnoActionRemoveContext();
};
-
-::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId();
-
/// helper function for implementing SwClient::Modify
void ClientModify(SwClient* pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew);
diff --git a/sw/inc/unocrsr.hxx b/sw/inc/unocrsr.hxx
index 5f3b752bd0..e6d64b3d87 100644
--- a/sw/inc/unocrsr.hxx
+++ b/sw/inc/unocrsr.hxx
@@ -49,8 +49,8 @@ protected:
public:
- // gibt es eine Selection vom Content in die Tabelle
- // Return Wert gibt an, ob der Crsr auf der alten Position verbleibt
+ // Does a selection of content exist in table?
+ // Return value indicates if the cursor remains at its old position.
virtual sal_Bool IsSelOvr( int eFlags =
( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE |
@@ -81,9 +81,9 @@ public:
class SwUnoTableCrsr : public virtual SwUnoCrsr, public virtual SwTableCursor
{
- // die Selection hat die gleiche Reihenfolge wie die
- // TabellenBoxen. D.h., wird aus dem einen Array an einer Position
- // etwas geloescht, dann muss es auch im anderen erfolgen!!
+ // The selection has the same order as the table boxes, i.e.
+ // if something is deleted from the one array at a certain position
+ // it has also to be deleted from the other!
SwCursor aTblSel;
using SwTableCursor::MakeBoxSels;
@@ -92,8 +92,8 @@ public:
SwUnoTableCrsr( const SwPosition& rPos );
virtual ~SwUnoTableCrsr();
- // gibt es eine Selection vom Content in die Tabelle
- // Return Wert gibt an, ob der Crsr auf der alten Position verbleibt
+ // Does a selection of content exist in table?
+ // Return value indicates if the cursor remains at its old position.
virtual sal_Bool IsSelOvr( int eFlags =
( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE |
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index 992061334c..a563319d89 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -47,17 +47,14 @@
class SdrMarkList;
class SdrView;
class SwDoc;
-/******************************************************************************
- *
- ******************************************************************************/
+
class SwFmDrawPage : public SvxFmDrawPage
{
SdrPageView* pPageView;
protected:
- // Erzeugen eines SdrObjects anhand einer Description. Kann von
- // abgeleiteten Klassen dazu benutzt werden, eigene ::com::sun::star::drawing::Shapes zu
- // unterstuetzen (z.B. Controls)
+ // Create a SdrObject according to a description. Can be used by derived classes to
+ // support own ::com::sun::star::drawing::Shapes (e.g. controls).
virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape ) throw ();
public:
@@ -72,9 +69,9 @@ public:
void RemovePageView();
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetInterface( SdrObject* pObj );
- // Die folgende Methode wird gerufen, wenn ein SvxShape-Objekt angelegt
- // werden soll. abgeleitete Klassen koennen hier eine Ableitung oder
- // ein ein SvxShape aggregierendes Objekt anlegen.
+ // The following method is called when a SvxShape-object is to be created.
+ // Derived classes may obtain at this point a derivation or an object
+ // that is aggregating a SvxShape.
virtual ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > _CreateShape( SdrObject *pObj ) const throw ();
};
diff --git a/sw/inc/unoevtlstnr.hxx b/sw/inc/unoevtlstnr.hxx
index 5f6556839d..7bbc23251a 100644
--- a/sw/inc/unoevtlstnr.hxx
+++ b/sw/inc/unoevtlstnr.hxx
@@ -37,9 +37,9 @@ namespace com{namespace sun{namespace star{
class XEventListener;
}
}}}
-/*
- * Verwaltung der EventListener
- * */
+
+// Managing the EventListeners.
+
typedef ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > * XEventListenerPtr;
SV_DECL_PTRARR(SwEvtLstnrArray, XEventListenerPtr, 4, 4)
diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index ba373c92d8..36d41a9eb6 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -166,7 +166,7 @@
#define WID_SECT_EDIT_IN_READONLY 8013
-//Verzeichnisse
+// Indices/Tables of content
#define WID_PRIMARY_KEY 1000
#define WID_SECONDARY_KEY 1001
#define WID_ALT_TEXT 1002
@@ -230,7 +230,7 @@
#define WID_PRIMARY_KEY_READING 1059
#define WID_SECONDARY_KEY_READING 1060
-//text document
+// Text document
#define WID_DOC_CHAR_COUNT 1000
#define WID_DOC_PARA_COUNT 1001
#define WID_DOC_WORD_COUNT 1002
@@ -253,7 +253,7 @@
#define WID_DOC_ISTEMPLATEID 1025
#define WID_APPLY_WORKAROUND_FOR_B6375613 1070
-//MailMerge
+// MailMerge
#define WID_SELECTION 1071
#define WID_RESULT_SET 1072
#define WID_CONNECTION 1073
@@ -296,11 +296,11 @@
#define WID_DOC_VBA_DOCOBJ 1106
-//AutoText
+// AutoText
#define WID_GROUP_PATH 0
#define WID_GROUP_TITLE 1
-//NumberingRules
+// NumberingRules
#define WID_IS_AUTOMATIC 0
#define WID_CONTINUOUS 1
#define WID_RULE_NAME 2
@@ -308,7 +308,7 @@
#define WID_IS_OUTLINE 4
#define WID_DEFAULT_LIST_ID 5
-//TextColumns
+// TextColumns
#define WID_TXTCOL_LINE_WIDTH 0
#define WID_TXTCOL_LINE_COLOR 1
#define WID_TXTCOL_LINE_REL_HGT 2
diff --git a/sw/inc/unoredlines.hxx b/sw/inc/unoredlines.hxx
index 95e5da693b..16a2d5832d 100644
--- a/sw/inc/unoredlines.hxx
+++ b/sw/inc/unoredlines.hxx
@@ -59,7 +59,7 @@ public:
virtual sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
- //XEnumerationAccess - frueher XParagraphEnumerationAccess
+ //XEnumerationAccess - was: XParagraphEnumerationAccess
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
//XElementAccess
diff --git a/sw/inc/unosett.hxx b/sw/inc/unosett.hxx
index 5770f15395..246bd35ec4 100644
--- a/sw/inc/unosett.hxx
+++ b/sw/inc/unosett.hxx
@@ -47,9 +47,7 @@ class SwDoc;
class SwFmtCol;
class SwDocShell;
class SwNumRule;
-/******************************************************************************
- *
- ******************************************************************************/
+
class SwXFootnoteProperties : public cppu::WeakAggImplHelper2
<
::com::sun::star::beans::XPropertySet,
@@ -156,8 +154,8 @@ class SwXNumberingRules : public cppu::WeakAggImplHelper5
String sNewCharStyleNames[MAXLEVEL];
String sNewBulletFontNames[MAXLEVEL];
String sCreatedNumRuleName; //connects to a numbering in SwDoc
- SwDoc* pDoc; // wird nur fuers anmelden gebraucht
- SwDocShell* pDocShell; //nur, wenn als ChapterNumbering verwendet
+ SwDoc* pDoc; // Only needed for registration.
+ SwDocShell* pDocShell; // Only if used as chapter numbering.
SwNumRule* pNumRule;
const SfxItemPropertySet* m_pPropertySet;
sal_Bool bOwnNumRuleCreated;
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index fff1e77fd5..e2217068b6 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -161,7 +161,7 @@ public:
virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
- //XEnumerationAccess - frueher XParagraphEnumerationAccess
+ //XEnumerationAccess - was: XParagraphEnumerationAccess
virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException );
//XElementAccess
diff --git a/sw/inc/usrfld.hxx b/sw/inc/usrfld.hxx
index 322034ebee..d67264486a 100644
--- a/sw/inc/usrfld.hxx
+++ b/sw/inc/usrfld.hxx
@@ -35,9 +35,6 @@ class SfxPoolItem;
class SwCalc;
class SwDoc;
-/*--------------------------------------------------------------------
- Beschreibung: Benutzerfelder
- --------------------------------------------------------------------*/
class SW_DLLPUBLIC SwUserFieldType : public SwValueFieldType
{
@@ -62,7 +59,7 @@ public:
inline sal_Bool IsValid() const;
inline void ChgValid( sal_Bool bNew );
- double GetValue(SwCalc& rCalc); // Member nValue neu berrechnen
+ double GetValue(SwCalc& rCalc); // Recalculate member nValue.
inline double GetValue() const;
inline void SetValue(const double nVal);
@@ -100,9 +97,6 @@ inline void SwUserFieldType::SetType(sal_uInt16 nSub)
EnableFormat(!(nSub & nsSwGetSetExpType::GSE_STRING));
}
-/*--------------------------------------------------------------------
- Beschreibung: Benutzerfelder
- --------------------------------------------------------------------*/
class SW_DLLPUBLIC SwUserField : public SwValueField
{
@@ -122,10 +116,10 @@ public:
virtual String GetFieldName() const;
- // Name kann nicht geaendert werden
+ // Name cannot be changed.
virtual const String& GetPar1() const;
- // Inhalt
+ // Content.
virtual String GetPar2() const;
virtual void SetPar2(const String& rStr);
virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhichId ) const;
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index 2cd921acfb..e90e8fc584 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -96,12 +96,13 @@ namespace svtools{ class ColorConfig;}
#define VIEWOPT_2_SHADOWCRSR 0x01000000L
#define VIEWOPT_2_V_RULER_RIGHT 0x02000000L
-//Tabellenhintergrund
+
+// Table background.
#define TBL_DEST_CELL 0
#define TBL_DEST_ROW 1
#define TBL_DEST_TBL 2
-//Appearance flags
+// Appearance flags.
#define VIEWOPT_DOC_BOUNDARIES 0x0001
#define VIEWOPT_OBJECT_BOUNDARIES 0x0002
#define VIEWOPT_TABLE_BOUNDARIES 0x0004
@@ -112,7 +113,7 @@ namespace svtools{ class ColorConfig;}
#define VIEWOPT_SECTION_BOUNDARIES 0x0080
#define VIEWOPT_SHADOW 0x0100
-// Implementierung in core/text/txtpaint.cxx
+// Implementation in core/text/txtpaint.cxx.
extern void SyncVout( const OutputDevice *pOut );
class SwViewOption
@@ -136,59 +137,59 @@ class SwViewOption
static Color aScriptIndicatorColor;
static Color aShadowColor;
- static sal_Int32 nAppearanceFlags; //
+ static sal_Int32 nAppearanceFlags;
protected:
static sal_uInt16 nPixelTwips;// 1 Pixel == ? Twips
- String sSymbolFont; // Symbolzeichensatz
- sal_uInt32 nCoreOptions; // Bits fuer die ViewShell
- sal_uInt32 nCore2Options; // Bits fuer die ViewShell
+ String sSymbolFont; // Symbolfont.
+ sal_uInt32 nCoreOptions; // Bits for ViewShell.
+ sal_uInt32 nCore2Options; // Bits for ViewShell.
sal_uInt32 nUIOptions; // UI-Bits
- Color aRetoucheColor; // DefaultBackground fuer BrowseView
- Size aSnapSize; // Beschreibt hori. wie vert. Snap
+ Color aRetoucheColor; // DefaultBackground for BrowseView
+ Size aSnapSize; // Describes horizontal and vertical snap.
sal_uInt16 mnViewLayoutColumns;// # columns for edit view
- short nDivisionX; // Rasterunterteilung
+ short nDivisionX; // Grid division.
short nDivisionY;
- sal_uInt8 nPagePrevRow; // Page Preview Row/Columns
- sal_uInt8 nPagePrevCol; // Page Preview Row/Columns
- sal_uInt8 nShdwCrsrFillMode; // FillMode fuer den ShadowCrsr
- sal_Bool bReadonly : 1; // Readonly-Doc
- sal_Bool bStarOneSetting : 1;// prevent from UI automatics (no scrollbars in readonly documents)
- sal_Bool bIsPagePreview : 1; // the preview mustn't print field/footnote/... shadings
- sal_Bool bSelectionInReadonly : 1; //determines whether selection is switched on in readonly documents
+ sal_uInt8 nPagePrevRow; // Page Preview Row/Columns.
+ sal_uInt8 nPagePrevCol; // Page Preview Row/Columns.
+ sal_uInt8 nShdwCrsrFillMode; // FillMode for ShadowCrsr.
+ sal_Bool bReadonly : 1; // Readonly-Doc.
+ sal_Bool bStarOneSetting : 1;// Prevent from UI automatics (no scrollbars in readonly documents).
+ sal_Bool bIsPagePreview : 1; // The preview mustn't print field/footnote/... shadings.
+ sal_Bool bSelectionInReadonly : 1; // Determines whether selection is switched on in readonly documents.
sal_Bool mbFormView : 1;
- sal_Bool mbBrowseMode : 1; //swmod 080130
- sal_Bool mbBookView : 1; // view mode for page preview
- sal_Bool mbViewLayoutBookMode : 1; // book view mode for edit view
- sal_Bool bShowPlaceHolderFields : 1; //only used in printing!
+ sal_Bool mbBrowseMode : 1; // swmod 080130.
+ sal_Bool mbBookView : 1; // View mode for page preview.
+ sal_Bool mbViewLayoutBookMode : 1; // Book view mode for edit view.
+ sal_Bool bShowPlaceHolderFields : 1; // Only used in printing!
mutable bool bIdle;
- // Maszstab
- sal_uInt16 nZoom; // Angaben in Prozent
- SvxZoomType eZoom; // 'enum' fuer Zoom
+ // Scale
+ sal_uInt16 nZoom; // In percent.
+ SvxZoomType eZoom; // 'enum' for zoom.
- sal_uInt8 nTblDest; // Ziel fuer Tabellenhintergrund
+ sal_uInt8 nTblDest; // Destination for table background.
#if OSL_DEBUG_LEVEL > 1
- // korrespondieren zu den Angaben in ui/config/cfgvw.src
- sal_Bool bTest1 :1; // Test-Flag "Layout not loading"
- sal_Bool bTest2 :1; // Test-Flag "WYSIWYG++"
- sal_Bool bTest3 :1; // Test-Flag ""
- sal_Bool bTest4 :1; // Test-Flag "WYSIWYG debug"
- sal_Bool bTest5 :1; // Test-Flag "No idle format"
- sal_Bool bTest6 :1; // Test-Flag "No screen adj"
- sal_Bool bTest7 :1; // Test-Flag "win format"
- sal_Bool bTest8 :1; // Test-Flag ""
+ // Corresponds to statements in ui/config/cfgvw.src.
+ sal_Bool bTest1 :1; // Test-flag "Layout not loading"
+ sal_Bool bTest2 :1; // Test-flag "WYSIWYG++"
+ sal_Bool bTest3 :1; // Test-flag ""
+ sal_Bool bTest4 :1; // Test-flag "WYSIWYG debug"
+ sal_Bool bTest5 :1; // Test-flag "No idle format"
+ sal_Bool bTest6 :1; // Test-flag "No screen adj"
+ sal_Bool bTest7 :1; // Test-flag "win format"
+ sal_Bool bTest8 :1; // Test-flag ""
static sal_Bool bTest9; // Test-Flag "DrawingLayerNotLoading"
sal_Bool bTest10 :1; // Test-Flag "Format by Input"
#endif
public:
SwViewOption(); // CTOR
- SwViewOption(const SwViewOption&); //
- ~SwViewOption(); //
+ SwViewOption(const SwViewOption&);
+ ~SwViewOption();
- void Init( Window *pWin ); // Initialisierung der statischen Daten
+ void Init( Window *pWin ); // Initializing of static data.
sal_uInt16 GetPixelTwips() const { return nPixelTwips; }
@@ -196,13 +197,13 @@ public:
inline void SetUIOptions( const SwViewOption& );
/*---------------------------------------------------------------------------
- Optionen aus nCoreOptions
+ Options from nCoreOptions
----------------------------------------------------------------------------*/
inline sal_Bool IsIdle() const
{ return bIdle; }
- // logically this is a const function since it does not modify the viewoptions
+ // Logically this is a const function since it does not modify the viewoptions
// but only effects idle formatting. Of course that member is already implement
// in the wrong place here... Also currently there are many const modifying casts in the code
// just to call this function on otherwise const objects. Thus declaring it as const now.
@@ -348,7 +349,7 @@ public:
{ (b != 0) ? (nCoreOptions |= VIEWOPT_1_CROSSHAIR ) : ( nCoreOptions &= ~VIEWOPT_1_CROSSHAIR); }
/*---------------------------------------------------------------------------
- Optionen aus nCore2Options
+ Options from nCore2Options
----------------------------------------------------------------------------*/
inline sal_Bool IsBlackFont() const
{return nCore2Options & VIEWOPT_CORE2_BLACKFONT ? sal_True : sal_False;}
@@ -417,7 +418,7 @@ public:
void SetViewLayoutColumns( sal_uInt16 nNew ) { mnViewLayoutColumns = nNew; }
#if OSL_DEBUG_LEVEL > 1
- // korrespondieren zu den Angaben in ui/config/cfgvw.src
+ // Correspond to statements in ui/config/cfgvw.src.
inline sal_Bool IsTest1() const { return bTest1; }
inline void SetTest1( sal_Bool b ) { bTest1 = b; }
inline sal_Bool IsTest2() const { return bTest2; }
@@ -447,14 +448,15 @@ public:
void DrawRectPrinter( OutputDevice* pOut, const SwRect& rRect ) const;
SwViewOption& operator=( const SwViewOption &rOpt );
- // Vergleichsmethoden
+
+ // Compare methods.
sal_Bool IsEqualFlags ( const SwViewOption &rOpt ) const;
inline sal_Bool operator == ( const SwViewOption &rOpt ) const;
inline sal_Bool operator != ( const SwViewOption &rOpt ) const { return !(*this == rOpt); }
/*---------------------------------------------------------------------------
- Optionen aus nUIOptions
+ Options from nUIOptions
----------------------------------------------------------------------------*/
sal_Bool IsViewVScrollBar() const
@@ -526,7 +528,7 @@ public:
void SetViewVRuler (sal_Bool b)
{ b ? (nUIOptions |= VIEWOPT_2_V_RULER ) : ( nUIOptions &= ~VIEWOPT_2_V_RULER);}
- // ShadowCursor ein schalten/abfragen/Farbe setzen/Modus setzen
+ // ShadowCursor, switch on/off, get/set color/mode.
sal_Bool IsShadowCursor() const
{ return nUIOptions & VIEWOPT_2_SHADOWCRSR ? sal_True : sal_False; }
void SetShadowCursor(sal_Bool b)
@@ -601,7 +603,7 @@ inline void SwViewOption::SetUIOptions( const SwViewOption& rVOpt )
}
-// Hilfsfunktion zur Ermittlung der HTML-Faehigkeiten
+// Helper function for checking HTML-capabilities.
SW_DLLPUBLIC sal_uInt16 GetHtmlMode(const SwDocShell*);
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 17675703ce..322da74c6c 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -36,7 +36,7 @@
#include <swtypes.hxx>
#include <ring.hxx>
#include <swrect.hxx>
-#include <boost/shared_ptr.hpp>// swmod 080115
+#include <boost/shared_ptr.hpp> // swmod 080115
#include <stack>
#include <vcl/mapmod.hxx>
#include <vcl/print.hxx>
@@ -93,9 +93,8 @@ namespace vcl
}
-// define fuer Flags, die im CTOR oder den darunter liegenden Schichten
-// benoetigt werden.
-// Zur Zeit wird fuer die DrawPage das PreView Flag benoetigt
+// Define for flags needed in ctor or layers below.
+// Currently the PreView flag is needed for DrawPage.
#define VSHELLFLAG_ISPREVIEW ((long)0x1)
#define VSHELLFLAG_SHARELAYOUT ((long)0x2)//swmod 080125 flag
typedef boost::shared_ptr<SwRootFrm> SwRootFrmPtr;
@@ -109,29 +108,28 @@ class SW_DLLPUBLIC ViewShell : public Ring
friend class SwViewImp;
friend class SwLayIdle;
- // for setting visible area for page preview paint
+ // For setting visible area for page preview paint.
friend class SwPagePreviewLayout;
- //Umsetzen der SwVisArea, damit vor dem Drucken sauber formatiert
- //werden kann.
+
+ // Set SwVisArea in order to enable clean formatting before printing.
friend void SetSwVisArea( ViewShell *pSh, const SwRect &, sal_Bool bPDFExport = sal_False );
static BitmapEx* pReplaceBmp; // replaced display of still loaded images
static BitmapEx* pErrorBmp; // error display of missed images
- static sal_Bool bLstAct; // sal_True wenn Das EndAction der letzten Shell
- // laeuft; also die EndActions der
- // anderen Shells auf das Dokument
- // abgearbeitet sind.
+ static sal_Bool bLstAct; // sal_True if EndAction of last Shell
+ // i.e. if the EndActions of the other
+ // Shells on the document are through.
- Point aPrtOffst; //Ofst fuer den Printer,
- //nicht bedruckbarer Rand.
- Size aBrowseBorder; //Rand fuer Framedokumente
+ Point aPrtOffst; // Ofst for Printer,
+ // non-printable margin.
+ Size aBrowseBorder; // Border for frame documents.
SwRect aInvalidRect;
SfxViewShell *pSfxViewShell;
- SwViewImp *pImp; //Core-Interna der ViewShell.
- //Der Pointer ist niemals 0.
+ SwViewImp *pImp; // Core-internals of ViewShell.
+ // The pointer is never 0.
Window *pWin; // = 0 during printing or pdf export
OutputDevice *pOut; // Window, Printer, VirtDev, ...
@@ -145,23 +143,23 @@ class SW_DLLPUBLIC ViewShell : public Ring
SwAccessibilityOptions* pAccOptions;
- sal_Bool bDocSizeChgd :1; //Fuer DocChgNotify(): Neue DocGroesse bei
- //EndAction an das DocMDI melden.
- sal_Bool bPaintWorks :1; //Normal Painten wenn sal_True,
- //Paint merken wenn sal_False
- sal_Bool bPaintInProgress :1; //Kein zweifaches Paint durchlassen.
- sal_Bool bViewLocked :1; //Lockt den sichtbaren Bereich,
- //MakeVisible laeuft dann in's leere.
- sal_Bool bInEndAction :1; //Fiese unstaende vermeiden, siehe viewsh.cxx
- sal_Bool bPreView :1; //Ist sal_True wenns eine PreView-ViewShell ist.
- sal_Bool bFrameView :1; //sal_True wenn es ein (HTML-)Frame ist.
- sal_Bool bEnableSmooth :1; //Disable des SmoothScroll z.B. fuer
- //Drag der Scrollbars.
- sal_Bool bEndActionByVirDev:1; //Paints aus der EndAction immer ueber virtuelles
-
- //Device (etwa beim Browsen)
-
- // boolean, indicating that class in in constructor
+ sal_Bool bDocSizeChgd :1; // For DocChgNotify(): Announce new DocSize
+ // at EndAction to DocMDI.
+ sal_Bool bPaintWorks :1; // Normal Painting if sal_True,
+ // remember Paint if sal_False.
+ sal_Bool bPaintInProgress :1; // Block any double paint.
+ sal_Bool bViewLocked :1; // Lock visible range;
+ // in this case MakeVisible is ineffectual.
+ sal_Bool bInEndAction :1; // Avoid problems, cf. viewsh.cxx.
+ sal_Bool bPreView :1; // If sal_True it is a PreView-ViewShell.
+ sal_Bool bFrameView :1; // If sal_True it is a (HTML-)Frame.
+ sal_Bool bEnableSmooth :1; // Disable SmoothScroll, e.g. for drag
+ // of scrollbars.
+ sal_Bool bEndActionByVirDev:1; // Paints from EndAction always via virtual device
+ sal_Bool bHeaderFooterEdit;
+ // (e.g. when browsing).
+
+ // boolean, indicating that class in in constructor.
bool mbInConstructor:1;
SdrPaintWindow* mpTargetPaintWindow;
@@ -169,34 +167,34 @@ class SW_DLLPUBLIC ViewShell : public Ring
SwRootFrmPtr pLayout; //swmod 080116
- //Initialisierung, wird von den verschiedenen Konstruktoren gerufen.
+ // Initialization; called by the diverse constructors.
SW_DLLPRIVATE void Init( const SwViewOption *pNewOpt );
inline void ResetInvalidRect();
- SW_DLLPRIVATE void Reformat(); //Invalidert das ges. Layout (ApplyViewOption)
+ SW_DLLPRIVATE void Reformat(); // Invalidates complete Layout (ApplyViewOption).
- SW_DLLPRIVATE void PaintDesktop( const SwRect & ); // sammeln der Werte fuers
- // Malen der Wiese und rufen
- // PaintDesktop gesplittet, dieser Teil wird auch von PreViewPage benutzt
+ SW_DLLPRIVATE void PaintDesktop( const SwRect & ); // Collect values for painting of desktop
+ // and calling.
+ // PaintDesktop split. This pars is also used by PreViewPage.
SW_DLLPRIVATE void _PaintDesktop( const SwRegionRects &rRegion );
- SW_DLLPRIVATE sal_Bool CheckInvalidForPaint( const SwRect & );//Direkt Paint oder lieber
- //eine Aktion ausloesen.
+ SW_DLLPRIVATE sal_Bool CheckInvalidForPaint( const SwRect & ); // Direct Paint or rather
+ // trigger an action.
SW_DLLPRIVATE void PrepareForPrint( const SwPrintData &rOptions );
SW_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt );
protected:
- static ShellResource* pShellRes; // Resourcen fuer die Shell
- static Window* pCareWindow; // diesem Fenster ausweichen
+ static ShellResource* pShellRes; // Resources for the Shell.
+ static Window* pCareWindow; // Avoid this window.
- SwRect aVisArea; //Die moderne Ausfuerung der VisArea
- SwDoc *pDoc; //Das Dokument, niemals 0
+ SwRect aVisArea; // The modern version of VisArea.
+ SwDoc *pDoc; // The document; never 0.
- sal_uInt16 nStartAction; //ist != 0 wenn mindestens eine ::com::sun::star::chaos::Action laeuft
- sal_uInt16 nLockPaint; //ist != 0 wenn das Paint gelocked ist.
+ sal_uInt16 nStartAction; // != 0 if at least one ::com::sun::star::chaos::Action is active.
+ sal_uInt16 nLockPaint; // != 0 if Paint is locked.
public:
TYPEINFO();
@@ -206,10 +204,10 @@ public:
const SwNodes& GetNodes() const;
- //Nach Druckerwechsel, vom Doc
+ // After change of printer; by Doc.
void InitPrt( OutputDevice *pOutDev );
- //Klammerung von zusammengehoerenden Aktionen.
+ // Bracketing of actions belonging together.
inline void StartAction();
void ImplStartAction();
inline void EndAction( const sal_Bool bIdleEnd = sal_False );
@@ -221,8 +219,8 @@ public:
void SetEndActionByVirDev( sal_Bool b ) { bEndActionByVirDev = b; }
sal_Bool IsEndActionByVirDev() { return bEndActionByVirDev; }
- // Per UNO wird am RootFrame fuer alle shells der ActionCount kurzfristig
- // auf Null gesetzt und wieder restauriert
+ // The ActionCount for all Shells is temporarily set to zero and then
+ // restored at the RootFrame via UNO.
void SetRestoreActions(sal_uInt16 nSet);
sal_uInt16 GetRestoreActions() const;
@@ -251,44 +249,43 @@ public:
sal_Bool IsPaintInProgress() const { return bPaintInProgress; }
bool IsDrawingLayerPaintInProgress() const { return !mPrePostPaintRegions.empty(); }
- //Benachrichtung, dass sich der sichtbare Bereich geaendert hat.
- //VisArea wird neu gesetzt, anschliessend wird gescrollt.
- //Das uebergebene Rect liegt auf Pixelgrenzen,
- //um Pixelfehler beim Scrollen zu vermeiden.
+ // Notification that visible area has been changed.
+ // VisArea is reset, after that scrolling takes place.
+ // The passed rect is situated on pixel borders
+ // in order to avoid pixel errors when scrolling.
virtual void VisPortChgd( const SwRect & );
sal_Bool SmoothScroll( long lXDiff, long lYDiff, const Rectangle* );//Browser
void EnableSmooth( sal_Bool b ) { bEnableSmooth = b; }
const SwRect& VisArea() const { return aVisArea; }
- //Es wird, wenn notwendig, soweit gescrollt, dass das
- //uebergebene Rect im sichtbaren Ausschnitt liegt.
+
+ // If necessary scroll until passed Rect is situated in visible sector.
void MakeVisible( const SwRect & );
- //Bei naechster Gelegenheit die neue Dokuemntgroesse an das UI weiterreichen.
+ // At nearest occasion pass new document size to UI.
void SizeChgNotify();
- void UISizeNotify(); //Das weiterreichen der aktuellen groesse.
+ void UISizeNotify(); // Passing of current size.
Point GetPagePos( sal_uInt16 nPageNum ) const;
- sal_uInt16 GetNumPages(); //Anzahl der aktuellen Seiten Layout erfragen.
+ sal_uInt16 GetNumPages(); // Ask count of current pages from layout.
sal_Bool IsDummyPage( sal_uInt16 nPageNum ) const; // An empty page?
- //Invalidierung der ersten Sichtbaren Seite fuer alle Shells im Ring.
+ // Invalidate first visible page for all Shells in ring.
void SetFirstVisPageInvalid();
- SwRootFrm *GetLayout() const;//swmod 080116
- sal_Bool IsNewLayout() const; //Wurde das Layout geladen oder neu
- //erzeugt?
+ SwRootFrm *GetLayout() const;// swmod 080116
+ sal_Bool IsNewLayout() const; // Has Layout been loaded or created?
- Size GetDocSize() const;// erfrage die Groesse des Dokuments
+ Size GetDocSize() const; // Get document size.
- void CalcLayout(); //Durchformatierung des Layouts erzwingen.
+ void CalcLayout(); // Force complete formatting of layout.
sal_uInt16 GetPageCount() const;
const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
- inline SwDoc *GetDoc() const { return pDoc; } //niemals 0.
+ inline SwDoc *GetDoc() const { return pDoc; } //Never 0.
/** Provides access to the document setting interface
*/
@@ -343,7 +340,6 @@ public:
const IDocumentListItems* getIDocumentListItemsAccess() const;
const IDocumentOutlineNodes* getIDocumentOutlineNodesAccess() const;
- // <--
// 1. GetRefDev: Either the printer or the virtual device from the doc
// 2. GetWin: Available if we not printing
@@ -354,65 +350,63 @@ public:
static inline sal_Bool IsLstEndAction() { return ViewShell::bLstAct; }
- //Andern alle PageDescriptoren
+ // Change of all page descriptors.
void ChgAllPageOrientation( sal_uInt16 eOri );
void ChgAllPageSize( Size &rSz );
- // printing of one page.
+ // Printing of one page.
// bIsPDFExport == true is: do PDF Export (no printing!)
sal_Bool PrintOrPDFExport( OutputDevice *pOutDev,
SwPrintData const& rPrintData,
sal_Int32 nRenderer /* offset in vector of pages to print */ );
- // printing of one brochure page
+ // Printing of one brochure page.
void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData,
sal_Int32 nRenderer /* offset in vector of page pairs for prospect printing */ );
- // printing for OLE 2.0
+ // Printing for OLE 2.0.
static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions,
OutputDevice* pOleOut, const Rectangle& rRect );
- /// fill temporary doc with selected text for Print or PDF export
+ // Fill temporary doc with selected text for Print or PDF export.
SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt );
- //Wird intern fuer die Shell gerufen die Druckt. Formatiert die Seiten.
+ // Called internally for Shell. Formats pages.
void CalcPagesForPrint( sal_uInt16 nMax );
- //All about fields.
+ // All about fields.
void UpdateFlds(sal_Bool bCloseDB = sal_False);
sal_Bool IsAnyFieldInDoc() const;
- // update all charts, for that exists any table
+ // Update all charts, for that exists any table.
void UpdateAllCharts();
sal_Bool HasCharts() const;
- //
// DOCUMENT COMPATIBILITY FLAGS START
- //
- // Sollen Absatzabstaende addiert oder maximiert werden?
+ // Add or maximize paragraph spacing?
void SetParaSpaceMax( bool bNew );
- // Sollen Absatzabstaende addiert oder maximiert werden?
+ // Add or maximize paragraph spacing?
void SetParaSpaceMaxAtPages( bool bNew );
- // compatible behaviour of tabs
+ // Compatible behaviour of tabs.
void SetTabCompat( bool bNew );
- // font metric attribute "External Leading" should be considered
+ // Font metric attribute "External Leading" should be considered.
void SetAddExtLeading( bool bNew );
- // formatting by virtual device or printer
+ // Formatting by virtual device or printer.
void SetUseVirDev( bool nNew );
- // adding paragraph and table spacing at bottom
- // of table cells
+ // Adding paragraph and table spacing at bottom
+ // of table cells.
void SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells );
- // former formatting of text lines with
- // proportional line spacing or not
+ // Former formatting of text lines with
+ // proportional line spacing or not.
void SetUseFormerLineSpacing( bool _bUseFormerLineSpacing );
- // former object positioning
+ // Former object positioning.
void SetUseFormerObjectPositioning( bool _bUseFormerObjPos );
void SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos );
@@ -421,20 +415,18 @@ public:
void SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWithManualBreak );
- //
// DOCUMENT COMPATIBILITY FLAGS END
- //
- //Ruft den Idle-Formatierer des Layouts
+ // Calls Idle-formatter of Layout.
void LayoutIdle();
inline const SwViewOption *GetViewOptions() const { return pOpt; }
virtual void ApplyViewOptions( const SwViewOption &rOpt );
void SetUIOptions( const SwViewOption &rOpt );
- void SetReadonlyOption(sal_Bool bSet); // Readonly-Bit d. ViewOptions setzen
- void SetPDFExportOption(sal_Bool bSet); // set/reset PDF export mode
- void SetPrtFormatOption(sal_Bool bSet); // PrtFormat-Bit d. ViewOptions setzen
- void SetReadonlySelectionOption(sal_Bool bSet);//change the selection mode in readonly docs
+ void SetReadonlyOption(sal_Bool bSet); // Set readonly-bit of ViewOptions.
+ void SetPDFExportOption(sal_Bool bSet); // Set/reset PDF export mode.
+ void SetPrtFormatOption(sal_Bool bSet); // Set PrtFormat-Bit of ViewOptions.
+ void SetReadonlySelectionOption(sal_Bool bSet); // Change the selection mode in readonly docs.
const SwAccessibilityOptions* GetAccessibilityOptions() const { return pAccOptions;}
@@ -449,7 +441,7 @@ public:
inline SfxViewShell *GetSfxViewShell() { return pSfxViewShell; }
inline void SetSfxViewShell(SfxViewShell *pNew) { pSfxViewShell = pNew; }
- // Selektion der Draw ::com::sun::star::script::Engine geaendert
+ // Selection of Draw ::com::sun::star::script::Engine has been changed.
virtual void DrawSelChanged();
SwPagePreviewLayout* PagePreviewLayout();
@@ -475,18 +467,18 @@ public:
void ImplUnlockPaint( sal_Bool bVirDev );
sal_Bool IsPaintLocked() const { return nLockPaint != 0; }
- // Abfragen/Erzeugen DrawView + PageView
+ // Get/set DrawView and PageView.
sal_Bool HasDrawView() const;
void MakeDrawView();
- //DrawView darf u.U. am UI benutzt werden.
+ // DrawView may be used at UI.
SdrView *GetDrawView();
const SdrView *GetDrawView() const { return ((ViewShell*)this)->GetDrawView(); }
- //sorge dafuer, das auf jedenfall die MarkListe aktuell ist (Bug 57153)
+ // Take care that MarkList is up-to-date in any case (Bug 57153).
SdrView *GetDrawViewWithValidMarkList();
- // erfrage den Attribut Pool
+ // Query attribute pool.
inline const SfxItemPool& GetAttrPool() const;
SfxItemPool& GetAttrPool();
@@ -496,10 +488,10 @@ public:
void SetFrameView( const Size& rBrowseBorder )
{ bFrameView = sal_True; aBrowseBorder = rBrowseBorder; }
- //Nimmt die notwendigen Invalidierungen vor,
- //wenn sich der BrowdseModus aendert, bBrowseChgd == sal_True
- //oder, im BrowseModus, wenn sich die Groessenverhaeltnisse
- //aendern (bBrowseChgd == sal_False)
+ // Makes the necessary invalidations:
+ // If BrowseMode has changed bBrowseChgd == sal_True
+ // or bBrowseChgd == sal_False in BrowseMode
+ // if proportions have changed.
void CheckBrowseView( sal_Bool bBrowseChgd );
const Size& GetBrowseBorder() const;
@@ -515,7 +507,7 @@ public:
void ShowPreViewSelection( sal_uInt16 nSelPage );
void InvalidateAccessibleFocus();
- //apply Accessiblity options
+ // Apply Accessiblity options.
void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
/** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
@@ -571,9 +563,12 @@ public:
const SwPostItMgr* GetPostItMgr() const { return (const_cast<ViewShell*>(this))->GetPostItMgr(); }
SwPostItMgr* GetPostItMgr();
+
+ virtual void ToggleHeaderFooterEdit( );
+ sal_Bool IsHeaderFooterEdit( ) const { return bHeaderFooterEdit; }
};
-//---- class CurrShell verwaltet den globalen ShellPointer -------------------
+//---- class CurrShell manages global ShellPointer -------------------
class CurrShell
{
diff --git a/sw/inc/viscrs.hxx b/sw/inc/viscrs.hxx
index 82be9d4e13..949f898a10 100644
--- a/sw/inc/viscrs.hxx
+++ b/sw/inc/viscrs.hxx
@@ -36,7 +36,7 @@
class SwCrsrShell;
class SwShellCrsr;
-// -------- Ab hier Klassen / Methoden fuer den nicht Text-Cursor ------
+// From here classes/methods for non-text cursor.
class SwVisCrsr
#ifdef SW_CRSR_TIMER
@@ -77,7 +77,7 @@ public:
};
-// ------ Ab hier Klassen / Methoden fuer die Selectionen -------
+// From here classes/methods for selections.
namespace sdr { namespace overlay { class OverlayObject; }}
@@ -122,11 +122,11 @@ public:
class SwShellCrsr : public virtual SwCursor, public SwSelPaintRects
{
- // Dokument-Positionen der Start/End-Charakter einer SSelection
+ // Document positions of start/end characters of a SSelection.
Point aMkPt, aPtPt;
- const SwPosition* pPt; // fuer Zuordung vom GetPoint() zum aPtPt
+ const SwPosition* pPt; // For assignment of GetPoint() to aPtPt.
- virtual void FillRects(); // fuer Table- und normalen Crsr
+ virtual void FillRects(); // For Table- und normal cursors.
using SwCursor::UpDown;
@@ -137,8 +137,8 @@ public:
SwShellCrsr( SwShellCrsr& );
virtual ~SwShellCrsr();
- void Show(); // Update und zeige alle Selektionen an
- void Hide(); // verstecke alle Selektionen
+ void Show(); // Update and display all selections.
+ void Hide(); // Hide all selections.
void Invalidate( const SwRect& rRect );
const Point& GetPtPos() const { return( SwPaM::GetPoint() == pPt ? aPtPt : aMkPt ); }
@@ -159,12 +159,12 @@ public:
sal_Bool UpDown( sal_Bool bUp, sal_uInt16 nCnt = 1 );
- // sal_True: an die Position kann der Cursor gesetzt werden
+ // sal_True: Cursor can be set to this position.
virtual sal_Bool IsAtValidPos( sal_Bool bPoint = sal_True ) const;
#if OSL_DEBUG_LEVEL > 1
- // zum Testen des UNO-Crsr Verhaltens hier die Implementierung
- // am sichtbaren Cursor
+
+ // For testing of UNO-Crsr behavior here the implementation at visible cursor.
virtual sal_Bool IsSelOvr( int eFlags =
( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE |
@@ -180,10 +180,9 @@ public:
class SwShellTableCrsr : public virtual SwShellCrsr, public virtual SwTableCursor
{
- // die Selection hat die gleiche Reihenfolge wie die
- // TabellenBoxen. D.h., wird aus dem einen Array an einer Position
- // etwas geloescht, dann muss es auch im anderen erfolgen!!
-
+ // The Selection has the same order as the table boxes, i.e.
+ // if something is deleted from the one array at a certain position
+ // it has to be deleted from the other one as well!!
public:
SwShellTableCrsr( const SwCrsrShell& rCrsrSh, const SwPosition& rPos );
@@ -192,9 +191,9 @@ public:
const SwPosition &rPtPos, const Point& rPtPt );
virtual ~SwShellTableCrsr();
- virtual void FillRects(); // fuer Table- und normalen Crsr
+ virtual void FillRects(); // For table and normal cursor.
- // Pruefe, ob sich der SPoint innerhalb der Tabellen-SSelection befindet
+ // Check if SPoint is within table SSelection.
sal_Bool IsInside( const Point& rPt ) const;
virtual void SetMark();
@@ -203,12 +202,12 @@ public:
virtual short MaxReplaceArived(); //returns RET_YES/RET_CANCEL/RET_NO
virtual void SaveTblBoxCntnt( const SwPosition* pPos = 0 );
- // sal_True: an die Position kann der Cursor gesetzt werden
+ // sal_True: Cursor can be set to this position.
virtual sal_Bool IsAtValidPos( sal_Bool bPoint = sal_True ) const;
#if OSL_DEBUG_LEVEL > 1
- // zum Testen des UNO-Crsr Verhaltens hier die Implementierung
- // am sichtbaren Cursor
+
+ // For testing of UNO-Crsr behavior here the implementation at visible cursor.
virtual sal_Bool IsSelOvr( int eFlags =
( nsSwCursorSelOverFlags::SELOVER_CHECKNODESSECTION |
nsSwCursorSelOverFlags::SELOVER_TOGGLE |
diff --git a/sw/inc/wdocsh.hxx b/sw/inc/wdocsh.hxx
index a3ad4a5be7..30e354f5fc 100644
--- a/sw/inc/wdocsh.hxx
+++ b/sw/inc/wdocsh.hxx
@@ -33,13 +33,13 @@
class SW_DLLPUBLIC SwWebDocShell: public SwDocShell
{
- sal_uInt16 nSourcePara; // aktive Zeile in der SourceView
+ sal_uInt16 nSourcePara; // Active line in source view.
public:
using SotObject::GetInterface;
- // aber selbst implementieren
+ // But implement yourself.
SFX_DECL_INTERFACE(SW_WEBDOCSHELL)
SFX_DECL_OBJECTFACTORY();
TYPEINFO();
diff --git a/sw/prj/build.lst b/sw/prj/build.lst
index 8de2b4d5a4..75c602e315 100644
--- a/sw/prj/build.lst
+++ b/sw/prj/build.lst
@@ -1,2 +1,2 @@
-sw sw : filter TRANSLATIONS:translations connectivity writerperfect lotuswordpro vbahelper svx stoc writerfilter unoxml fileaccess package comphelper LIBXSLT:libxslt NULL
+sw sw : filter TRANSLATIONS:translations connectivity writerperfect vbahelper svx stoc writerfilter unoxml fileaccess package forms toolkit dbaccess comphelper LIBXSLT:libxslt test NULL
sw sw\prj nmake - all sw_prj NULL
diff --git a/sw/qa/complex/accessibility/makefile.mk b/sw/qa/complex/accessibility/makefile.mk
deleted file mode 100644
index 06e7c6a704..0000000000
--- a/sw/qa/complex/accessibility/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
-nothing .PHONY:
-.ELSE
-
-PRJ = ../../..
-PRJNAME = sw
-TARGET = qa_complex_accessibility
-
-.IF "$(OOO_JUNIT_JAR)" != ""
-PACKAGE = complex/accessibility
-JAVATESTFILES = AccessibleRelationSet.java
-JAVAFILES = $(JAVATESTFILES)
-JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
-EXTRAJARFILES = $(OOO_JUNIT_JAR)
-.END
-
-.INCLUDE: settings.mk
-.INCLUDE: target.mk
-.INCLUDE: installationtest.mk
-
-ALLTAR : javatest
-
-.END
diff --git a/sw/qa/complex/checkColor/makefile.mk b/sw/qa/complex/checkColor/makefile.mk
deleted file mode 100644
index e5b368083a..0000000000
--- a/sw/qa/complex/checkColor/makefile.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
-nothing .PHONY:
-.ELSE
-
-PRJ = ../../..
-PRJNAME = sw
-TARGET = qa_complex_checkColor
-
-.IF "$(OOO_JUNIT_JAR)" != ""
-PACKAGE = complex/checkColor
-JAVATESTFILES = CheckChangeColor.java
-JAVAFILES = $(JAVATESTFILES)
-JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar
-EXTRAJARFILES = $(OOO_JUNIT_JAR)
-.END
-
-.INCLUDE: settings.mk
-.INCLUDE: target.mk
-.INCLUDE: installationtest.mk
-
-ALLTAR : javatest
-
-.END
diff --git a/sw/qa/core/Test-BigPtrArray.cxx b/sw/qa/core/Test-BigPtrArray.cxx
index 3251cec184..bacd5f0bb6 100644
--- a/sw/qa/core/Test-BigPtrArray.cxx
+++ b/sw/qa/core/Test-BigPtrArray.cxx
@@ -29,19 +29,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#define TIMELOG
+//#define TIMELOG for measuring performance
-#include <cppunit/TestSuite.h>
-#include <cppunit/TestFixture.h>
-#include <cppunit/TestCase.h>
-#include <cppunit/plugin/TestPlugIn.h>
-#include <cppunit/extensions/HelperMacros.h>
-
-#include <bparr.hxx>
#include <string.h>
#include <stdlib.h>
+
+#include <sal/cppunit.h>
+
+#include <sal/config.h>
#include <rtl/logfile.hxx>
+#include <bparr.hxx>
+
using namespace std;
@@ -118,7 +117,9 @@ namespace /* private */
delete bparr[i];
}
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT(logFile, "BigPtrArray performance measures" );
+#endif
}
class BigPtrArrayUnittest : public CppUnit::TestFixture
@@ -151,7 +152,9 @@ public:
{
printMethodName("test_insert_entries_at_front\n");
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, "START: test_insert_entries_at_front");
+#endif
BigPtrArray bparr;
@@ -166,7 +169,9 @@ public:
);
}
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, "END: test_insert_entries_at_front");
+#endif
for (sal_uLong i = 0, j = NUM_ENTRIES - 1; i < NUM_ENTRIES; i++, j--)
{
@@ -191,7 +196,9 @@ public:
{
printMethodName("test_insert_entries_in_the_middle\n");
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, "START: test_insert_entries_in_the_middle");
+#endif
BigPtrArray bparr;
@@ -202,7 +209,9 @@ public:
bparr.Insert(new BigPtrEntryMock(NUM_ENTRIES), bparr.Count() / 2);
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, "END: test_insert_entries_in_the_middle");
+#endif
CPPUNIT_ASSERT_MESSAGE
(
@@ -224,7 +233,9 @@ public:
{
printMethodName("test_insert_at_already_used_index\n");
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, "START: test_insert_at_already_used_index");
+#endif
BigPtrArray bparr;
@@ -236,7 +247,9 @@ public:
for (sal_uLong i = 0, j = -5; i < 5; i++, j++)
bparr.Insert(new BigPtrEntryMock(j), i);
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, "END: test_insert_at_already_used_index");
+#endif
CPPUNIT_ASSERT_MESSAGE
(
@@ -295,7 +308,9 @@ public:
{
printMethodName("test_remove_at_front\n");
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, "START: test_remove_at_front");
+#endif
BigPtrArray bparr;
@@ -333,7 +348,9 @@ public:
dumpBigPtrArray(bparr);
}
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, "END: test_remove_at_front");
+#endif
}
void test_remove_at_back()
@@ -380,7 +397,9 @@ public:
{
printMethodName("test_remove_in_the_middle\n");
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, "START: test_remove_in_the_middle");
+#endif
BigPtrArray bparr;
@@ -418,7 +437,9 @@ public:
dumpBigPtrArray(bparr);
}
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, "END: test_remove_in_the_middle");
+#endif
}
void test_remove_multiple_elements_at_once()
@@ -777,12 +798,16 @@ public:
{
startString_ += methodName;
endString_ += methodName;
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, startString_.c_str());
+#endif
}
~PerformanceTracer()
{
+#ifdef TIMELOG
RTL_LOGFILE_CONTEXT_TRACE(logFile, endString_.c_str());
+#endif
}
private:
@@ -864,8 +889,8 @@ private:
// register test suites
CPPUNIT_TEST_SUITE_REGISTRATION(BigPtrArrayUnittest);
+#ifdef TIMELOG
CPPUNIT_TEST_SUITE_REGISTRATION(BigPtrArrayPerformanceTest);
-
-CPPUNIT_PLUGIN_IMPLEMENT();
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/core/bigpointerarray-new.cxx b/sw/qa/core/bigpointerarray-new.cxx
index c86c059356..b642e7f2d3 100644
--- a/sw/qa/core/bigpointerarray-new.cxx
+++ b/sw/qa/core/bigpointerarray-new.cxx
@@ -44,14 +44,14 @@ sal_uLong BigPtrArray::Count() const
void BigPtrArray::Move(sal_uLong fromPos, sal_uLong toPos)
{
- DBG_ASSERT(fromPos < container_.size() && toPos < container_.size(), "BigPtrArray.Move precondition violation");
+ OSL_ENSURE(fromPos < container_.size() && toPos < container_.size(), "BigPtrArray.Move precondition violation");
Insert(container_[fromPos], toPos);
Remove(toPos < fromPos ? fromPos + 1 : fromPos, 1);
}
void BigPtrArray::ForEach(sal_uLong fromPos, sal_uLong toPos, FnForEach fn, void* pArgs)
{
- DBG_ASSERT(fromPos < toPos && fromPos < container_.size() && toPos < container_.size(), "BigPtrArray::ForEach precondition violation");
+ OSL_ENSURE(fromPos < toPos && fromPos < container_.size() && toPos < container_.size(), "BigPtrArray::ForEach precondition violation");
Container_t::const_iterator iter = container_.begin() + fromPos;
Container_t::const_iterator iter_end = container_.begin() + toPos;
for (/*no init*/; iter != iter_end; ++iter)
@@ -68,13 +68,13 @@ void BigPtrArray::ForEach(FnForEach fn, void* pArgs)
ElementPtr BigPtrArray::operator[](sal_uLong pos) const
{
- DBG_ASSERT(pos < container_.size(), "BigPtrArray::operator[] precondition violation");
+ OSL_ENSURE(pos < container_.size(), "BigPtrArray::operator[] precondition violation");
return container_[pos];
}
void BigPtrArray::Insert(const ElementPtr& rElem, sal_uLong pos)
{
- DBG_ASSERT(pos <= container_.size(), "BigPtrArray::Insert precondition violation");
+ OSL_ENSURE(pos <= container_.size(), "BigPtrArray::Insert precondition violation");
rElem->pBigPtrArray_ = this;
rElem->pos_ = pos;
@@ -90,14 +90,14 @@ void BigPtrArray::Insert(const ElementPtr& rElem, sal_uLong pos)
void BigPtrArray::Remove( sal_uLong pos, sal_uLong n )
{
- DBG_ASSERT((pos < container_.size()) && ((container_.begin() + pos + n) < container_.end()), "BigPtrArray.Remove precondition violation")
+ OSL_ENSURE((pos < container_.size()) && ((container_.begin() + pos + n) < container_.end()), "BigPtrArray.Remove precondition violation")
container_.erase(container_.begin() + pos, container_.begin() + pos + n);
FixElementIndizes(container_.begin(), container_.end());
}
void BigPtrArray::Replace(sal_uLong pos, const ElementPtr& rElem)
{
- DBG_ASSERT(pos < container_.size(), "BigPtrArray::Replace precondition violation");
+ OSL_ENSURE(pos < container_.size(), "BigPtrArray::Replace precondition violation");
rElem->pBigPtrArray_ = this;
rElem->pos_ = pos;
container_[pos] = rElem;
diff --git a/sw/qa/core/bigpointerarray-new.hxx b/sw/qa/core/bigpointerarray-new.hxx
index 0c835a0029..b48a81597b 100644
--- a/sw/qa/core/bigpointerarray-new.hxx
+++ b/sw/qa/core/bigpointerarray-new.hxx
@@ -30,8 +30,6 @@
#define _BPARR_HXX
#include <tools/solar.h>
-#include <tools/debug.hxx>
-
#include <deque>
class BigPtrArray;
diff --git a/sw/qa/core/data/rtf/fail/CVE-2005-2971-1.rtf b/sw/qa/core/data/rtf/fail/CVE-2005-2971-1.rtf
new file mode 100644
index 0000000000..7ed841f88d
--- /dev/null
+++ b/sw/qa/core/data/rtf/fail/CVE-2005-2971-1.rtf
@@ -0,0 +1,11 @@
+{\AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA1\ansi\deff0\adeflang1025
+{\fonttbl{\f0\froman\fprq2\fcharset0 Nimbus Roman No9 L;}}
+{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
+{\stylesheet{\s1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\afs24\lang255\ltrch\dbch\af2\afs24\langfe255\loch\f0\fs24\lang1033\snext1 Default;}
+}
+{\info{\comment StarWriter}{\vern6410}}\deftab1250
+{\*\pgdsctbl
+{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Default;}}
+\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
+\pard\plain \s1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\afs24\lang255\ltrch\dbch\af2\afs24\langfe255\loch\f0\fs24\lang1033 {\ltrch\loch\f0 hello}
+\par }
diff --git a/sw/qa/core/CVE/CVE-2010-3451-1.rtf b/sw/qa/core/data/rtf/fail/CVE-2010-3451-1.rtf
index 88f84f12fe..88f84f12fe 100644
--- a/sw/qa/core/CVE/CVE-2010-3451-1.rtf
+++ b/sw/qa/core/data/rtf/fail/CVE-2010-3451-1.rtf
diff --git a/sw/qa/core/data/rtf/indeterminate/.gitignore b/sw/qa/core/data/rtf/indeterminate/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sw/qa/core/data/rtf/indeterminate/.gitignore
diff --git a/sw/qa/core/data/rtf/pass/.gitignore b/sw/qa/core/data/rtf/pass/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/.gitignore
diff --git a/sw/qa/core/data/rtf/pass/CVE-2005-2964.rtf b/sw/qa/core/data/rtf/pass/CVE-2005-2964.rtf
new file mode 100644
index 0000000000..bf61eeade2
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/CVE-2005-2964.rtf
@@ -0,0 +1,11 @@
+{\rtf1\ansi\deff0\adeflang1025
+{\fonttbl{\f0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfroman\fprq2\fcharset0 Nimbus Roman No9 L;}}
+{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
+{\stylesheet{\s1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\afs24\lang255\ltrch\dbch\af2\afs24\langfe255\loch\f0\fs24\lang1033\snext1 Default;}
+}
+{\info{\comment StarWriter}{\vern6410}}\deftab1250
+{\*\pgdsctbl
+{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Default;}}
+\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
+\pard\plain \s1{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\rtlch\afs24\lang255\ltrch\dbch\af2\afs24\langfe255\loch\f0\fs24\lang1033 {\ltrch\loch\f0 hello}
+\par }
diff --git a/sw/qa/core/data/rtf/pass/CVE-2005-2972-1.rtf b/sw/qa/core/data/rtf/pass/CVE-2005-2972-1.rtf
new file mode 100644
index 0000000000..c38d6fc644
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/CVE-2005-2972-1.rtf
@@ -0,0 +1,57 @@
+{\rtf1\ansi\ansicpg1252\deff0
+{\fonttbl
+{\f0\fnil\fcharset0\fprq0\fttruetype Times New Roman;}
+{\f1\fnil\fcharset0\fprq0\fttruetype Nimbus Sans L;}
+{\f2\fnil\fcharset0\fprq0\fttruetype Dingbats;}
+{\f3\fnil\fcharset0\fprq0\fttruetype Symbol;}
+{\f4\fnil\fcharset0\fprq0\fttruetype Courier New;}}
+{\colortbl
+\red0\green0\blue0;
+\red255\green255\blue255;}
+{\stylesheet
+{\s1\fi-431\li720\sbasedon28\snext28 Contents 1;}
+{\s2\fi-431\li1440\sbasedon28\snext28 Contents 2;}
+{\s3\fi-431\li2160\sbasedon28\snext28 Contents 3;}
+{\s8\fi-431\li720\sbasedon28 Lower Roman List;}
+{\s5\tx431\sbasedon24\snext28 Numbered Heading 1;}
+{\s6\tx431\sbasedon25\snext28 Numbered Heading 2;}
+{\s7\fi-431\li720 Square List;}
+{\*\cs11\sbasedon28 Endnote Text;}
+{\s4\fi-431\li2880\sbasedon28\snext28 Contents 4;}
+{\s9\fi-431\li720 Diamond List;}
+{\s10\fi-431\li720 Numbered List;}
+{\*\cs12\fs20\super Endnote Reference;}
+{\s13\fi-431\li720 Triangle List;}
+{\s14\tx431\sbasedon26\snext28 Numbered Heading 3;}
+{\s15\fi-431\li720 Dashed List;}
+{\s16\fi-431\li720\sbasedon10 Upper Roman List;}
+{\s17\sb440\sa60\f1\fs24\b\sbasedon28\snext28 Heading 4;}
+{\s18\fi-431\li720 Heart List;}
+{\s34\fi-431\li720 Box List;}
+{\s20\fi-431\li720\sbasedon10 Upper Case List;}
+{\s21\fi-431\li720 Bullet List;}
+{\s22\fi-431\li720 Hand List;}
+{\*\cs23\fs20\sbasedon28 Footnote Text;}
+{\s24\sb440\sa60\f1\fs34\b\sbasedon28\snext28 Heading 1;}
+{\s25\sb440\sa60\f1\fs28\b\sbasedon28\snext28 Heading 2;}
+{\s19\qc\sb240\sa120\f1\fs32\b\sbasedon28\snext28 Contents Header;}
+{\s27\fi-431\li720 Tick List;}
+{\s26\sb440\sa60\f1\fs24\b\sbasedon28\snext28 Heading 3;}
+{\s29\fi-431\li720\sbasedon10 Lower Case List;}
+{\s30\li1440\ri1440\sa120\sbasedon28 Block Text;}
+{\s36\f4\sbasedon28 Plain Text;}
+{\s32\tx1584\sbasedon5\snext28 Section Heading;}
+{\s33\fi-431\li720 Implies List;}
+{\s28\f0\fs24\lang1033 Normal;}
+{\s35\fi-431\li720 Star List;}
+{\*\cs31\fs20\super Footnote Reference;}
+{\s37\tx1584\sbasedon5\snext28 Chapter Heading;}}
+{\*\listtable
+{\list\listtemplateid1002\listsimple{\listlevel\levelnfc0\levelstartat1\levelspace0\levelfollow0\fi-431\li720{\leveltext\'02\'00.;}{\levelnumbers\'01;}}\listid1000}}
+{\*\listoverridetable
+{\listoverride\listoverridecount0\listid1000\levelnfc0\levelstartat1\levelspace0\levelfollow0\fi-431\li720{\leveltext\'02\'00.;}{\levelnumbers\'01;}\ls1}}
+
+\kerning0\cf0\ftnbj\fet2\ftnstart1\ftnnar\aftnnar\ftnstart1\aftnstart1\aenddoc\facingp\titlepg\revprop3{\info}\deftab720\viewkind1\paperw12240\paperh15840\margl1440\margr1440\widowctl
+\sectd\sbknone\colsx360\pgncont\ltrsect
+{\listtext\pard\fi-431\li720 1. }\pard\plain{\ltrpar\ql\fi-431\li720\s28{\*\abilist\abilistid1000\abilistparentid0\abilistlevel1\abistartat1{\abifieldfont NULL}{\abilistdecimal .}{\abilistdelim %L.}{\abiliststyle Numbered List}}{\*\pn\pnql\pnstart1\pnlvlbody\pndec{\pntxtb AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA}{\pntxta .}}\fn-431\li720\ls1\ilvl0\itap0{\s28\f0\fs24\lang1033{\*\listtag0}\abinodiroverride\ltrch test}{\s28\f0\fs24\lang1033{\*\listtag1001}\par}
+}\pard\plain\ltrpar\ql\s28\itap0{\s28\f0\fs24\lang1033{\*\listtag0}\par}}
diff --git a/sw/qa/core/data/rtf/pass/CVE-2005-2972-2.rtf b/sw/qa/core/data/rtf/pass/CVE-2005-2972-2.rtf
new file mode 100644
index 0000000000..2a3f782b72
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/CVE-2005-2972-2.rtf
@@ -0,0 +1,57 @@
+{\rtf1\ansi\ansicpg1252\deff0
+{\fonttbl
+{\f0\fnil\fcharset0\fprq0\fttruetype Times New Roman;}
+{\f1\fnil\fcharset0\fprq0\fttruetype Nimbus Sans L;}
+{\f2\fnil\fcharset0\fprq0\fttruetype Dingbats;}
+{\f3\fnil\fcharset0\fprq0\fttruetype Symbol;}
+{\f4\fnil\fcharset0\fprq0\fttruetype Courier New;}}
+{\colortbl
+\red0\green0\blue0;
+\red255\green255\blue255;}
+{\stylesheet
+{\s1\fi-431\li720\sbasedon28\snext28 Contents 1;}
+{\s2\fi-431\li1440\sbasedon28\snext28 Contents 2;}
+{\s3\fi-431\li2160\sbasedon28\snext28 Contents 3;}
+{\s8\fi-431\li720\sbasedon28 Lower Roman List;}
+{\s5\tx431\sbasedon24\snext28 Numbered Heading 1;}
+{\s6\tx431\sbasedon25\snext28 Numbered Heading 2;}
+{\s7\fi-431\li720 Square List;}
+{\*\cs11\sbasedon28 Endnote Text;}
+{\s4\fi-431\li2880\sbasedon28\snext28 Contents 4;}
+{\s9\fi-431\li720 Diamond List;}
+{\s10\fi-431\li720 Numbered List;}
+{\*\cs12\fs20\super Endnote Reference;}
+{\s13\fi-431\li720 Triangle List;}
+{\s14\tx431\sbasedon26\snext28 Numbered Heading 3;}
+{\s15\fi-431\li720 Dashed List;}
+{\s16\fi-431\li720\sbasedon10 Upper Roman List;}
+{\s17\sb440\sa60\f1\fs24\b\sbasedon28\snext28 Heading 4;}
+{\s18\fi-431\li720 Heart List;}
+{\s34\fi-431\li720 Box List;}
+{\s20\fi-431\li720\sbasedon10 Upper Case List;}
+{\s21\fi-431\li720 Bullet List;}
+{\s22\fi-431\li720 Hand List;}
+{\*\cs23\fs20\sbasedon28 Footnote Text;}
+{\s24\sb440\sa60\f1\fs34\b\sbasedon28\snext28 Heading 1;}
+{\s25\sb440\sa60\f1\fs28\b\sbasedon28\snext28 Heading 2;}
+{\s19\qc\sb240\sa120\f1\fs32\b\sbasedon28\snext28 Contents Header;}
+{\s27\fi-431\li720 Tick List;}
+{\s26\sb440\sa60\f1\fs24\b\sbasedon28\snext28 Heading 3;}
+{\s29\fi-431\li720\sbasedon10 Lower Case List;}
+{\s30\li1440\ri1440\sa120\sbasedon28 Block Text;}
+{\s36\f4\sbasedon28 Plain Text;}
+{\s32\tx1584\sbasedon5\snext28 Section Heading;}
+{\s33\fi-431\li720 Implies List;}
+{\s28\f0\fs24\lang1033 Normal;}
+{\s35\fi-431\li720 Star List;}
+{\*\cs31\fs20\super Footnote Reference;}
+{\s37\tx1584\sbasedon5\snext28 Chapter Heading;}}
+{\*\listtable
+{\list\listtemplateid1002\listsimple{\listlevel\levelnfc0\levelstartat1\levelspace0\levelfollow0\fi-431\li720{\leveltext\'02\'00.;}{\levelnumbers\'01;}}\listid1000}}
+{\*\listoverridetable
+{\listoverride\listoverridecount0\listid1000\levelnfc0\levelstartat1\levelspace0\levelfollow0\fi-431\li720{\leveltext\'02\'00.;}{\levelnumbers\'01;}\ls1}}
+
+\kerning0\cf0\ftnbj\fet2\ftnstart1\ftnnar\aftnnar\ftnstart1\aftnstart1\aenddoc\facingp\titlepg\revprop3{\info}\deftab720\viewkind1\paperw12240\paperh15840\margl1440\margr1440\widowctl
+\sectd\sbknone\colsx360\pgncont\ltrsect
+{\listtext\pard\fi-431\li720 1. }\pard\plain{\ltrpar\ql\fi-431\li720\s28{\*\abilist\abilistid1000\abilistparentid0\abilistlevel1\abistartat1{\abifieldfont NULL}{\abilistdecimal .}{\abilistdelim %L.}{\abiliststyle AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANumbered List}}{\*\pn\pnql\pnstart1\pnlvlbody\pndec{\pntxtb }{\pntxta .}}\fn-431\li720\ls1\ilvl0\itap0{\s28\f0\fs24\lang1033{\*\listtag0}\abinodiroverride\ltrch test}{\s28\f0\fs24\lang1033{\*\listtag1001}\par}
+}\pard\plain\ltrpar\ql\s28\itap0{\s28\f0\fs24\lang1033{\*\listtag0}\par}}
diff --git a/sw/qa/core/CVE/CVE-2007-0245-1.rtf b/sw/qa/core/data/rtf/pass/CVE-2007-0245-1.rtf
index a166c56e1b..a166c56e1b 100644
--- a/sw/qa/core/CVE/CVE-2007-0245-1.rtf
+++ b/sw/qa/core/data/rtf/pass/CVE-2007-0245-1.rtf
diff --git a/sw/qa/core/data/rtf/pass/CVE-2010-3333-1.rtf b/sw/qa/core/data/rtf/pass/CVE-2010-3333-1.rtf
new file mode 100644
index 0000000000..aaf9acd99a
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/CVE-2010-3333-1.rtf
Binary files differ
diff --git a/sw/qa/core/CVE/CVE-2010-3452-1.rtf b/sw/qa/core/data/rtf/pass/CVE-2010-3452-1.rtf
index b2800b5edb..b2800b5edb 100644
--- a/sw/qa/core/CVE/CVE-2010-3452-1.rtf
+++ b/sw/qa/core/data/rtf/pass/CVE-2010-3452-1.rtf
diff --git a/sw/qa/core/data/ww8/fail/.gitignore b/sw/qa/core/data/ww8/fail/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sw/qa/core/data/ww8/fail/.gitignore
diff --git a/sw/qa/core/data/ww8/fail/CVE-2005-0941-1.doc b/sw/qa/core/data/ww8/fail/CVE-2005-0941-1.doc
new file mode 100644
index 0000000000..18b300c852
--- /dev/null
+++ b/sw/qa/core/data/ww8/fail/CVE-2005-0941-1.doc
Binary files differ
diff --git a/sw/qa/core/data/ww8/fail/CVE-2006-2389-1.doc b/sw/qa/core/data/ww8/fail/CVE-2006-2389-1.doc
new file mode 100644
index 0000000000..a1bf07a71a
--- /dev/null
+++ b/sw/qa/core/data/ww8/fail/CVE-2006-2389-1.doc
Binary files differ
diff --git a/sw/qa/core/data/ww8/fail/CVE-2008-0320-1.doc b/sw/qa/core/data/ww8/fail/CVE-2008-0320-1.doc
new file mode 100644
index 0000000000..b5a08324f1
--- /dev/null
+++ b/sw/qa/core/data/ww8/fail/CVE-2008-0320-1.doc
Binary files differ
diff --git a/sw/qa/core/data/ww8/indeterminate/.gitignore b/sw/qa/core/data/ww8/indeterminate/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sw/qa/core/data/ww8/indeterminate/.gitignore
diff --git a/sw/qa/core/data/ww8/pass/.gitignore b/sw/qa/core/data/ww8/pass/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sw/qa/core/data/ww8/pass/.gitignore
diff --git a/sw/qa/core/data/ww8/pass/CVE-2006-6561-1.doc b/sw/qa/core/data/ww8/pass/CVE-2006-6561-1.doc
new file mode 100644
index 0000000000..240ea77bca
--- /dev/null
+++ b/sw/qa/core/data/ww8/pass/CVE-2006-6561-1.doc
Binary files differ
diff --git a/sw/qa/core/data/ww8/pass/CVE-2008-4841-1.doc b/sw/qa/core/data/ww8/pass/CVE-2008-4841-1.doc
index f099938bc1..0942b6d8d4 120000..100644
--- a/sw/qa/core/data/ww8/pass/CVE-2008-4841-1.doc
+++ b/sw/qa/core/data/ww8/pass/CVE-2008-4841-1.doc
Binary files differ
diff --git a/sw/qa/core/CVE/CVE-2009-0200-1.doc b/sw/qa/core/data/ww8/pass/CVE-2009-0200-1.doc
index a142fec96b..a142fec96b 100644
--- a/sw/qa/core/CVE/CVE-2009-0200-1.doc
+++ b/sw/qa/core/data/ww8/pass/CVE-2009-0200-1.doc
Binary files differ
diff --git a/sw/qa/core/CVE/CVE-2009-0201-1.doc b/sw/qa/core/data/ww8/pass/CVE-2009-0201-1.doc
index bc6182d1d5..bc6182d1d5 100644
--- a/sw/qa/core/CVE/CVE-2009-0201-1.doc
+++ b/sw/qa/core/data/ww8/pass/CVE-2009-0201-1.doc
Binary files differ
diff --git a/sw/qa/core/CVE/CVE-2009-3301-1.doc b/sw/qa/core/data/ww8/pass/CVE-2009-3301-1.doc
index 8f1c2de020..8f1c2de020 100644
--- a/sw/qa/core/CVE/CVE-2009-3301-1.doc
+++ b/sw/qa/core/data/ww8/pass/CVE-2009-3301-1.doc
Binary files differ
diff --git a/sw/qa/core/CVE/CVE-2009-3302-1.doc b/sw/qa/core/data/ww8/pass/CVE-2009-3302-1.doc
index 8f1c2de020..8f1c2de020 100644
--- a/sw/qa/core/CVE/CVE-2009-3302-1.doc
+++ b/sw/qa/core/data/ww8/pass/CVE-2009-3302-1.doc
Binary files differ
diff --git a/sw/qa/core/CVE/CVE-2009-3302-2.doc b/sw/qa/core/data/ww8/pass/CVE-2009-3302-2.doc
index 0cd7a7dcd1..0cd7a7dcd1 100644
--- a/sw/qa/core/CVE/CVE-2009-3302-2.doc
+++ b/sw/qa/core/data/ww8/pass/CVE-2009-3302-2.doc
Binary files differ
diff --git a/sw/qa/core/CVE/CVE-2010-3453-1.doc b/sw/qa/core/data/ww8/pass/CVE-2010-3453-1.doc
index 22cd8eebbe..22cd8eebbe 100644
--- a/sw/qa/core/CVE/CVE-2010-3453-1.doc
+++ b/sw/qa/core/data/ww8/pass/CVE-2010-3453-1.doc
Binary files differ
diff --git a/sw/qa/core/CVE/CVE-2010-3454-1.doc b/sw/qa/core/data/ww8/pass/CVE-2010-3454-1.doc
index 33706c2c33..33706c2c33 100644
--- a/sw/qa/core/CVE/CVE-2010-3454-1.doc
+++ b/sw/qa/core/data/ww8/pass/CVE-2010-3454-1.doc
Binary files differ
diff --git a/sw/qa/core/data/xml/fail/.gitignore b/sw/qa/core/data/xml/fail/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sw/qa/core/data/xml/fail/.gitignore
diff --git a/sw/qa/core/CVE/CVE-2006-3117-1.sxw b/sw/qa/core/data/xml/fail/CVE-2006-3117-1.sxw
index 49acb42d81..49acb42d81 100644
--- a/sw/qa/core/CVE/CVE-2006-3117-1.sxw
+++ b/sw/qa/core/data/xml/fail/CVE-2006-3117-1.sxw
Binary files differ
diff --git a/sw/qa/core/data/xml/indeterminate/.gitignore b/sw/qa/core/data/xml/indeterminate/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sw/qa/core/data/xml/indeterminate/.gitignore
diff --git a/sw/qa/core/data/xml/pass/.gitignore b/sw/qa/core/data/xml/pass/.gitignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/sw/qa/core/data/xml/pass/.gitignore
diff --git a/sw/qa/core/export.map b/sw/qa/core/export.map
deleted file mode 100644
index 0dbbcc5a73..0000000000
--- a/sw/qa/core/export.map
+++ /dev/null
@@ -1,34 +0,0 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2010 Oracle and/or its affiliates.
-#
-# OpenOffice.org - a multi-platform office productivity suite
-#
-# This file is part of OpenOffice.org.
-#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
-#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-UDK_3_0_0 {
- global:
- cppunitTestPlugIn;
-
- local:
- *;
-};
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index 3c6ec0a23f..71e5d743d9 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -26,31 +26,35 @@
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
-#include "precompiled_sw.hxx"
-#include <cppunit/TestSuite.h>
-#include <cppunit/TestFixture.h>
-#include <cppunit/TestCase.h>
-#include <cppunit/plugin/TestPlugIn.h>
-#include <cppunit/extensions/HelperMacros.h>
+#include <sal/cppunit.h>
+#include <sal/config.h>
#include <osl/file.hxx>
#include <osl/process.h>
+
#include <cppuhelper/compbase1.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <cppuhelper/basemutex.hxx>
+
#include <comphelper/processfactory.hxx>
+
+#include <i18npool/mslangid.hxx>
+
+#include <tools/urlobj.hxx>
+
+#include <unotools/tempfile.hxx>
+#include <unotools/syslocaleoptions.hxx>
+
#include <vcl/svapp.hxx>
+#include <ucbhelper/contentbroker.hxx>
+
#include <sfx2/app.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/sfxmodelfactory.hxx>
-#include <tools/urlobj.hxx>
-#include <unotools/tempfile.hxx>
-#include <ucbhelper/contentbroker.hxx>
-
#include "init.hxx"
#include "swtypes.hxx"
#include "doc.hxx"
@@ -61,12 +65,9 @@
SO2_DECL_REF(SwDocShell)
SO2_IMPL_REF(SwDocShell)
-using namespace ::com::sun::star;
+const int indeterminate = 2;
-static sal_uInt16 aWndFunc(Window *, sal_uInt16, const String &, const String &)
-{
- return ERRCODE_BUTTON_OK;
-}
+using namespace ::com::sun::star;
/* Implementation of Filters test */
@@ -79,9 +80,8 @@ public:
virtual void setUp();
virtual void tearDown();
- bool testLoad(const rtl::OUString &rFilter,
- const rtl::OUString &rUserData,
- const rtl::OUString &rURL);
+ void recursiveScan(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData, int nExpected);
+ bool load(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData);
/**
* Ensure CVEs remain unbroken
@@ -96,12 +96,12 @@ private:
uno::Reference<uno::XComponentContext> m_xContext;
uno::Reference<lang::XMultiComponentFactory> m_xFactory;
uno::Reference<uno::XInterface> m_xWriterComponent;
- ::rtl::OUString m_aPWDURL;
+ ::rtl::OUString m_aSrcRoot;
+ int m_nLoadedDocs;
};
-bool FiltersTest::testLoad(const rtl::OUString &rFilter,
- const rtl::OUString &rUserData,
- const rtl::OUString &rURL)
+bool FiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL,
+ const rtl::OUString &rUserData)
{
SfxFilter aFilter(
rFilter,
@@ -111,74 +111,84 @@ bool FiltersTest::testLoad(const rtl::OUString &rFilter,
SwDocShellRef xDocShRef = new SwDocShell;
SfxMedium aSrcMed(rURL, STREAM_STD_READ, true);
aSrcMed.SetFilter(&aFilter);
- return xDocShRef->DoLoad(&aSrcMed);
+ bool bRet = xDocShRef->DoLoad(&aSrcMed);
+
+ ++m_nLoadedDocs;
+
+ return bRet;
+}
+
+void FiltersTest::recursiveScan(const rtl::OUString &rFilter, const rtl::OUString &rURL, const rtl::OUString &rUserData, int nExpected)
+{
+ osl::Directory aDir(rURL);
+
+ CPPUNIT_ASSERT(osl::FileBase::E_None == aDir.open());
+ osl::DirectoryItem aItem;
+ osl::FileStatus aFileStatus(osl_FileStatus_Mask_FileURL|osl_FileStatus_Mask_Type);
+ while (aDir.getNextItem(aItem) == osl::FileBase::E_None)
+ {
+ aItem.getFileStatus(aFileStatus);
+ rtl::OUString sURL = aFileStatus.getFileURL();
+ if (aFileStatus.getFileType() == osl::FileStatus::Directory)
+ recursiveScan(rFilter, sURL, rUserData, nExpected);
+ else
+ {
+ sal_Int32 nLastSlash = sURL.lastIndexOf('/');
+
+ //ignore .files
+ if (
+ (nLastSlash != -1) && (nLastSlash+1 < sURL.getLength()) &&
+ (sURL.getStr()[nLastSlash+1] == '.')
+ )
+ {
+ continue;
+ }
+
+ rtl::OString aRes(rtl::OUStringToOString(sURL,
+ osl_getThreadTextEncoding()));
+ if (nExpected == indeterminate)
+ {
+ fprintf(stderr, "loading %s\n", aRes.getStr());
+ }
+ sal_uInt32 nStartTime = osl_getGlobalTimer();
+ bool bRes = load(rFilter, sURL, rUserData);
+ sal_uInt32 nEndTime = osl_getGlobalTimer();
+ if (nExpected == indeterminate)
+ {
+ fprintf(stderr, "pass/fail was %d (%"SAL_PRIuUINT32" ms)\n",
+ bRes, nEndTime-nStartTime);
+ continue;
+ }
+ CPPUNIT_ASSERT_MESSAGE(aRes.getStr(), bRes == nExpected);
+ }
+ }
+ CPPUNIT_ASSERT(osl::FileBase::E_None == aDir.close());
}
void FiltersTest::testCVEs()
{
-//To-Do: I know this works on Linux, please check if this test works under
-//windows and enable it if so
-#ifndef WNT
- bool bResult;
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StarOffice XML (Writer)")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2006-3117-1.sxw")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2006-3117 regression", bResult == false);
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rich Text Format")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RTF")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2007-0245-1.rtf")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2007-0245 regression", bResult == true);
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2009-0200-1.doc")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2009-0200 regression", bResult == true);
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2009-0201-1.doc")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2009-0201 regression", bResult == true);
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2009-3301-1.doc")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2009-3301 regression", bResult == true);
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2009-3302-1.doc")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2009-3302 regression", bResult == true);
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2009-3302-2.doc")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2009-3302 regression", bResult == true);
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rich Text Format")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RTF")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2010-3451-1.rtf")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2010-3451 regression", bResult == false);
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rich Text Format")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RTF")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2010-3452-1.rtf")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2010-3452 regression", bResult == true);
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2010-3453-1.doc")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2010-3453 regression", bResult == true);
-
- bResult = testLoad(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")),
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")),
- m_aPWDURL + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/CVE/CVE-2010-3454-1.doc")));
- CPPUNIT_ASSERT_MESSAGE("CVE-2010-3454 regression", bResult == true);
-#endif
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Staroffice XML (Writer)")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/writer/sw/qa/core/data/xml/pass")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML")), true);
+
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Staroffice XML (Writer)")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/writer/sw/qa/core/data/xml/fail")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML")), false);
+
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rich Text Format")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/writer/sw/qa/core/data/rtf/pass")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RTF")), true);
+
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rich Text Format")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/writer/sw/qa/core/data/rtf/fail")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RTF")), false);
+
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Rich Text Format")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/writer/sw/qa/core/data/rtf/indeterminate")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RTF")), indeterminate);
+
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/writer/sw/qa/core/data/ww8/pass")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), true);
+
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/writer/sw/qa/core/data/ww8/fail")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), false);
+
+ recursiveScan(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MS Word 97")), m_aSrcRoot + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/clone/writer/sw/qa/core/data/ww8/indeterminate")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CWW8")), indeterminate);
+
+ printf("Writer: tested %d files\n", m_nLoadedDocs);
}
FiltersTest::FiltersTest()
+ : m_aSrcRoot(RTL_CONSTASCII_USTRINGPARAM("file://"))
+ , m_nLoadedDocs(0)
{
m_xContext = cppu::defaultBootstrap_InitialComponentContext();
m_xFactory = m_xContext->getServiceManager();
@@ -203,20 +213,35 @@ FiltersTest::FiltersTest()
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.FileContentProvider"))), uno::UNO_QUERY);
xUcb->registerContentProvider(xFileProvider, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file")), sal_True);
+ // force locale (and resource files loaded) to en-US
+ const LanguageType eLang=LANGUAGE_ENGLISH_US;
+
+ rtl::OUString aLang, aCountry;
+ MsLangId::convertLanguageToIsoNames(eLang, aLang, aCountry);
+ lang::Locale aLocale(aLang, aCountry, rtl::OUString());
+ ResMgr::SetDefaultLocale( aLocale );
+
+ SvtSysLocaleOptions aLocalOptions;
+ aLocalOptions.SetUILocaleConfigString(
+ MsLangId::convertLanguageToIsoString( eLang ) );
InitVCL(xSM);
- //This is a bit of a fudge, we do this to ensure that SwDLL::Init, which is
- //a private symbol to us, gets called
+ //This is a bit of a fudge, we do this to ensure that SwGlobals::ensure,
+ //which is a private symbol to us, gets called
m_xWriterComponent =
xSM->createInstance(rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Writer.TextDocument")));
- CPPUNIT_ASSERT_MESSAGE("no PWD!", m_xWriterComponent.is());
+ CPPUNIT_ASSERT_MESSAGE("no writer component!", m_xWriterComponent.is());
- ErrorHandler::RegisterDisplay(&aWndFunc);
+ const char* pSrcRoot = getenv( "SRC_ROOT" );
+ CPPUNIT_ASSERT_MESSAGE("SRC_ROOT env variable not set", pSrcRoot != NULL && pSrcRoot[0] != 0);
- oslProcessError err = osl_getProcessWorkingDir(&m_aPWDURL.pData);
- CPPUNIT_ASSERT_MESSAGE("no PWD!", err == osl_Process_E_None);
+#ifdef WNT
+ if (pSrcRoot[1] == ':')
+ m_aSrcRoot += rtl::OUString::createFromAscii( "/" );
+#endif
+ m_aSrcRoot += rtl::OUString::createFromAscii( pSrcRoot );
}
void FiltersTest::setUp()
@@ -225,6 +250,7 @@ void FiltersTest::setUp()
FiltersTest::~FiltersTest()
{
+ uno::Reference< lang::XComponent >(m_xContext, uno::UNO_QUERY_THROW)->dispose();
}
void FiltersTest::tearDown()
diff --git a/sw/qa/core/swdoc-test.cxx b/sw/qa/core/swdoc-test.cxx
index e4de51fac3..10ee439180 100644
--- a/sw/qa/core/swdoc-test.cxx
+++ b/sw/qa/core/swdoc-test.cxx
@@ -27,20 +27,25 @@
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
-#include "precompiled_sw.hxx"
+#include <sal/cppunit.h>
-#include <cppunit/TestSuite.h>
-#include <cppunit/TestFixture.h>
-#include <cppunit/TestCase.h>
-#include <cppunit/plugin/TestPlugIn.h>
-#include <cppunit/extensions/HelperMacros.h>
+#include <sal/config.h>
#include <osl/file.hxx>
#include <osl/process.h>
+
#include <cppuhelper/compbase1.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <cppuhelper/basemutex.hxx>
+
#include <comphelper/processfactory.hxx>
+
+#include <tools/urlobj.hxx>
+
+#include <unotools/tempfile.hxx>
+
+#include <ucbhelper/contentbroker.hxx>
+
#include <vcl/svapp.hxx>
#include <sfx2/app.hxx>
@@ -48,27 +53,20 @@
#include <sfx2/docfile.hxx>
#include <sfx2/sfxmodelfactory.hxx>
-#include <tools/urlobj.hxx>
-#include <unotools/tempfile.hxx>
-#include <ucbhelper/contentbroker.hxx>
-
#include "init.hxx"
#include "swtypes.hxx"
#include "doc.hxx"
#include "docsh.hxx"
#include "shellres.hxx"
#include "docufld.hxx"
+#include "swcrsr.hxx"
+#include "swmodule.hxx"
SO2_DECL_REF(SwDocShell)
SO2_IMPL_REF(SwDocShell)
using namespace ::com::sun::star;
-static sal_uInt16 aWndFunc(Window *, sal_uInt16, const String &, const String &)
-{
- return ERRCODE_BUTTON_OK;
-}
-
/* Implementation of Swdoc-Test class */
class SwDocTest : public CppUnit::TestFixture
@@ -174,9 +172,165 @@ void SwDocTest::testFileNameFields()
m_xDocShRef->DoInitNew(0);
}
+static int
+getRand(int modulus)
+{
+ if (modulus <= 0)
+ return 0;
+ return rand() % modulus;
+}
+
+static rtl::OUString
+getRandString()
+{
+ static rtl::OUString aText( rtl::OUString::createFromAscii("AAAAA BBBB CCC DD E \n"));
+ int s = getRand(aText.getLength());
+ int j = getRand(aText.getLength() - s);
+ rtl::OUString aRet(aText + s, j);
+ if (!getRand(5))
+ aRet += rtl::OUString(sal_Unicode('\n'));
+// fprintf (stderr, "rand string '%s'\n", OUStringToOString(aRet, RTL_TEXTENCODING_UTF8).getStr());
+ return aRet;
+}
+
+#ifdef COMPLEX
+static SwPosition
+getRandomPosition(SwDoc *pDoc, int nOffset)
+{
+ SwPaM aPam(pDoc->GetNodes());
+ SwCursor aCrs(*aPam.Start(), 0, false);
+ for (int sskip = getRand(nOffset); sskip > 0; sskip--)
+ aCrs.GoNextSentence();
+ aCrs.GoNextCell(getRand(50));
+ return *aCrs.GetPoint();
+}
+#endif
+
void SwDocTest::randomTest()
{
CPPUNIT_ASSERT_MESSAGE("SwDoc::IsRedlineOn()", !m_pDoc->IsRedlineOn());
+ RedlineMode_t modes[] = {
+ nsRedlineMode_t::REDLINE_NONE,
+ nsRedlineMode_t::REDLINE_ON,
+ nsRedlineMode_t::REDLINE_SHOW_MASK,
+ nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_MASK,
+ nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_IGNORE,
+ nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_IGNORE | nsRedlineMode_t::REDLINE_SHOW_MASK,
+ nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT,
+ nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_DELETE
+ };
+ static const char *authors[] = {
+ "Jim", "Bob", "JimBobina", "Helga", "Gertrude", "Spagna", "Hurtleweed"
+ };
+
+ for( sal_uInt16 rlm = 0; rlm < SAL_N_ELEMENTS(modes); rlm++)
+ {
+#ifdef COMPLEX
+ m_pDoc->ClearDoc();
+
+ // setup redlining
+ m_pDoc->SetRedlineMode(modes[rlm]);
+ SW_MOD()->SetRedlineAuthor(rtl::OUString::createFromAscii(authors[0]));
+#endif
+
+ for( int i = 0; i < 2000; i++ )
+ {
+#ifdef COMPLEX
+ SwPaM aPam(m_pDoc->GetNodes());
+ SwCursor aCrs(getRandomPosition(m_pDoc, i/20), 0, false);
+ aCrs.SetMark();
+ aCrs.GoNextCell(getRand(30));
+#else // simple:
+ SwNodeIndex nNode( m_pDoc->GetNodes().GetEndOfContent(), -1 );
+ SwPaM aCrs( nNode );
+#endif
+
+ switch (getRand (i < 50 ? 3 : 6)) {
+ // insert ops first
+ case 0: {
+ if (!m_pDoc->InsertString(aCrs, getRandString()))
+ fprintf (stderr, "failed to insert string !\n");
+ break;
+ }
+ case 1:
+ break;
+ case 2: { // switch author
+ int a = getRand(SAL_N_ELEMENTS(authors));
+ SW_MOD()->SetRedlineAuthor(rtl::OUString::createFromAscii(authors[a]));
+ break;
+ }
+
+#ifdef COMPLEX
+ // movement / deletion ops later
+ case 3: // deletion
+ switch (getRand(6)) {
+ case 0:
+ m_pDoc->DelFullPara(aCrs);
+ break;
+ case 1:
+ m_pDoc->DeleteRange(aCrs);
+ break;
+ case 2:
+ m_pDoc->DeleteAndJoin(aCrs, !!getRand(1));
+ break;
+ case 3:
+ default:
+ m_pDoc->Overwrite(aCrs, getRandString());
+ break;
+ }
+ break;
+ case 4: { // movement
+ IDocumentContentOperations::SwMoveFlags nFlags =
+ (IDocumentContentOperations::SwMoveFlags)
+ (getRand(1) ? // FIXME: puterb this more ?
+ IDocumentContentOperations::DOC_MOVEDEFAULT :
+ IDocumentContentOperations::DOC_MOVEALLFLYS |
+ IDocumentContentOperations::DOC_CREATEUNDOOBJ |
+ IDocumentContentOperations::DOC_MOVEREDLINES |
+ IDocumentContentOperations::DOC_NO_DELFRMS);
+ SwPosition aTo(getRandomPosition(m_pDoc, i/10));
+ m_pDoc->MoveRange(aCrs, aTo, nFlags);
+ break;
+ }
+#endif
+ case 5:
+ break;
+
+ // undo / redo ?
+ default:
+ break;
+ }
+#ifdef COMPLEX
+ SwPosition start(m_pDoc->GetNodes());
+ SwPosition end(m_pDoc->GetNodes().GetEndOfContent());
+ CheckNodesRange(start.nNode, end.nNode, sal_True);
+#endif
+ }
+
+#if 0
+ fprintf (stderr, "write it !\n");
+#ifdef COMPLEX
+ SfxFilter aFilter(rtl::OUString::createFromAscii("writer8"),
+ rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CXML")),
+ rtl::OUString() );
+#else
+ SfxFilter aFilter(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Text")),
+ rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TEXT")), rtl::OUString() );
+#endif
+ SfxMedium aDstMed(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///tmp/test.txt")),
+ STREAM_STD_READWRITE, true);
+ aDstMed.SetFilter(&aFilter);
+ m_xDocShRef->DoSaveAs(aDstMed);
+ m_xDocShRef->DoSaveCompleted(&aDstMed);
+ m_xDocShRef->DoInitNew(0);
+#endif
+
+#ifndef COMPLEX
+ return;
+#endif
+ }
}
SwDocTest::SwDocTest()
@@ -207,9 +361,7 @@ SwDocTest::SwDocTest()
InitVCL(xSM);
- SwDLL::Init();
-
- ErrorHandler::RegisterDisplay(&aWndFunc);
+ SwGlobals::ensure();
}
void SwDocTest::setUp()
diff --git a/sw/qa/unoapi/knownissues.xcl b/sw/qa/unoapi/knownissues.xcl
index 3cea08107c..ed29ec08f3 100644
--- a/sw/qa/unoapi/knownissues.xcl
+++ b/sw/qa/unoapi/knownissues.xcl
@@ -187,9 +187,3 @@ sw.SwXTextViewCursor::com::sun::star::view::XScreenCursor
### fd#35660 ###
sw.DocumentSettings::com::sun::star::text::PrintSettings
-
-### fd#35661 ###
-sw.SwXViewSettings::com::sun::star::text::ViewSettings
-
-### fd#35662 ###
-sw.SwXPrintSettings::com::sun::star::text::PrintSettings
diff --git a/sw/sdi/_basesh.sdi b/sw/sdi/_basesh.sdi
index 9ee0c71e60..5f895dd79c 100644
--- a/sw/sdi/_basesh.sdi
+++ b/sw/sdi/_basesh.sdi
@@ -430,9 +430,7 @@ interface BaseTextSelection
StateMethod = GetState ;
]
-/*-----------------22.01.97 09.41-------------------
-// ab hier immer Export = FALSE
---------------------------------------------------*/
+// from here on Export = FALSE
FN_FRAME_WRAP // status()
[
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 490b7ac9b7..7fdd27d890 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -373,6 +373,12 @@ interface BaseText
StateMethod = GetState;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
+ FN_EDIT_HEADER_FOOTER
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState;
+ DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
+ ]
FN_TABLE_UNSET_READ_ONLY // status(final|play)
[
ExecMethod = Execute ;
@@ -768,9 +774,6 @@ interface BaseText
StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
- /*-----------------24.01.97 07.33-------------------
- Fussnoten - Befehle
---------------------------------------------------*/
FN_INSERT_ENDNOTE // status(final|play)
[
@@ -804,9 +807,7 @@ interface BaseText
StateMethod = GetState ;
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
]
- /*-----------------24.01.97 07.34-------------------
- Ende Fussnoten
- --------------------------------------------------*/
+
FN_INSERT_FIELD // status(final|play)
[
ExecMethod = ExecField ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 36c45e495c..152b3fd36a 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -10417,3 +10417,30 @@ SfxVoidItem NavigateForward FN_NAVIGATION_FORWARD
ToolBoxConfig = TRUE,
GroupId = GID_NAVIGATION;
]
+
+//--------------------------------------------------------------------------
+SfxVoidItem EditHeaderFooter FN_EDIT_HEADER_FOOTER
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = TRUE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ Readonly = FALSE,
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
diff --git a/sw/sdi/textsh.sdi b/sw/sdi/textsh.sdi
index f91b3e562a..a3ab0f09a5 100644
--- a/sw/sdi/textsh.sdi
+++ b/sw/sdi/textsh.sdi
@@ -42,10 +42,6 @@ interface Text : BaseText
import TextSelection;
- /*-----------------24.01.97 08.13-------------------
- Spezielle Feldbefehle
---------------------------------------------------*/
-
FN_INSERT_FLD_TOPIC
[
ExecMethod = ExecField ;
@@ -53,23 +49,15 @@ interface Text : BaseText
DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
ReadOnlyDoc = FALSE ;
]
- /*-----------------24.01.97 08.13-------------------
- Ende Spezielle Feldbefehle
---------------------------------------------------*/
-
- /*-----------------24.01.97 07.36-------------------
- Verzeichnisse
---------------------------------------------------*/
- /*
+/*
enum TOXTypes
{
- TOX_INDEX,
- TOX_USER,
- TOX_CONTENT
+ TOX_INDEX,
+ TOX_USER,
+ TOX_CONTENT
};
-
- */
+*/
FN_INSERT_IDX_ENTRY_DLG // status(final|play)
[
@@ -107,14 +95,6 @@ enum TOXTypes
ExecMethod = ExecIdx ;
]
- /*-----------------24.01.97 08.01-------------------
- Absatzeinstellungen
---------------------------------------------------*/
-
- /*-----------------24.01.97 08.01-------------------
- Ende Absatzeinstellungen
---------------------------------------------------*/
-
}
shell SwTextShell : SwBaseShell
diff --git a/sw/source/core/SwNumberTree/SwNodeNum.cxx b/sw/source/core/SwNumberTree/SwNodeNum.cxx
index 637c044982..ee51a04d29 100644
--- a/sw/source/core/SwNumberTree/SwNodeNum.cxx
+++ b/sw/source/core/SwNumberTree/SwNodeNum.cxx
@@ -35,9 +35,8 @@
#include <ndtxt.hxx>
#include <pam.hxx>
#include <stdio.h>
-// --> OD 2007-10-31 #i83479#
+// #i83479#
#include <IDocumentListItems.hxx>
-// <--
#include <doc.hxx>
SwNodeNum::SwNodeNum( SwTxtNode* pTxtNode )
@@ -145,7 +144,6 @@ void SwNodeNum::PostRemove()
mpNumRule = 0;
}
}
-// <--
bool SwNodeNum::IsNotifiable() const
{
@@ -171,7 +169,7 @@ bool SwNodeNum::IsContinuous() const
{
bool aResult = false;
- // --> OD 2006-04-21 #i64311#
+ // #i64311#
if ( GetNumRule() )
{
aResult = mpNumRule->IsContinusNum();
@@ -184,7 +182,6 @@ bool SwNodeNum::IsContinuous() const
{
OSL_FAIL( "<SwNodeNum::IsContinuous()> - OD debug" );
}
- // <--
return aResult;
}
@@ -195,10 +192,9 @@ bool SwNodeNum::IsCounted() const
if ( GetTxtNode() )
{
- // --> OD 2006-01-25 #i59559#
+ // #i59559#
// <SwTxtNode::IsCounted()> determines, if a text node is counted for numbering
aResult = GetTxtNode()->IsCountedInList();
- // <--
}
else
aResult = SwNumberTreeNode::IsCounted();
@@ -206,7 +202,7 @@ bool SwNodeNum::IsCounted() const
return aResult;
}
-// --> OD 2006-04-26 #i64010#
+// #i64010#
bool SwNodeNum::HasCountedChildren() const
{
bool bResult = false;
@@ -230,8 +226,7 @@ bool SwNodeNum::HasCountedChildren() const
return bResult;
}
-// <--
-// --> OD 2006-04-26 #i64010#
+// #i64010#
bool SwNodeNum::IsCountedForNumbering() const
{
return IsCounted() &&
@@ -240,7 +235,6 @@ bool SwNodeNum::IsCountedForNumbering() const
GetTxtNode()->HasNumber() || // text node
GetTxtNode()->HasBullet() ); // text node
}
-// <--
void SwNodeNum::NotifyNode()
@@ -262,10 +256,9 @@ bool SwNodeNum::LessThan(const SwNumberTreeNode & rNode) const
bResult = true;
else if (mpTxtNode != NULL && rTmpNode.mpTxtNode != NULL)
{
- // --> OD 2007-10-31 #i83479# - refactoring
+ // #i83479# - refactoring
// simplify comparison by comparing the indexes of the text nodes
bResult = ( mpTxtNode->GetIndex() < rTmpNode.mpTxtNode->GetIndex() ) ? true : false;
- // <--
}
return bResult;
@@ -287,7 +280,7 @@ bool SwNodeNum::IsCountPhantoms() const
{
bool bResult = true;
- // --> OD 2006-04-21 #i64311#
+ // #i64311#
// phantoms aren't counted in consecutive numbering rules
if ( mpNumRule )
bResult = !mpNumRule->IsContinusNum() &&
@@ -296,7 +289,6 @@ bool SwNodeNum::IsCountPhantoms() const
{
OSL_FAIL( "<SwNodeNum::IsCountPhantoms(): missing numbering rule - please inform OD" );
}
- // <--
return bResult;
}
@@ -380,31 +372,28 @@ void SwNodeNum::_UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum )
{
pTxtNode->RemoveFromList();
// --> clear all list attributes and the list style
- SvUShortsSort aResetAttrsArray;
- aResetAttrsArray.Insert( RES_PARATR_LIST_ID );
- aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL );
- aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART );
- aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE );
- aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED );
- aResetAttrsArray.Insert( RES_PARATR_NUMRULE );
+ std::set<sal_uInt16> aResetAttrsArray;
+ aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_ID );
+ aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_LEVEL );
+ aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_ISRESTART );
+ aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_RESTARTVALUE );
+ aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_LIST_ISCOUNTED );
+ aResetAttrsArray.insert( aResetAttrsArray.end(), RES_PARATR_NUMRULE );
SwPaM aPam( *pTxtNode );
pTxtNode->GetDoc()->ResetAttrs( aPam, sal_False,
- &aResetAttrsArray,
+ aResetAttrsArray,
false );
- // <--
}
}
}
-// <--
-// --> OD 2007-09-06 #i81002#
+// #i81002#
const SwNodeNum* SwNodeNum::GetPrecedingNodeNumOf( const SwTxtNode& rTxtNode ) const
{
const SwNodeNum* pPrecedingNodeNum( 0 );
- // --> OD 2007-10-31 #i83479#
+ // #i83479#
SwNodeNum aNodeNumForTxtNode( const_cast<SwTxtNode*>(&rTxtNode) );
- // <--
pPrecedingNodeNum = dynamic_cast<const SwNodeNum*>(
GetRoot()
@@ -413,6 +402,5 @@ const SwNodeNum* SwNodeNum::GetPrecedingNodeNumOf( const SwTxtNode& rTxtNode ) c
return pPrecedingNodeNum;
}
-// <--
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx b/sw/source/core/SwNumberTree/SwNumberTree.cxx
index 03ccf0e71b..184f94c827 100644
--- a/sw/source/core/SwNumberTree/SwNumberTree.cxx
+++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx
@@ -135,12 +135,11 @@ void SwNumberTreeNode::ClearObsoletePhantoms()
if ((*aIt)->mChildren.empty())
{
- // --> OD 2006-01-17 #i60652#
+ // #i60652#
// Because <mChildren.erase(aIt)> could destroy the element, which
// is referenced by <mItLastValid>, it's needed to adjust
// <mItLastValid> before erasing <aIt>.
SetLastValid(mChildren.end());
- // <--
delete *aIt;
mChildren.erase(aIt);
@@ -243,11 +242,9 @@ void SwNumberTreeNode::ValidateHierarchical(const SwNumberTreeNode * pNode) cons
else
++nTmpNumber;
}
- // <--
(*aIt)->mnNumber = nTmpNumber;
}
- // <--
SetLastValid(aIt, true);
}
@@ -274,15 +271,14 @@ void SwNumberTreeNode::ValidateContinuous(const SwNumberTreeNode * pNode) const
{
SwNumberTreeNode * pPred = (*aIt)->GetPred();
- // --> OD 2006-04-21 #i64311#
+ // #i64311#
// correct consideration of phantoms
// correct consideration of restart at a number tree node
if ( pPred )
{
if ( !(*aIt)->IsCounted() )
- // --> OD 2006-05-12 #i65284#
+ // #i65284#
nTmpNumber = pPred->GetNumber( pPred->GetParent() != (*aIt)->GetParent() );
- // <--
else
{
if ( (*aIt)->IsRestart() )
@@ -303,17 +299,15 @@ void SwNumberTreeNode::ValidateContinuous(const SwNumberTreeNode * pNode) const
nTmpNumber = GetStartValue();
}
}
- // <--
(*aIt)->mnNumber = nTmpNumber;
}
}
while (aIt != mChildren.end() && *aIt != pNode);
- // --> OD 2008-05-21 #i74748# - applied patch from garnier_romain
+ // #i74748# - applied patch from garnier_romain
// number tree node has to be validated.
SetLastValid( aIt, true );
- // <--
}
void SwNumberTreeNode::Validate(const SwNumberTreeNode * pNode) const
@@ -401,21 +395,19 @@ void SwNumberTreeNode::MoveGreaterChildren( SwNumberTreeNode& _rCompareNode,
_rDestNode.mChildren.insert(aItUpper, mChildren.end());
- // --> OD 2006-01-17 #i60652#
+ // #i60652#
// Because <mChildren.erase(aItUpper, mChildren.end())> could destroy
// the element, which is referenced by <mItLastValid>, it's needed to
// adjust <mItLastValid> before erasing <aIt>.
SetLastValid( mChildren.end() );
- // <--
mChildren.erase(aItUpper, mChildren.end());
- // --> OD 2006-01-17 #i60652#
+ // #i60652#
if ( !mChildren.empty() )
{
SetLastValid( --(mChildren.end()) );
}
- // <--
}
#ifdef __SW_NUMBER_TREE_SANITY_CHECK
@@ -431,12 +423,11 @@ void SwNumberTreeNode::MoveChildren(SwNumberTreeNode * pDest)
tSwNumberTreeChildren::iterator aItBegin = mChildren.begin();
SwNumberTreeNode * pMyFirst = *mChildren.begin();
- // --> OD 2006-01-17 #i60652#
+ // #i60652#
// Because <mChildren.erase(aItBegin)> could destroy the element,
// which is referenced by <mItLastValid>, it's needed to adjust
// <mItLastValid> before erasing <aItBegin>.
SetLastValid(mChildren.end());
- // <--
if (pMyFirst->IsPhantom())
{
@@ -598,7 +589,6 @@ void SwNumberTreeNode::AddChild( SwNumberTreeNode * pChild,
}
// assure that unnessary created phantoms at <pChild> are deleted.
pChild->ClearObsoletePhantoms();
- // <--
if ((*aPredIt)->IsValid())
SetLastValid(aPredIt);
@@ -680,7 +670,7 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild)
(*aItPred)->NotifyInvalidChildren();
}
- // --> OD 2006-01-17 #i60652#
+ // #i60652#
// Because <mChildren.erase(aRemoveIt)> could destroy the element,
// which is referenced by <mItLastValid>, it's needed to adjust
// <mItLastValid> before erasing <aRemoveIt>.
@@ -688,7 +678,6 @@ void SwNumberTreeNode::RemoveChild(SwNumberTreeNode * pChild)
SetLastValid(mChildren.end());
else
SetLastValid(aItPred);
- // <--
mChildren.erase(aRemoveIt);
@@ -1065,10 +1054,9 @@ SwNumberTreeNode * SwNumberTreeNode::GetPred(bool bSibling) const
if ( aIt == mpParent->mChildren.begin() )
{
- // --> OD 2006-04-24 #i64311#
+ // #i64311#
// root node is no valid predecessor
pResult = mpParent->GetParent() ? mpParent : NULL;
- // <--
}
else
{
@@ -1237,7 +1225,6 @@ void SwNumberTreeNode::NotifyInvalidChildren()
}
}
- // <--
}
if (IsContinuous() && mpParent)
@@ -1250,7 +1237,7 @@ void SwNumberTreeNode::NotifyInvalidSiblings()
mpParent->NotifyInvalidChildren();
}
-// --> OD 2007-09-07 #i81002#
+// #i81002#
const SwNumberTreeNode* SwNumberTreeNode::GetPrecedingNodeOf(
const SwNumberTreeNode& rNode ) const
{
@@ -1281,7 +1268,6 @@ const SwNumberTreeNode* SwNumberTreeNode::GetPrecedingNodeOf(
return pPrecedingNode;
}
-// <--
void SwNumberTreeNode::NotifyNodesOnListLevel( const int nListLevel )
{
diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx
index dbd1b51965..83c61cf318 100644
--- a/sw/source/core/access/acccell.cxx
+++ b/sw/source/core/access/acccell.cxx
@@ -35,7 +35,7 @@
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <unotools/accessiblestatesethelper.hxx>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <vcl/svapp.hxx>
#include <cellfrm.hxx>
#include <tabfrm.hxx>
@@ -49,10 +49,7 @@
#include "accmap.hxx"
#include <acccell.hxx>
-#ifndef _STLP_CFLOAT
#include <cfloat>
-#endif
-
#include <limits.h>
using namespace ::com::sun::star;
@@ -67,9 +64,9 @@ sal_Bool SwAccessibleCell::IsSelected()
{
sal_Bool bRet = sal_False;
- DBG_ASSERT( GetMap(), "no map?" );
+ OSL_ENSURE( GetMap(), "no map?" );
const ViewShell *pVSh = GetMap()->GetShell();
- DBG_ASSERT( pVSh, "no shell?" );
+ OSL_ENSURE( pVSh, "no shell?" );
if( pVSh->ISA( SwCrsrShell ) )
{
const SwCrsrShell *pCSh = static_cast< const SwCrsrShell * >( pVSh );
@@ -92,7 +89,7 @@ void SwAccessibleCell::GetStates( ::utl::AccessibleStateSetHelper& rStateSet )
// SELECTABLE
const ViewShell *pVSh = GetMap()->GetShell();
- DBG_ASSERT( pVSh, "no shell?" );
+ OSL_ENSURE( pVSh, "no shell?" );
if( pVSh->ISA( SwCrsrShell ) )
rStateSet.AddState( AccessibleStateType::SELECTABLE );
@@ -306,26 +303,23 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleCell::getTypes()
return aTypes;
}
+namespace
+{
+ class theSwAccessibleCellImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleCellImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleCell::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleCellImplementationId::get().getSeq();
}
// ===== XAccessibleValue ===============================================
SwFrmFmt* SwAccessibleCell::GetTblBoxFormat() const
{
- DBG_ASSERT( GetFrm() != NULL, "no frame?" );
- DBG_ASSERT( GetFrm()->IsCellFrm(), "no cell frame?" );
+ OSL_ENSURE( GetFrm() != NULL, "no frame?" );
+ OSL_ENSURE( GetFrm()->IsCellFrm(), "no cell frame?" );
const SwCellFrm* pCellFrm = static_cast<const SwCellFrm*>( GetFrm() );
return pCellFrm->GetTabBox()->GetFrmFmt();
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 78f18fab7a..bbb07c69d6 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -28,16 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#if (OSL_DEBUG_LEVEL > 1) && defined TEST_MIB
- #ifndef _STRING_HXX
- #include <tools/string.hxx>
- #endif
-
- #ifndef _STREAM_HXX
- #include <tools/stream.hxx>
- #endif
-#endif // #if (OSL_DEBUG_LEVEL > 1) && defined TEST_MIB
-#include <tools/debug.hxx>
#include <vcl/window.hxx>
#include <swtypes.hxx>
@@ -67,28 +57,6 @@
#include <PostItMgr.hxx>
using namespace sw::access;
-
-#if (OSL_DEBUG_LEVEL > 1) && defined TEST_MIB
-#define DBG_MSG( _msg ) \
- lcl_SwAccessibleContext_DbgMsg( this, _msg, 0, sal_False );
-#define DBG_MSG_CD( _msg ) \
- lcl_SwAccessibleContext_DbgMsg( this, _msg, 0, sal_True );
-#define DBG_MSG_PARAM( _msg, _param ) \
- lcl_SwAccessibleContext_DbgMsg( this, _msg, _param, sal_False );
-#define DBG_MSG_THIS_PARAM( _msg, _this, _param ) \
- lcl_SwAccessibleContext_DbgMsg( _this, _msg, _param, sal_False );
-
-void lcl_SwAccessibleContext_DbgMsg( SwAccessibleContext *pThisAcc,
- const char *pMsg,
- SwAccessibleContext *pChildAcc,
- sal_Bool bConstrDestr );
-#else
-#define DBG_MSG( _msg )
-#define DBG_MSG_PARAM( _msg, _param )
-#define DBG_MSG_THIS_PARAM( _msg, _this, _param )
-#define DBG_MSG_CD( _msg )
-#endif
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
using ::rtl::OUString;
@@ -363,7 +331,6 @@ void SwAccessibleContext::ScrolledIn()
aEvent.NewValue <<= xThis;
xParentImpl->FireAccessibleEvent( aEvent );
- DBG_MSG_PARAM( "AccessibleChild (added)", xChildImpl.get() );
if( HasCursor() )
{
@@ -431,7 +398,6 @@ void SwAccessibleContext::InvalidateChildrenStates( const SwFrm* _pFrm,
++aIter;
}
}
-// <--
void SwAccessibleContext::DisposeChildren( const SwFrm *pFrm,
sal_Bool bRecursive )
@@ -502,7 +468,6 @@ void SwAccessibleContext::FireVisibleDataEvent()
aEvent.EventId = AccessibleEventId::VISIBLE_DATA_CHANGED;
FireAccessibleEvent( aEvent );
- DBG_MSG( "AccessibleVisibleData" )
}
void SwAccessibleContext::FireStateChangedEvent( sal_Int16 nState,
@@ -517,7 +482,6 @@ void SwAccessibleContext::FireStateChangedEvent( sal_Int16 nState,
aEvent.OldValue <<= nState;
FireAccessibleEvent( aEvent );
- DBG_MSG( "StateChanged" )
}
void SwAccessibleContext::GetStates(
@@ -570,14 +534,11 @@ SwAccessibleContext::SwAccessibleContext( SwAccessibleMap *pM,
, bRegisteredAtAccessibleMap( true )
{
InitStates();
- DBG_MSG_CD( "constructed" )
}
SwAccessibleContext::~SwAccessibleContext()
{
SolarMutexGuard aGuard;
-
- DBG_MSG_CD( "destructed" )
RemoveFrmFromAccessibleMap();
}
@@ -750,8 +711,6 @@ void SAL_CALL SwAccessibleContext::addEventListener(
const uno::Reference< XAccessibleEventListener >& xListener )
throw (uno::RuntimeException)
{
- DBG_MSG( "accessible event listener added" )
-
if (xListener.is())
{
SolarMutexGuard aGuard;
@@ -765,8 +724,6 @@ void SAL_CALL SwAccessibleContext::removeEventListener(
const uno::Reference< XAccessibleEventListener >& xListener )
throw (uno::RuntimeException)
{
- DBG_MSG( "accessible event listener removed" )
-
if (xListener.is())
{
SolarMutexGuard aGuard;
@@ -1103,7 +1060,6 @@ void SwAccessibleContext::Dispose( sal_Bool bRecursive )
aEvent.EventId = AccessibleEventId::CHILD;
aEvent.OldValue <<= xThis;
pAcc->FireAccessibleEvent( aEvent );
- DBG_MSG_THIS_PARAM( "AccessibleChild (removed)", pAcc, this )
}
// set defunc state (its not required to broadcast a state changed
@@ -1118,7 +1074,6 @@ void SwAccessibleContext::Dispose( sal_Bool bRecursive )
{
comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( nClientId, *this );
nClientId = 0;
- DBG_MSG_CD( "dispose" )
}
RemoveFrmFromAccessibleMap();
@@ -1255,7 +1210,6 @@ void SwAccessibleContext::InvalidateChildPosOrSize(
{
OSL_FAIL( "<SwAccessibleContext::InvalidateChildPosOrSize(..)> - no accessible shape found." );
}
- // <--
}
else if ( rChildFrmOrObj.GetWindow() )
{
@@ -1361,7 +1315,6 @@ void SwAccessibleContext::InvalidateStates( tAccessibleStates _nStates )
InvalidateChildrenStates( GetFrm(), _nStates );
}
}
-// <--
void SwAccessibleContext::InvalidateRelation( sal_uInt16 nType )
{
@@ -1520,65 +1473,4 @@ void SwAccessibleContext::GetAdditionalAccessibleChildren( std::vector< Window*
}
}
-#if (OSL_DEBUG_LEVEL > 1) && defined TEST_MIB
-void lcl_SwAccessibleContext_DbgMsg( SwAccessibleContext *pThisAcc,
- const char *pMsg,
- SwAccessibleContext *pChildAcc,
- sal_Bool bConstrDestr )
-{
- static SvFileStream aStrm( String::CreateFromAscii("j:\\acc.log"),
- STREAM_WRITE|STREAM_TRUNC|STREAM_SHARE_DENYNONE );
- ByteString aName( String(pThisAcc->GetName()),
- RTL_TEXTENCODING_ISO_8859_1 );
- if( aName.Len() )
- {
- aStrm << aName.GetBuffer()
- << ": ";
- }
- aStrm << pMsg;
- if( pChildAcc )
- {
- ByteString aChild( String(pChildAcc->GetName()),
- RTL_TEXTENCODING_ISO_8859_1 );
- aStrm << ": "
- << aChild.GetBuffer();
- }
- aStrm << "\r\n (";
-
- if( !bConstrDestr )
- {
- ByteString aDesc( String(pThisAcc->getAccessibleDescription()),
- RTL_TEXTENCODING_ISO_8859_1 );
- aStrm << aDesc.GetBuffer()
- << ", ";
- }
-
- Rectangle aVisArea( pThisAcc->GetVisArea() );
- aStrm << "VA: "
- << ByteString::CreateFromInt32( aVisArea.Left() ).GetBuffer()
- << ","
- << ByteString::CreateFromInt32( aVisArea.Top() ).GetBuffer()
- << ","
- << ByteString::CreateFromInt32( aVisArea.GetWidth() ).GetBuffer()
- << ","
- << ByteString::CreateFromInt32( aVisArea.GetHeight() ).GetBuffer();
-
- if( pThisAcc->GetFrm() )
- {
- Rectangle aBounds( pThisAcc->GetBounds( pThisAcc->GetFrm() ) );
- aStrm << ", BB: "
- << ByteString::CreateFromInt32( aBounds.Left() ).GetBuffer()
- << ","
- << ByteString::CreateFromInt32( aBounds.Top() ).GetBuffer()
- << ","
- << ByteString::CreateFromInt32( aBounds.GetWidth() ).GetBuffer()
- << ","
- << ByteString::CreateFromInt32( aBounds.GetHeight() ).GetBuffer()
- << ")\r\n";
- }
-
- aStrm.Flush();
-}
-#endif
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acccontext.hxx b/sw/source/core/access/acccontext.hxx
index 8a35344b18..46f6c49d64 100644
--- a/sw/source/core/access/acccontext.hxx
+++ b/sw/source/core/access/acccontext.hxx
@@ -156,7 +156,6 @@ protected:
// #i27301# - use new type definition for <_nStates>
void InvalidateChildrenStates( const SwFrm* _pFrm,
tAccessibleStates _nStates );
- // <--
// Dispose children of the specified SwFrm. The SwFrm might belong to
// the current object or to any other child or grandchild.
@@ -374,7 +373,7 @@ public:
bool HasAdditionalAccessibleChildren();
// #i88070# - get additional child by index
- Window* GetAdditionalAccessibleChild( const sal_Int32 nIndex );
+ Window* GetAdditionalAccessibleChild( const sal_Int32 nIndex );
// #i88070# - get all additional accessible children
void GetAdditionalAccessibleChildren( std::vector< Window* >* pChildren );
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index d60c8ae17d..65dd8984c9 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -41,6 +41,7 @@
#include <sfx2/viewsh.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
#include <viewsh.hxx>
#include <doc.hxx>
#include <accmap.hxx>
@@ -346,11 +347,11 @@ void SwAccessibleDocument::Dispose( sal_Bool bRecursive )
IMPL_LINK( SwAccessibleDocument, WindowChildEventListener, VclSimpleEvent*, pEvent )
{
- DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
+ OSL_ENSURE( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
if ( pEvent && pEvent->ISA( VclWindowEvent ) )
{
VclWindowEvent *pVclEvent = static_cast< VclWindowEvent * >( pEvent );
- DBG_ASSERT( pVclEvent->GetWindow(), "Window???" );
+ OSL_ENSURE( pVclEvent->GetWindow(), "Window???" );
switch ( pVclEvent->GetId() )
{
case VCLEVENT_WINDOW_SHOW: // send create on show for direct accessible children
@@ -444,18 +445,15 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleDocument::getTypes()
return aTypes;
}
+namespace
+{
+ class theSwAccessibleDocumentImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleDocumentImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleDocument::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleDocumentImplementationId::get().getSeq();
}
//===== XAccessibleSelection ============================================
diff --git a/sw/source/core/access/accembedded.cxx b/sw/source/core/access/accembedded.cxx
index 18808e2e80..cb84ff0bda 100644
--- a/sw/source/core/access/accembedded.cxx
+++ b/sw/source/core/access/accembedded.cxx
@@ -33,7 +33,7 @@
#include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <flyfrm.hxx>
#include "accembedded.hxx"
@@ -82,19 +82,15 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleEmbeddedObject::getSupportedServi
return aRet;
}
+namespace
+{
+ class theSwAccessibleEmbeddedObjectImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleEmbeddedObjectImplementationId > {};
+}
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleEmbeddedObject::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleEmbeddedObjectImplementationId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accfootnote.cxx b/sw/source/core/access/accfootnote.cxx
index 6cfea84869..af5c83aa56 100644
--- a/sw/source/core/access/accfootnote.cxx
+++ b/sw/source/core/access/accfootnote.cxx
@@ -34,7 +34,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblestatesethelper.hxx>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <vcl/svapp.hxx>
#include <ftnfrm.hxx>
#include <fmtftn.hxx>
@@ -135,18 +135,15 @@ Sequence< OUString > SAL_CALL SwAccessibleFootnote::getSupportedServiceNames()
return aRet;
}
+namespace
+{
+ class theSwAccessibleFootnoteImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleFootnoteImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwAccessibleFootnote::getImplementationId()
throw(RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleFootnoteImplementationId::get().getSeq();
}
sal_Bool SwAccessibleFootnote::IsEndnote( const SwFtnFrm *pFtnFrm )
diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx
index bd88adbafa..060af1e27d 100644
--- a/sw/source/core/access/accframebase.cxx
+++ b/sw/source/core/access/accframebase.cxx
@@ -55,9 +55,9 @@ sal_Bool SwAccessibleFrameBase::IsSelected()
{
sal_Bool bRet = sal_False;
- DBG_ASSERT( GetMap(), "no map?" );
+ OSL_ENSURE( GetMap(), "no map?" );
const ViewShell *pVSh = GetMap()->GetShell();
- DBG_ASSERT( pVSh, "no shell?" );
+ OSL_ENSURE( pVSh, "no shell?" );
if( pVSh->ISA( SwFEShell ) )
{
const SwFEShell *pFESh = static_cast< const SwFEShell * >( pVSh );
@@ -75,7 +75,7 @@ void SwAccessibleFrameBase::GetStates(
SwAccessibleContext::GetStates( rStateSet );
const ViewShell *pVSh = GetMap()->GetShell();
- DBG_ASSERT( pVSh, "no shell?" );
+ OSL_ENSURE( pVSh, "no shell?" );
sal_Bool bSelectable = pVSh->ISA( SwFEShell );
// SELECTABLE
diff --git a/sw/source/core/access/accgraphic.cxx b/sw/source/core/access/accgraphic.cxx
index d6ba4ee9ff..eaf463c9b6 100644
--- a/sw/source/core/access/accgraphic.cxx
+++ b/sw/source/core/access/accgraphic.cxx
@@ -33,7 +33,7 @@
#include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <flyfrm.hxx>
#include "accgraphic.hxx"
@@ -83,18 +83,15 @@ Sequence< OUString > SAL_CALL SwAccessibleGraphic::getSupportedServiceNames()
return aRet;
}
+namespace
+{
+ class theSwAccessibleGraphicImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleGraphicImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwAccessibleGraphic::getImplementationId()
throw(RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleGraphicImplementationId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accheaderfooter.cxx b/sw/source/core/access/accheaderfooter.cxx
index c1e2697116..245b274bce 100644
--- a/sw/source/core/access/accheaderfooter.cxx
+++ b/sw/source/core/access/accheaderfooter.cxx
@@ -34,7 +34,7 @@
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <unotools/accessiblestatesethelper.hxx>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <vcl/svapp.hxx>
#include <hffrm.hxx>
#include "accheaderfooter.hxx"
@@ -129,18 +129,15 @@ Sequence< OUString > SAL_CALL SwAccessibleHeaderFooter::getSupportedServiceNames
return aRet;
}
+namespace
+{
+ class theSwAccessibleHeaderFooterImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleHeaderFooterImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwAccessibleHeaderFooter::getImplementationId()
throw(RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleHeaderFooterImplementationId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index dd16efc5b4..2a6c725946 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -35,8 +35,6 @@
#include <vcl/window.hxx>
#include <svx/svdmodel.hxx>
#include <svx/unomod.hxx>
-#include <tools/debug.hxx>
-
#include <map>
#include <list>
#include <accmap.hxx>
@@ -1412,7 +1410,7 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrm *pFrm,
static_cast< const SwTabFrm *>( pFrm ) );
break;
case FRM_PAGE:
- DBG_ASSERT( GetShell()->IsPreView(),
+ OSL_ENSURE( GetShell()->IsPreView(),
"accessible page frames only in PagePreview" );
pAcc = new SwAccessiblePage( this, pFrm );
break;
@@ -2210,8 +2208,8 @@ void SwAccessibleMap::UpdatePreview( const std::vector<PrevwPage*>& _rPrevwPages
const SwPageFrm* _pSelectedPageFrm,
const Size& _rPrevwWinSize )
{
- DBG_ASSERT( GetShell()->IsPreView(), "no preview?" );
- DBG_ASSERT( mpPreview != NULL, "no preview data?" );
+ OSL_ENSURE( GetShell()->IsPreView(), "no preview?" );
+ OSL_ENSURE( mpPreview != NULL, "no preview data?" );
mpPreview->Update( *this, _rPrevwPages, _rScale, _pSelectedPageFrm, _rPrevwWinSize );
@@ -2247,8 +2245,8 @@ void SwAccessibleMap::UpdatePreview( const std::vector<PrevwPage*>& _rPrevwPages
void SwAccessibleMap::InvalidatePreViewSelection( sal_uInt16 nSelPage )
{
- DBG_ASSERT( GetShell()->IsPreView(), "no preview?" );
- DBG_ASSERT( mpPreview != NULL, "no preview data?" );
+ OSL_ENSURE( GetShell()->IsPreView(), "no preview?" );
+ OSL_ENSURE( mpPreview != NULL, "no preview data?" );
mpPreview->InvalidateSelection( GetShell()->GetLayout()->GetPageByPageNum( nSelPage ) );
@@ -2550,7 +2548,7 @@ void SwAccessibleMap::GetMapMode( const Point& _rPoint,
MapMode aMapMode = GetShell()->GetWin()->GetMapMode();
if( GetShell()->IsPreView() )
{
- DBG_ASSERT( mpPreview != NULL, "need preview data" );
+ OSL_ENSURE( mpPreview != NULL, "need preview data" );
mpPreview->AdjustMapMode( aMapMode, _rPoint );
}
@@ -2559,8 +2557,8 @@ void SwAccessibleMap::GetMapMode( const Point& _rPoint,
Size SwAccessibleMap::GetPreViewPageSize( sal_uInt16 _nPrevwPageNum ) const
{
- DBG_ASSERT( mpVSh->IsPreView(), "no page preview accessible." );
- DBG_ASSERT( mpVSh->IsPreView() && ( mpPreview != NULL ),
+ OSL_ENSURE( mpVSh->IsPreView(), "no page preview accessible." );
+ OSL_ENSURE( mpVSh->IsPreView() && ( mpPreview != NULL ),
"missing accessible preview data at page preview" );
if ( mpVSh->IsPreView() && ( mpPreview != NULL ) )
{
@@ -2770,7 +2768,7 @@ void SwAccessibleMap::InvalidateTextSelectionOfAllParas()
const SwRect& SwAccessibleMap::GetVisArea() const
{
- DBG_ASSERT( !GetShell()->IsPreView() || (mpPreview != NULL),
+ OSL_ENSURE( !GetShell()->IsPreView() || (mpPreview != NULL),
"preview without preview data?" );
return GetShell()->IsPreView()
diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx
index 9b8763030d..62be2a981f 100644
--- a/sw/source/core/access/accnotextframe.cxx
+++ b/sw/source/core/access/accnotextframe.cxx
@@ -84,7 +84,6 @@ SwAccessibleNoTextFrame::SwAccessibleNoTextFrame(
msDesc = msTitle;
}
}
- // <--
}
SwAccessibleNoTextFrame::~SwAccessibleNoTextFrame()
@@ -184,7 +183,6 @@ OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleName (void)
return SwAccessibleFrameBase::getAccessibleName();
}
-// <--
OUString SAL_CALL SwAccessibleNoTextFrame::getAccessibleDescription (void)
throw (uno::RuntimeException)
diff --git a/sw/source/core/access/accnotextframe.hxx b/sw/source/core/access/accnotextframe.hxx
index b7459ca6aa..2c206ce140 100644
--- a/sw/source/core/access/accnotextframe.hxx
+++ b/sw/source/core/access/accnotextframe.hxx
@@ -60,7 +60,6 @@ public:
virtual ::rtl::OUString SAL_CALL
getAccessibleName (void)
throw (::com::sun::star::uno::RuntimeException);
- // <--
/// Return this object's description.
virtual ::rtl::OUString SAL_CALL
diff --git a/sw/source/core/access/accpage.cxx b/sw/source/core/access/accpage.cxx
index cd1dc8a02a..24b57e4c8a 100644
--- a/sw/source/core/access/accpage.cxx
+++ b/sw/source/core/access/accpage.cxx
@@ -30,12 +30,12 @@
#include "precompiled_sw.hxx"
-#include <rtl/uuid.h>
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
#include <unotools/accessiblestatesethelper.hxx>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
+#include <comphelper/servicehelper.hxx>
#include "accpage.hxx"
#include "access.hrc"
@@ -129,9 +129,9 @@ SwAccessiblePage::SwAccessiblePage( SwAccessibleMap* pInitMap,
: SwAccessibleContext( pInitMap, AccessibleRole::PANEL, pFrame )
, bIsSelected( sal_False )
{
- DBG_ASSERT( pFrame != NULL, "need frame" );
- DBG_ASSERT( pInitMap != NULL, "need map" );
- DBG_ASSERT( pFrame->IsPageFrm(), "need page frame" );
+ OSL_ENSURE( pFrame != NULL, "need frame" );
+ OSL_ENSURE( pInitMap != NULL, "need map" );
+ OSL_ENSURE( pFrame->IsPageFrm(), "need page frame" );
SolarMutexGuard aGuard;
@@ -175,18 +175,15 @@ Sequence<OUString> SwAccessiblePage::getSupportedServiceNames( )
return aRet;
}
+namespace
+{
+ class theSwAccessiblePageImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessiblePageImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwAccessiblePage::getImplementationId()
throw(RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessiblePageImplementationId::get().getSeq();
}
OUString SwAccessiblePage::getAccessibleDescription( )
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index f515494d23..e8ec678fe8 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -81,8 +81,8 @@
// #i10825#
#include <parachangetrackinginfo.hxx>
#include <com/sun/star/text/TextMarkupType.hpp>
-// <--
#include <comphelper/stlunosequence.hxx> // #i92233#
+#include <comphelper/servicehelper.hxx>
#include <algorithm>
@@ -111,10 +111,10 @@ const xub_StrLen MAX_DESC_TEXT_LEN = 40;
const SwTxtNode* SwAccessibleParagraph::GetTxtNode() const
{
const SwFrm* pFrm = GetFrm();
- DBG_ASSERT( pFrm->IsTxtFrm(), "The text frame has mutated!" );
+ OSL_ENSURE( pFrm->IsTxtFrm(), "The text frame has mutated!" );
const SwTxtNode* pNode = static_cast<const SwTxtFrm*>(pFrm)->GetTxtNode();
- DBG_ASSERT( pNode != NULL, "A text frame without a text node." );
+ OSL_ENSURE( pNode != NULL, "A text frame without a text node." );
return pNode;
}
@@ -161,8 +161,8 @@ sal_Int32 SwAccessibleParagraph::GetCaretPos()
nRet = GetPortionData().GetAccessiblePosition( nIndex );
}
- DBG_ASSERT( nRet >= 0, "invalid cursor?" );
- DBG_ASSERT( nRet <= GetPortionData().GetAccessibleString().
+ OSL_ENSURE( nRet >= 0, "invalid cursor?" );
+ OSL_ENSURE( nRet <= GetPortionData().GetAccessibleString().
getLength(), "invalid cursor?" );
}
// else: in this paragraph, but in different frame
@@ -216,7 +216,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
}
else
{
- DBG_ASSERT( nHere == nStartIndex,
+ OSL_ENSURE( nHere == nStartIndex,
"miscalculated index" );
// selection starts in this node:
@@ -231,7 +231,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
else if( nCoreStart <=
GetPortionData().GetLastValidCorePosition() )
{
- DBG_ASSERT(
+ OSL_ENSURE(
GetPortionData().IsValidCorePosition(
nCoreStart ),
"problem determining valid core position" );
@@ -253,7 +253,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
}
else
{
- DBG_ASSERT( nHere == nEndIndex,
+ OSL_ENSURE( nHere == nEndIndex,
"miscalculated index" );
// selection ends in this node: then select everything
@@ -270,7 +270,7 @@ sal_Bool SwAccessibleParagraph::GetSelection(
GetPortionData().GetFirstValidCorePosition() )
{
// selection is inside our part of this para
- DBG_ASSERT(
+ OSL_ENSURE(
GetPortionData().IsValidCorePosition(
nCoreEnd ),
"problem determining valid core position" );
@@ -312,7 +312,6 @@ SwPaM* SwAccessibleParagraph::GetCursor( const bool _bForSelection )
// a table selection has to be returned.
if ( pCrsrShell != NULL &&
( _bForSelection || !pCrsrShell->IsTableMode() ) )
- // <--
{
SwFEShell *pFESh = pCrsrShell->ISA( SwFEShell )
? static_cast< SwFEShell * >( pCrsrShell ) : 0;
@@ -521,8 +520,8 @@ void SwAccessibleParagraph::UpdatePortionData()
throw( uno::RuntimeException )
{
// obtain the text frame
- DBG_ASSERT( GetFrm() != NULL, "The text frame has vanished!" );
- DBG_ASSERT( GetFrm()->IsTxtFrm(), "The text frame has mutated!" );
+ OSL_ENSURE( GetFrm() != NULL, "The text frame has vanished!" );
+ OSL_ENSURE( GetFrm()->IsTxtFrm(), "The text frame has mutated!" );
const SwTxtFrm* pFrm = static_cast<const SwTxtFrm*>( GetFrm() );
// build new portion data
@@ -531,7 +530,7 @@ void SwAccessibleParagraph::UpdatePortionData()
pFrm->GetTxtNode(), GetMap()->GetShell()->GetViewOptions() );
pFrm->VisitPortions( *pPortionData );
- DBG_ASSERT( pPortionData != NULL, "UpdatePortionData() failed" );
+ OSL_ENSURE( pPortionData != NULL, "UpdatePortionData() failed" );
}
void SwAccessibleParagraph::ClearPortionData()
@@ -546,23 +545,23 @@ void SwAccessibleParagraph::ClearPortionData()
void SwAccessibleParagraph::ExecuteAtViewShell( sal_uInt16 nSlot )
{
- DBG_ASSERT( GetMap() != NULL, "no map?" );
+ OSL_ENSURE( GetMap() != NULL, "no map?" );
ViewShell* pViewShell = GetMap()->GetShell();
- DBG_ASSERT( pViewShell != NULL, "View shell exptected!" );
+ OSL_ENSURE( pViewShell != NULL, "View shell exptected!" );
SfxViewShell* pSfxShell = pViewShell->GetSfxViewShell();
- DBG_ASSERT( pSfxShell != NULL, "SfxViewShell shell exptected!" );
+ OSL_ENSURE( pSfxShell != NULL, "SfxViewShell shell exptected!" );
if( !pSfxShell )
return;
SfxViewFrame *pFrame = pSfxShell->GetViewFrame();
- DBG_ASSERT( pFrame != NULL, "View frame exptected!" );
+ OSL_ENSURE( pFrame != NULL, "View frame exptected!" );
if( !pFrame )
return;
SfxDispatcher *pDispatcher = pFrame->GetDispatcher();
- DBG_ASSERT( pDispatcher != NULL, "Dispatcher exptected!" );
+ OSL_ENSURE( pDispatcher != NULL, "Dispatcher exptected!" );
if( !pDispatcher )
return;
@@ -573,7 +572,7 @@ SwXTextPortion* SwAccessibleParagraph::CreateUnoPortion(
sal_Int32 nStartIndex,
sal_Int32 nEndIndex )
{
- DBG_ASSERT( (IsValidChar(nStartIndex, GetString().getLength()) &&
+ OSL_ENSURE( (IsValidChar(nStartIndex, GetString().getLength()) &&
(nEndIndex == -1)) ||
IsValidRange(nStartIndex, nEndIndex, GetString().getLength()),
"please check parameters before calling this method" );
@@ -646,8 +645,8 @@ sal_Bool SwAccessibleParagraph::GetWordBoundary(
sal_Bool bRet = sal_False;
// now ask the Break-Iterator for the word
- DBG_ASSERT( pBreakIt != NULL, "We always need a break." );
- DBG_ASSERT( pBreakIt->GetBreakIter().is(), "No break-iterator." );
+ OSL_ENSURE( pBreakIt != NULL, "We always need a break." );
+ OSL_ENSURE( pBreakIt->GetBreakIter().is(), "No break-iterator." );
if( pBreakIt->GetBreakIter().is() )
{
// get locale for this position
@@ -726,8 +725,8 @@ sal_Bool SwAccessibleParagraph::GetGlyphBoundary(
// ask the Break-Iterator for the glyph by moving one cell
// forward, and then one cell back
- DBG_ASSERT( pBreakIt != NULL, "We always need a break." );
- DBG_ASSERT( pBreakIt->GetBreakIter().is(), "No break-iterator." );
+ OSL_ENSURE( pBreakIt != NULL, "We always need a break." );
+ OSL_ENSURE( pBreakIt->GetBreakIter().is(), "No break-iterator." );
if( pBreakIt->GetBreakIter().is() )
{
// get locale for this position
@@ -743,8 +742,8 @@ sal_Bool SwAccessibleParagraph::GetGlyphBoundary(
rBound.startPos = pBreakIt->GetBreakIter()->previousCharacters(
rText, rBound.endPos, aLocale, nIterMode, 1, nDone );
- DBG_ASSERT( rBound.startPos <= nPos, "start pos too high" );
- DBG_ASSERT( rBound.endPos >= nPos, "end pos too low" );
+ OSL_ENSURE( rBound.startPos <= nPos, "start pos too high" );
+ OSL_ENSURE( rBound.endPos >= nPos, "end pos too low" );
}
else
{
@@ -982,7 +981,6 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getBackground()
return SwAccessibleContext::getBackground();
}
-// <--
::rtl::OUString SAL_CALL SwAccessibleParagraph::getImplementationName()
throw( uno::RuntimeException )
@@ -1045,7 +1043,6 @@ uno::Any SwAccessibleParagraph::queryInterface( const uno::Type& rType )
uno::Reference<XAccessibleTextAttributes> aAccTextAttr = this;
aRet <<= aAccTextAttr;
}
- // <--
// #i89175#
// add interface com::sun:star:accessibility::XAccessibleTextMarkup
else if ( rType == ::getCppuType((uno::Reference<XAccessibleTextMarkup> *)0) )
@@ -1059,7 +1056,6 @@ uno::Any SwAccessibleParagraph::queryInterface( const uno::Type& rType )
uno::Reference<XAccessibleMultiLineText> aAccMultiLineText = this;
aRet <<= aAccMultiLineText;
}
- // <--
else
{
aRet = SwAccessibleContext::queryInterface(rType);
@@ -1086,23 +1082,19 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleParagraph::getTypes() throw(uno:
pTypes[nIndex++] = ::getCppuType( static_cast< uno::Reference< XAccessibleTextMarkup > * >( 0 ) );
pTypes[nIndex++] = ::getCppuType( static_cast< uno::Reference< XAccessibleMultiLineText > * >( 0 ) );
pTypes[nIndex] = ::getCppuType( static_cast< uno::Reference< XAccessibleHypertext > * >( 0 ) );
- // <--
return aTypes;
}
+namespace
+{
+ class theSwAccessibleParagraphImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleParagraphImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleParagraph::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleParagraphImplementationId::get().getSeq();
}
@@ -1280,7 +1272,6 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl(
aCharSet.Put( pTxtNode->GetTxtColl()->GetAttrSet() );
pSet->Put( aCharSet );
}
- // <--
// build-up sequence containing the run attributes <rDefAttrSeq>
tAccParaPropValMap aDefAttrSeq;
@@ -1327,7 +1318,6 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl(
aDefAttrSeq[rPropVal.Name] = rPropVal;
}
}
- // <--
// #i73371#
// resolve value text::WritingMode2::PAGE of property value entry WritingMode
@@ -1378,7 +1368,6 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl(
}
}
}
- // <--
}
if ( aRequestedAttributes.getLength() == 0 )
@@ -1430,7 +1419,6 @@ uno::Sequence< PropertyValue > SwAccessibleParagraph::getDefaultAttributes(
}
}
}
- // <--
uno::Sequence< PropertyValue > aValues( aDefAttrSeq.size() +
( bProvideMMToPixelRatio ? 1 : 0 ) );
@@ -1457,7 +1445,6 @@ uno::Sequence< PropertyValue > SwAccessibleParagraph::getDefaultAttributes(
rPropVal.State = beans::PropertyState_DEFAULT_VALUE;
pValues[ aValues.getLength() - 1 ] = rPropVal;
}
- // <--
return aValues;
}
@@ -1511,7 +1498,6 @@ void SwAccessibleParagraph::_getRunAttributesImpl(
SwUnoCursorHelper::GetCrsrAttr(*pPaM, aCharAttrsAtPaM, sal_True, sal_True);
aSet.Put( aCharAttrsAtPaM );
}
- // <--
// build-up sequence containing the run attributes <rRunAttrSeq>
{
@@ -1609,7 +1595,6 @@ uno::Sequence< PropertyValue > SwAccessibleParagraph::getRunAttributes(
return aValues;
}
-// <--
awt::Rectangle SwAccessibleParagraph::getCharacterBounds(
sal_Int32 nIndex )
@@ -1726,8 +1711,8 @@ sal_Int32 SwAccessibleParagraph::getIndexAtPoint( const awt::Point& rPoint )
}
// ask core for position
- DBG_ASSERT( GetFrm() != NULL, "The text frame has vanished!" );
- DBG_ASSERT( GetFrm()->IsTxtFrm(), "The text frame has mutated!" );
+ OSL_ENSURE( GetFrm() != NULL, "The text frame has vanished!" );
+ OSL_ENSURE( GetFrm()->IsTxtFrm(), "The text frame has mutated!" );
const SwTxtFrm* pFrm = static_cast<const SwTxtFrm*>( GetFrm() );
SwCrsrMoveState aMoveState;
aMoveState.bPosMatchesBounds = sal_True;
@@ -1887,8 +1872,8 @@ sal_Bool SwAccessibleParagraph::setSelection( sal_Int32 nStartIndex, sal_Int32 n
i18n::Boundary aBound;
sal_Bool bWord = GetTextBoundary( aBound, rText, nIndex, nTextType );
- DBG_ASSERT( aBound.startPos >= 0, "illegal boundary" );
- DBG_ASSERT( aBound.startPos <= aBound.endPos, "illegal boundary" );
+ OSL_ENSURE( aBound.startPos >= 0, "illegal boundary" );
+ OSL_ENSURE( aBound.startPos <= aBound.endPos, "illegal boundary" );
// return word (if present)
if ( bWord )
@@ -2301,7 +2286,6 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getHyperLinkCount()
sal_Int32 nCount = 0;
// #i77108# - provide hyperlinks also in editable documents.
// if( !IsEditableState() )
- // <--
{
const SwTxtFrm *pTxtFrm = static_cast<const SwTxtFrm*>( GetFrm() );
SwHyperlinkIter_Impl aIter( pTxtFrm );
@@ -2490,7 +2474,6 @@ uno::Sequence< /*accessibility::*/TextSegment > SAL_CALL
return pTextMarkupHelper->getTextMarkupAtIndex( nCharIndex, nTextMarkupType );
}
-// <--
// #i89175#
sal_Int32 SAL_CALL SwAccessibleParagraph::getLineNumberAtIndex( sal_Int32 nIndex )
diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx
index a2ddb5c3be..0bf4c18b8f 100644
--- a/sw/source/core/access/accpara.hxx
+++ b/sw/source/core/access/accpara.hxx
@@ -149,7 +149,6 @@ class SwAccessibleParagraph :
const sal_Int32 nIndex,
const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes,
tAccParaPropValMap& rRunAttrSeq );
- // <--
public:
@@ -266,7 +265,6 @@ public:
throw (::com::sun::star::uno::RuntimeException);
virtual sal_Int32 SAL_CALL getBackground()
throw (::com::sun::star::uno::RuntimeException);
- // <--
//===== XServiceInfo ====================================================
@@ -396,7 +394,6 @@ public:
throw (::com::sun::star::lang::IndexOutOfBoundsException,
::com::sun::star::lang::IllegalArgumentException,
::com::sun::star::uno::RuntimeException);
- // <--
// #i89175#
//===== XAccessibleMultiLineText ========================================
@@ -415,13 +412,11 @@ public:
virtual sal_Int32 SAL_CALL getNumberOfLineWithCaret()
throw (::com::sun::star::uno::RuntimeException);
- // <--
// #i63870#
//===== XAccesibleTextAttributes ========================================
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getDefaultAttributes( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getRunAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRequestedAttributes ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
- // <--
};
inline SwAccessibleParagraph::operator ::com::sun::star::accessibility::XAccessibleText *()
diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx
index a8881df897..4bc211fb5c 100644
--- a/sw/source/core/access/accportions.cxx
+++ b/sw/source/core/access/accportions.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include "accportions.hxx"
-#include <tools/debug.hxx>
#include <rtl/ustring.hxx>
#include <com/sun/star/i18n/Boundary.hpp>
#include <txttypes.hxx>
@@ -99,7 +98,7 @@ SwAccessiblePortionData::SwAccessiblePortionData(
nBeforePortions( 0 ),
bLastIsSpecial( sal_False )
{
- DBG_ASSERT( pTxtNode != NULL, "Text node is needed!" );
+ OSL_ENSURE( pTxtNode != NULL, "Text node is needed!" );
// reserve some space to reduce memory allocations
aLineBreaks.reserve( 5 );
@@ -117,10 +116,10 @@ SwAccessiblePortionData::~SwAccessiblePortionData()
void SwAccessiblePortionData::Text(sal_uInt16 nLength, sal_uInt16 nType)
{
- DBG_ASSERT( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
+ OSL_ENSURE( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
"portion exceeds model string!" );
- DBG_ASSERT( !bFinished, "We are already done!" );
+ OSL_ENSURE( !bFinished, "We are already done!" );
// ignore zero-length portions
if( nLength == 0 )
@@ -147,11 +146,11 @@ void SwAccessiblePortionData::Text(sal_uInt16 nLength, sal_uInt16 nType)
void SwAccessiblePortionData::Special(
sal_uInt16 nLength, const String& rText, sal_uInt16 nType)
{
- DBG_ASSERT( nModelPosition >= 0, "illegal position" );
- DBG_ASSERT( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
+ OSL_ENSURE( nModelPosition >= 0, "illegal position" );
+ OSL_ENSURE( (nModelPosition + nLength) <= pTxtNode->GetTxt().Len(),
"portion exceeds model string!" );
- DBG_ASSERT( !bFinished, "We are already done!" );
+ OSL_ENSURE( !bFinished, "We are already done!" );
// construct string with representation; either directly from
// rText, or use resources for special case portions
@@ -182,7 +181,6 @@ void SwAccessiblePortionData::Special(
sDisplay = aTmpBuffer.makeStringAndClear();
break;
}
- // <--
default:
sDisplay = rText;
break;
@@ -220,23 +218,23 @@ void SwAccessiblePortionData::Special(
void SwAccessiblePortionData::LineBreak()
{
- DBG_ASSERT( !bFinished, "We are already done!" );
+ OSL_ENSURE( !bFinished, "We are already done!" );
aLineBreaks.push_back( aBuffer.getLength() );
}
void SwAccessiblePortionData::Skip(sal_uInt16 nLength)
{
- DBG_ASSERT( !bFinished, "We are already done!" );
- DBG_ASSERT( aModelPositions.size() == 0, "Never Skip() after portions" );
- DBG_ASSERT( nLength <= pTxtNode->GetTxt().Len(), "skip exceeds model string!" );
+ OSL_ENSURE( !bFinished, "We are already done!" );
+ OSL_ENSURE( aModelPositions.empty(), "Never Skip() after portions" );
+ OSL_ENSURE( nLength <= pTxtNode->GetTxt().Len(), "skip exceeds model string!" );
nModelPosition += nLength;
}
void SwAccessiblePortionData::Finish()
{
- DBG_ASSERT( !bFinished, "We are already done!" );
+ OSL_ENSURE( !bFinished, "We are already done!" );
// include terminator values: always include two 'last character'
// markers in the position arrays to make sure we always find one
@@ -254,7 +252,7 @@ void SwAccessiblePortionData::Finish()
sal_Bool SwAccessiblePortionData::IsPortionAttrSet(
size_t nPortionNo, sal_uInt8 nAttr ) const
{
- DBG_ASSERT( nPortionNo < aPortionAttrs.size(),
+ OSL_ENSURE( nPortionNo < aPortionAttrs.size(),
"Illegal portion number" );
return (aPortionAttrs[nPortionNo] & nAttr) != 0;
}
@@ -301,7 +299,7 @@ sal_Bool SwAccessiblePortionData::IsGrayPortionType( sal_uInt16 nType ) const
const OUString& SwAccessiblePortionData::GetAccessibleString() const
{
- DBG_ASSERT( bFinished, "Shouldn't call this before we are done!" );
+ OSL_ENSURE( bFinished, "Shouldn't call this before we are done!" );
return sAccessibleString;
}
@@ -348,12 +346,11 @@ void SwAccessiblePortionData::GetBoundaryOfLine( const sal_Int32 nLineNo,
{
FillBoundary( rLineBound, aLineBreaks, nLineNo );
}
-// <--
void SwAccessiblePortionData::GetLastLineBoundary(
Boundary& rBound ) const
{
- DBG_ASSERT( aLineBreaks.size() >= 2, "need min + max value" );
+ OSL_ENSURE( aLineBreaks.size() >= 2, "need min + max value" );
// The last two positions except the two deleimiters are the ones
// we are looking for, except for empty paragraphs (nBreaks==3)
@@ -363,8 +360,8 @@ void SwAccessiblePortionData::GetLastLineBoundary(
sal_uInt16 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const
{
- DBG_ASSERT( nPos >= 0, "illegal position" );
- DBG_ASSERT( nPos <= sAccessibleString.getLength(), "illegal position" );
+ OSL_ENSURE( nPos >= 0, "illegal position" );
+ OSL_ENSURE( nPos <= sAccessibleString.getLength(), "illegal position" );
// find the portion number
size_t nPortionNo = FindBreak( aAccessiblePositions, nPos );
@@ -377,7 +374,7 @@ sal_uInt16 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const
if( ! IsSpecialPortion( nPortionNo ) )
{
// 'wide' portions have to be of the same width
- DBG_ASSERT( ( aModelPositions[nPortionNo+1] - nStartPos ) ==
+ OSL_ENSURE( ( aModelPositions[nPortionNo+1] - nStartPos ) ==
( aAccessiblePositions[nPortionNo+1] -
aAccessiblePositions[nPortionNo] ),
"accesability portion disagrees with text model" );
@@ -387,7 +384,7 @@ sal_uInt16 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const
}
// else: return nStartPos unmodified
- DBG_ASSERT( (nStartPos >= 0) && (nStartPos < USHRT_MAX),
+ OSL_ENSURE( (nStartPos >= 0) && (nStartPos < USHRT_MAX),
"How can the SwTxtNode have so many characters?" );
return static_cast<sal_uInt16>(nStartPos);
}
@@ -406,11 +403,11 @@ size_t SwAccessiblePortionData::FindBreak(
const Positions_t& rPositions,
sal_Int32 nValue ) const
{
- DBG_ASSERT( rPositions.size() >= 2, "need min + max value" );
- DBG_ASSERT( rPositions[0] <= nValue, "need min value" );
- DBG_ASSERT( rPositions[rPositions.size()-1] >= nValue,
+ OSL_ENSURE( rPositions.size() >= 2, "need min + max value" );
+ OSL_ENSURE( rPositions[0] <= nValue, "need min value" );
+ OSL_ENSURE( rPositions[rPositions.size()-1] >= nValue,
"need first terminator value" );
- DBG_ASSERT( rPositions[rPositions.size()-2] >= nValue,
+ OSL_ENSURE( rPositions[rPositions.size()-2] >= nValue,
"need second terminator value" );
size_t nMin = 0;
@@ -420,20 +417,20 @@ size_t SwAccessiblePortionData::FindBreak(
while( nMin+1 < nMax )
{
// check loop invariants
- DBG_ASSERT( ( (nMin == 0) && (rPositions[nMin] <= nValue) ) ||
+ OSL_ENSURE( ( (nMin == 0) && (rPositions[nMin] <= nValue) ) ||
( (nMin != 0) && (rPositions[nMin] < nValue) ),
"minvalue not minimal" );
- DBG_ASSERT( nValue <= rPositions[nMax], "max value not maximal" );
+ OSL_ENSURE( nValue <= rPositions[nMax], "max value not maximal" );
// get middle (and ensure progress)
size_t nMiddle = (nMin + nMax)/2;
- DBG_ASSERT( nMin < nMiddle, "progress?" );
- DBG_ASSERT( nMiddle < nMax, "progress?" );
+ OSL_ENSURE( nMin < nMiddle, "progress?" );
+ OSL_ENSURE( nMiddle < nMax, "progress?" );
// check array
- DBG_ASSERT( rPositions[nMin] <= rPositions[nMiddle],
+ OSL_ENSURE( rPositions[nMin] <= rPositions[nMiddle],
"garbled positions array" );
- DBG_ASSERT( rPositions[nMiddle] <= rPositions[nMax],
+ OSL_ENSURE( rPositions[nMiddle] <= rPositions[nMax],
"garbled positions array" );
if( nValue > rPositions[nMiddle] )
@@ -443,17 +440,17 @@ size_t SwAccessiblePortionData::FindBreak(
}
// only two are left; we only need to check which one is the winner
- DBG_ASSERT( (nMax == nMin) || (nMax == nMin+1), "only two left" );
+ OSL_ENSURE( (nMax == nMin) || (nMax == nMin+1), "only two left" );
if( (rPositions[nMin] < nValue) && (rPositions[nMin+1] <= nValue) )
nMin = nMin+1;
// finally, check to see whether the returned value is the 'right' position
- DBG_ASSERT( rPositions[nMin] <= nValue, "not smaller or equal" );
- DBG_ASSERT( nValue <= rPositions[nMin+1], "not equal or larger" );
- DBG_ASSERT( (nMin == 0) || (rPositions[nMin-1] <= nValue),
+ OSL_ENSURE( rPositions[nMin] <= nValue, "not smaller or equal" );
+ OSL_ENSURE( nValue <= rPositions[nMin+1], "not equal or larger" );
+ OSL_ENSURE( (nMin == 0) || (rPositions[nMin-1] <= nValue),
"earlier value should have been returned" );
- DBG_ASSERT( nMin < rPositions.size()-1,
+ OSL_ENSURE( nMin < rPositions.size()-1,
"shouldn't return last position (due to termintator values)" );
return nMin;
@@ -472,7 +469,6 @@ size_t SwAccessiblePortionData::FindLastBreak(
{
nResult++;
}
- // <--
return nResult;
}
@@ -482,13 +478,13 @@ void SwAccessiblePortionData::GetSentenceBoundary(
Boundary& rBound,
sal_Int32 nPos )
{
- DBG_ASSERT( nPos >= 0, "illegal position; check before" );
- DBG_ASSERT( nPos < sAccessibleString.getLength(), "illegal position" );
+ OSL_ENSURE( nPos >= 0, "illegal position; check before" );
+ OSL_ENSURE( nPos < sAccessibleString.getLength(), "illegal position" );
if( pSentences == NULL )
{
- DBG_ASSERT( pBreakIt != NULL, "We always need a break." );
- DBG_ASSERT( pBreakIt->GetBreakIter().is(), "No break-iterator." );
+ OSL_ENSURE( pBreakIt != NULL, "We always need a break." );
+ OSL_ENSURE( pBreakIt->GetBreakIter().is(), "No break-iterator." );
if( pBreakIt->GetBreakIter().is() )
{
pSentences = new Positions_t();
@@ -537,7 +533,7 @@ void SwAccessiblePortionData::GetAttributeBoundary(
Boundary& rBound,
sal_Int32 nPos) const
{
- DBG_ASSERT( pTxtNode != NULL, "Need SwTxtNode!" );
+ OSL_ENSURE( pTxtNode != NULL, "Need SwTxtNode!" );
// attribute boundaries can only occur on portion boundaries
FillBoundary( rBound, aAccessiblePositions,
@@ -547,7 +543,7 @@ void SwAccessiblePortionData::GetAttributeBoundary(
sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( sal_uInt16 nPos ) const
{
- DBG_ASSERT( nPos <= pTxtNode->GetTxt().Len(), "illegal position" );
+ OSL_ENSURE( nPos <= pTxtNode->GetTxt().Len(), "illegal position" );
// find the portion number
// #i70538# - consider "empty" model portions - e.g. number portion
@@ -563,7 +559,7 @@ sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( sal_uInt16 nPos ) cons
if( (nEndPos - nStartPos) > 1 )
{
// 'wide' portions have to be of the same width
- DBG_ASSERT( ( nEndPos - nStartPos ) ==
+ OSL_ENSURE( ( nEndPos - nStartPos ) ==
( aAccessiblePositions[nPortionNo+1] -
aAccessiblePositions[nPortionNo] ),
"accesability portion disagrees with text model" );
@@ -573,7 +569,7 @@ sal_Int32 SwAccessiblePortionData::GetAccessiblePosition( sal_uInt16 nPos ) cons
}
// else: return nRet unmodified
- DBG_ASSERT( (nRet >= 0) && (nRet <= sAccessibleString.getLength()),
+ OSL_ENSURE( (nRet >= 0) && (nRet <= sAccessibleString.getLength()),
"too long!" );
return nRet;
}
@@ -609,10 +605,10 @@ sal_uInt16 SwAccessiblePortionData::FillSpecialPos(
nModelEndPos = nModelPos;
nModelPos = aModelPositions[nCorePortionNo];
- DBG_ASSERT( nModelPos >= 0, "Can't happen." );
- DBG_ASSERT( nCorePortionNo >= nBeforePortions, "Can't happen." );
+ OSL_ENSURE( nModelPos >= 0, "Can't happen." );
+ OSL_ENSURE( nCorePortionNo >= nBeforePortions, "Can't happen." );
}
- DBG_ASSERT( nModelPos != nModelEndPos,
+ OSL_ENSURE( nModelPos != nModelEndPos,
"portion with core-representation expected" );
// if we have anything except plain text, compute nExtend + nRefPos
@@ -640,7 +636,7 @@ sal_uInt16 SwAccessiblePortionData::FillSpecialPos(
else
{
// case 3: regular text portion
- DBG_ASSERT( ( nModelEndPos - nModelPos ) ==
+ OSL_ENSURE( ( nModelEndPos - nModelPos ) ==
( aAccessiblePositions[nPortionNo+1] -
aAccessiblePositions[nPortionNo] ),
"text portion expected" );
@@ -651,9 +647,9 @@ sal_uInt16 SwAccessiblePortionData::FillSpecialPos(
}
if( rpPos != NULL )
{
- DBG_ASSERT( rpPos == &rPos, "Yes!" );
- DBG_ASSERT( nRefPos <= nPos, "wrong reference" );
- DBG_ASSERT( (nExtend == SP_EXTEND_RANGE_NONE) ||
+ OSL_ENSURE( rpPos == &rPos, "Yes!" );
+ OSL_ENSURE( nRefPos <= nPos, "wrong reference" );
+ OSL_ENSURE( (nExtend == SP_EXTEND_RANGE_NONE) ||
(nExtend == SP_EXTEND_RANGE_BEFORE) ||
(nExtend == SP_EXTEND_RANGE_BEHIND), "need extend" );
diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx
index 3cdf5adcaa..06e709febd 100644
--- a/sw/source/core/access/accportions.hxx
+++ b/sw/source/core/access/accportions.hxx
@@ -127,7 +127,6 @@ public:
sal_Int32 GetLineNo( const sal_Int32 nPos ) const;
void GetBoundaryOfLine( const sal_Int32 nLineNo,
com::sun::star::i18n::Boundary& rLineBound );
- // <--
/// get the position in the model string for a given
/// (accessibility) position
diff --git a/sw/source/core/access/accpreview.cxx b/sw/source/core/access/accpreview.cxx
index c102a360f4..ee98ca39b9 100644
--- a/sw/source/core/access/accpreview.cxx
+++ b/sw/source/core/access/accpreview.cxx
@@ -30,7 +30,7 @@
#include "precompiled_sw.hxx"
#include <vcl/svapp.hxx>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include "access.hrc"
#include <accpreview.hxx>
@@ -80,18 +80,15 @@ Sequence<OUString> SwAccessiblePreview::getSupportedServiceNames( )
return aSeq;
}
+namespace
+{
+ class theSwAccessiblePreviewImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessiblePreviewImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwAccessiblePreview::getImplementationId()
throw(RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessiblePreviewImplementationId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/accselectionhelper.cxx b/sw/source/core/access/accselectionhelper.cxx
index 26b1995ee5..799560cf01 100644
--- a/sw/source/core/access/accselectionhelper.cxx
+++ b/sw/source/core/access/accselectionhelper.cxx
@@ -39,7 +39,6 @@
#include <viewsh.hxx>
#include <fesh.hxx>
#include <vcl/svapp.hxx> // for SolarMutex
-#include <tools/debug.hxx>
#include <flyfrm.hxx>
@@ -64,9 +63,9 @@ SwAccessibleSelectionHelper::~SwAccessibleSelectionHelper()
SwFEShell* SwAccessibleSelectionHelper::GetFEShell()
{
- DBG_ASSERT( rContext.GetMap() != NULL, "no map?" );
+ OSL_ENSURE( rContext.GetMap() != NULL, "no map?" );
ViewShell* pViewShell = rContext.GetMap()->GetShell();
- DBG_ASSERT( pViewShell != NULL,
+ OSL_ENSURE( pViewShell != NULL,
"No view shell? Then what are you looking at?" );
SwFEShell* pFEShell = NULL;
@@ -293,7 +292,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild(
if( !aChild.IsValid() )
throwIndexOutOfBoundsException();
- DBG_ASSERT( rContext.GetMap() != NULL, "We need the map." );
+ OSL_ENSURE( rContext.GetMap() != NULL, "We need the map." );
Reference< XAccessible > xChild;
if( aChild.GetSwFrm() )
{
diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx
index 2807a91ac9..40e3fdd934 100644
--- a/sw/source/core/access/acctable.cxx
+++ b/sw/source/core/access/acctable.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <osl/mutex.hxx>
-#include <rtl/uuid.h>
#include <rtl/ustrbuf.hxx>
#include <list>
@@ -56,6 +55,7 @@
#include <acctable.hxx>
#include <com/sun/star/accessibility/XAccessibleText.hpp>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::accessibility;
@@ -109,14 +109,12 @@ class SwAccessibleTableData_Impl
return !mbOnlyTableColumnHeader ||
mpTabFrm->IsInHeadline( rFrm );
}
- // <--
public:
// #i77106# - add third optional parameter <bOnlyTableColumnHeader>, default value <false>
SwAccessibleTableData_Impl( SwAccessibleMap& rAccMap,
const SwTabFrm *pTabFrm,
sal_Bool bIsInPagePreview,
bool bOnlyTableColumnHeader = false );
- // <--
const Int32Set_Impl& GetRows() const { return maRows; }
const Int32Set_Impl& GetColumns() const { return maColumns; }
@@ -628,8 +626,8 @@ void SwAccessibleTable::FireTableChangeEvent(
const SwTableBox* SwAccessibleTable::GetTableBox( sal_Int32 nChildIndex ) const
{
- DBG_ASSERT( nChildIndex >= 0, "Illegal child index." );
- DBG_ASSERT( nChildIndex < const_cast<SwAccessibleTable*>(this)->getAccessibleChildCount(), "Illegal child index." ); // #i77106#
+ OSL_ENSURE( nChildIndex >= 0, "Illegal child index." );
+ OSL_ENSURE( nChildIndex < const_cast<SwAccessibleTable*>(this)->getAccessibleChildCount(), "Illegal child index." ); // #i77106#
const SwTableBox* pBox = NULL;
@@ -646,7 +644,7 @@ const SwTableBox* SwAccessibleTable::GetTableBox( sal_Int32 nChildIndex ) const
}
}
- DBG_ASSERT( pBox != NULL, "We need the table box." );
+ OSL_ENSURE( pBox != NULL, "We need the table box." );
return pBox;
}
@@ -657,7 +655,7 @@ sal_Bool SwAccessibleTable::IsChildSelected( sal_Int32 nChildIndex ) const
if( pSelBoxes )
{
const SwTableBox* pBox = GetTableBox( nChildIndex );
- DBG_ASSERT( pBox != NULL, "We need the table box." );
+ OSL_ENSURE( pBox != NULL, "We need the table box." );
bRet = pSelBoxes->Seek_Entry( const_cast<SwTableBox*>( pBox ) );
}
@@ -829,18 +827,15 @@ uno::Sequence< uno::Type > SAL_CALL SwAccessibleTable::getTypes()
return aTypes;
}
+namespace
+{
+ class theSwAccessibleTableImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleTableImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleTable::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleTableImplementationId::get().getSeq();
}
// #i77106#
@@ -849,14 +844,12 @@ SwAccessibleTableData_Impl* SwAccessibleTable::CreateNewTableData()
const SwTabFrm* pTabFrm = static_cast<const SwTabFrm*>( GetFrm() );
return new SwAccessibleTableData_Impl( *GetMap(), pTabFrm, IsInPagePreview() );
}
-// <--
void SwAccessibleTable::UpdateTableData()
{
// #i77106# - usage of new method <CreateNewTableData()>
delete mpTableData;
mpTableData = CreateNewTableData();
- // <--
}
void SwAccessibleTable::ClearTableData()
@@ -927,7 +920,6 @@ OUString SAL_CALL SwAccessibleTable::getAccessibleRowDescription(
}
return sRowDesc;
- // <--
}
OUString SAL_CALL SwAccessibleTable::getAccessibleColumnDescription(
@@ -962,7 +954,6 @@ OUString SAL_CALL SwAccessibleTable::getAccessibleColumnDescription(
}
return sColumnDesc;
- // <--
}
sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRowExtentAt(
@@ -1050,7 +1041,6 @@ uno::Reference< XAccessibleTable > SAL_CALL
}
return xTableColumnHeaders;
- // <--
}
uno::Sequence< sal_Int32 > SAL_CALL SwAccessibleTable::getSelectedAccessibleRows()
@@ -1247,7 +1237,6 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleRow( sal_Int32 nChildIndex )
{
throw lang::IndexOutOfBoundsException();
}
- // <--
SwAccessibleChild aCell( GetChild( *(GetMap()), nChildIndex ) );
if ( aCell.GetSwFrm() )
@@ -1286,7 +1275,6 @@ sal_Int32 SAL_CALL SwAccessibleTable::getAccessibleColumn(
{
throw lang::IndexOutOfBoundsException();
}
- // <--
SwAccessibleChild aCell( GetChild( *(GetMap()), nChildIndex ) );
if ( aCell.GetSwFrm() )
@@ -1426,7 +1414,7 @@ void SAL_CALL SwAccessibleTable::selectAccessibleChild(
// preliminaries: get 'our' table box, and get the cursor shell
const SwTableBox* pBox = GetTableBox( nChildIndex );
- DBG_ASSERT( pBox != NULL, "We need the table box." );
+ OSL_ENSURE( pBox != NULL, "We need the table box." );
SwCrsrShell* pCrsrShell = GetCrsrShell();
if( pCrsrShell == NULL )
@@ -1599,10 +1587,9 @@ void SAL_CALL SwAccessibleTable::deselectAccessibleChild(
// assure, that child, identified by the given index, is selected.
if ( !IsChildSelected( nChildIndex ) )
return;
- // <--
const SwTableBox* pBox = GetTableBox( nChildIndex );
- DBG_ASSERT( pBox != NULL, "We need the table box." );
+ OSL_ENSURE( pBox != NULL, "We need the table box." );
// If we unselect point, then set cursor to mark. If we clear another
// selected box, then set cursor to point.
diff --git a/sw/source/core/access/acctable.hxx b/sw/source/core/access/acctable.hxx
index fbcfff6dab..f8f063d150 100644
--- a/sw/source/core/access/acctable.hxx
+++ b/sw/source/core/access/acctable.hxx
@@ -325,7 +325,6 @@ public:
throw (::com::sun::star::uno::RuntimeException);
};
-// <--
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index bda57ac5e2..ff11552fbe 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -30,7 +30,7 @@
#include "precompiled_sw.hxx"
#include <com/sun/star/accessibility/XAccessibleContext.hpp>
-#include <rtl/uuid.h>
+#include <comphelper/servicehelper.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
@@ -150,7 +150,6 @@ void SwAccessibleTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *
}
}
break;
- // <--
}
}
@@ -169,7 +168,6 @@ OUString SAL_CALL SwAccessibleTextFrame::getAccessibleName (void)
return SwAccessibleFrameBase::getAccessibleName();
}
-// <--
OUString SAL_CALL SwAccessibleTextFrame::getAccessibleDescription (void)
throw (uno::RuntimeException)
{
@@ -207,18 +205,15 @@ uno::Sequence< OUString > SAL_CALL SwAccessibleTextFrame::getSupportedServiceNam
return aRet;
}
+namespace
+{
+ class theSwAccessibleTextFrameImplementationId : public rtl::Static< UnoTunnelIdInit, theSwAccessibleTextFrameImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwAccessibleTextFrame::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwAccessibleTextFrameImplementationId::get().getSeq();
}
@@ -232,7 +227,7 @@ SwFlyFrm* SwAccessibleTextFrame::getFlyFrm() const
SwFlyFrm* pFlyFrm = NULL;
const SwFrm* pFrm = GetFrm();
- DBG_ASSERT( pFrm != NULL, "frame expected" );
+ OSL_ENSURE( pFrm != NULL, "frame expected" );
if( pFrm->IsFlyFrm() )
{
pFlyFrm = static_cast<SwFlyFrm*>( const_cast<SwFrm*>( pFrm ) );
@@ -260,7 +255,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL SwAccessibleTextFrame::getAccess
AccessibleRelationSetHelper* pHelper = new AccessibleRelationSetHelper();
SwFlyFrm* pFlyFrm = getFlyFrm();
- DBG_ASSERT( pFlyFrm != NULL, "fly frame expected" );
+ OSL_ENSURE( pFlyFrm != NULL, "fly frame expected" );
const SwFlyFrm* pPrevFrm = pFlyFrm->GetPrevLink();
if( pPrevFrm != NULL )
diff --git a/sw/source/core/access/acctextframe.hxx b/sw/source/core/access/acctextframe.hxx
index 0dbdc2bcbd..9e4a0dd3cb 100644
--- a/sw/source/core/access/acctextframe.hxx
+++ b/sw/source/core/access/acctextframe.hxx
@@ -41,7 +41,6 @@ private:
// #i73249#
::rtl::OUString msTitle;
::rtl::OUString msDesc;
- // <--
protected:
@@ -59,7 +58,6 @@ public:
virtual ::rtl::OUString SAL_CALL
getAccessibleName (void)
throw (::com::sun::star::uno::RuntimeException);
- // <--
/// Return this object's description.
virtual ::rtl::OUString SAL_CALL
getAccessibleDescription (void)
diff --git a/sw/source/core/access/textmarkuphelper.cxx b/sw/source/core/access/textmarkuphelper.cxx
index 597ca89f89..79400d9ac3 100644
--- a/sw/source/core/access/textmarkuphelper.cxx
+++ b/sw/source/core/access/textmarkuphelper.cxx
@@ -88,7 +88,6 @@ SwTextMarkupHelper::SwTextMarkupHelper( const SwAccessiblePortionData& rPortionD
// #i108125#
, mpTxtNode( &rTxtNode )
, mpTextMarkupList( 0 )
- // <--
{
}
@@ -100,7 +99,6 @@ SwTextMarkupHelper::SwTextMarkupHelper( const SwAccessiblePortionData& rPortionD
, mpTextMarkupList( &rTextMarkupList )
{
}
-// <--
sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupType )
throw (::com::sun::star::lang::IllegalArgumentException,
@@ -113,7 +111,6 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
mpTextMarkupList
? mpTextMarkupList
: getTextMarkupList( *mpTxtNode, nTextMarkupType );
- // <--
if ( pTextMarkupList )
{
nTextMarkupCount = pTextMarkupList->Count();
@@ -143,7 +140,6 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
mpTextMarkupList
? mpTextMarkupList
: getTextMarkupList( *mpTxtNode, nTextMarkupType );
- // <--
if ( pTextMarkupList )
{
const SwWrongArea* pTextMarkup =
@@ -191,7 +187,6 @@ sal_Int32 SwTextMarkupHelper::getTextMarkupCount( const sal_Int32 nTextMarkupTyp
mpTextMarkupList
? mpTextMarkupList
: getTextMarkupList( *mpTxtNode, nTextMarkupType );
- // <--
::std::vector< ::com::sun::star::accessibility::TextSegment > aTmpTextMarkups;
if ( pTextMarkupList )
{
diff --git a/sw/source/core/access/textmarkuphelper.hxx b/sw/source/core/access/textmarkuphelper.hxx
index ca40848c5e..78897bea23 100644
--- a/sw/source/core/access/textmarkuphelper.hxx
+++ b/sw/source/core/access/textmarkuphelper.hxx
@@ -77,7 +77,6 @@ class SwTextMarkupHelper
// #i108125#
const SwTxtNode* mpTxtNode;
const SwWrongList* mpTextMarkupList;
- // <--
};
#endif
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index f9e88f5a44..348b92c344 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -86,7 +86,7 @@ void SwClient::SwClientNotify( const SwModify&, const SfxHint& )
//*************************************************************************
SwClient::~SwClient()
{
- DBG_ASSERT( !pRegisteredIn || pRegisteredIn->GetDepends(),"SwModify still known, but Client already disconnected!" );
+ OSL_ENSURE( !pRegisteredIn || pRegisteredIn->GetDepends(),"SwModify still known, but Client already disconnected!" );
if( pRegisteredIn && pRegisteredIn->GetDepends() )
// still connected
pRegisteredIn->Remove( this );
diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx
index 243a3977da..97ba70bccc 100644
--- a/sw/source/core/bastyp/bparr.cxx
+++ b/sw/source/core/bastyp/bparr.cxx
@@ -45,18 +45,18 @@ const sal_uInt16 nBlockGrowSize = 20;
void CheckIdx( BlockInfo** ppInf, sal_uInt16 nBlock, sal_uLong nSize, sal_uInt16 nCur )
{
- DBG_ASSERT( !nSize || nCur < nBlock, "BigPtrArray: CurIndex steht falsch" );
+ OSL_ENSURE( !nSize || nCur < nBlock, "BigPtrArray: CurIndex steht falsch" );
sal_uLong nIdx = 0;
for( sal_uInt16 nCnt = 0; nCnt < nBlock; ++nCnt, ++ppInf )
{
nIdx += (*ppInf)->nElem;
// Array mit Luecken darf es nicht geben
- DBG_ASSERT( !nCnt || (*(ppInf-1))->nEnd + 1 == (*ppInf)->nStart,
+ OSL_ENSURE( !nCnt || (*(ppInf-1))->nEnd + 1 == (*ppInf)->nStart,
"BigPtrArray: Luecke in der Verwaltung!" );
}
- DBG_ASSERT( nIdx == nSize, "BigPtrArray: Anzahl ungueltig" );
+ OSL_ENSURE( nIdx == nSize, "BigPtrArray: Anzahl ungueltig" );
}
#else
@@ -140,7 +140,7 @@ void BigPtrArray::ForEach( sal_uLong nStart, sal_uLong nEnd,
ElementPtr BigPtrArray::operator[]( sal_uLong idx ) const
{
// weil die Funktion eben doch nicht const ist:
- DBG_ASSERT( idx < nSize, "operator[]: Index aussserhalb" );
+ OSL_ENSURE( idx < nSize, "operator[]: Index aussserhalb" );
BigPtrArray* pThis = (BigPtrArray*) this;
sal_uInt16 cur = Index2Block( idx );
BlockInfo* p = ppInf[ cur ];
@@ -351,7 +351,7 @@ void BigPtrArray::Insert( const ElementPtr& rElem, sal_uLong pos )
}
// Nun haben wir einen freien Block am Wickel: eintragen
pos -= p->nStart;
- DBG_ASSERT( pos < MAXENTRY, "falsche Pos" );
+ OSL_ENSURE( pos < MAXENTRY, "falsche Pos" );
if( pos != p->nElem )
{
int nCount = p->nElem - sal_uInt16(pos);
@@ -461,7 +461,7 @@ void BigPtrArray::Remove( sal_uLong pos, sal_uLong n )
void BigPtrArray::Replace( sal_uLong idx, const ElementPtr& rElem)
{
// weil die Funktion eben doch nicht const ist:
- DBG_ASSERT( idx < nSize, "Set: Index aussserhalb" );
+ OSL_ENSURE( idx < nSize, "Set: Index aussserhalb" );
BigPtrArray* pThis = (BigPtrArray*) this;
sal_uInt16 cur = Index2Block( idx );
BlockInfo* p = ppInf[ cur ];
diff --git a/sw/source/core/bastyp/breakit.cxx b/sw/source/core/bastyp/breakit.cxx
index 1f0a5aa5b2..f3c964faf3 100644
--- a/sw/source/core/bastyp/breakit.cxx
+++ b/sw/source/core/bastyp/breakit.cxx
@@ -67,7 +67,7 @@ SwBreakIt::SwBreakIt(
aLast( LANGUAGE_DONTKNOW ),
aForbiddenLang( LANGUAGE_DONTKNOW)
{
- DBG_ASSERT( m_xMSF.is(), "SwBreakIt: no MultiServiceFactory" );
+ OSL_ENSURE( m_xMSF.is(), "SwBreakIt: no MultiServiceFactory" );
}
SwBreakIt::~SwBreakIt()
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 2bd18eda2d..6bf8e26f03 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -167,14 +167,7 @@ const sal_Int32 coContFlags =
extern "C" {
-static int
-#if defined( WNT )
- __cdecl
-#endif
-#if defined( ICC )
- _Optlink
-#endif
- OperatorCompare( const void *pFirst, const void *pSecond)
+static int SAL_CALL OperatorCompare( const void *pFirst, const void *pSecond)
{
int nRet = 0;
if( CALC_NAME == ((_CalcOp*)pFirst)->eOp )
diff --git a/sw/source/core/bastyp/index.cxx b/sw/source/core/bastyp/index.cxx
index 734b92ca24..919b5b62e8 100644
--- a/sw/source/core/bastyp/index.cxx
+++ b/sw/source/core/bastyp/index.cxx
@@ -259,7 +259,7 @@ SwIndexReg::SwIndexReg()
SwIndexReg::~SwIndexReg()
{
- OSL_ENSURE( !pFirst || !pLast, "Es sind noch Indizies angemeldet" );
+ OSL_ENSURE( !pFirst || !pLast, "There are still indices registered" );
}
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 55ff35d447..ce74a581b1 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -134,6 +134,8 @@
#include <fmtmeta.hxx>
+#include <rtl/instance.hxx>
+#include <boost/scoped_ptr.hpp>
using namespace ::com::sun::star;
@@ -193,7 +195,7 @@ sal_uInt16 aTableSetRange[] = {
RES_KEEP, RES_KEEP,
RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT,
RES_FRAMEDIR, RES_FRAMEDIR,
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
RES_COLLAPSING_BORDERS, RES_COLLAPSING_BORDERS,
// <-- collapsing
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
@@ -446,7 +448,6 @@ SwCheckIt* pCheckIt = 0;
CharClass* pAppCharClass = 0;
CollatorWrapper* pCollator = 0, *pCaseCollator = 0;
-::utl::TransliterationWrapper* pTransWrp = 0;
/******************************************************************************
* void _InitCore()
@@ -610,7 +611,6 @@ void _InitCore()
// #i35017# - constant name has changed
aAttrTab[ RES_WRAP_INFLUENCE_ON_OBJPOS - POOLATTR_BEGIN ] =
new SwFmtWrapInfluenceOnObjPos( text::WrapInfluenceOnPosition::ONCE_CONCURRENT );
- // <--
// FrmAttr-Dummies
aAttrTab[ RES_AUTO_STYLE - POOLATTR_BEGIN ] = new SwFmtAutoFmt( RES_AUTO_STYLE );
aAttrTab[ RES_FRMATR_STYLE_NAME - POOLATTR_BEGIN ] = new SfxStringItem( RES_FRMATR_STYLE_NAME, aEmptyStr );
@@ -729,7 +729,7 @@ void _InitCore()
pGlobalOLEExcludeList = new SvPtrarr;
- const SvxSwAutoFmtFlags& rAFlags = SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
+ const SvxSwAutoFmtFlags& rAFlags = SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags();
SwDoc::pACmpltWords = new SwAutoCompleteWord( rAFlags.nAutoCmpltListLen,
rAFlags.nAutoCmpltWordLen );
}
@@ -882,21 +882,37 @@ CollatorWrapper& GetAppCaseCollator()
return *pCaseCollator;
}
-const ::utl::TransliterationWrapper& GetAppCmpStrIgnore()
+namespace
{
- if( !pTransWrp )
+ class TransWrp
{
- uno::Reference<
- lang::XMultiServiceFactory > xMSF =
- ::comphelper::getProcessServiceFactory();
+ private:
+ boost::scoped_ptr< ::utl::TransliterationWrapper > xTransWrp;
+ public:
+ TransWrp()
+ {
+ uno::Reference< lang::XMultiServiceFactory > xMSF =
+ ::comphelper::getProcessServiceFactory();
+
+ xTransWrp.reset(new ::utl::TransliterationWrapper( xMSF,
+ i18n::TransliterationModules_IGNORE_CASE |
+ i18n::TransliterationModules_IGNORE_KANA |
+ i18n::TransliterationModules_IGNORE_WIDTH ));
+
+ xTransWrp->loadModuleIfNeeded( static_cast<sal_uInt16>(GetAppLanguage()) );
+ }
+ const ::utl::TransliterationWrapper& getTransliterationWrapper() const
+ {
+ return *xTransWrp;
+ }
+ };
+
+ class theTransWrp : public rtl::Static<TransWrp, theTransWrp> {};
+}
- pTransWrp = new ::utl::TransliterationWrapper( xMSF,
- i18n::TransliterationModules_IGNORE_CASE |
- i18n::TransliterationModules_IGNORE_KANA |
- i18n::TransliterationModules_IGNORE_WIDTH );
- pTransWrp->loadModuleIfNeeded( static_cast<sal_uInt16>(GetAppLanguage()) );
- }
- return *pTransWrp;
+const ::utl::TransliterationWrapper& GetAppCmpStrIgnore()
+{
+ return theTransWrp::get().getTransliterationWrapper();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/bastyp/swcache.cxx b/sw/source/core/bastyp/swcache.cxx
index b30b59c2b7..5e1fb445ac 100644
--- a/sw/source/core/bastyp/swcache.cxx
+++ b/sw/source/core/bastyp/swcache.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <tools/debug.hxx>
#include <swcache.hxx>
SV_IMPL_PTRARR(SwCacheObjArr,SwCacheObj*);
@@ -127,35 +126,63 @@ SwCache::SwCache( const sal_uInt16 nInitSize, const sal_uInt16 nGrowSize
SwCache::~SwCache()
{
{
- ByteString sOut( aName ); sOut += '\n';
- (( sOut += "Anzahl neuer Eintraege: " )
- += ByteString::CreateFromInt32( nAppend ))+= '\n';
- (( sOut += "Anzahl Insert auf freie Plaetze: " )
- += ByteString::CreateFromInt32( nInsertFree ))+= '\n';
- (( sOut += "Anzahl Ersetzungen: " )
- += ByteString::CreateFromInt32( nReplace ))+= '\n';
- (( sOut += "Anzahl Erfolgreicher Get's: " )
- += ByteString::CreateFromInt32( nGetSuccess ))+= '\n';
- (( sOut += "Anzahl Fehlgeschlagener Get's: " )
- += ByteString::CreateFromInt32( nGetFail ))+= '\n';
- (( sOut += "Anzahl Umsortierungen (LRU): " )
- += ByteString::CreateFromInt32( nToTop ))+= '\n';
- (( sOut += "Anzahl Loeschungen: " )
- += ByteString::CreateFromInt32( nDelete ))+= '\n';
- (( sOut += "Anzahl Get's ohne Index: " )
- += ByteString::CreateFromInt32( nGetSeek ))+= '\n';
- (( sOut += "Anzahl Seek fuer Get ohne Index: " )
- += ByteString::CreateFromInt32( nAverageSeekCnt ))+= '\n';
- (( sOut += "Anzahl Flush-Aufrufe: " )
- += ByteString::CreateFromInt32( nFlushCnt ))+= '\n';
- (( sOut += "Anzahl geflush'ter Objekte: " )
- += ByteString::CreateFromInt32( nFlushedObjects ))+= '\n';
- (( sOut += "Anzahl Cache-Erweiterungen: " )
- += ByteString::CreateFromInt32( nIncreaseMax ))+= '\n';
- (( sOut += "Anzahl Cache-Verkleinerungen: " )
- += ByteString::CreateFromInt32( nDecreaseMax ))+= '\n';
-
- OSL_FAIL( sOut.GetBuffer() );
+ rtl::OStringBuffer sOut(aName);
+
+ sOut.append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of new entries: ")).
+ append(static_cast<sal_Int32>(nAppend)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of insert on free places: ")).
+ append(static_cast<sal_Int32<(nInsertFree)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of replacements: ")).
+ append(static_cast<sal_Int32>(nReplace)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of successful Get's: ")).
+ append(static_cast<sal_Int32>(nGetSuccess)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of failed Get's: ")).
+ append(static_cast<sal_Int32>(nGetFail)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number or reordering (LRU): ")).
+ append(static_cast<sal_Int32>(nToTop)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of suppressions: ")).
+ append(static_cast<sal_Int32>(nDelete)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of Get's without Index: ")).
+ append(static_cast<sal_Int32>(nGetSeek)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of Seek for Get without Index: ")).
+ append(static_cast<sal_Int32>(nAverageSeekCnt)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of Flush calls: " )).
+ append(static_cast<sal_Int32>(nFlushCnt)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of flushed objects: ")).
+ append(static_cast<sal_Int32>(nFlushedObjects)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of Cache expansions: ")).
+ append(static_cast<sal_Int32>(nIncreaseMax)).
+ append('\n').
+ append(RTL_CONSTASCII_STRINGPARAM(
+ "Number of Cache reductions: ")).
+ append(static_cast<sal_Int32>(nDecreaseMax)).
+ append('\n');
+
+ OSL_TRACE(sOut.getStr());
}
Check();
}
diff --git a/sw/source/core/bastyp/swregion.cxx b/sw/source/core/bastyp/swregion.cxx
index 1c049219d2..a00dbe06bf 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -29,10 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-
-#include <tools/debug.hxx>
#include "swtypes.hxx"
#include "swrect.hxx"
#include "swregion.hxx"
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 2b2af4fc79..90fec7d89d 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -113,7 +113,7 @@ namespace sw { namespace mark
, m_aName(rName)
{
lcl_FixPosition(*m_pPos1);
- if(aPaM.HasMark())
+ if (aPaM.HasMark() && (*aPaM.GetMark() != *aPaM.GetPoint()))
{
MarkBase::SetOtherMarkPos(*(aPaM.GetMark()));
lcl_FixPosition(*m_pPos2);
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 38fe63fd6e..81dcb5078c 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -448,7 +448,6 @@ void SwCrsrShell::UpdateMarkedListLevel()
}
}
}
-// <--
sal_Bool SwCrsrShell::UpDown( sal_Bool bUp, sal_uInt16 nCnt )
{
@@ -647,9 +646,8 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
SwTxtNode * pTxtNd = pCrsr->GetNode()->GetTxtNode();
if ( pTxtNd && !IsTableMode() &&
- // --> FME 2004-11-25 #i37515# No bInFrontOfLabel during selection
+ // #i37515# No bInFrontOfLabel during selection
!pCrsr->HasMark() &&
- // <--
pTxtNd->HasVisibleNumberingOrBullet() )
{
aTmpState.bInFrontOfLabel = sal_True; // #i27615#
@@ -678,6 +676,11 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
// -> zurueck
return bRet;
+ // Toggle the Header/Footer mode if needed
+ bool bInHeaderFooter = pFrm && ( pFrm->IsHeaderFrm() || pFrm->IsFooterFrm() );
+ if ( bInHeaderFooter ^ IsHeaderFooterEdit() )
+ ToggleHeaderFooterEdit();
+
if( pBlockCrsr && bBlock )
{
pBlockCrsr->setEndPoint( rLPt );
@@ -1301,7 +1304,6 @@ class SwNotifyAccAboutInvalidTextSelections
mrCrsrSh.InvalidateAccessibleParaTextSelection();
}
};
-// <--
void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
{
SET_CURR_SHELL( this );
@@ -1367,7 +1369,6 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
// --> Make code robust. The table cursor may point
// to a table in a currently inactive header.
SwTabFrm *pTab = pTblFrm ? pTblFrm->FindTabFrm() : 0;
- // <--
if ( pTab && pTab->GetTable()->GetRowsToRepeat() > 0 )
{
@@ -2330,6 +2331,15 @@ sal_Bool SwCrsrShell::IsOverReadOnlyPos( const Point& rPt ) const
return aPam.HasReadonlySel( GetViewOptions()->IsFormView() );
}
+sal_Bool SwCrsrShell::IsOverHeaderFooterPos( const Point& rPt ) const
+{
+ Point aPt( rPt );
+ SwPaM aPam( *pCurCrsr->GetPoint() );
+ GetLayout()->GetCrsrOfst( aPam.GetPoint(), aPt );
+
+ return GetDoc()->IsInHeaderFooter( aPam.GetPoint()->nNode );
+}
+
// returne die Anzahl der Cursor im Ring (Flag besagt ob man nur
// aufgepspannte haben will - sprich etwas selektiert ist (Basic))
@@ -2535,7 +2545,7 @@ void SwCrsrShell::ParkCrsr( const SwNodeIndex &rIdx )
SwCrsrShell::SwCrsrShell( SwCrsrShell& rShell, Window *pInitWin )
: ViewShell( rShell, pInitWin ),
- SwModify( 0 ), pCrsrStk( 0 ), pBlockCrsr( 0 ), pTblCrsr( 0 ),
+ SwModify( 0 ), pCrsrStk( 0 ), pCrsrBack( 0 ), pBlockCrsr( 0 ), pTblCrsr( 0 ),
pBoxIdx( 0 ), pBoxPtr( 0 ), nCrsrMove( 0 ), nBasicActionCnt( 0 ),
eMvState( MV_NONE ),
sMarkedListId(),
@@ -2563,7 +2573,7 @@ SwCrsrShell::SwCrsrShell( SwCrsrShell& rShell, Window *pInitWin )
SwCrsrShell::SwCrsrShell( SwDoc& rDoc, Window *pInitWin,
const SwViewOption *pInitOpt )
: ViewShell( rDoc, pInitWin, pInitOpt ),
- SwModify( 0 ), pCrsrStk( 0 ), pBlockCrsr( 0 ), pTblCrsr( 0 ),
+ SwModify( 0 ), pCrsrStk( 0 ), pCrsrBack( 0 ), pBlockCrsr( 0 ), pTblCrsr( 0 ),
pBoxIdx( 0 ), pBoxPtr( 0 ), nCrsrMove( 0 ), nBasicActionCnt( 0 ),
eMvState( MV_NONE ), // state for crsr-travelling - GetCrsrOfst
sMarkedListId(),
@@ -2625,6 +2635,9 @@ SwCrsrShell::~SwCrsrShell()
delete pCrsrStk;
}
+ if( pCrsrBack )
+ delete pCrsrBack;
+
// JP 27.07.98: Bug 54025 - ggfs. den HTML-Parser, der als Client in
// der CursorShell haengt keine Chance geben, sich an den
// TextNode zu haengen.
@@ -3272,7 +3285,7 @@ void lcl_FillRecognizerData( uno::Sequence< rtl::OUString >& rSmartTagTypes,
}
}
- if ( aSmartTagTypes.size() )
+ if ( !aSmartTagTypes.empty() )
{
rSmartTagTypes.realloc( aSmartTagTypes.size() );
rStringKeyMaps.realloc( aSmartTagTypes.size() );
@@ -3436,4 +3449,44 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
}
}
+
+void SwCrsrShell::ToggleHeaderFooterEdit( )
+{
+ ViewShell::ToggleHeaderFooterEdit();
+
+ SET_CURR_SHELL( this );
+
+ if ( IsHeaderFooterEdit() )
+ {
+ pCrsrBack = new SwShellCrsr( *this, *pCurCrsr->GetPoint(),
+ pCurCrsr->GetPtPos() );
+
+ if ( pCurCrsr->HasMark() )
+ {
+ pCrsrBack->SetMark();
+ *pCrsrBack->GetMark() = *pCurCrsr->GetMark();
+ }
+ }
+ else
+ {
+ SwPosition& rPos = *pCurCrsr->GetPoint();
+ rPos.nNode = pCrsrBack->GetPoint()->nNode;
+ rPos.nContent = pCrsrBack->GetPoint()->nContent;
+
+ if ( pCrsrBack->HasMark( ) )
+ {
+ pCurCrsr->SetMark();
+ rPos = *pCurCrsr->GetMark();
+ rPos.nNode = pCrsrBack->GetMark()->nNode;
+ rPos.nContent = pCrsrBack->GetMark()->nContent;
+ }
+
+ delete pCrsrBack;
+ pCrsrBack = NULL;
+
+ UpdateCrsr( SwCrsrShell::SCROLLWIN | SwCrsrShell::CHKRANGE |
+ SwCrsrShell::READONLY );
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index ca4b282676..990dea1b92 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1035,13 +1035,12 @@ sal_Bool SwCrsrShell::GetContentAtPos( const Point& rPt,
bRet = sal_True;
}
}
- // --> FME 2005-05-13 #i43742# New function: SW_CONTENT_CHECK
+ // #i43742# New function
else if ( SwContentAtPos::SW_CONTENT_CHECK & rCntntAtPos.eCntntAtPos &&
bCrsrFoundExact )
{
bRet = sal_True;
}
- // <--
// #i23726#
else if( pTxtNd &&
SwContentAtPos::SW_NUMLABEL & rCntntAtPos.eCntntAtPos)
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 5a7150c9f0..c1124d9395 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -312,15 +312,33 @@ void SwAttrCheckArr::SetNewSet( const SwTxtNode& rTxtNd, const SwPaM& rPam )
pItem = aIter.NextItem();
}
}
+
+static bool
+lcl_IsAttributeIgnorable(xub_StrLen const nNdStart, xub_StrLen const nNdEnd,
+ _SwSrchChrAttr const& rTmp)
+{
+ // #i115528#: if there is a paragraph attribute, it has been added by the
+ // SwAttrCheckArr ctor, and nFound is 1.
+ // if the paragraph is entirely covered by hints that override the paragraph
+ // attribute, then this function must find an attribute to decrement nFound!
+ // so check for an empty search range, let attributes that start/end there
+ // cover it, and hope for the best...
+ return ((nNdEnd == nNdStart)
+ ? ((rTmp.nEnd < nNdStart) || (nNdEnd < rTmp.nStt))
+ : ((rTmp.nEnd <= nNdStart) || (nNdEnd <= rTmp.nStt)));
+}
+
int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
{
_SwSrchChrAttr aTmp( rAttr.GetAttr(), *rAttr.GetStart(), *rAttr.GetAnyEnd() );
- // alle die nicht im Bereich sind -> ignorieren
- if( aTmp.nEnd <= nNdStt || aTmp.nStt >= nNdEnd )
+
+ // ignore all attributes not in search range
+ if (lcl_IsAttributeIgnorable(nNdStt, nNdEnd, aTmp))
+ {
return Found();
+ }
const SfxPoolItem* pItem;
-
// --------------------------------------------------------------
// Hier wird jetzt ausdruecklich auch in Zeichenvorlagen gesucht
// --------------------------------------------------------------
@@ -471,9 +489,12 @@ int SwAttrCheckArr::SetAttrFwd( const SwTxtAttr& rAttr )
int SwAttrCheckArr::SetAttrBwd( const SwTxtAttr& rAttr )
{
_SwSrchChrAttr aTmp( rAttr.GetAttr(), *rAttr.GetStart(), *rAttr.GetAnyEnd() );
- // alle die nicht im Bereich sind -> ignorieren
- if( aTmp.nEnd < nNdStt || aTmp.nStt >= nNdEnd )
+
+ // ignore all attributes not in search range
+ if (lcl_IsAttributeIgnorable(nNdStt, nNdEnd, aTmp))
+ {
return Found();
+ }
const SfxPoolItem* pItem;
// --------------------------------------------------------------
diff --git a/sw/source/core/crsr/findtxt.cxx b/sw/source/core/crsr/findtxt.cxx
index c2faef33dd..b16ca3f4a9 100644
--- a/sw/source/core/crsr/findtxt.cxx
+++ b/sw/source/core/crsr/findtxt.cxx
@@ -33,7 +33,6 @@
#include <com/sun/star/util/SearchFlags.hpp>
#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
#include <svl/svstdarr.hxx>
#include <vcl/svapp.hxx>
@@ -63,12 +62,11 @@ using namespace util;
String *ReplaceBackReferences( const SearchOptions& rSearchOpt, SwPaM* pPam );
String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
- xub_StrLen& rEnde, SvULongs& rArr, String& rRet,
+ xub_StrLen& rEnde, std::vector<sal_uLong> &rArr, String& rRet,
bool bRemoveSoftHyphen )
{
rRet = rNd.GetTxt();
- if( rArr.Count() )
- rArr.Remove( 0, rArr.Count() );
+ rArr.clear();
const SwpHints *pHts = rNd.GetpSwpHints();
@@ -119,7 +117,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
else
break;
- const xub_StrLen nAkt = nStt - rArr.Count();
+ const xub_StrLen nAkt = nStt - rArr.size();
if ( bNewHint )
{
@@ -150,7 +148,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
->GetFld().GetFld()->ExpandField(true).Len());
if ( bEmpty && nStart == nAkt )
{
- rArr.Insert( nAkt, rArr.Count() );
+ rArr.push_back( nAkt );
--rEnde;
rRet.Erase( nAkt, 1 );
}
@@ -172,7 +170,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
if ( bNewSoftHyphen )
{
- rArr.Insert( nAkt, rArr.Count() );
+ rArr.push_back( nAkt );
--rEnde;
rRet.Erase( nAkt, 1 );
++nSoftHyphen;
@@ -186,7 +184,7 @@ String& lcl_CleanStr( const SwTxtNode& rNd, xub_StrLen nStart,
if( nTmp == rRet.Len() - 1 )
{
rRet.Erase( nTmp );
- rArr.Insert( nTmp, rArr.Count() );
+ rArr.push_back( nTmp );
--rEnde;
}
}
@@ -265,10 +263,6 @@ sal_uInt8 SwPaM::Find( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes
*/
sal_Bool bFirst = sal_True;
SwCntntNode * pNode;
- //testarea
- //String sCleanStr;
- //SvULongs aFltArr;
- //const SwNode* pSttNd = &rNdIdx.GetNode();
xub_StrLen nStart, nEnde, nTxtLen;
@@ -429,7 +423,7 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
SwNodeIndex& rNdIdx = pPam->GetPoint()->nNode;
const SwNode* pSttNd = &rNdIdx.GetNode();
String sCleanStr;
- SvULongs aFltArr;
+ std::vector<sal_uLong> aFltArr;
LanguageType eLastLang = 0;
// if the search string contains a soft hypen, we don't strip them from the text:
bool bRemoveSoftHyphens = true;
@@ -501,19 +495,19 @@ bool SwPaM::DoSearch( const SearchOptions& rSearchOpt, utl::TextSearch& rSTxt,
SetMark();
// Start und Ende wieder korrigieren !!
- if( aFltArr.Count() )
+ if( !aFltArr.empty() )
{
xub_StrLen n, nNew;
// bei Rueckwaertssuche die Positionen temp. vertauschen
if( !bSrchForward ) { n = nStart; nStart = nEnde; nEnde = n; }
for( n = 0, nNew = nStart;
- n < aFltArr.Count() && aFltArr[ n ] <= nStart;
+ n < aFltArr.size() && aFltArr[ n ] <= nStart;
++n, ++nNew )
;
nStart = nNew;
for( n = 0, nNew = nEnde;
- n < aFltArr.Count() && aFltArr[ n ] < nEnde;
+ n < aFltArr.size() && aFltArr[ n ] < nEnde;
++n, ++nNew )
;
nEnde = nNew;
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index c27d8f7c68..ba3d559537 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -358,7 +358,7 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
0 == pFrm->Frm().Height() )
;
- // --> LIJIAN/FME 2007-11-27 #i72394# skip to prev /next valid paragraph
+ // #i72394# skip to prev /next valid paragraph
// with a layout in case the first search did not succeed:
if( !pFrm )
{
@@ -370,7 +370,6 @@ sal_Bool SwCursor::IsSelOvr( int eFlags )
: pFrm->GetPrevCntntFrm();
}
}
- // <--
SwCntntNode* pCNd;
if( pFrm && 0 != (pCNd = (SwCntntNode*)pFrm->GetNode()) )
@@ -2045,7 +2044,7 @@ sal_Bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara )
bool bShortCut = false;
if ( fnWhichPara == fnParaCurr )
{
- // --> FME 2005-02-21 #i41048#
+ // #i41048#
// If fnWhichPara == fnParaCurr, (*fnWhichPara)( *this, fnPosPara )
// can already move the cursor to a different text node. In this case
// we better check if IsSelOvr().
@@ -2056,7 +2055,6 @@ sal_Bool SwCursor::MovePara(SwWhichPara fnWhichPara, SwPosPara fnPosPara )
if ( GetPoint()->nContent.GetIndex() != nSttEnd )
bShortCut = true;
}
- // <--
}
else
{
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index 12b43feaf3..a18512a090 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -177,7 +177,7 @@ sal_Bool SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
pStt = aBoxes[0];
pEnd = aBoxes[aBoxes.Count() - 1];
}
- // --> FME 2004-07-30 #i32329# Enhanced table selection
+ // #i32329# Enhanced table selection
else if ( pTable->IsNewModel() )
{
const SwShellCrsr *pCrsr = _GetCrsr();
@@ -233,7 +233,6 @@ sal_Bool SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
pEnd = aCells[ bVert ? (bRow ? 3 : 0) : (bRow ? 1 : 2) ]->GetTabBox(); // will become mark of table cursor
}
}
- // <--
// noch kein Tabellen-Cursor vorhanden, dann erzeuge einen
if( !pTblCrsr )
@@ -756,6 +755,10 @@ String SwCrsrShell::GetBoxNms() const
} while ( pFrm && !pFrm->IsCellFrm() );
OSL_ENSURE( pFrm, "kein Frame zur Box" );
+
+ if( !pFrm )
+ return sNm;
+
sNm = ((SwCellFrm*)pFrm)->GetTabBox()->GetName();
sNm += ':';
pPos = pTblCrsr->End();
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 83796c3953..5f4f749853 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -339,7 +339,7 @@ void SwSelPaintRects::Show()
if(mpCursorOverlay)
{
- if(aNewRanges.size())
+ if(!aNewRanges.empty())
{
static_cast< sdr::overlay::OverlaySelection* >(mpCursorOverlay)->setRanges(aNewRanges);
}
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx
index e27a6ba795..ac79022628 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -36,7 +36,6 @@
#include <tools/resmgr.hxx>
#include <poolfmt.hxx>
#include <rcid.hrc>
-#include <tools/debug.hxx>
#ifdef _NEED_TO_DEBUG_MAPPING
#include <stdlib.h>
#endif
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx
index f9e25036d7..768c72cc69 100644
--- a/sw/source/core/doc/acmplwrd.cxx
+++ b/sw/source/core/doc/acmplwrd.cxx
@@ -424,7 +424,7 @@ void SwAutoCompleteWord::DocumentDying(const SwDoc& rDoc)
{
pImpl->RemoveDocument(rDoc);
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
const sal_Bool bDelete = !pACorr->GetSwFlags().bAutoCmpltKeepList;
for(sal_uInt16 nPos = aWordLst.Count(); nPos; nPos--)
{
@@ -433,7 +433,7 @@ void SwAutoCompleteWord::DocumentDying(const SwDoc& rDoc)
{
aWordLst.Remove( nPos - 1 );
sal_uInt16 nLRUPos = aLRULst.GetPos( (void*)pCurrent );
- DBG_ASSERT(nLRUPos < USHRT_MAX, "word not found in LRU list" );
+ OSL_ENSURE(nLRUPos < USHRT_MAX, "word not found in LRU list" );
aLRULst.Remove( nLRUPos );
delete pCurrent;
}
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index 9b83b52f6c..2ca96f6b46 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -28,7 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
#include <tools/string.hxx>
#include <svl/poolitem.hxx>
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 0086fc91e1..28f5bc4071 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -667,7 +667,7 @@ const SwPrintData & SwDoc::getPrintData() const
// the respective config item is implememted by SwPrintOptions which
// is also derived from SwPrintData
const SwDocShell *pDocSh = GetDocShell();
- DBG_ASSERT( pDocSh, "pDocSh is 0, can't determine if this is a WebDoc or not" );
+ OSL_ENSURE( pDocSh, "pDocSh is 0, can't determine if this is a WebDoc or not" );
bool bWeb = 0 != dynamic_cast< const SwWebDocShell * >(pDocSh);
SwPrintOptions aPrintOptions( bWeb );
*pThis->pPrtData = aPrintOptions;
@@ -796,7 +796,7 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
}
}
- SvULongs aBkmkArr( 15, 15 );
+ std::vector<sal_uLong> aBkmkArr;
_SaveCntntIdx( this, rPos.nNode.GetIndex(), rPos.nContent.GetIndex(),
aBkmkArr, SAVEFLY_SPLIT );
// FIXME: only SwTxtNode has a valid implementation of SplitCntntNode!
@@ -805,7 +805,7 @@ bool SwDoc::SplitNode( const SwPosition &rPos, bool bChkTableStart )
if (pNode)
{
// verschiebe noch alle Bookmarks/TOXMarks/FlyAtCnt
- if( aBkmkArr.Count() )
+ if( !aBkmkArr.empty() )
_RestoreCntntIdx( this, aBkmkArr, rPos.nNode.GetIndex()-1, 0, sal_True );
if( IsRedlineOn() || (!IsIgnoreRedline() && pRedlineTbl->Count() ))
@@ -1126,7 +1126,7 @@ bool lcl_GetPostIts(
bool bHasPostIts = false;
SwFieldType* pFldType = pIDFA->GetSysFldType( RES_POSTITFLD );
- DBG_ASSERT( pFldType, "kein PostItType ? ");
+ OSL_ENSURE( pFldType, "kein PostItType ? ");
if( pFldType->GetDepends() )
{
@@ -1163,7 +1163,7 @@ static void lcl_FormatPostIt(
{
static char const sTmp[] = " : ";
- DBG_ASSERT( ViewShell::GetShellRes(), "missing ShellRes" );
+ OSL_ENSURE( ViewShell::GetShellRes(), "missing ShellRes" );
if (bNewPage)
{
@@ -1199,7 +1199,7 @@ static void lcl_FormatPostIt(
pIDCO->SplitNode( *aPam.GetPoint(), false );
aStr = pField->GetPar2();
-#if defined( WNT ) || defined( PM2 )
+#if defined( WNT )
// Bei Windows und Co alle CR rausschmeissen
aStr.EraseAllChars( '\r' );
#endif
@@ -1277,7 +1277,7 @@ void SwDoc::CalculatePagesForPrinting(
}
}
- DBG_ASSERT( nFirstPageNo, "first page not found! Should not happen!" );
+ OSL_ENSURE( nFirstPageNo, "first page not found! Should not happen!" );
if (nFirstPageNo)
{
// HACK: Hier muss von der MultiSelection noch eine akzeptable Moeglichkeit
@@ -1385,7 +1385,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
{
sal_Int16 nPostItMode = (sal_Int16) rOptions.getIntValue( "PrintAnnotationMode", 0 );
- DBG_ASSERT(nPostItMode == POSTITS_NONE || rData.HasPostItData(),
+ OSL_ENSURE(nPostItMode == POSTITS_NONE || rData.HasPostItData(),
"print post-its without post-it data?" );
const sal_uInt16 nPostItCount = rData.HasPostItData() ? rData.m_pPostItFields->Count() : 0;
if (nPostItMode != POSTITS_NONE && nPostItCount > 0)
@@ -1471,14 +1471,14 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
const SwPageFrm * pPageFrm = (SwPageFrm*)rData.m_pPostItShell->GetLayout()->Lower();
while( pPageFrm && nPageNum < nPostItDocPageCount )
{
- DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" );
+ OSL_ENSURE( pPageFrm, "Empty page frame. How are we going to print this?" );
++nPageNum;
rData.GetPagesToPrint().push_back( 0 ); // a page number of 0 indicates this page is from the post-it doc
- DBG_ASSERT( pPageFrm, "pPageFrm is NULL!" );
+ OSL_ENSURE( pPageFrm, "pPageFrm is NULL!" );
rData.GetPostItStartFrames().push_back( pPageFrm );
pPageFrm = (SwPageFrm*)pPageFrm->GetNext();
}
- DBG_ASSERT( nPageNum == nPostItDocPageCount, "unexpected number of pages" );
+ OSL_ENSURE( nPageNum == nPostItDocPageCount, "unexpected number of pages" );
}
else if (nPostItMode == POSTITS_ENDPAGE)
{
@@ -1492,12 +1492,12 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
const SwPageFrm * pPageFrm = (SwPageFrm*)rData.m_pPostItShell->GetLayout()->Lower();
while( pPageFrm && sal_Int32(aAllPostItStartFrames.size()) < nPostItDocPageCount )
{
- DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" );
+ OSL_ENSURE( pPageFrm, "Empty page frame. How are we going to print this?" );
++nPostItPageNum;
aAllPostItStartFrames.push_back( pPageFrm );
pPageFrm = (SwPageFrm*)pPageFrm->GetNext();
}
- DBG_ASSERT( sal_Int32(aAllPostItStartFrames.size()) == nPostItDocPageCount,
+ OSL_ENSURE( sal_Int32(aAllPostItStartFrames.size()) == nPostItDocPageCount,
"unexpected number of frames; does not match number of pages" );
// get a map that holds all post-it frames to be printed for a
@@ -1509,13 +1509,13 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
const sal_Int32 nFrames = aIt->second - nLastStartPageNum;
const sal_Int32 nFirstStartPageNum = aIt == aPostItLastStartPageNum.begin() ?
1 : aIt->second - nFrames + 1;
- DBG_ASSERT( 1 <= nFirstStartPageNum && nFirstStartPageNum <= nPostItDocPageCount,
+ OSL_ENSURE( 1 <= nFirstStartPageNum && nFirstStartPageNum <= nPostItDocPageCount,
"page number for first frame out of range" );
std::vector< const SwPageFrm * > aStartFrames;
for (sal_Int32 i = 0; i < nFrames; ++i)
{
const sal_Int32 nIdx = nFirstStartPageNum - 1 + i; // -1 because lowest page num is 1
- DBG_ASSERT( 0 <= nIdx && nIdx < sal_Int32(aAllPostItStartFrames.size()),
+ OSL_ENSURE( 0 <= nIdx && nIdx < sal_Int32(aAllPostItStartFrames.size()),
"index out of range" );
aStartFrames.push_back( aAllPostItStartFrames[ nIdx ] );
}
@@ -1606,7 +1606,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
const SwPageFrm *pPageFrm = dynamic_cast<const SwPageFrm*>( rLayout.Lower() );
while( pPageFrm && nPageNum < nDocPageCount )
{
- DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" );
+ OSL_ENSURE( pPageFrm, "Empty page frame. How are we going to print this?" );
++nPageNum;
rValidPagesSet.insert( nPageNum );
rValidStartFrms[ nPageNum ] = pPageFrm;
@@ -1614,7 +1614,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
rPrinterPaperTrays[ nPageNum ] = lcl_GetPaperBin( pStPage );
}
- DBG_ASSERT( nPageNum == nDocPageCount, "unexpected number of pages" );
+ OSL_ENSURE( nPageNum == nDocPageCount, "unexpected number of pages" );
// properties to take into account when calcualting the set of pages
// Note: here bPrintLeftPages and bPrintRightPages refer to the (virtual) resulting pages
@@ -1700,7 +1700,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
nSPg = nSPg + nStep;
nEPg = nEPg - nStep;
}
- DBG_ASSERT( size_t(nCntPage) == rPagePairs.size(), "size mismatch for number of page pairs" );
+ OSL_ENSURE( size_t(nCntPage) == rPagePairs.size(), "size mismatch for number of page pairs" );
// luckily prospect printing does not make use of post-its so far,
// thus we are done here.
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index f79374c735..88282b82eb 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -57,7 +57,6 @@
#include <sfx2/linkmgr.hxx>
#include <swserv.hxx>
#include <swundo.hxx>
-#include <tools/pstm.hxx>
#include <unocrsr.hxx>
#include <viscrs.hxx>
#include <stdio.h>
@@ -423,19 +422,19 @@ namespace sw { namespace mark
const rtl::OUString& rName,
const rtl::OUString& rType )
{
- sw::mark::IMark* pMark = makeMark( rPaM, rName,
+ sw::mark::IMark* pMark = makeMark( rPaM, rName,
IDocumentMarkAccess::TEXT_FIELDMARK );
sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark );
pFieldMark->SetFieldname( rType );
return pFieldMark;
}
-
- ::sw::mark::IFieldmark* MarkManager::makeNoTextFieldBookmark( const SwPaM& rPaM,
- const rtl::OUString& rName,
+
+ ::sw::mark::IFieldmark* MarkManager::makeNoTextFieldBookmark( const SwPaM& rPaM,
+ const rtl::OUString& rName,
const rtl::OUString& rType)
{
- sw::mark::IMark* pMark = makeMark( rPaM, rName,
+ sw::mark::IMark* pMark = makeMark( rPaM, rName,
IDocumentMarkAccess::CHECKBOX_FIELDMARK );
sw::mark::IFieldmark* pFieldMark = dynamic_cast<sw::mark::IFieldmark*>( pMark );
pFieldMark->SetFieldname( rType );
@@ -767,7 +766,7 @@ namespace sw { namespace mark
{
m_vFieldmarks.clear();
m_vBookmarks.clear();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
for(iterator_t pBkmk = m_vMarks.begin();
pBkmk != m_vMarks.end();
++pBkmk)
@@ -905,15 +904,15 @@ namespace
SetTypeAndCount( nType, 0 );
nContent = 0;
}
- _SwSaveTypeCountContent( const SvULongs& rArr, sal_uInt16& rPos )
+ _SwSaveTypeCountContent( const std::vector<sal_uLong> &rArr, sal_uInt16& rPos )
{
TYPECOUNT.nTypeCount = rArr[ rPos++ ];
nContent = static_cast<xub_StrLen>(rArr[ rPos++ ]);
}
- void Add( SvULongs& rArr )
+ void Add( std::vector<sal_uLong> &rArr )
{
- rArr.Insert( TYPECOUNT.nTypeCount, rArr.Count() );
- rArr.Insert( nContent, rArr.Count() );
+ rArr.push_back( TYPECOUNT.nTypeCount );
+ rArr.push_back( nContent );
}
void SetType( sal_uInt16 n ) { TYPECOUNT.TC.nType = n; }
@@ -967,7 +966,7 @@ namespace
return rPos.nNode > rNdIdx || ( pIdx && rPos.nNode == rNdIdx && rPos.nContent > pIdx->GetIndex() );
}
- static void lcl_ChkPaM( SvULongs& rSaveArr, sal_uLong nNode, xub_StrLen nCntnt,
+ static void lcl_ChkPaM( std::vector<sal_uLong> &rSaveArr, sal_uLong nNode, xub_StrLen nCntnt,
const SwPaM& rPam, _SwSaveTypeCountContent& rSave,
sal_Bool bChkSelDirection )
{
@@ -1214,7 +1213,7 @@ void _DelBookmarks(
void _SaveCntntIdx(SwDoc* pDoc,
sal_uLong nNode,
xub_StrLen nCntnt,
- SvULongs& rSaveArr,
+ std::vector<sal_uLong> &rSaveArr,
sal_uInt8 nSaveFly)
{
// 1. Bookmarks
@@ -1430,7 +1429,7 @@ void _SaveCntntIdx(SwDoc* pDoc,
void _RestoreCntntIdx(SwDoc* pDoc,
- SvULongs& rSaveArr,
+ std::vector<sal_uLong> &rSaveArr,
sal_uLong nNode,
xub_StrLen nOffset,
sal_Bool bAuto)
@@ -1440,7 +1439,7 @@ void _RestoreCntntIdx(SwDoc* pDoc,
SwSpzFrmFmts* pSpz = pDoc->GetSpzFrmFmts();
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
sal_uInt16 n = 0;
- while( n < rSaveArr.Count() )
+ while( n < rSaveArr.size() )
{
_SwSaveTypeCountContent aSave( rSaveArr, n );
SwPosition* pPos = 0;
@@ -1591,7 +1590,7 @@ void _RestoreCntntIdx(SwDoc* pDoc,
}
}
-void _RestoreCntntIdx(SvULongs& rSaveArr,
+void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr,
const SwNode& rNd,
xub_StrLen nLen,
xub_StrLen nChkLen)
@@ -1603,7 +1602,7 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
SwCntntNode* pCNd = (SwCntntNode*)rNd.GetCntntNode();
sal_uInt16 n = 0;
- while( n < rSaveArr.Count() )
+ while( n < rSaveArr.size() )
{
_SwSaveTypeCountContent aSave( rSaveArr, n );
if( aSave.GetContent() >= nChkLen )
@@ -1749,7 +1748,7 @@ void _RestoreCntntIdx(SvULongs& rSaveArr,
pPos->nContent.Assign( pCNd, Min( aSave.GetContent(), nLen ) );
}
n -= 2;
- rSaveArr.Remove( n, 2 );
+ rSaveArr.erase( rSaveArr.begin() + n, rSaveArr.begin() + n + 2);
}
}
}
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 8630801c45..cd8592a84e 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -991,7 +991,6 @@ sal_Bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd
{
bRet = (SimpleTableToText(rSrcNd) == SimpleTableToText(rDstNd));
}
- // <--
}
break;
@@ -1053,7 +1052,6 @@ sal_Bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd
bRet = CompareNode(
*rSrcNd.StartOfSectionNode(), *rDstNd.StartOfSectionNode());
}
- // <--
break;
}
@@ -1411,13 +1409,13 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
sal_uInt16 nAuthor = rDoc.GetRedlineAuthor();
DateTime aTimeStamp;
SwDocShell *pDocShell(rDoc.GetDocShell());
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
if (pDocShell) {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+ OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
if( bUseDocInfo && xDocProps.is() ) {
String aTmp( 1 == xDocProps->getEditingCycles()
@@ -1449,7 +1447,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
pTmp->GetPoint()->nNode++;
pTmp->GetPoint()->nContent.Assign( pTmp->GetCntntNode(), 0 );
}
- // --> mst 2010-05-17 #i101009#
+ // #i101009#
// prevent redlines that end on structural end node
if (& rDoc.GetNodes().GetEndOfContent() ==
& pTmp->GetPoint()->nNode.GetNode())
@@ -1459,7 +1457,6 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
pTmp->GetPoint()->nContent.Assign( pContentNode,
(pContentNode) ? pContentNode->Len() : 0 );
}
- // <--
rDoc.DeleteRedline( *pTmp, false, USHRT_MAX );
@@ -1482,7 +1479,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
pTmp->GetPoint()->nNode++;
pTmp->GetPoint()->nContent.Assign( pTmp->GetCntntNode(), 0 );
}
- // --> mst 2010-05-17 #i101009#
+ // #i101009#
// prevent redlines that end on structural end node
if (& rDoc.GetNodes().GetEndOfContent() ==
& pTmp->GetPoint()->nNode.GetNode())
@@ -1492,7 +1489,6 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
pTmp->GetPoint()->nContent.Assign( pContentNode,
(pContentNode) ? pContentNode->Len() : 0 );
}
- // <--
} while( pInsRing != ( pTmp = (SwPaM*)pTmp->GetNext() ));
SwRedlineData aRedlnData( nsRedlineType_t::REDLINE_INSERT, nAuthor, aTimeStamp,
aEmptyStr, 0, 0 );
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index c35367c49b..aeee09820a 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -211,10 +211,22 @@ void SwDoc::CorrAbs(const SwNodeIndex& rOldNode,
getIDocumentMarkAccess()->correctMarksAbsolute(rOldNode, rNewPos, nOffset);
{ // fix redlines
SwRedlineTbl& rTbl = *pRedlineTbl;
- for( sal_uInt16 n = 0; n < rTbl.Count(); ++n )
+ for (sal_uInt16 n = 0; n < rTbl.Count(); )
{
// is on position ??
- lcl_PaMCorrAbs(*rTbl[ n ], *aPam.Start(), *aPam.End(), aNewPos);
+ SwRedline *const pRedline( rTbl[ n ] );
+ bool const bChanged =
+ lcl_PaMCorrAbs(*pRedline, *aPam.Start(), *aPam.End(), aNewPos);
+ // clean up empty redlines: docredln.cxx asserts these as invalid
+ if (bChanged && (*pRedline->GetPoint() == *pRedline->GetMark())
+ && (pRedline->GetContentIdx() == NULL))
+ {
+ rTbl.DeleteAndDestroy(n);
+ }
+ else
+ {
+ ++n;
+ }
}
}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 0269d6be68..0900b18d07 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -83,11 +83,10 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId,
SwFrmFmt &rFmt1,
SwFrmFmt &rFmt2 )
{
- // --> FME 2005-01-21 #i41075# Printer on demand
+ // --> #i41075# Printer on demand
// This function does not require a printer anymore.
// The default page size is obtained from the application
//locale
- // <--
SwFmtFrmSize aFrmSize( ATT_FIX_SIZE );
const Size aPhysSize = SvxPaperInfo::GetDefaultPaperSize();
@@ -147,7 +146,6 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
const sal_Bool bPage = sal_True )
{
/////////////// !!!!!!!!!!!!!!!!
-//JP 03.03.99:
// eigentlich sollte hier das Intersect von ItemSet benutzt werden, aber das
// funktioniert nicht richtig, wenn man unterschiedliche WhichRanges hat.
/////////////// !!!!!!!!!!!!!!!!
@@ -157,10 +155,9 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
RES_COL, RES_COL,
RES_FRAMEDIR, RES_FRAMEDIR,
RES_TEXTGRID, RES_TEXTGRID,
- // --> FME 2005-04-18 #i45539#
+ // #i45539#
RES_HEADER_FOOTER_EAT_SPACING,
RES_HEADER_FOOTER_EAT_SPACING,
- // <--
RES_UNKNOWNATR_CONTAINER,
RES_UNKNOWNATR_CONTAINER,
0 };
@@ -170,12 +167,11 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
{
for( sal_uInt16 nId = aIdArr[ n ]; nId <= aIdArr[ n+1]; ++nId )
{
- // --> FME 2005-04-18 #i45539#
+ // #i45539#
// bPage == true:
// All in aIdArr except from RES_HEADER_FOOTER_EAT_SPACING
// bPage == false:
// All in aIdArr except from RES_COL and RES_PAPER_BIN:
- // <--
if( ( bPage && RES_HEADER_FOOTER_EAT_SPACING != nId ) ||
( !bPage && RES_COL != nId && RES_PAPER_BIN != nId ))
{
@@ -199,7 +195,7 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
OSL_ENSURE( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
SwPageDesc *pDesc = aPageDescs[i];
- SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
+ SwRootFrm* pTmpRoot = GetCurrentLayout();
if (GetIDocumentUndoRedo().DoesUndo())
{
@@ -220,7 +216,7 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
if( rChged.GetNumType().GetNumberingType() != pDesc->GetNumType().GetNumberingType() )
{
pDesc->SetNumType( rChged.GetNumType() );
- // JP 30.03.99: Bug 64121 - den Seitennummernfeldern bescheid sagen,
+ // den Seitennummernfeldern bescheid sagen,
// das sich das Num-Format geaendert hat
GetSysFldType( RES_PAGENUMBERFLD )->UpdateFlds();
GetSysFldType( RES_REFPAGEGETFLD )->UpdateFlds();
@@ -399,7 +395,7 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
//Layot benachrichtigen!
{
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080304
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));
}
//Jetzt noch die Seiten-Attribute uebernehmen.
@@ -475,7 +471,7 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
if( bHasLayout )
{
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080228
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));
}
}
}
@@ -534,7 +530,7 @@ void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast )
|*************************************************************************/
sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
- sal_Bool bRegardLanguage, sal_Bool bBroadcast) // #116530#
+ sal_Bool bRegardLanguage, sal_Bool bBroadcast)
{
SwPageDesc *pNew;
if( pCpy )
@@ -569,7 +565,6 @@ sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
if (GetIDocumentUndoRedo().DoesUndo())
{
- // #116530#
GetIDocumentUndoRedo().AppendUndo(new SwUndoPageDescCreate(pNew, this));
}
@@ -602,11 +597,10 @@ void SwDoc::PrtDataChanged()
{
//!!!!!!!! Bei Aenderungen hier bitte ggf. InJobSetup im Sw3io mitpflegen
- // --> FME 2005-01-21 #i41075#
+ // #i41075#
OSL_ENSURE( get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) ||
0 != getPrinter( sal_False ), "PrtDataChanged will be called recursive!" );
- // <--
- SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
+ SwRootFrm* pTmpRoot = GetCurrentLayout();
SwWait *pWait = 0;
sal_Bool bEndAction = sal_False;
@@ -636,7 +630,7 @@ void SwDoc::PrtDataChanged()
pFntCache->Flush();
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
- std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));//swmod 080304
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));
if ( pSh )
{
@@ -649,7 +643,7 @@ void SwDoc::PrtDataChanged()
}
}
- } //swmod 080218
+ }
if ( bDraw && pDrawModel )
{
const sal_Bool bTmpAddExtLeading = get(IDocumentSettingAccess::ADD_EXT_LEADING);
@@ -664,7 +658,7 @@ void SwDoc::PrtDataChanged()
PrtOLENotify( sal_True );
if ( bEndAction )
- pTmpRoot->EndAllAction(); //swmod 080218
+ pTmpRoot->EndAllAction();
delete pWait;
}
@@ -689,7 +683,7 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
if ( pSh->ISA(SwFEShell) )
pShell = (SwFEShell*)pSh;
- } //swmod 071107//swmod 071225
+ }
if ( !pShell )
{
//Das hat ohne Shell und damit ohne Client keinen Sinn, weil nur darueber
@@ -713,7 +707,7 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
{
::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
0, pNodes->Count(), GetDocShell());
- GetCurrentLayout()->StartAllAction(); //swmod 080218
+ GetCurrentLayout()->StartAllAction();
for( sal_uInt16 i = 0; i < pNodes->Count(); ++i )
{
@@ -756,7 +750,7 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
}
}
delete pNodes;
- GetCurrentLayout()->EndAllAction(); //swmod 080218
+ GetCurrentLayout()->EndAllAction();
::EndProgress( GetDocShell() );
}
}
@@ -774,7 +768,7 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
{
::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
0, pNodes->Count(), GetDocShell());
- GetCurrentLayout()->StartAllAction(); //swmod 080218
+ GetCurrentLayout()->StartAllAction();
SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
for( sal_uInt16 i = 0; i < pNodes->Count(); ++i )
@@ -791,7 +785,7 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
pOLENd->ModifyNotification( &aMsgHint, &aMsgHint );
}
}
- GetCurrentLayout()->EndAllAction(); //swmod 080218
+ GetCurrentLayout()->EndAllAction();
::EndProgress( GetDocShell() );
delete pNodes;
}
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 297c42fc87..7cd35a5322 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -949,13 +949,13 @@ bool SwDoc::MoveRange( SwPaM& rPaM, SwPosition& rPos, SwMoveFlags eMvFlags )
bSplit = sal_True;
xub_StrLen nMkCntnt = rPaM.GetMark()->nContent.GetIndex();
- SvULongs aBkmkArr( 15, 15 );
+ std::vector<sal_uLong> aBkmkArr;
_SaveCntntIdx( this, rPos.nNode.GetIndex(), rPos.nContent.GetIndex(),
aBkmkArr, SAVEFLY_SPLIT );
pTNd = static_cast<SwTxtNode*>(pTNd->SplitCntntNode( rPos ));
- if( aBkmkArr.Count() )
+ if( !aBkmkArr.empty() )
_RestoreCntntIdx( this, aBkmkArr, rPos.nNode.GetIndex()-1, 0, sal_True );
// jetzt noch den Pam berichtigen !!
@@ -1255,9 +1255,9 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, SwNodeIndex& rPos,
}
// Convert list of ranges of whichIds to a corresponding list of whichIds
-SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges)
+std::vector<sal_uInt16> * lcl_RangesToVector(sal_uInt16 * pRanges)
{
- SvUShorts * pResult = new SvUShorts();
+ std::vector<sal_uInt16> * pResult = new std::vector<sal_uInt16>();
int i = 0;
while (pRanges[i] != 0)
@@ -1265,7 +1265,7 @@ SvUShorts * lcl_RangesToUShorts(sal_uInt16 * pRanges)
OSL_ENSURE(pRanges[i+1] != 0, "malformed ranges");
for (sal_uInt16 j = pRanges[i]; j < pRanges[i+1]; j++)
- pResult->Insert(j, pResult->Count());
+ pResult->push_back(j);
i += 2;
}
@@ -1381,7 +1381,7 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
}
pOldTxtNd->FmtToTxtAttr( pTxtNd );
- SvULongs aBkmkArr( 15, 15 );
+ std::vector<sal_uLong> aBkmkArr;
::_SaveCntntIdx( pDoc, aOldIdx.GetIndex(),
pOldTxtNd->Len(), aBkmkArr );
@@ -1392,7 +1392,7 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
pDoc->CorrRel( rPam.GetPoint()->nNode, aAlphaPos, 0, sal_True );
// verschiebe noch alle Bookmarks/TOXMarks
- if( aBkmkArr.Count() )
+ if( !aBkmkArr.empty() )
::_RestoreCntntIdx( pDoc, aBkmkArr, aIdx.GetIndex() );
// falls der uebergebene PaM nicht im Crsr-Ring steht,
@@ -1423,8 +1423,8 @@ void lcl_JoinText( SwPaM& rPam, sal_Bool bJoinPrev )
first resetting all character attributes in first
paragraph (pTxtNd).
*/
- SvUShorts * pShorts =
- lcl_RangesToUShorts(aCharFmtSetRange);
+ std::vector<sal_uInt16> * pShorts =
+ lcl_RangesToVector(aCharFmtSetRange);
pTxtNd->ResetAttr(*pShorts);
delete pShorts;
@@ -2482,8 +2482,6 @@ SetRedlineMode( eOld );
rPam.GetMark()->nNode = aPtNd;
rPam.GetMark()->nContent.Assign( aPtNd.GetNode().GetCntntNode(),
nPtCnt );
- if( bJoinTxt )
- rPam.Move( fnMoveBackward );
if( pUndoRpl )
{
@@ -2605,8 +2603,15 @@ bool SwDoc::DelFullPara( SwPaM& rPam )
return sal_False;
}
}
- // text::Bookmarks usw. verschieben
- CorrAbs( aRg.aStart, aRg.aEnd, *rPam.GetPoint(), sal_True );
+ // move bookmarks, redlines etc.
+ if (aRg.aStart == aRg.aEnd) // only first CorrAbs variant handles this
+ {
+ CorrAbs( aRg.aStart, *rPam.GetPoint(), 0, sal_True );
+ }
+ else
+ {
+ CorrAbs( aRg.aStart, aRg.aEnd, *rPam.GetPoint(), sal_True );
+ }
// was ist mit Fly's ??
{
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 4fcca81477..bbbc60889b 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -36,7 +36,6 @@
#include <float.h>
#include <tools/datetime.hxx>
#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_ULONGS
#include <svl/svarray.hxx>
#endif
#include <vcl/svapp.hxx>
@@ -2241,7 +2240,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
{
// damit die Frames richtig angelegt werden, muessen sie in der
// Reihenfolgen von oben nach unten expandiert werden
- SvULongs aTmpArr;
+ std::vector<sal_uLong> aTmpArr;
SwSectionFmts& rArr = rDoc.GetSections();
SwSectionNode* pSectNd;
sal_uInt16 nArrStt = 0;
@@ -2254,20 +2253,17 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
0 != ( pSectNd = pSect->GetFmt()->GetSectionNode() ))
{
sal_uLong nIdx = pSectNd->GetIndex();
- sal_uInt16 i;
-
- for( i = 0; i < aTmpArr.Count() && aTmpArr[ i ] < nIdx; ++i )
- ;
- aTmpArr.Insert( nIdx, i );
+ aTmpArr.push_back( nIdx );
if( nIdx < nSttCntnt )
++nArrStt;
}
}
+ std::sort(aTmpArr.begin(), aTmpArr.end());
// erst alle anzeigen, damit die Frames vorhanden sind. Mit deren
// Position wird das BodyAnchor ermittelt.
// Dafuer erst den ContentBereich, dann die Sonderbereiche!!!
- for (sal_uInt16 n = nArrStt; n < aTmpArr.Count(); ++n)
+ for (sal_uInt16 n = nArrStt; n < aTmpArr.size(); ++n)
{
pSectNd = rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode();
OSL_ENSURE( pSectNd, "Wo ist mein SectionNode" );
@@ -2281,7 +2277,7 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
}
// so, erst jetzt alle sortiert in die Liste eintragen
- for (sal_uInt16 n = 0; n < aTmpArr.Count(); ++n)
+ for (sal_uInt16 n = 0; n < aTmpArr.size(); ++n)
{
GetBodyNode( *rDoc.GetNodes()[ aTmpArr[ n ] ]->GetSectionNode() );
}
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index d76471759b..1bfe62ad58 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -31,8 +31,6 @@
#define _ZFORLIST_DECLARE_TABLE
-#define _SVSTDARR_USHORTSSORT
-#define _SVSTDARR_USHORTS
#include <hintids.hxx>
#include <rtl/logfile.hxx>
#include <svl/itemiter.hxx>
@@ -214,7 +212,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
0 );
const SfxItemSet* pSet = pNode->GetpSwAttrSet();
- SvUShorts aClearWhichIds;
+ std::vector<sal_uInt16> aClearWhichIds;
// restoring all paragraph list attributes
{
SfxItemSet aListAttrSet( pDoc->GetAttrPool(),
@@ -228,7 +226,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
const SfxPoolItem* pItem = aIter.GetCurItem();
while( pItem )
{
- aClearWhichIds.Insert( pItem->Which(), aClearWhichIds.Count() );
+ aClearWhichIds.push_back( pItem->Which() );
pItem = aIter.NextItem();
}
}
@@ -266,7 +264,7 @@ sal_Bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs )
if( bSave )
{
aSet.Put( *pItem );
- aClearWhichIds.Insert( aSavIds[n], aClearWhichIds.Count() );
+ aClearWhichIds.push_back( aSavIds[n] );
}
}
}
@@ -349,12 +347,11 @@ void SwDoc::RstTxtAttrs(const SwPaM &rRg, sal_Bool bInclRefToxMark )
void SwDoc::ResetAttrs( const SwPaM &rRg,
sal_Bool bTxtAttr,
- const SvUShortsSort* pAttrs,
+ const std::set<sal_uInt16> &rAttrs,
const bool bSendDataChangedEvents )
{
SwPaM* pPam = (SwPaM*)&rRg;
- if( !bTxtAttr && pAttrs && pAttrs->Count() &&
- RES_TXTATR_END > (*pAttrs)[ 0 ] )
+ if( !bTxtAttr && !rAttrs.empty() && RES_TXTATR_END > *(rAttrs.begin()) )
bTxtAttr = sal_True;
if( !rRg.HasMark() )
@@ -417,9 +414,9 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
{
SwUndoResetAttr* pUndo = new SwUndoResetAttr( rRg,
static_cast<sal_uInt16>(bTxtAttr ? RES_CONDTXTFMTCOLL : RES_TXTFMTCOLL ));
- if( pAttrs && pAttrs->Count() )
+ if( !rAttrs.empty() )
{
- pUndo->SetAttrs( *pAttrs );
+ pUndo->SetAttrs( rAttrs );
}
pHst = &pUndo->GetHistory();
GetIDocumentUndoRedo().AppendUndo(pUndo);
@@ -443,12 +440,13 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
};
SfxItemSet aDelSet( GetAttrPool(), aResetableSetRange );
- if( pAttrs && pAttrs->Count() )
+ if( !rAttrs.empty() )
{
- for( sal_uInt16 n = pAttrs->Count(); n; )
- if( POOLATTR_END > (*pAttrs)[ --n ] )
- aDelSet.Put( *GetDfltAttr( (*pAttrs)[ n ] ));
-
+ for( std::set<sal_uInt16>::const_reverse_iterator it = rAttrs.rbegin(); it != rAttrs.rend(); ++it )
+ {
+ if( POOLATTR_END > *it )
+ aDelSet.Put( *GetDfltAttr( *it ));
+ }
if( aDelSet.Count() )
aPara.pDelSet = &aDelSet;
}
@@ -462,45 +460,14 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
SwTxtNode* pTNd = aTmpStt.GetNode().GetTxtNode();
if( pTNd && pTNd->HasSwAttrSet() && pTNd->GetpSwAttrSet()->Count() )
{
- SfxItemIter aIter( *pTNd->GetpSwAttrSet() );
- const SfxPoolItem* pItem = aIter.GetCurItem();
- SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_CHRATR_END );
-
- while( sal_True )
+ if (pHst)
{
- if( IsInRange( aCharFmtSetRange, pItem->Which() ))
- {
- pTNd->GetOrCreateSwpHints();
-
- aCharSet.Put( *pItem );
-
- if( pHst )
- {
- SwRegHistory aRegH( pTNd, *pTNd, pHst );
- pTNd->ResetAttr( pItem->Which() );
- }
- else
- pTNd->ResetAttr( pItem->Which() );
- }
- if( aIter.IsAtEnd() )
- break;
- pItem = aIter.NextItem();
+ SwRegHistory history(pTNd, *pTNd, pHst);
+ pTNd->FmtToTxtAttr(pTNd);
}
-
- if ( aCharSet.Count() )
+ else
{
- if ( pHst )
- {
- SwRegHistory history( pTNd, *pTNd, pHst );
- history.InsertItems( aCharSet, 0, pTNd->GetTxt().Len(),
- nsSetAttrMode::SETATTR_NOFORMATATTR );
- }
- else
- {
- SwTxtAttr* pNew =
- MakeTxtAttr( *this, aCharSet, 0, pTNd->GetTxt().Len() );
- pTNd->InsertHint( pNew );
- }
+ pTNd->FmtToTxtAttr(pTNd);
}
}
@@ -514,29 +481,14 @@ void SwDoc::ResetAttrs( const SwPaM &rRg,
SwTxtNode* pTNd = aTmpEnd.GetNode().GetTxtNode();
if( pTNd && pTNd->HasSwAttrSet() && pTNd->GetpSwAttrSet()->Count() )
{
- SfxItemIter aIter( *pTNd->GetpSwAttrSet() );
- const SfxPoolItem* pItem = aIter.GetCurItem();
- while( sal_True )
+ if (pHst)
{
- if( IsInRange( aCharFmtSetRange, pItem->Which() ))
- {
- SwTxtAttr* pTAttr = MakeTxtAttr( *this,
- const_cast<SfxPoolItem&>(*pItem),
- 0, pTNd->GetTxt().Len() );
- SwpHints & rHints = pTNd->GetOrCreateSwpHints();
- rHints.SwpHintsArray::Insert( pTAttr );
- if ( pHst )
- {
- SwRegHistory aRegH( pTNd, *pTNd, pHst );
- pTNd->ResetAttr( pItem->Which() );
- pHst->Add( pTAttr, aTmpEnd.GetIndex(), true );
- }
- else
- pTNd->ResetAttr( pItem->Which() );
- }
- if( aIter.IsAtEnd() )
- break;
- pItem = aIter.NextItem();
+ SwRegHistory history(pTNd, *pTNd, pHst);
+ pTNd->FmtToTxtAttr(pTNd);
+ }
+ else
+ {
+ pTNd->FmtToTxtAttr(pTNd);
}
}
}
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index f9ec5c2c8b..ea0eada3b0 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -176,7 +176,7 @@ SwCharFmt* SwEndNoteInfo::GetCharFmt(SwDoc &rDoc) const
void SwEndNoteInfo::SetCharFmt( SwCharFmt* pChFmt )
{
- DBG_ASSERT(pChFmt, "kein CharFmt?");
+ OSL_ENSURE(pChFmt, "kein CharFmt?");
pChFmt->Add( &((SwClient&)aCharFmtDep) );
}
@@ -193,7 +193,7 @@ SwCharFmt* SwEndNoteInfo::GetAnchorCharFmt(SwDoc &rDoc) const
void SwEndNoteInfo::SetAnchorCharFmt( SwCharFmt* pChFmt )
{
- DBG_ASSERT(pChFmt, "kein CharFmt?");
+ OSL_ENSURE(pChFmt, "kein CharFmt?");
pChFmt->Add( &((SwClient&)aAnchorCharFmtDep) );
}
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index a0fadbcd4a..23444880f3 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -69,30 +69,97 @@ enum SwSplitDocType
};
sal_Bool SwDoc::GenerateGlobalDoc( const String& rPath,
- const SwTxtFmtColl* pSplitColl )
+ const SwTxtFmtColl* pSplitColl )
{
- return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, pSplitColl );
+ return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, false, pSplitColl, 0 );
}
-//#outline level,add by zhaojianwei
sal_Bool SwDoc::GenerateGlobalDoc( const String& rPath, int nOutlineLevel )
{
- return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, nOutlineLevel );
+ return SplitDoc( SPLITDOC_TO_GLOBALDOC, rPath, true, 0, nOutlineLevel );
}
+
sal_Bool SwDoc::GenerateHTMLDoc( const String& rPath, int nOutlineLevel )
{
- return SplitDoc( SPLITDOC_TO_HTML, rPath, nOutlineLevel );
+ return SplitDoc( SPLITDOC_TO_HTML, rPath, true, 0, nOutlineLevel );
}
-//<-end,zhaojianwei
sal_Bool SwDoc::GenerateHTMLDoc( const String& rPath,
- const SwTxtFmtColl* pSplitColl )
+ const SwTxtFmtColl* pSplitColl )
+{
+ return SplitDoc( SPLITDOC_TO_HTML, rPath, false, pSplitColl, 0 );
+}
+
+// two helpers for outline mode
+SwNodePtr GetStartNode( SwOutlineNodes* pOutlNds, int nOutlineLevel, sal_uInt16* nOutl )
+{
+ SwNodePtr pNd;
+
+ for( ; *nOutl < pOutlNds->Count(); ++(*nOutl) )
+ if( ( pNd = pOutlNds->GetObject( *nOutl ))->GetTxtNode()->GetAttrOutlineLevel() == nOutlineLevel && !pNd->FindTableNode() )
+ {
+ return pNd;
+ }
+
+ return 0;
+}
+
+SwNodePtr GetEndNode( SwOutlineNodes* pOutlNds, int nOutlineLevel, sal_uInt16* nOutl )
{
- return SplitDoc( SPLITDOC_TO_HTML, rPath, pSplitColl );
+ SwNodePtr pNd;
+
+ for( ++(*nOutl); (*nOutl) < pOutlNds->Count(); ++(*nOutl) )
+ {
+ pNd = pOutlNds->GetObject( *nOutl );
+
+ const int nLevel = pNd->GetTxtNode()->GetAttrOutlineLevel();
+
+ if( ( 0 < nLevel && nLevel <= nOutlineLevel ) &&
+ !pNd->FindTableNode() )
+ {
+ return pNd;
+ }
+ }
+ return 0;
}
-sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
- const SwTxtFmtColl* pSplitColl )
+// two helpers for collection mode
+SwNodePtr GetStartNode( const SwOutlineNodes* pOutlNds, const SwTxtFmtColl* pSplitColl, sal_uInt16* nOutl )
+{
+ SwNodePtr pNd;
+ for( ; *nOutl < pOutlNds->Count(); ++(*nOutl) )
+ if( ( pNd = pOutlNds->GetObject( *nOutl ))->GetTxtNode()->
+ GetTxtColl() == pSplitColl &&
+ !pNd->FindTableNode() )
+ {
+ return pNd;
+ }
+ return 0;
+}
+
+SwNodePtr GetEndNode( const SwOutlineNodes* pOutlNds, const SwTxtFmtColl* pSplitColl, sal_uInt16* nOutl )
+{
+ SwNodePtr pNd;
+
+ for( ++(*nOutl); *nOutl < pOutlNds->Count(); ++(*nOutl) )
+ {
+ pNd = pOutlNds->GetObject( *nOutl );
+ SwTxtFmtColl* pTColl = pNd->GetTxtNode()->GetTxtColl();
+
+ if( ( pTColl == pSplitColl ||
+ ( pSplitColl->GetAttrOutlineLevel() > 0 &&
+ pTColl->GetAttrOutlineLevel() > 0 &&
+ pTColl->GetAttrOutlineLevel() <
+ pSplitColl->GetAttrOutlineLevel() )) &&
+ !pNd->FindTableNode() )
+ {
+ return pNd;
+ }
+ }
+ return 0;
+}
+
+bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, bool bOutline, const SwTxtFmtColl* pSplitColl, int nOutlineLevel )
{
// ueber alle Node der Vorlage Iterieren und dafuer einzelne
// Dokumente erzeugen und in diesem gegen
@@ -102,12 +169,13 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
// Am Ende wird dieses Doc als GlobalDoc/HTML-Doc gespreichert.
if( !pDocShell || !pDocShell->GetMedium() ||
( SPLITDOC_TO_GLOBALDOC == eDocType && get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ) )
- return sal_False;
+ return false;
sal_uInt16 nOutl = 0;
SwOutlineNodes* pOutlNds = (SwOutlineNodes*)&GetNodes().GetOutLineNds();
- SwNodePtr pSttNd;
+ SwNodePtr pStartNd;
+ if ( !bOutline) {
if( pSplitColl )
{
// wenn keine OutlineNumerierung ist, dann benutze eigenes Array
@@ -123,7 +191,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
if( !pOutlNds->Count() )
{
delete pOutlNds;
- return sal_False;
+ return false;
}
}
}
@@ -139,7 +207,8 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
}
if( !pSplitColl )
- return sal_False;
+ return false;
+ }
}
const SfxFilter* pFilter;
@@ -158,7 +227,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
}
if( !pFilter )
- return sal_False;
+ return false;
// Undo/Redline aufjedenfall abschalten
GetIDocumentUndoRedo().DoUndo(false);
@@ -190,44 +259,24 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
++nOutl;
do {
- pSttNd = 0;
+ if( bOutline )
+ pStartNd = GetStartNode( pOutlNds, nOutlineLevel, &nOutl );
+ else
+ pStartNd = GetStartNode( pOutlNds, pSplitColl, &nOutl );
- SwNodePtr pNd;
- for( ; nOutl < pOutlNds->Count(); ++nOutl )
- if( ( pNd = pOutlNds->GetObject( nOutl ))->GetTxtNode()->
- GetTxtColl() == pSplitColl &&
- !pNd->FindTableNode() )
- {
- pSttNd = pNd;
- break;
- }
-
- if( pSttNd )
+ if( pStartNd )
{
- SwNodePtr pEndNd = 0;
- for( ++nOutl; nOutl < pOutlNds->Count(); ++nOutl )
- {
- pNd = pOutlNds->GetObject( nOutl );
- SwTxtFmtColl* pTColl = pNd->GetTxtNode()->GetTxtColl();
-
- if( ( pTColl == pSplitColl ||
- ( pSplitColl->GetAttrOutlineLevel() > 0 &&
- pTColl->GetAttrOutlineLevel() > 0 &&
- pTColl->GetAttrOutlineLevel() <
- pSplitColl->GetAttrOutlineLevel() )) &&
- !pNd->FindTableNode() ) //<-end,zhaojianwei
- {
- pEndNd = pNd;
-
- break;
- }
- }
+ SwNodePtr pEndNd;
+ if( bOutline )
+ pEndNd = GetEndNode( pOutlNds, nOutlineLevel, &nOutl );
+ else
+ pEndNd = GetEndNode( pOutlNds, pSplitColl, &nOutl );
SwNodeIndex aEndIdx( pEndNd ? *pEndNd
: GetNodes().GetEndOfContent() );
// die Nodes komplett rausschreiben
String sFileName;
- if( pSttNd->GetIndex() + 1 < aEndIdx.GetIndex() )
+ if( pStartNd->GetIndex() + 1 < aEndIdx.GetIndex() )
{
SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
if( xDocSh->DoInitNew( 0 ) )
@@ -239,7 +288,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+ OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
// the GlobalDoc is the template
xDocProps->setTemplateName(aEmptyStr);
::util::DateTime uDT(aTmplDate.Get100Sec(),
@@ -254,7 +303,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
String sTitle( xDocProps->getTitle() );
if( sTitle.Len() )
sTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ));
- sTitle += ((SwTxtNode*)pSttNd)->GetExpandTxt();
+ sTitle += ((SwTxtNode*)pStartNd)->GetExpandTxt();
xDocProps->setTitle( sTitle );
// Vorlagen ersetzen
@@ -264,7 +313,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
if( pOutlineRule )
pDoc->SetOutlineNumRule( *pOutlineRule );
- SwNodeRange aRg( *pSttNd, 0, aEndIdx.GetNode() );
+ SwNodeRange aRg( *pStartNd, 0, aEndIdx.GetNode() );
SwNodeIndex aTmpIdx( pDoc->GetNodes().GetEndOfContent() );
GetNodes()._Copy( aRg, aTmpIdx, sal_False );
@@ -293,7 +342,6 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
if( SPLITDOC_TO_HTML == eDocType &&
pDoc->GetSpzFrmFmts()->Count() )
{
- /* SfxViewFrame* pFrame = */
SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 );
}
xDocSh->DoSaveAs( *pTmpMed );
@@ -316,10 +364,10 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
// loesche alle Nodes im Bereich und setze im "Start-
// Node" den Link auf das gespeicherte Doc
sal_uLong nNodeDiff = aEndIdx.GetIndex() -
- pSttNd->GetIndex() - 1;
+ pStartNd->GetIndex() - 1;
if( nNodeDiff )
{
- SwPaM aTmp( *pSttNd, aEndIdx.GetNode(), 1, -1 );
+ SwPaM aTmp( *pStartNd, aEndIdx.GetNode(), 1, -1 );
aTmp.GetPoint()->nContent.Assign( 0, 0 );
aTmp.GetMark()->nContent.Assign( 0, 0 );
SwNodeIndex aSIdx( aTmp.GetMark()->nNode );
@@ -361,13 +409,13 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
// dann setze im StartNode noch den Link:
SwFmtINetFmt aINet( sFileName , aEmptyStr );
- SwTxtNode* pTNd = (SwTxtNode*)pSttNd;
+ SwTxtNode* pTNd = (SwTxtNode*)pStartNd;
pTNd->InsertItem( aINet, 0, pTNd->GetTxt().Len() );
// wenn der nicht mehr gefunden wird, kann das nur
// ein Bug sein!
- if( !pOutlNds->Seek_Entry( pSttNd, &nOutl ))
- pSttNd = 0;
+ if( !pOutlNds->Seek_Entry( pStartNd, &nOutl ))
+ pStartNd = 0;
++nOutl;
}
break;
@@ -388,31 +436,31 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
// JP 06.07.99 - Bug 67361 - is any Section ends or
// starts in the new sectionrange, they must end or
// start before or behind the range!
- SwSectionNode* pSectNd = pSttNd->FindSectionNode();
+ SwSectionNode* pSectNd = pStartNd->FindSectionNode();
while( pSectNd && pSectNd->EndOfSectionIndex()
<= aEndIdx.GetIndex() )
{
const SwNode* pSectEnd = pSectNd->EndOfSectionNode();
if( pSectNd->GetIndex() + 1 ==
- pSttNd->GetIndex() )
+ pStartNd->GetIndex() )
{
- sal_Bool bMvIdx = aEndIdx == *pSectEnd;
+ bool bMvIdx = aEndIdx == *pSectEnd;
DelSectionFmt( pSectNd->GetSection().GetFmt() );
if( bMvIdx )
aEndIdx--;
}
else
{
- SwNodeRange aRg( *pSttNd, *pSectEnd );
+ SwNodeRange aRg( *pStartNd, *pSectEnd );
SwNodeIndex aIdx( *pSectEnd, 1 );
GetNodes()._MoveNodes( aRg, GetNodes(), aIdx );
}
- pSectNd = pSttNd->FindSectionNode();
+ pSectNd = pStartNd->FindSectionNode();
}
pSectNd = aEndIdx.GetNode().FindSectionNode();
while( pSectNd && pSectNd->GetIndex() >
- pSttNd->GetIndex() )
+ pStartNd->GetIndex() )
{
// #i15712# don't attempt to split sections if
// they are fully enclosed in [pSectNd,aEndIdx].
@@ -423,12 +471,12 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
GetNodes()._MoveNodes( aRg, GetNodes(), aIdx );
}
- pSectNd = pSttNd->FindSectionNode();
+ pSectNd = pStartNd->FindSectionNode();
}
// -> #i26762#
// Ensure order of start and end of section is sane.
- SwNodeIndex aStartIdx(*pSttNd);
+ SwNodeIndex aStartIdx(*pStartNd);
if (aEndIdx >= aStartIdx)
{
@@ -448,7 +496,7 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
}
}
}
- } while( pSttNd );
+ } while( pStartNd );
if( pOutlNds != &GetNodes().GetOutLineNds() )
delete pOutlNds;
@@ -484,344 +532,4 @@ sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath,
return pRet && pRet->GetValue();
}
-//#outline level,add by zhaojianwei
-sal_Bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, int nOutlineLevel )
-{
- if( !pDocShell || !pDocShell->GetMedium() ||
- ( SPLITDOC_TO_GLOBALDOC == eDocType && get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ) )
- return sal_False;
-
- sal_uInt16 nOutl = 0;
- SwOutlineNodes* pOutlNds = (SwOutlineNodes*)&GetNodes().GetOutLineNds();
- SwNodePtr pSttNd;
-
- const SfxFilter* pFilter;
- switch( eDocType )
- {
- case SPLITDOC_TO_HTML:
- pFilter = SwIoSystem::GetFilterOfFormat( String::CreateFromAscii(
- RTL_CONSTASCII_STRINGPARAM( "HTML" )));
- break;
-
- default:
- pFilter = SwIoSystem::GetFilterOfFormat(
- String::CreateFromAscii( FILTER_XML ));
- eDocType = SPLITDOC_TO_GLOBALDOC;
- break;
- }
-
- if( !pFilter )
- return sal_False;
-
- // Undo/Redline aufjedenfall abschalten
- GetIDocumentUndoRedo().DoUndo(false);
- SetRedlineMode_intern( (RedlineMode_t)(GetRedlineMode() & ~nsRedlineMode_t::REDLINE_ON));
-
- String sExt( pFilter->GetSuffixes().GetToken(0, ',') );
- if( !sExt.Len() )
- sExt.AssignAscii( "sxw" );
- if( '.' != sExt.GetChar( 0 ) )
- sExt.Insert( '.', 0 );
-
- INetURLObject aEntry(rPath);
- String sLeading(aEntry.GetBase());
- aEntry.removeSegment();
- String sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE );
- utl::TempFile aTemp(sLeading,&sExt,&sPath );
- aTemp.EnableKillingFile();
-
- DateTime aTmplDate;
- {
- Time a2Min( 0 ); a2Min.SetMin( 2 );
- aTmplDate += a2Min;
- }
-
-
- // alle Ungueltigen ueberspringen
- while( nOutl < pOutlNds->Count() &&
- pOutlNds->GetObject( nOutl )->GetIndex() < GetNodes().GetEndOfExtras().GetIndex() )
- ++nOutl;
-
- do {
- pSttNd = 0;
-
- SwNodePtr pNd;
- for( ; nOutl < pOutlNds->Count(); ++nOutl )
- if( ( pNd = pOutlNds->GetObject( nOutl ))->GetTxtNode()->GetAttrOutlineLevel() == nOutlineLevel &&
- !pNd->FindTableNode() )
- {
- pSttNd = pNd;
- break;
- }
-
- if( pSttNd )
- {
- SwNodePtr pEndNd = 0;
- for( ++nOutl; nOutl < pOutlNds->Count(); ++nOutl )
- {
- pNd = pOutlNds->GetObject( nOutl );
-
- const int nLevel = pNd->GetTxtNode()->GetAttrOutlineLevel();
-
- if( ( 0 < nLevel && nLevel <= nOutlineLevel ) &&
- !pNd->FindTableNode() )
- {
- pEndNd = pNd;
-
- break;
- }
- }
- SwNodeIndex aEndIdx( pEndNd ? *pEndNd
- : GetNodes().GetEndOfContent() );
-
- String sFileName;
- if( pSttNd->GetIndex() + 1 < aEndIdx.GetIndex() )
- {
- SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL ));
- if( xDocSh->DoInitNew( 0 ) )
- {
- SwDoc* pDoc = ((SwDocShell*)(&xDocSh))->GetDoc();
-
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- ((SwDocShell*)(&xDocSh))->GetModel(),
- uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentProperties> xDocProps(
- xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
- // the GlobalDoc is the template
- xDocProps->setTemplateName(aEmptyStr);
- ::util::DateTime uDT(aTmplDate.Get100Sec(),
- aTmplDate.GetSec(), aTmplDate.GetMin(),
- aTmplDate.GetHour(), aTmplDate.GetDay(),
- aTmplDate.GetMonth(), aTmplDate.GetYear());
- xDocProps->setTemplateDate(uDT);
- xDocProps->setTemplateURL(rPath);
- //JP 14.06.99: Set the text of the "split para" as title
- // from the new doc. Is the current doc has
- // a title, insert it at begin.
- String sTitle( xDocProps->getTitle() );
- if( sTitle.Len() )
- sTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ));
- sTitle += ((SwTxtNode*)pSttNd)->GetExpandTxt();
- xDocProps->setTitle( sTitle );
-
- // Vorlagen ersetzen
- pDoc->ReplaceStyles( *this );
-
- // KapitelNumerierung uebernehmen
- if( pOutlineRule )
- pDoc->SetOutlineNumRule( *pOutlineRule );
-
- SwNodeRange aRg( *pSttNd, 0, aEndIdx.GetNode() );
- SwNodeIndex aTmpIdx( pDoc->GetNodes().GetEndOfContent() );
- GetNodes()._Copy( aRg, aTmpIdx, sal_False );
-
- // den initialen TextNode loeschen
- SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 2 );
- if( aIdx.GetIndex() + 1 !=
- pDoc->GetNodes().GetEndOfContent().GetIndex() )
- pDoc->GetNodes().Delete( aIdx, 1 );
-
- // alle Flys in dem Bereich
- CopyFlyInFlyImpl( aRg, 0, aIdx );
-
-
- // und noch alle Bookmarks
- // ?????
-
- utl::TempFile aTempFile2(sLeading,&sExt,&sPath );
- sFileName = aTempFile2.GetURL();
- SfxMedium* pTmpMed = new SfxMedium( sFileName,
- STREAM_STD_READWRITE, sal_True );
- pTmpMed->SetFilter( pFilter );
-
- // fuer den HTML-Filter mussen wir aber ein Layout
- // haben, damit Textrahmen/Controls/OLE-Objecte korrekt
- // als Grafik exportiert werden koennen.
- if( SPLITDOC_TO_HTML == eDocType &&
- pDoc->GetSpzFrmFmts()->Count() )
- {
- SfxViewFrame::LoadHiddenDocument( *xDocSh, 0 );
- }
- xDocSh->DoSaveAs( *pTmpMed );
- xDocSh->DoSaveCompleted( pTmpMed );
-
- // beim Fehler wird keine FileLinkSection eingefuegt
- if( xDocSh->GetError() )
- sFileName.Erase();
- }
- xDocSh->DoClose();
- }
-
- // dann koennen ja die Bereiche eingefuegt werden
- if( sFileName.Len() )
- {
- switch( eDocType )
- {
- case SPLITDOC_TO_HTML:
- {
- // loesche alle Nodes im Bereich und setze im "Start-
- // Node" den Link auf das gespeicherte Doc
- sal_uLong nNodeDiff = aEndIdx.GetIndex() -
- pSttNd->GetIndex() - 1;
- if( nNodeDiff )
- {
- SwPaM aTmp( *pSttNd, aEndIdx.GetNode(), 1, -1 );
- aTmp.GetPoint()->nContent.Assign( 0, 0 );
- aTmp.GetMark()->nContent.Assign( 0, 0 );
- SwNodeIndex aSIdx( aTmp.GetMark()->nNode );
- SwNodeIndex aEIdx( aTmp.GetPoint()->nNode );
-
- // versuche hinters Ende zu verschieben
- if( !aTmp.Move( fnMoveForward, fnGoNode ) )
- {
- // na gut, dann an den Anfang
- aTmp.Exchange();
- if( !aTmp.Move( fnMoveBackward, fnGoNode ))
- {
- OSL_FAIL( "kein Node mehr vorhanden" );
- }
- }
- // Bookmarks usw. verschieben
- CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), sal_True);
-
- // stehen noch FlyFrames rum, loesche auch diese
- for( sal_uInt16 n = 0; n < GetSpzFrmFmts()->Count(); ++n )
- {
- SwFrmFmt* pFly = (*GetSpzFrmFmts())[n];
- const SwFmtAnchor* pAnchor = &pFly->GetAnchor();
- SwPosition const*const pAPos =
- pAnchor->GetCntntAnchor();
- if (pAPos &&
- ((FLY_AT_PARA == pAnchor->GetAnchorId()) ||
- (FLY_AT_CHAR == pAnchor->GetAnchorId())) &&
- aSIdx <= pAPos->nNode &&
- pAPos->nNode < aEIdx )
- {
- DelLayoutFmt( pFly );
- --n;
- }
- }
-
- GetNodes().Delete( aSIdx, nNodeDiff );
- }
-
- // dann setze im StartNode noch den Link:
- SwFmtINetFmt aINet( sFileName , aEmptyStr );
- SwTxtNode* pTNd = (SwTxtNode*)pSttNd;
- pTNd->InsertItem( aINet, 0, pTNd->GetTxt().Len() );
-
- // wenn der nicht mehr gefunden wird, kann das nur
- // ein Bug sein!
- if( !pOutlNds->Seek_Entry( pSttNd, &nOutl ))
- pSttNd = 0;
- ++nOutl;
- }
- break;
-
- default:
- {
- String sNm( INetURLObject( sFileName ).GetName() );
- SwSectionData aSectData( FILE_LINK_SECTION,
- GetUniqueSectionName( &sNm ));
- SwSectionFmt* pFmt = MakeSectionFmt( 0 );
- aSectData.SetLinkFileName(sFileName);
- aSectData.SetProtectFlag(true);
-
- aEndIdx--; // im InsertSection ist Ende inclusive
- while( aEndIdx.GetNode().IsStartNode() )
- aEndIdx--;
-
- // JP 06.07.99 - Bug 67361 - is any Section ends or
- // starts in the new sectionrange, they must end or
- // start before or behind the range!
- SwSectionNode* pSectNd = pSttNd->FindSectionNode();
- while( pSectNd && pSectNd->EndOfSectionIndex()
- <= aEndIdx.GetIndex() )
- {
- const SwNode* pSectEnd = pSectNd->EndOfSectionNode();
- if( pSectNd->GetIndex() + 1 ==
- pSttNd->GetIndex() )
- {
- sal_Bool bMvIdx = aEndIdx == *pSectEnd;
- DelSectionFmt( pSectNd->GetSection().GetFmt() );
- if( bMvIdx )
- aEndIdx--;
- }
- else
- {
- SwNodeRange aRg( *pSttNd, *pSectEnd );
- SwNodeIndex aIdx( *pSectEnd, 1 );
- GetNodes()._MoveNodes( aRg, GetNodes(), aIdx );
- }
- pSectNd = pSttNd->FindSectionNode();
- }
-
- pSectNd = aEndIdx.GetNode().FindSectionNode();
- while( pSectNd && pSectNd->GetIndex() >
- pSttNd->GetIndex() )
- {
- if( aEndIdx < pSectNd->EndOfSectionIndex() )
- {
- SwNodeRange aRg( *pSectNd, 1, aEndIdx, 1 );
- SwNodeIndex aIdx( *pSectNd );
- GetNodes()._MoveNodes( aRg, GetNodes(), aIdx );
- }
-
- pSectNd = pSttNd->FindSectionNode();
- }
-
- SwNodeIndex aStartIdx(*pSttNd);
-
- if (aEndIdx >= aStartIdx)
- {
- pSectNd = GetNodes().InsertTextSection(aStartIdx,
- *pFmt, aSectData, 0, &aEndIdx, false);
- }
- else
- {
- pSectNd = GetNodes().InsertTextSection(aEndIdx,
- *pFmt, aSectData, 0, &aStartIdx, false);
- }
-
- pSectNd->GetSection().CreateLink( CREATE_CONNECT );
- }
- break;
- }
- }
- }
- } while( pSttNd );
-
- if( pOutlNds != &GetNodes().GetOutLineNds() )
- delete pOutlNds;
-
- switch( eDocType )
- {
- case SPLITDOC_TO_HTML:
- if( get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
- {
- while( GetSections().Count() )
- DelSectionFmt( GetSections()[ 0 ] );
-
- SfxFilterContainer* pFCntnr = pDocShell->GetFactory().GetFilterContainer();
- pFilter = pFCntnr->GetFilter4EA( pFilter->GetTypeName(), SFX_FILTER_EXPORT );
- }
- break;
-
-// case SPLITDOC_TO_GLOBALDOC:
- default:
- set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true);
- set(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS, false);
- }
-
- SfxRequest aReq( SID_SAVEASDOC, SFX_CALLMODE_SYNCHRON, GetAttrPool() );
- aReq.AppendItem( SfxStringItem( SID_FILE_NAME, rPath ) );
- aReq.AppendItem( SfxBoolItem( SID_SAVETO, sal_True ) );
- if(pFilter)
- aReq.AppendItem( SfxStringItem( SID_FILTER_NAME, pFilter->GetName() ) );
- const SfxBoolItem *pRet = (const SfxBoolItem*)pDocShell->ExecuteSlot( aReq );
-
- return pRet && pRet->GetValue();
-}//<-end,zhaojianwei
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx
index 84f5a484ff..60bdf00dfc 100644
--- a/sw/source/core/doc/docglos.cxx
+++ b/sw/source/core/doc/docglos.cxx
@@ -52,8 +52,8 @@ using namespace ::com::sun::star;
static void lcl_copyDocumentProperties(
uno::Reference<document::XDocumentProperties> i_xSource,
uno::Reference<document::XDocumentProperties> i_xTarget) {
- DBG_ASSERT(i_xSource.is(), "null reference");
- DBG_ASSERT(i_xTarget.is(), "null reference");
+ OSL_ENSURE(i_xSource.is(), "null reference");
+ OSL_ENSURE(i_xTarget.is(), "null reference");
i_xTarget->setAuthor(i_xSource->getAuthor());
i_xTarget->setGenerator(i_xSource->getGenerator());
@@ -130,8 +130,8 @@ sal_Bool SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
// entry document.
// To be able to do this, we copy the document properties of the
// target document to the glossary document
-// DBG_ASSERT(GetDocShell(), "no SwDocShell"); // may be clipboard!
- DBG_ASSERT(pGDoc->GetDocShell(), "no SwDocShell at glossary");
+// OSL_ENSURE(GetDocShell(), "no SwDocShell"); // may be clipboard!
+ OSL_ENSURE(pGDoc->GetDocShell(), "no SwDocShell at glossary");
if (GetDocShell() && pGDoc->GetDocShell()) {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
GetDocShell()->GetModel(), uno::UNO_QUERY_THROW);
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index a90b3a79e2..c4d348aa0b 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -315,7 +315,6 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt )
}
}
}
- // <--
//Inhalt Loeschen.
if( pCntIdx )
@@ -474,7 +473,12 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
// sorge dafuer das auch Fly's in Fly's kopiert werden
aIdx = *pSttNd->EndOfSectionNode();
+ bool bDrawingLayerUndoState = GetIDocumentUndoRedo().DoesDrawUndo();
+ //fdo#36631 disable any undo operations associated with the contact
+ //object itself. They should be managed by SwUndoInsLayFmt.
+ GetIDocumentUndoRedo().DoDrawUndo(false);
pSrcDoc->CopyWithFlyInFly( aRg, 0, aIdx, sal_False, sal_True, sal_True );
+ GetIDocumentUndoRedo().DoDrawUndo(bDrawingLayerUndoState);
}
else
{
@@ -494,7 +498,6 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
{
static_cast<SwDrawFrmFmt*>(pDest)->PosAttrSet();
}
- // <--
if( pDest->GetAnchor() == rNewAnchor )
{
@@ -653,7 +656,6 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
aAnch.SetAnchor( &rAnchPos );
}
}
- // <--
pFmt->SetFmtAttr( aAnch );
}
else
@@ -1192,7 +1194,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
break;
}
}
- DBG_ASSERT( pColl, "no text collection found" );
+ OSL_ENSURE( pColl, "no text collection found" );
}
if( !pColl )
@@ -1247,7 +1249,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Erstmal das Format zum Fly besorgen und das Layout entkoppeln.
SwFrmFmt *pOldFmt = rDoc.GetNodes()[nNdIdx]->GetFlyFmt();
OSL_ENSURE( pOldFmt, "Format des Fly nicht gefunden." );
- // --> OD #i115719#
+ // #i115719#
// <title> and <description> attributes are lost when calling <DelFrms()>.
// Thus, keep them and restore them after the calling <MakeFrms()>
const bool bIsSwFlyFrmFmtInstance( dynamic_cast<SwFlyFrmFmt*>(pOldFmt) != 0 );
@@ -1257,7 +1259,6 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
const String sDescription( bIsSwFlyFrmFmtInstance
? static_cast<SwFlyFrmFmt*>(pOldFmt)->GetObjDescription()
: String() );
- // <--
pOldFmt->DelFrms();
pNewFmt = rDoc.MakeFlyFrmFmt( rDoc.GetUniqueFrameName(),
@@ -1395,13 +1396,12 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
//Nun nur noch die Flys erzeugen lassen. Das ueberlassen
//wir vorhanden Methoden (insb. fuer InCntFlys etwas aufwendig).
pNewFmt->MakeFrms();
- // --> OD #i115719#
+ // #i115719#
if ( bIsSwFlyFrmFmtInstance )
{
static_cast<SwFlyFrmFmt*>(pOldFmt)->SetObjTitle( sTitle );
static_cast<SwFlyFrmFmt*>(pOldFmt)->SetObjDescription( sDescription );
}
- // <--
}
break;
@@ -1556,7 +1556,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl,
break;
}
}
- DBG_ASSERT( pColl, "no text collection found" );
+ OSL_ENSURE( pColl, "no text collection found" );
}
if( !pColl )
@@ -1889,7 +1889,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
SwFldUpdateFlags nFldUpdFlag;
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080320
std::set<SwRootFrm*>::iterator pLayIter = aAllLayouts.begin();
- for ( ;pLayIter != aAllLayouts.end();pLayIter++ )
+ for ( ;pLayIter != aAllLayouts.end();++pLayIter )
{
if ((*pLayIter)->IsIdleFormat())
{
@@ -2148,7 +2148,7 @@ void SwDoc::SetAllUniqueFlyNames()
if( GetFtnIdxs().Count() )
{
SwTxtFtn::SetUniqueSeqRefNo( *this );
- // --> FME 2005-08-02 #i52775# Chapter footnotes did not
+ // #i52775# Chapter footnotes did not
// get updated correctly. Calling UpdateAllFtn() instead of
// UpdateFtn() solves this problem, but I do not dare to
// call UpdateAllFtn() in all cases: Safety first.
@@ -2156,7 +2156,6 @@ void SwDoc::SetAllUniqueFlyNames()
{
GetFtnIdxs().UpdateAllFtn();
}
- // <--
else
{
SwNodeIndex aTmp( GetNodes() );
@@ -2363,4 +2362,4 @@ std::set<SwRootFrm*> SwDoc::GetAllLayouts()
return aAllLayouts;
}//swmod 070825
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index af16178053..9b0ff5b508 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -66,6 +66,30 @@
#include <map>
+namespace {
+ static void lcl_ResetIndentAttrs(SwDoc *pDoc, const SwPaM &rPam, sal_uInt16 marker )
+ {
+ std::set<sal_uInt16> aResetAttrsArray;
+ aResetAttrsArray.insert( marker );
+ // #i114929#
+ // On a selection setup a corresponding Point-and-Mark in order to get
+ // the indentation attribute reset on all paragraphs touched by the selection
+ if ( rPam.HasMark() &&
+ rPam.End()->nNode.GetNode().GetTxtNode() )
+ {
+ SwPaM aPam( rPam.Start()->nNode,
+ rPam.End()->nNode );
+ aPam.Start()->nContent = 0;
+ aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len();
+ pDoc->ResetAttrs( aPam, sal_False, aResetAttrsArray );
+ }
+ else
+ {
+ pDoc->ResetAttrs( rPam, sal_False, aResetAttrsArray );
+ }
+ }
+}
+
inline sal_uInt8 GetUpperLvlChg( sal_uInt8 nCurLvl, sal_uInt8 nLevel, sal_uInt16 nMask )
{
if( 1 < nLevel )
@@ -643,7 +667,6 @@ sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName )
// its number vector will not fit to the searched level.
if ( pNd->GetNum() &&
pNd->GetActualListLevel() == ( nLevel - 1 ) )
- // <--
{
const SwNodeNum & rNdNum = *(pNd->GetNum());
SwNumberTree::tNumberVector aLevelVal = rNdNum.GetNumberVector();
@@ -928,25 +951,7 @@ void SwDoc::SetNumRule( const SwPaM& rPam,
if ( bResetIndentAttrs &&
pNew && pNew->Get( 0 ).GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
- SvUShortsSort aResetAttrsArray;
- aResetAttrsArray.Insert( RES_LR_SPACE );
- // --> OD 2010-10-05 #i114929#
- // On a selection setup a corresponding Point-and-Mark in order to get
- // the indentation attribute reset on all paragraphs touched by the selection
- if ( rPam.HasMark() &&
- rPam.End()->nNode.GetNode().GetTxtNode() )
- {
- SwPaM aPam( rPam.Start()->nNode,
- rPam.End()->nNode );
- aPam.Start()->nContent = 0;
- aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len();
- ResetAttrs( aPam, sal_False, &aResetAttrsArray );
- }
- else
- {
- ResetAttrs( rPam, sal_False, &aResetAttrsArray );
- }
- // <--
+ ::lcl_ResetIndentAttrs(this, rPam, RES_LR_SPACE);
}
if (GetIDocumentUndoRedo().DoesUndo())
@@ -961,25 +966,7 @@ void SwDoc::SetCounted(const SwPaM & rPam, bool bCounted)
{
if ( bCounted )
{
- SvUShortsSort aResetAttrsArray;
- aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED );
- // --> OD 2010-10-05 #i114929#
- // On a selection setup a corresponding Point-and-Mark in order to get
- // the list-is-counted attribute reset on all paragraphs touched by the selection
- if ( rPam.HasMark() &&
- rPam.End()->nNode.GetNode().GetTxtNode() )
- {
- SwPaM aPam( rPam.Start()->nNode,
- rPam.End()->nNode );
- aPam.Start()->nContent = 0;
- aPam.End()->nContent = rPam.End()->nNode.GetNode().GetTxtNode()->Len();
- ResetAttrs( aPam, sal_False, &aResetAttrsArray );
- }
- else
- {
- ResetAttrs( rPam, sal_False, &aResetAttrsArray );
- }
- // <--
+ ::lcl_ResetIndentAttrs(this, rPam, RES_PARATR_LIST_ISCOUNTED);
}
else
{
@@ -1070,17 +1057,16 @@ sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast )
++aListIter;
}
- while ( aListsForDeletion.size() > 0 )
+ while ( !aListsForDeletion.empty() )
{
SwList* pList = aListsForDeletion.back();
aListsForDeletion.pop_back();
deleteList( pList->GetListId() );
}
}
- // --> FME 2004-11-02 #i34097# DeleteAndDestroy deletes rName if
+ // #i34097# DeleteAndDestroy deletes rName if
// rName is directly taken from the numrule.
const String aTmpName( rName );
- // <--
pNumRuleTbl->DeleteAndDestroy( nPos );
maNumRuleMap.erase(aTmpName);
@@ -1303,7 +1289,6 @@ void SwDoc::MakeUniqueNumRules(const SwPaM & rPaM)
aListStyleData.sListId = pCNd->GetListId();
aMyNumRuleMap[pRule] = aListStyleData;
}
- // <--
bFirst = false;
}
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 09e373ff30..e62bfaefea 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -71,19 +71,19 @@ TYPEINIT1(SwRedlineHint, SfxHint);
SwPosition aComparePos( *pPos );
aComparePos.nContent.Assign(
aComparePos.nNode.GetNode().GetCntntNode(), 0 );
- DBG_ASSERT( pPos->nContent.GetIdxReg() ==
+ OSL_ENSURE( pPos->nContent.GetIdxReg() ==
aComparePos.nContent.GetIdxReg(),
_ERROR_PREFIX "illegal position" );
SwTxtNode* pTxtNode = pPos->nNode.GetNode().GetTxtNode();
if( pTxtNode == NULL )
{
- DBG_ASSERT( pPos->nContent == 0,
+ OSL_ENSURE( pPos->nContent == 0,
_ERROR_PREFIX "non-text-node with content" );
}
else
{
- DBG_ASSERT( pPos->nContent >= 0 &&
+ OSL_ENSURE( pPos->nContent >= 0 &&
pPos->nContent <= pTxtNode->Len(),
_ERROR_PREFIX "index behind text" );
}
@@ -91,7 +91,7 @@ TYPEINIT1(SwRedlineHint, SfxHint);
void lcl_CheckPam( const SwPaM* pPam )
{
- DBG_ASSERT( pPam != NULL, _ERROR_PREFIX "illegal argument" );
+ OSL_ENSURE( pPam != NULL, _ERROR_PREFIX "illegal argument" );
lcl_CheckPosition( pPam->GetPoint() );
lcl_CheckPosition( pPam->GetMark() );
}
@@ -109,7 +109,7 @@ TYPEINIT1(SwRedlineHint, SfxHint);
for( sal_uInt16 j = 0; j < rTbl.Count(); ++j )
{
// check for empty redlines
- DBG_ASSERT( ( *(rTbl[j]->GetPoint()) != *(rTbl[j]->GetMark()) ) ||
+ OSL_ENSURE( ( *(rTbl[j]->GetPoint()) != *(rTbl[j]->GetMark()) ) ||
( rTbl[j]->GetContentIdx() != NULL ),
_ERROR_PREFIX "empty redline" );
}
@@ -121,11 +121,11 @@ TYPEINIT1(SwRedlineHint, SfxHint);
const SwRedline* pCurrent = rTbl[ n ];
// check redline sorting
- DBG_ASSERT( *pPrev->Start() <= *pCurrent->Start(),
+ OSL_ENSURE( *pPrev->Start() <= *pCurrent->Start(),
_ERROR_PREFIX "not sorted correctly" );
// check for overlapping redlines
- DBG_ASSERT( *pPrev->End() <= *pCurrent->Start(),
+ OSL_ENSURE( *pPrev->End() <= *pCurrent->Start(),
_ERROR_PREFIX "overlapping redlines" );
}
}
@@ -254,7 +254,7 @@ inline bool IsPrevPos( const SwPosition rPos1, const SwPosition rPos2 )
: false;
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
bool CheckPosition( const SwPosition* pStt, const SwPosition* pEnd )
{
int nError = 0;
@@ -336,7 +336,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
if( pStt->nContent > 0 )
{
- DBG_ASSERT( false, "Redline start: non-text-node with content" );
+ OSL_ENSURE( false, "Redline start: non-text-node with content" );
pStt->nContent = 0;
}
}
@@ -344,7 +344,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
if( pStt->nContent > pTxtNode->Len() )
{
- DBG_ASSERT( false, "Redline start: index behind text" );
+ OSL_ENSURE( false, "Redline start: index behind text" );
pStt->nContent = pTxtNode->Len();
}
}
@@ -353,7 +353,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
if( pEnd->nContent > 0 )
{
- DBG_ASSERT( false, "Redline end: non-text-node with content" );
+ OSL_ENSURE( false, "Redline end: non-text-node with content" );
pEnd->nContent = 0;
}
}
@@ -361,7 +361,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
if( pEnd->nContent > pTxtNode->Len() )
{
- DBG_ASSERT( false, "Redline end: index behind text" );
+ OSL_ENSURE( false, "Redline end: index behind text" );
pEnd->nContent = pTxtNode->Len();
}
}
@@ -452,7 +452,6 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
pRedlineTbl->Remove( n );
bDec = true;
}
- // <--
else if( POS_OVERLAP_BEHIND == eCmpPos )
{
*pStt = *pREnd;
@@ -905,10 +904,9 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
{
if( *pRStt == *pStt )
{
- // --> mst 2010-05-17 #i97421#
+ // #i97421#
// redline w/out extent loops
if (*pStt != *pEnd)
- // <--
{
pNewRedl->PushData( *pRedl, sal_False );
pRedl->SetStart( *pEnd, pRStt );
@@ -2735,7 +2733,7 @@ sal_Bool SwRedlineTbl::InsertWithValidRanges( SwRedlinePtr& p, sal_uInt16* pInsP
}
else
aNewStt = *pNew->GetPoint();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
CheckPosition( pNew->GetPoint(), pNew->GetMark() );
#endif
if( *pNew->GetPoint() != *pNew->GetMark() &&
@@ -2951,7 +2949,7 @@ SwRedlineExtraData_Format::SwRedlineExtraData_Format( const SfxItemSet& rSet )
const SfxPoolItem* pItem = aIter.FirstItem();
while( sal_True )
{
- aWhichIds.Insert( pItem->Which(), aWhichIds.Count() );
+ aWhichIds.push_back( pItem->Which() );
if( aIter.IsAtEnd() )
break;
pItem = aIter.NextItem();
@@ -2960,9 +2958,9 @@ SwRedlineExtraData_Format::SwRedlineExtraData_Format( const SfxItemSet& rSet )
SwRedlineExtraData_Format::SwRedlineExtraData_Format(
const SwRedlineExtraData_Format& rCpy )
- : SwRedlineExtraData(), aWhichIds( (sal_uInt8)rCpy.aWhichIds.Count() )
+ : SwRedlineExtraData()
{
- aWhichIds.Insert( &rCpy.aWhichIds, 0 );
+ aWhichIds.insert( aWhichIds.begin(), rCpy.aWhichIds.begin(), rCpy.aWhichIds.end() );
}
SwRedlineExtraData_Format::~SwRedlineExtraData_Format()
@@ -2982,9 +2980,10 @@ void SwRedlineExtraData_Format::Reject( SwPaM& rPam ) const
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld & ~(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_IGNORE)));
// eigentlich muesste hier das Attribut zurueck gesetzt werden!!!
- for( sal_uInt16 n = 0, nEnd = aWhichIds.Count(); n < nEnd; ++n )
+ std::vector<sal_uInt16>::const_iterator it;
+ for( it = aWhichIds.begin(); it != aWhichIds.end(); ++it )
{
- pDoc->InsertPoolItem( rPam, *GetDfltAttr( aWhichIds[ n ] ),
+ pDoc->InsertPoolItem( rPam, *GetDfltAttr( *it ),
nsSetAttrMode::SETATTR_DONTEXPAND );
}
@@ -2994,8 +2993,9 @@ void SwRedlineExtraData_Format::Reject( SwPaM& rPam ) const
int SwRedlineExtraData_Format::operator == ( const SwRedlineExtraData& rCmp ) const
{
int nRet = 1;
- sal_uInt16 n = 0, nEnd = aWhichIds.Count();
- if( nEnd != ((SwRedlineExtraData_Format&)rCmp).aWhichIds.Count() )
+ size_t n = 0;
+ size_t nEnd = aWhichIds.size();
+ if( nEnd != ((SwRedlineExtraData_Format&)rCmp).aWhichIds.size() )
nRet = 0;
else
for( ; n < nEnd; ++n )
@@ -3667,7 +3667,6 @@ void SwRedline::MoveFromSection()
{
pDoc->DeleteSection( &pCntntSect->GetNode() );
}
- // <--
delete pCntntSect, pCntntSect = 0;
// adjustment of redline table positions must take start and
diff --git a/sw/source/core/doc/docruby.cxx b/sw/source/core/doc/docruby.cxx
index f71b1f34e7..abe9ab1d03 100644
--- a/sw/source/core/doc/docruby.cxx
+++ b/sw/source/core/doc/docruby.cxx
@@ -111,8 +111,8 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
sal_uInt16 nMode )
{
GetIDocumentUndoRedo().StartUndo( UNDO_SETRUBYATTR, NULL );
- SvUShortsSort aDelArr;
- aDelArr.Insert( RES_TXTATR_CJK_RUBY );
+ std::set<sal_uInt16> aDelArr;
+ aDelArr.insert( RES_TXTATR_CJK_RUBY );
sal_uInt16 nListEntry = 0;
@@ -147,7 +147,7 @@ sal_uInt16 SwDoc::SetRubyList( const SwPaM& rPam, const SwRubyList& rList,
}
else
{
- ResetAttrs( aPam, sal_True, &aDelArr );
+ ResetAttrs( aPam, sal_True, aDelArr );
}
}
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx
index c88f1f262c..c422d22403 100644
--- a/sw/source/core/doc/docsort.cxx
+++ b/sw/source/core/doc/docsort.cxx
@@ -551,10 +551,9 @@ sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
// MIB 9.7.97: HTML-Layout loeschen
pTblNd->GetTable().SetHTMLTableLayout( 0 );
- // --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting
+ // #i37739# A simple 'MakeFrms' after the node sorting
// does not work if the table is inside a frame and has no prev/next.
SwNode2Layout aNode2Layout( *pTblNd );
- // <--
// loesche die Frames der Tabelle
pTblNd->DelFrms();
@@ -600,11 +599,10 @@ sal_Bool SwDoc::SortTbl(const SwSelBoxes& rBoxes, const SwSortOptions& rOpt)
}
// Restore table frames:
- // --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting
+ // #i37739# A simple 'MakeFrms' after the node sorting
// does not work if the table is inside a frame and has no prev/next.
const sal_uLong nIdx = pTblNd->GetIndex();
aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 );
- // <--
// TL_CHART2: need to inform chart of probably changed cell names
UpdateCharts( pTblNd->GetTable().GetFrmFmt()->GetName() );
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 3a883ff109..c00edabb76 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -788,7 +788,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
SwDoc* pDoc = (SwDoc*)pSectNd->GetDoc();
- DBG_ASSERT(pDoc != NULL, "Where is the document?");
+ OSL_ENSURE(pDoc != NULL, "Where is the document?");
if(pAttr && pDoc && GetFmt())
pDoc->ChgFmt(*GetFmt(), *pAttr);
@@ -1056,7 +1056,7 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
aN2L.RestoreUpperFrms( pDoc->GetNodes(), nIdx, nIdx + 1 );
std::set<SwRootFrm*> aAllLayouts = pDoc->GetAllLayouts();
- for ( std::set<SwRootFrm*>::iterator pLayoutIter = aAllLayouts.begin(); pLayoutIter != aAllLayouts.end(); pLayoutIter++)
+ for ( std::set<SwRootFrm*>::iterator pLayoutIter = aAllLayouts.begin(); pLayoutIter != aAllLayouts.end(); ++pLayoutIter)
{
SwFrm::CheckPageDescs( (SwPageFrm*)(*pLayoutIter)->Lower() );
}//swmod 080310
@@ -1779,7 +1779,6 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
aFld.ChangeExpansion( pFrm,
dynamic_cast<const SwCntntNode*>(pTOXSource->pNd),
sal_True );
- // <--
//---> #i89791#
// continue to support CF_NUMBER
// and CF_NUM_TITLE in order to handle ODF 1.0/1.1
@@ -1790,7 +1789,6 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx,
rTxt.Insert(aFld.GetNumber()); //get the string number without pre/postfix
else if ( CF_NUMBER_NOPREPST == aToken.nChapterFormat ||
CF_NUM_TITLE == aToken.nChapterFormat )
- //<---
{
rTxt += aFld.GetNumber();
rTxt += ' ';
diff --git a/sw/source/core/doc/docxforms.cxx b/sw/source/core/doc/docxforms.cxx
index 322d286431..682c8c9717 100644
--- a/sw/source/core/doc/docxforms.cxx
+++ b/sw/source/core/doc/docxforms.cxx
@@ -70,28 +70,28 @@ bool SwDoc::isXForms() const
Reference<XInterface> lcl_createInstance( const sal_Char* pServiceName )
{
- DBG_ASSERT( pServiceName != NULL, "no service name" );
+ OSL_ENSURE( pServiceName != NULL, "no service name" );
return utl::getProcessServiceFactory()->createInstance(
OUString::createFromAscii( pServiceName ) );
}
void SwDoc::initXForms( bool bCreateDefaultModel )
{
- DBG_ASSERT( ! isXForms(), "please initialize only once" );
+ OSL_ENSURE( ! isXForms(), "please initialize only once" );
try
{
// create XForms components
xXForms.set( lcl_createInstance( "com.sun.star.xforms.XForms" ),
UNO_QUERY );
- DBG_ASSERT( xXForms.is(), "can't create XForms container" );
+ OSL_ENSURE( xXForms.is(), "can't create XForms container" );
// change our module identifier, to be able to have a dedicated UI
Reference< XModule > xModule;
SwDocShell* pShell( GetDocShell() );
if ( pShell )
xModule = xModule.query( pShell->GetModel() );
- DBG_ASSERT( xModule.is(), "SwDoc::initXForms: no XModule at the document!" );
+ OSL_ENSURE( xModule.is(), "SwDoc::initXForms: no XModule at the document!" );
if ( xModule.is() )
xModule->setIdentifier( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xforms.XMLFormDocument" ) ) );
@@ -102,7 +102,7 @@ void SwDoc::initXForms( bool bCreateDefaultModel )
Reference<XModel> xModel(
lcl_createInstance( "com.sun.star.xforms.Model" ),
UNO_QUERY );
- DBG_ASSERT( xModel.is(), "no model?" );
+ OSL_ENSURE( xModel.is(), "no model?" );
if( xModel.is() )
{
xModel->setID( sName );
@@ -112,10 +112,10 @@ void SwDoc::initXForms( bool bCreateDefaultModel )
xModel->initialize();
xXForms->insertByName( sName, makeAny( xModel ) );
}
- DBG_ASSERT( xXForms->hasElements(), "can't create XForms model" );
+ OSL_ENSURE( xXForms->hasElements(), "can't create XForms model" );
}
- DBG_ASSERT( isXForms(), "initialization failed" );
+ OSL_ENSURE( isXForms(), "initialization failed" );
}
catch( const Exception& )
{
diff --git a/sw/source/core/doc/extinput.cxx b/sw/source/core/doc/extinput.cxx
index 7722f13d21..85b12776ec 100644
--- a/sw/source/core/doc/extinput.cxx
+++ b/sw/source/core/doc/extinput.cxx
@@ -79,10 +79,9 @@ SwExtTextInput::~SwExtTextInput()
// muss ueber die Doc-Schnittstellen gegangen werden !!!
if(eInputLanguage != LANGUAGE_DONTKNOW)
{
- // --> FME 2005-02-11 #i41974# Only set language attribute
+ // #i41974# Only set language attribute
// for CJK/CTL scripts.
bool bLang = true;
- // <--
sal_uInt16 nWhich = RES_CHRATR_LANGUAGE;
switch(GetI18NScriptTypeOfLanguage(eInputLanguage))
{
@@ -205,10 +204,12 @@ void SwExtTextInput::SetInputData( const CommandExtTextInputData& rData )
GetPoint()->nContent = nSttCnt;
- if( aAttrs.Count() )
- aAttrs.Remove( 0, aAttrs.Count() );
+ aAttrs.clear();
if( rData.GetTextAttr() )
- aAttrs.Insert( rData.GetTextAttr(), rData.GetText().Len(), 0 );
+ {
+ const sal_uInt16 *pAttrs = rData.GetTextAttr();
+ aAttrs.insert( aAttrs.begin(), pAttrs, pAttrs + rData.GetText().Len() );
+ }
}
}
diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx
index 88f264633d..8fdbe60bf4 100644
--- a/sw/source/core/doc/fmtcol.cxx
+++ b/sw/source/core/doc/fmtcol.cxx
@@ -72,7 +72,6 @@ namespace TxtFmtCollFunc
// #i73790#
if ( !pTxtFmtColl->StayAssignedToListLevelOfOutlineStyle() &&
pTxtFmtColl->IsAssignedToListLevelOfOutlineStyle() )
- // <--
{
if ( !pNewNumRuleItem )
{
@@ -90,7 +89,6 @@ namespace TxtFmtCollFunc
}
}
}
- // <--
SwNumRule* GetNumRule( SwTxtFmtColl& rTxtFmtColl )
{
@@ -128,7 +126,6 @@ namespace TxtFmtCollFunc
}
}
} // end of namespace TxtFmtCollFunc
-// <--
/*
* SwTxtFmtColl TXT
@@ -176,7 +173,6 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
pNewChgSet->GetChgSet()->GetItemState( RES_PARATR_NUMRULE, sal_False,
(const SfxPoolItem**)&pNewNumRuleItem );
}
- // <--
break;
@@ -227,7 +223,6 @@ void SwTxtFmtColl::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
TxtFmtCollFunc::CheckTxtFmtCollForDeletionOfAssignmentToOutlineStyle(
this, pNewNumRuleItem );
}
- // <--
int bWeiter = sal_True;
@@ -410,7 +405,6 @@ sal_Bool SwTxtFmtColl::ResetFmtAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
return bRet;
}
-// <--
// #i73790#
sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
@@ -424,7 +418,6 @@ sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
const int nAssignedOutlineStyleLevel = IsAssignedToListLevelOfOutlineStyle()
? GetAssignedOutlineStyleLevel()
: -1;
- // <--
sal_uInt16 nRet = SwFmtColl::ResetAllFmtAttr();
@@ -433,13 +426,11 @@ sal_uInt16 SwTxtFmtColl::ResetAllFmtAttr()
{
AssignToListLevelOfOutlineStyle( nAssignedOutlineStyleLevel );
}
- // <--
mbStayAssignedToListLevelOfOutlineStyle = bOldState;
return nRet;
}
-// <--
bool SwTxtFmtColl::AreListLevelIndentsApplicable() const
{
@@ -493,7 +484,6 @@ bool SwTxtFmtColl::AreListLevelIndentsApplicable() const
return bAreListLevelIndentsApplicable;
}
-// <--
//FEATURE::CONDCOLL
@@ -694,7 +684,6 @@ void SwTxtFmtColl::AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
pDerivedTxtFmtColl = aIter.Next();
}
- // <--
}
void SwTxtFmtColl::DeleteAssignmentToListLevelOfOutlineStyle()
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index 7cf4ad5487..39db8ad11b 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -356,7 +356,7 @@ sal_uInt16 SwUpdFtnEndNtAtEnd::GetNumber( const SwTxtFtn& rTxtFtn,
{
sal_uInt16 nRet = 0, nWh;
SvPtrarr* pArr;
- SvUShorts* pNum;
+ std::vector<sal_uInt16> *pNum;
if( rTxtFtn.GetFtn().IsEndNote() )
{
pArr = &aEndSects;
@@ -374,7 +374,7 @@ sal_uInt16 SwUpdFtnEndNtAtEnd::GetNumber( const SwTxtFtn& rTxtFtn,
for( sal_uInt16 n = pArr->Count(); n; )
if( pArr->GetObject( --n ) == pNd )
{
- nRet = ++pNum->GetObject( n );
+ nRet = ++((*pNum)[ n ]);
break;
}
@@ -384,7 +384,7 @@ sal_uInt16 SwUpdFtnEndNtAtEnd::GetNumber( const SwTxtFtn& rTxtFtn,
nRet = ((SwFmtFtnEndAtTxtEnd&)rNd.GetSection().GetFmt()->
GetFmtAttr( nWh )).GetOffset();
++nRet;
- pNum->Insert( nRet, pNum->Count() );
+ pNum->push_back( nRet );
}
return nRet;
}
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index c99bc959fb..2b456e33ba 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -366,7 +366,6 @@ sal_uInt16 SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc )
// Investigation reveals that all calls can handle the case that no browse
// width is provided.
return GetBrowseWidthByVisArea( rDoc );
- // <--
}
sal_uInt16 SwHTMLTableLayout::GetBrowseWidthByTabFrm(
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 15708c76f6..198bd296c1 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -248,6 +248,10 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
return;
const ViewShell* pSh = getRootFrm()->GetCurrShell();
+ OutputDevice *pOut = pSh->GetOut();
+
+ sal_uInt64 nOldDrawMode = SetHeaderFooterEditMask( pOut );
+
if( !pSh->GetViewOptions()->IsGraphic() )
{
StopAnimation();
@@ -262,18 +266,17 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
aTxt = FindFlyFrm()->GetFmt()->GetName();
lcl_PaintReplacement( Frm(), aTxt, *pSh, this, sal_False );
}
+ pOut->SetDrawMode( nOldDrawMode );
return;
}
if( pSh->GetAccessibilityOptions()->IsStopAnimatedGraphics() ||
- // --> FME 2004-06-21 #i9684# Stop animation during printing/pdf export
+ // #i9684# Stop animation during printing/pdf export
!pSh->GetWin() )
- // <--
StopAnimation();
SfxProgress::EnterLock(); //Keine Progress-Reschedules im Paint (SwapIn)
- OutputDevice *pOut = pSh->GetOut();
pOut->Push();
sal_Bool bClip = sal_True;
PolyPolygon aPoly;
@@ -330,6 +333,7 @@ void SwNoTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
pGrfNd->SetFrameInPaint( sal_False );
pOut->Pop();
+ pOut->SetDrawMode( nOldDrawMode );
SfxProgress::LeaveLock();
}
@@ -632,7 +636,6 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
RES_GRAPHIC_ARRIVED != nWhich &&
RES_GRF_REREAD_AND_INCACHE != nWhich &&
RES_LINKED_GRAPHIC_STREAM_ARRIVED != nWhich )
- // <--
{
SwCntntFrm::Modify( pOld, pNew );
}
@@ -838,7 +841,6 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
{
pGrfNd->UpdateLinkWithInputStream();
}
- // <--
// #i85717#, #i90395# - check, if asynchronous retrieval
// if input stream for the graphic is possible
// else if( GRAPHIC_DEFAULT == rGrfObj.GetType() &&
@@ -846,7 +848,6 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
rGrfObj.GetType() == GRAPHIC_NONE ) &&
pGrfNd->IsLinkedFile() &&
pGrfNd->IsAsyncRetrieveInputStreamPossible() )
- // <--
{
Size aTmpSz;
::sfx2::SvLinkSource* pGrfObj = pGrfNd->GetLink()->GetObj();
@@ -882,9 +883,8 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
const sal_Bool bAnimate = rGrfObj.IsAnimated() &&
!pShell->IsPreView() &&
!pShell->GetAccessibilityOptions()->IsStopAnimatedGraphics() &&
- // --> FME 2004-06-21 #i9684# Stop animation during printing/pdf export
+ // #i9684# Stop animation during printing/pdf export
pShell->GetWin();
- // <--
if( bAnimate &&
FindFlyFrm() != ::GetFlyFromMarked( 0, pShell ))
@@ -970,7 +970,6 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
pOut->SetAntialiasing( nNewAntialiasingAtOutput );
}
- // <--
Point aPosition(aAlignedGrfArea.Pos());
Size aSize(aAlignedGrfArea.SSize());
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 95ea5c888d..a977649832 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -108,7 +108,6 @@ const SwNumFmt* SwNumRule::GetNumFmt( sal_uInt16 i ) const
// #i91400#
void SwNumRule::SetName( const String & rName,
IDocumentListsAccess& rDocListAccess)
-// <--
{
if ( sName != rName )
{
@@ -245,7 +244,7 @@ void SwNumFmt::NotifyGraphicArrived()
// #i22362#
sal_Bool SwNumFmt::IsEnumeration() const
{
- // --> FME 2004-08-12 #i30655# native numbering did not work any longer
+ // #i30655# native numbering did not work any longer
// using this code. Therefore HBRINKM and I agreed upon defining
// IsEnumeration() as !IsItemize()
return !IsItemize();
@@ -373,7 +372,6 @@ void SwNumFmt::UpdateNumNodes( SwDoc* pDoc )
{
lcl_SetRuleChgd( *(*aIter), i );
}
- // <--
bFnd = sal_True;
break;
}
@@ -876,11 +874,9 @@ void SwNumRule::SetInvalidRule(sal_Bool bFlag)
{
aLists.insert( pList );
}
- // <--
}
std::for_each( aLists.begin(), aLists.end(),
std::mem_fun( &SwList::InvalidateListTree ) );
- // <--
}
bInvalidRuleFlag = bFlag;
@@ -1049,15 +1045,7 @@ namespace numfunc
class SwDefBulletConfig : private utl::ConfigItem
{
public:
- static SwDefBulletConfig* getInstance()
- {
- if ( mpInstance == 0 )
- {
- mpInstance = new SwDefBulletConfig;
- }
-
- return mpInstance;
- }
+ static SwDefBulletConfig& getInstance();
inline const String& GetFontname() const
{
@@ -1093,8 +1081,9 @@ namespace numfunc
return mnLevelChars[p_nListLevel];
}
- private:
SwDefBulletConfig();
+ ~SwDefBulletConfig();
+ private:
/** sets internal default bullet configuration data to default values
@@ -1128,8 +1117,6 @@ namespace numfunc
virtual void Notify( const uno::Sequence<rtl::OUString>& aPropertyNames );
virtual void Commit();
- static SwDefBulletConfig* mpInstance;
-
// default bullet list configuration data
String msFontname;
bool mbUserDefinedFontname;
@@ -1141,7 +1128,16 @@ namespace numfunc
Font* mpFont;
};
- SwDefBulletConfig* SwDefBulletConfig::mpInstance = 0;
+ namespace
+ {
+ class theSwDefBulletConfig
+ : public rtl::Static<SwDefBulletConfig, theSwDefBulletConfig>{};
+ }
+
+ SwDefBulletConfig& SwDefBulletConfig::getInstance()
+ {
+ return theSwDefBulletConfig::get();
+ }
SwDefBulletConfig::SwDefBulletConfig()
: ConfigItem( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Writer/Numbering/DefaultBulletList")) ),
@@ -1160,11 +1156,15 @@ namespace numfunc
EnableNotification( GetPropNames() );
}
+ SwDefBulletConfig::~SwDefBulletConfig()
+ {
+ delete mpFont;
+ }
+
void SwDefBulletConfig::SetToDefault()
{
msFontname = String::CreateFromAscii("OpenSymbol");
mbUserDefinedFontname = false;
- // <--
meFontWeight = WEIGHT_DONTKNOW;
meFontItalic = ITALIC_NONE;
@@ -1281,22 +1281,22 @@ namespace numfunc
const String& GetDefBulletFontname()
{
- return SwDefBulletConfig::getInstance()->GetFontname();
+ return SwDefBulletConfig::getInstance().GetFontname();
}
bool IsDefBulletFontUserDefined()
{
- return SwDefBulletConfig::getInstance()->IsFontnameUserDefined();
+ return SwDefBulletConfig::getInstance().IsFontnameUserDefined();
}
const Font& GetDefBulletFont()
{
- return SwDefBulletConfig::getInstance()->GetFont();
+ return SwDefBulletConfig::getInstance().GetFont();
}
sal_Unicode GetBulletChar( sal_uInt8 nLevel )
{
- return SwDefBulletConfig::getInstance()->GetChar( nLevel );
+ return SwDefBulletConfig::getInstance().GetChar( nLevel );
}
/** class containing configuration data about user interface behavior
@@ -1309,24 +1309,17 @@ namespace numfunc
class SwNumberingUIBehaviorConfig : private utl::ConfigItem
{
public:
- static SwNumberingUIBehaviorConfig* getInstance()
- {
- if ( mpInstance == 0 )
- {
- mpInstance = new SwNumberingUIBehaviorConfig();
- }
-
- return mpInstance;
- }
+ static SwNumberingUIBehaviorConfig& getInstance();
inline sal_Bool ChangeIndentOnTabAtFirstPosOfFirstListItem() const
{
return mbChangeIndentOnTabAtFirstPosOfFirstListItem;
}
- private:
SwNumberingUIBehaviorConfig();
+ private:
+
/** sets internal configuration data to default values
@author OD
@@ -1352,13 +1345,19 @@ namespace numfunc
virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames );
virtual void Commit();
- static SwNumberingUIBehaviorConfig* mpInstance;
-
// configuration data
sal_Bool mbChangeIndentOnTabAtFirstPosOfFirstListItem;
};
- SwNumberingUIBehaviorConfig* SwNumberingUIBehaviorConfig::mpInstance = 0;
+ namespace
+ {
+ class theSwNumberingUIBehaviorConfig : public rtl::Static<SwNumberingUIBehaviorConfig, theSwNumberingUIBehaviorConfig>{};
+ }
+
+ SwNumberingUIBehaviorConfig& SwNumberingUIBehaviorConfig::getInstance()
+ {
+ return theSwNumberingUIBehaviorConfig::get();
+ }
SwNumberingUIBehaviorConfig::SwNumberingUIBehaviorConfig()
: ConfigItem( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Writer/Numbering/UserInterfaceBehavior")) ),
@@ -1427,7 +1426,7 @@ namespace numfunc
sal_Bool ChangeIndentOnTabAtFirstPosOfFirstListItem()
{
- return SwNumberingUIBehaviorConfig::getInstance()->ChangeIndentOnTabAtFirstPosOfFirstListItem();
+ return SwNumberingUIBehaviorConfig::getInstance().ChangeIndentOnTabAtFirstPosOfFirstListItem();
}
SvxNumberFormat::SvxNumPositionAndSpaceMode GetDefaultPositionAndSpaceMode()
@@ -1450,8 +1449,6 @@ namespace numfunc
return ePosAndSpaceMode;
}
- // <--
}
-// <--
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index 1bafb37c2d..e97b56b9aa 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -253,7 +253,6 @@ void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl,
pColl->SetFmtAttr(aItem);
}
- // <--
}
}
pColl->SetNextTxtFmtColl( *pDoc->GetTxtCollFromPool(
@@ -576,12 +575,12 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage )
}
break;
- case RES_POOLCOLL_FOOTNOTE: // Fussnote
- case RES_POOLCOLL_ENDNOTE:
+ case RES_POOLCOLL_FOOTNOTE: // paragraph style Footnote
+ case RES_POOLCOLL_ENDNOTE: // paragraph style Endnote
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
- aLR.SetTxtFirstLineOfst( -(short)GetMetricVal( CM_05 ));
- aLR.SetTxtLeft( GetMetricVal( CM_05 ));
+ aLR.SetTxtFirstLineOfst( -(short)( GetMetricVal( CM_05 ) + GetMetricVal( CM_01 ) ) );
+ aLR.SetTxtLeft( GetMetricVal( CM_05 ) + GetMetricVal( CM_01 ) );
SetAllScriptItem( aSet, SvxFontHeightItem( PT_10, 100, RES_CHRATR_FONTSIZE ) );
aSet.Put( aLR );
SwFmtLineNumber aLN; aLN.SetCountLines( sal_False );
@@ -1647,7 +1646,6 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId )
const SvxNumberFormat::SvxNumPositionAndSpaceMode eNumberFormatPositionAndSpaceMode
= numfunc::GetDefaultPositionAndSpaceMode(); //#i89178#
- // <--
{
sal_Bool bIsModified = IsModified();
@@ -2320,7 +2318,6 @@ sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const
rRule.GetParagraphStyleListSize() > 0;
return bUsed;
- // <--
}
// Suche die Position vom Vorlagen-Namen. Ist nicht vorhanden
diff --git a/sw/source/core/doc/sortopt.cxx b/sw/source/core/doc/sortopt.cxx
index 4c3ddb80f1..3f6d62b0d1 100644
--- a/sw/source/core/doc/sortopt.cxx
+++ b/sw/source/core/doc/sortopt.cxx
@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <tools/debug.hxx>
#include <i18npool/lang.h>
#include <sortopt.hxx>
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index c19f8cb7e4..d5a586ebc8 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -101,9 +101,9 @@ struct _CpyTabFrm
_CpyTabFrm& operator=( const _CpyTabFrm& );
- sal_Bool operator==( const _CpyTabFrm& rCpyTabFrm )
+ sal_Bool operator==( const _CpyTabFrm& rCpyTabFrm ) const
{ return (sal_uLong)Value.nSize == (sal_uLong)rCpyTabFrm.Value.nSize; }
- sal_Bool operator<( const _CpyTabFrm& rCpyTabFrm )
+ sal_Bool operator<( const _CpyTabFrm& rCpyTabFrm ) const
{ return (sal_uLong)Value.nSize < (sal_uLong)rCpyTabFrm.Value.nSize; }
};
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 0176adaf4e..dc6723f5dd 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -203,6 +203,14 @@ namespace
const ::sw::mark::IFieldmark* const pOldFieldmark = dynamic_cast< const ::sw::mark::IFieldmark* >(pMark);
pNewFieldmark->SetFieldname(pOldFieldmark->GetFieldname());
pNewFieldmark->SetFieldHelptext(pOldFieldmark->GetFieldHelptext());
+ ::sw::mark::IFieldmark::parameter_map_t* pNewParams = pNewFieldmark->GetParameters();
+ const ::sw::mark::IFieldmark::parameter_map_t* pOldParams = pOldFieldmark->GetParameters();
+ ::sw::mark::IFieldmark::parameter_map_t::const_iterator pIt = pOldParams->begin();
+ while ( pIt != pOldParams->end() )
+ {
+ pNewParams->insert( *pIt );
+ pIt++;
+ }
}
::sfx2::Metadatable const*const pMetadatable(
@@ -282,7 +290,6 @@ SwCntntNode* SwTxtNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
// #i96213# - force copy of all attributes
pCpyTxtNd->CopyText( pTxtNd, SwIndex( pCpyTxtNd ),
pCpyTxtNd->GetTxt().Len(), true );
- // <--
//FEATURE::CONDCOLL
if( RES_CONDTXTFMTCOLL == pColl->Which() )
@@ -852,7 +859,6 @@ bool lcl_ContainsOnlyParagraphsInList( const SwPaM& rPam )
return bRet;
}
-// <--
bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
const bool bMakeNewFrms, const bool bCopyAll,
@@ -940,7 +946,6 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
pNumRuleToPropagate =
pDoc->SearchNumRule( rPos, false, false, false, 0, aListIdToPropagate, true );
}
- // <--
// #i86492#
// Do not propagate previous found list, if
// - destination is an empty paragraph which is not in a list and
@@ -951,7 +956,6 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
{
pNumRuleToPropagate = 0;
}
- // <--
// Block, damit aus diesem gesprungen werden kann !!
do {
@@ -1038,7 +1042,6 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
}
}
}
- // <--
if( !bCopyOk )
{
@@ -1157,7 +1160,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
// (text) node, and thus we set bStartisTxtNode to true. This
// will ensure that this node will be deleted during Undo
// using JoinNext.
- DBG_ASSERT( !bStartIsTxtNode, "Oops, undo may be instable now." );
+ OSL_ENSURE( !bStartIsTxtNode, "Oops, undo may be instable now." );
bStartIsTxtNode = sal_True;
}
@@ -1184,7 +1187,6 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
aListIdItem.SetValue( static_cast<const SfxStringItem*>(pItem)->GetValue() );
}
}
- // <--
const bool bEmptyDestNd = 0 == pDestTxtNd->GetTxt().Len();
pEndTxtNd->CopyText( pDestTxtNd, aDestIdx, SwIndex( pEndTxtNd ),
@@ -1556,7 +1558,6 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
SwNodeIndex aIdx( rStartIdx, nOffset );
pNewPos->nNode = aIdx;
}
- // <--
// die am Zeichen Flys wieder ans das vorgegebene Zeichen setzen
if ((FLY_AT_CHAR == aAnchor.GetAnchorId()) &&
pNewPos->nNode.GetNode().IsTxtNode() )
diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx
index 7f8e10715a..c5e082419a 100644..100755
--- a/sw/source/core/docnode/ndnotxt.cxx
+++ b/sw/source/core/docnode/ndnotxt.cxx
@@ -135,8 +135,31 @@ const PolyPolygon *SwNoTxtNode::HasContour() const
const MapMode aContourMap( bPixelGrf ? MAP_PIXEL : MAP_100TH_MM );
if( bPixelGrf ? !bPixelContour : aGrfMap != aContourMap )
{
+ // #i102238#
+ double nGrfDPIx = 0.0;
+ double nGrfDPIy = 0.0;
+ {
+ if ( !bPixelGrf && bPixelContour )
+ {
+ const Size aGrfPixelSize( GetGraphic().GetSizePixel() );
+ const Size aGrfPrefMapModeSize( GetGraphic().GetPrefSize() );
+ if ( aGrfMap.GetMapUnit() == MAP_INCH )
+ {
+ nGrfDPIx = aGrfPixelSize.Width() / ( (double)aGrfMap.GetScaleX() * aGrfPrefMapModeSize.Width() );
+ nGrfDPIy = aGrfPixelSize.Height() / ( (double)aGrfMap.GetScaleY() * aGrfPrefMapModeSize.Height() );
+ }
+ else
+ {
+ const Size aGrf1000thInchSize =
+ OutputDevice::LogicToLogic( aGrfPrefMapModeSize,
+ aGrfMap, MAP_1000TH_INCH );
+ nGrfDPIx = 1000.0 * aGrfPixelSize.Width() / aGrf1000thInchSize.Width();
+ nGrfDPIy = 1000.0 * aGrfPixelSize.Height() / aGrf1000thInchSize.Height();
+ }
+ }
+ }
OSL_ENSURE( !bPixelGrf || aGrfMap == aContourMap,
- "scale factor for pixel unsupported" );
+ "scale factor for pixel unsupported" );
OutputDevice* pOutDev =
(bPixelGrf || bPixelContour) ? Application::GetDefaultDevice()
: 0;
@@ -152,7 +175,15 @@ const PolyPolygon *SwNoTxtNode::HasContour() const
rPoly[i] = pOutDev->LogicToPixel( rPoly[i],
aContourMap );
else if( bPixelContour )
+ {
rPoly[i] = pOutDev->PixelToLogic( rPoly[i], aGrfMap );
+ // #i102238#
+ if ( nGrfDPIx != 0 && nGrfDPIy != 0 )
+ {
+ rPoly[i] = Point( rPoly[i].X() * pOutDev->ImplGetDPIX() / nGrfDPIx,
+ rPoly[i].Y() * pOutDev->ImplGetDPIY() / nGrfDPIy );
+ }
+ }
else
rPoly[i] = OutputDevice::LogicToLogic( rPoly[i],
aContourMap,
@@ -202,7 +233,9 @@ sal_Bool SwNoTxtNode::GetContourAPI( PolyPolygon &rContour ) const
sal_uInt16 nPolyCount = rContour.Count();
for( sal_uInt16 j=0; j<nPolyCount; j++ )
{
- Polygon& rPoly = (*pContour)[j];
+ // --> OD #i102238# - use the right <PolyPolygon> instance
+ Polygon& rPoly = rContour[j];
+ // <--
sal_uInt16 nCount = rPoly.GetSize();
for( sal_uInt16 i=0 ; i<nCount; i++ )
@@ -303,6 +336,5 @@ const String SwNoTxtNode::GetDescription() const
return pFlyFmt->GetObjDescription();
}
-// <--
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index daeca265b5..767887afa3 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -65,7 +65,6 @@
// #i27138#
#include <viewsh.hxx>
#include <txtfrm.hxx>
-// <--
// #i21457# - new implementation of local method <lcl_IsInSameTblBox(..)>.
@@ -1163,7 +1162,6 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
dynamic_cast<SwTxtFrm*>(pNew->FindPrevCnt( true )) );
}
}
- // <--
pNew = pSct;
}
@@ -1190,7 +1188,6 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
dynamic_cast<SwTxtFrm*>(pNew->FindPrevCnt( true )) );
}
}
- // <--
if ( bInitNewSect )
static_cast<SwSectionFrm*>(pNew)->Init();
}
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 2af5012077..30d9d385d9 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -339,7 +339,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
const SwPosition& rPos, sal_uInt16 nRows,
sal_uInt16 nCols, sal_Int16 eAdjust,
const SwTableAutoFmt* pTAFmt,
- const SvUShorts* pColArr,
+ const std::vector<sal_uInt16> *pColArr,
sal_Bool bCalledFromShell,
sal_Bool bNewModel )
{
@@ -354,7 +354,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
// sollte das ColumnArray die falsche Anzahl haben wird es ignoriert!
if( pColArr &&
- (nCols + ( text::HoriOrientation::NONE == eAdjust ? 2 : 1 )) != pColArr->Count() )
+ (size_t)(nCols + ( text::HoriOrientation::NONE == eAdjust ? 2 : 1 )) != pColArr->size() )
pColArr = 0;
}
@@ -426,12 +426,12 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
SwTwips nWidth = USHRT_MAX;
if( pColArr )
{
- sal_uInt16 nSttPos = (*pColArr)[ 0 ];
- sal_uInt16 nLastPos = (*pColArr)[ sal_uInt16(pColArr->Count()-1)];
+ sal_uInt16 nSttPos = pColArr->front();
+ sal_uInt16 nLastPos = pColArr->back();
if( text::HoriOrientation::NONE == eAdjust )
{
sal_uInt16 nFrmWidth = nLastPos;
- nLastPos = (*pColArr)[ sal_uInt16(pColArr->Count()-2)];
+ nLastPos = (*pColArr)[ pColArr->size()-2 ];
pTableFmt->SetFmtAttr( SvxLRSpaceItem( nSttPos, nFrmWidth - nLastPos, 0, 0, RES_LR_SPACE ) );
}
nWidth = nLastPos - nSttPos;
@@ -531,7 +531,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts,
// Positionen der Spalten!! (nicht deren Breite!)
if( pColArr )
{
- nWidth = (*pColArr)[ sal_uInt16(i + 1) ] - (*pColArr)[ i ];
+ nWidth = (*pColArr)[ i + 1 ] - (*pColArr)[ i ];
if( pBoxF->GetFrmSize().GetWidth() != nWidth )
{
if( pBoxF->GetDepends() ) // neues Format erzeugen!
@@ -600,7 +600,7 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
SwTxtNode * pTmpNd = new SwTxtNode( aIdx, pTxtColl );
- // --> FME 2006-04-13 #i60422# Propagate some more attributes.
+ // #i60422# Propagate some more attributes.
const SfxPoolItem* pItem = NULL;
if ( NULL != pAttrSet )
{
@@ -619,7 +619,6 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx,
++pIdx;
}
}
- // <--
new SwEndNode( aIdx, *pSttNd );
}
@@ -934,7 +933,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
}
}
- aPosArr.Insert(
+ aPosArr.Insert(
static_cast<sal_uInt16>(aFInfo.GetFrm()->IsVertical() ?
aFInfo.GetFrm()->Prt().Bottom() :
aFInfo.GetFrm()->Prt().Right()),
@@ -978,7 +977,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
SwStartNode* pSttNd;
SwPosition aCntPos( aSttIdx, SwIndex( pTxtNd ));
- SvULongs aBkmkArr( 15, 15 );
+ std::vector<sal_uLong> aBkmkArr;
_SaveCntntIdx( pDoc, aSttIdx.GetIndex(), pTxtNd->GetTxt().Len(), aBkmkArr );
const sal_Unicode* pTxt = pTxtNd->GetTxt().GetBuffer();
@@ -990,7 +989,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
aCntPos.nContent = nChPos;
SwCntntNode* pNewNd = pTxtNd->SplitCntntNode( aCntPos );
- if( aBkmkArr.Count() )
+ if( !aBkmkArr.empty() )
_RestoreCntntIdx( aBkmkArr, *pNewNd, nChPos,
nChPos + 1 );
@@ -1014,7 +1013,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
}
// und jetzt den letzten Teil-String
- if( aBkmkArr.Count() )
+ if( !aBkmkArr.empty() )
_RestoreCntntIdx( aBkmkArr, *pTxtNd, pTxtNd->GetTxt().Len(),
pTxtNd->GetTxt().Len()+1 );
@@ -1408,13 +1407,12 @@ sal_Bool SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh )
if( !pTblNd )
return sal_False;
- // --> FME 2004-09-28 #i34471#
+ // #i34471#
// If this is trigged by SwUndoTblToTxt::Repeat() nobody ever deleted
// the table cursor.
SwEditShell* pESh = GetEditShell();
if( pESh && pESh->IsTableMode() )
pESh->ClearMark();
- // <--
SwNodeRange aRg( *pTblNd, 0, *pTblNd->EndOfSectionNode() );
SwUndoTblToTxt* pUndo = 0;
@@ -1510,14 +1508,14 @@ sal_Bool lcl_DelBox( const SwTableBox*& rpBox, void* pPara )
pDelPara->pUndo->AddBoxPos( *pDoc, nNdIdx, aDelRg.aEnd.GetIndex(),
aCntIdx.GetIndex() );
- SvULongs aBkmkArr( 4, 4 );
+ std::vector<sal_uLong> aBkmkArr;
xub_StrLen nOldTxtLen = aCntIdx.GetIndex();
_SaveCntntIdx( pDoc, nNdIdx, pCurTxtNd->GetTxt().Len(),
aBkmkArr );
pDelPara->pLastNd->JoinNext();
- if( aBkmkArr.Count() )
+ if( !aBkmkArr.empty() )
_RestoreCntntIdx( pDoc, aBkmkArr,
pDelPara->pLastNd->GetIndex(),
nOldTxtLen );
@@ -2147,7 +2145,7 @@ sal_Bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, sal_uInt16 n
if( rTbl.ISA( SwDDETable ))
return sal_False;
- SvULongs aNdsCnts;
+ std::vector<sal_uLong> aNdsCnts;
SwTableSortBoxes aTmpLst( 0, 5 );
SwUndoTblNdsChg* pUndo = 0;
if (GetIDocumentUndoRedo().DoesUndo())
@@ -2161,8 +2159,8 @@ sal_Bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, sal_Bool bVert, sal_uInt16 n
for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
{
const SwStartNode* pSttNd = rBoxes[ n ]->GetSttNd();
- aNdsCnts.Insert( pSttNd->EndOfSectionIndex() -
- pSttNd->GetIndex(), n );
+ aNdsCnts.push_back( pSttNd->EndOfSectionIndex() -
+ pSttNd->GetIndex() );
}
}
}
@@ -2223,9 +2221,8 @@ sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam )
nRet = TBLMERGE_NOSELECTION;
}
- // --> FME 2004-10-08 #i33394#
+ // #i33394#
GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_MERGE, NULL );
- // <--
RedlineMode_t eOld = GetRedlineMode();
SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
@@ -2404,7 +2401,6 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind )
dynamic_cast<SwTxtFrm*>(pNew->FindPrevCnt( true )) );
}
}
- // <--
((SwTabFrm*)pNew)->RegistFlys();
}
}
@@ -2442,7 +2438,6 @@ void SwTableNode::DelFrms()
dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
}
}
- // <--
pFrm->Cut();
delete pFrm;
bAgain = sal_True;
@@ -2559,7 +2554,7 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* ,
if ( !pBoxFrm )
return;
- // --> FME 2005-01-06 #i39552# Collection of the boxes of the current
+ // #i39552# Collection of the boxes of the current
// column has to be done at the beginning of this function, because
// the table may be formatted in ::GetTblSel.
SwDeletionChecker aDelCheck( pBoxFrm );
@@ -2572,7 +2567,6 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* ,
const SwCursor aTmpCrsr( aPos, 0, false );
::GetTblSel( aTmpCrsr, aBoxes, nsSwTblSearchType::TBLSEARCH_COL );
}
- // <--
// Make code robust:
if ( aDelCheck.HasBeenDeleted() )
@@ -2680,11 +2674,10 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* ,
// delete first and last entry
OSL_ENSURE( rFill.Count(), "Deleting from empty vector. Fasten your seatbelts!" );
- // --> FME 2006-01-19 #i60818# There may be only one entry in rFill. Make
+ // #i60818# There may be only one entry in rFill. Make
// code robust by checking count of rFill.
if ( rFill.Count() ) rFill.Remove( 0, 1 );
if ( rFill.Count() ) rFill.Remove( rFill.Count() - 1 , 1 );
- // <--
rFill.SetLastRowAllowedToChange( !pTab->HasFollowFlowLine() );
}
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 1dcbbf6e02..b63967692e 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -156,24 +156,22 @@ int Put( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, const SwCntntNode& rNo
{
SwAttrSet aNewSet( (SwAttrSet&)*mrpAttrSet );
- // --> FME 2007-4-12 #i76273# Robust: Save the style name items:
+ // #i76273# Robust
SfxItemSet* pStyleNames = 0;
if ( SFX_ITEM_SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, sal_False ) )
{
pStyleNames = new SfxItemSet( *aNewSet.GetPool(), RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME );
pStyleNames->Put( aNewSet );
}
- // <--
const int nRet = aNewSet.Put( rSet );
- // --> FME 2007-4-12 #i76273# Robust: Save the style name items:
+ // #i76273# Robust
if ( pStyleNames )
{
aNewSet.Put( *pStyleNames );
delete pStyleNames;
}
- // <--
if ( nRet )
GetNewAutoStyle( mrpAttrSet, rNode, aNewSet );
@@ -206,14 +204,13 @@ int Put_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
{
SwAttrSet aNewSet( (SwAttrSet&)*mrpAttrSet );
- // --> FME 2007-4-12 #i76273# Robust: Save the style name items:
+ // #i76273# Robust
SfxItemSet* pStyleNames = 0;
if ( SFX_ITEM_SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, sal_False ) )
{
pStyleNames = new SfxItemSet( *aNewSet.GetPool(), RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME );
pStyleNames->Put( aNewSet );
}
- // <--
// for a correct broadcast, we need to do a SetModifyAtAttr with the items
// from aNewSet. The 'regular' SetModifyAtAttr is done in GetNewAutoStyle
@@ -222,13 +219,12 @@ int Put_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet,
const int nRet = aNewSet.Put_BC( rSet, pOld, pNew );
- // --> FME 2007-4-12 #i76273# Robust: Save the style name items:
+ // #i76273# Robust
if ( pStyleNames )
{
aNewSet.Put( *pStyleNames );
delete pStyleNames;
}
- // <--
if ( nRet )
GetNewAutoStyle( mrpAttrSet, rNode, aNewSet );
@@ -890,7 +886,6 @@ sal_uInt8 SwNode::HasPrevNextLayNode() const
{
--aIdx;
}
- // <--
if( IsValidNextPrevNd( aIdx.GetNode() ))
nRet |= ND_HAS_PREV_LAYNODE;
// #i77805# - skip section start and end nodes
@@ -1328,7 +1323,6 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode )
dynamic_cast<SwTxtFrm*>(pNew->FindPrevCnt( true )) );
}
}
- // <--
}
}
@@ -1567,7 +1561,7 @@ sal_Bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
}
return bRet;
}
-sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
+sal_Bool SwCntntNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr )
{
if( !GetpSwAttrSet() )
return sal_False;
@@ -1582,10 +1576,7 @@ sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
sal_uInt16 nDel = 0;
if( IsModifyLocked() )
{
- std::vector<sal_uInt16> aClearWhichIds;
- for( sal_uInt16 n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n )
- aClearWhichIds.push_back( rWhichArr[ n ] );
-
+ std::vector<sal_uInt16> aClearWhichIds(rWhichArr);
nDel = ClearItemsFromAttrSet( aClearWhichIds );
}
else
@@ -1593,8 +1584,9 @@ sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr )
SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ),
aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() );
- for( sal_uInt16 n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n )
- if( AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, rWhichArr[ n ], &aOld, &aNew ))
+ std::vector<sal_uInt16>::const_iterator it;
+ for ( it = rWhichArr.begin(); it != rWhichArr.end(); ++it )
+ if( AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, *it, &aOld, &aNew ))
++nDel;
if( nDel )
@@ -1697,7 +1689,6 @@ const SfxPoolItem* SwCntntNode::GetNoCondAttr( sal_uInt16 nWhich,
// the attribute set of the paragraph style, which is valid for the
// content node - see file <node.hxx>
else
- // <--
{
GetSwAttrSet().GetItemState( nWhich, bInParents, &pFnd );
}
@@ -1956,7 +1947,6 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos,
return nRet;
}
-// <--
SwOLENodes* SwCntntNode::CreateOLENodesArray( const SwFmtColl& rColl, bool bOnlyWithInvalidSize )
{
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index d12ff9a5f8..28eb833747 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -181,7 +181,6 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz,
pOutlineNds->Remove( pSrch );
}
}
- // <--
BigPtrArray::Move( aDelIdx.GetIndex(), rInsPos.GetIndex() );
@@ -1899,9 +1898,9 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
return;
// when inserting into the source range, nothing need to be done
- DBG_ASSERT( &aRg.aStart.GetNodes() == this,
+ OSL_ENSURE( &aRg.aStart.GetNodes() == this,
"aRg should use thisnodes array" );
- DBG_ASSERT( &aRg.aStart.GetNodes() == &aRg.aEnd.GetNodes(),
+ OSL_ENSURE( &aRg.aStart.GetNodes() == &aRg.aEnd.GetNodes(),
"Range across different nodes arrays? You deserve punishment!");
if( &rIndex.GetNodes() == &aRg.aStart.GetNodes() &&
rIndex.GetIndex() >= aRg.aStart.GetIndex() &&
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index bda3044fc8..4d72c1cfa3 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -86,8 +86,8 @@ public:
{}
virtual void Closed();
- virtual void DataChanged( const String& rMimeType,
- const uno::Any & rValue );
+ virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
+ const String& rMimeType, const ::com::sun::star::uno::Any & rValue );
virtual const SwNode* GetAnchor() const;
virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, xub_StrLen nStt = 0,
@@ -451,7 +451,6 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
pNewSet->ClearItem( RES_EDIT_IN_READONLY );
pOldSet->ClearItem( RES_EDIT_IN_READONLY );
}
- // <--
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_FTN_AT_TXTEND, sal_False, &pItem ) ||
@@ -715,7 +714,7 @@ void SwSectionFmt::DelFrms()
if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() &&
0 != (pSectNd = pIdx->GetNode().GetSectionNode() ))
{
- // #147431# : First delete the <SwSectionFrm> of the <SwSectionFmt> instance
+ // First delete the <SwSectionFrm> of the <SwSectionFmt> instance
// mba: test iteration as objects are removed in iteration
// use hint which allows to specify, if the content shall be saved or not
CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( sal_False ) );
@@ -792,7 +791,6 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
pNewSet->ClearItem( RES_EDIT_IN_READONLY );
pOldSet->ClearItem( RES_EDIT_IN_READONLY );
}
- // <--
if( SFX_ITEM_SET == pNewSet->GetItemState(
RES_FTN_AT_TXTEND, sal_False, &pItem ))
@@ -908,14 +906,7 @@ sal_Bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const
extern "C" {
- int
-#if defined( WNT )
- __cdecl
-#endif
-#if defined( ICC )
- _Optlink
-#endif
- lcl_SectionCmpPos( const void *pFirst, const void *pSecond)
+ int SAL_CALL lcl_SectionCmpPos( const void *pFirst, const void *pSecond)
{
const SwSectionFmt* pFSectFmt = (*(SwSectionPtr*)pFirst)->GetFmt();
const SwSectionFmt* pSSectFmt = (*(SwSectionPtr*)pSecond)->GetFmt();
@@ -927,14 +918,7 @@ extern "C" {
pSSectFmt->GetCntnt(sal_False).GetCntntIdx()->GetIndex();
}
- int
-#if defined( WNT )
- __cdecl
-#endif
-#if defined( ICC )
- _Optlink
-#endif
- lcl_SectionCmpNm( const void *pFirst, const void *pSecond)
+ int SAL_CALL lcl_SectionCmpNm( const void *pFirst, const void *pSecond)
{
const SwSectionPtr pFSect = *(SwSectionPtr*)pFirst;
const SwSectionPtr pSSect = *(SwSectionPtr*)pSecond;
@@ -1340,8 +1324,9 @@ int lcl_FindDocShell( SfxObjectShellRef& xDocSh,
}
-void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
- const uno::Any & rValue )
+
+::sfx2::SvBaseLink::UpdateResult SwIntrnlSectRefLink::DataChanged(
+ const String& rMimeType, const uno::Any & rValue )
{
SwSectionNode* pSectNd = rSectFmt.GetSectionNode( sal_False );
SwDoc* pDoc = rSectFmt.GetDoc();
@@ -1352,7 +1337,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
sfx2::LinkManager::RegisterStatusInfoId() == nDataFormat )
{
// sollten wir schon wieder im Undo stehen?
- return ;
+ return SUCCESS;
}
// #i38810# - Due to possible existing signatures, the
@@ -1361,7 +1346,6 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
// set additional flag that links have been updated, in order to check this
// during load.
pDoc->SetLinksUpdated( sal_True );
- // <--
// Undo immer abschalten
bool const bWasUndo = pDoc->GetIDocumentUndoRedo().DoesUndo();
@@ -1510,7 +1494,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
{
pSrcDoc->GetLinkManager().UpdateAllLinks( sal_False, sal_True, sal_False, 0 );
}
- // <--
+
if( pCpyRg )
{
SwNodeIndex& rInsPos = pPam->GetPoint()->nNode;
@@ -1614,6 +1598,8 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
else if( pVSh )
pVSh->EndAction();
delete pPam; // wurde am Anfang angelegt
+
+ return SUCCESS;
}
diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx
index 515559b530..90e8c4e18c 100644
--- a/sw/source/core/docnode/swbaslnk.cxx
+++ b/sw/source/core/docnode/swbaslnk.cxx
@@ -94,20 +94,20 @@ void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem )
}
-void SwBaseLink::DataChanged( const String& rMimeType,
- const uno::Any & rValue )
+::sfx2::SvBaseLink::UpdateResult SwBaseLink::DataChanged(
+ const String& rMimeType, const uno::Any & rValue )
{
if( !pCntntNode )
{
OSL_ENSURE(!this, "DataChanged ohne ContentNode" );
- return ;
+ return ERROR_GENERAL;
}
SwDoc* pDoc = pCntntNode->GetDoc();
if( pDoc->IsInDtor() || ChkNoDataFlag() || bIgnoreDataChanged )
{
bIgnoreDataChanged = sal_False;
- return ;
+ return SUCCESS;
}
sal_uLong nFmt = SotExchange::GetFormatIdFromMimeType( rMimeType );
@@ -135,7 +135,7 @@ void SwBaseLink::DataChanged( const String& rMimeType,
pDoc->CallEvent( nEvent, aCallEvent );
}
}
- return; // das wars!
+ return SUCCESS; // das wars!
}
sal_Bool bUpdate = sal_False;
@@ -297,6 +297,8 @@ void SwBaseLink::DataChanged( const String& rMimeType,
if( pSh && !bLockView )
pSh->LockView( sal_False );
}
+
+ return SUCCESS;
}
sal_Bool SetGrfFlySize( const Size& rGrfSz, const Size& rFrmSz, SwGrfNode* pGrfNd )
diff --git a/sw/source/core/docnode/swthreadjoiner.cxx b/sw/source/core/docnode/swthreadjoiner.cxx
index 15df350547..b549458526 100644
--- a/sw/source/core/docnode/swthreadjoiner.cxx
+++ b/sw/source/core/docnode/swthreadjoiner.cxx
@@ -30,6 +30,8 @@
#include <finalthreadmanager.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx>
+#include <osl/mutex.hxx>
+#include <rtl/instance.hxx>
/** Testing
@@ -38,11 +40,15 @@
using namespace ::com::sun::star;
uno::Reference< util::XJobManager > SwThreadJoiner::mpThreadJoiner;
-osl::Mutex* SwThreadJoiner::mpGetJoinerMutex = new osl::Mutex();
+
+namespace
+{
+ class theJoinerMutex : public rtl::Static<osl::Mutex, theJoinerMutex> {};
+}
uno::Reference< util::XJobManager >& SwThreadJoiner::GetThreadJoiner()
{
- osl::MutexGuard aGuard(*mpGetJoinerMutex);
+ osl::MutexGuard aGuard(theJoinerMutex::get());
if ( !mpThreadJoiner.is() )
{
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index ec6693c85d..5f2fedf15d 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -145,12 +145,11 @@ sal_Bool HasWrap( const SdrObject* pObj )
*
*****************************************************************************/
-// --> OD 2006-08-15 #i68520# - change naming
+// #i68520# - change naming
SwRect GetBoundRectOfAnchoredObj( const SdrObject* pObj )
-// <--
{
SwRect aRet( pObj->GetCurrentBoundRect() );
- // --> OD 2006-08-10 #i68520# - call cache of <SwAnchoredObject>
+ // #i68520# - call cache of <SwAnchoredObject>
SwContact* pContact( GetUserCall( pObj ) );
if ( pContact )
{
@@ -160,7 +159,6 @@ SwRect GetBoundRectOfAnchoredObj( const SdrObject* pObj )
aRet = pAnchoredObj->GetObjRectWithSpaces();
}
}
- // <--
return aRet;
}
@@ -218,14 +216,13 @@ void SwContact::SetInDTOR()
*/
void SwContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
{
- // --> OD 2005-06-08 #i46297# - notify background about the arriving of
+ // #i46297# - notify background about the arriving of
// the object and invalidate its position.
const bool bNotify( !GetFmt()->getIDocumentDrawModelAccess()->IsVisibleLayerId( _pDrawObj->GetLayer() ) );
- // <--
_MoveObjToLayer( true, _pDrawObj );
- // --> OD 2005-05-23 #i46297#
+ // #i46297#
if ( bNotify )
{
SwAnchoredObject* pAnchoredObj = GetAnchoredObj( _pDrawObj );
@@ -245,7 +242,6 @@ void SwContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
pAnchoredObj->InvalidateObjPos();
}
}
- // <--
}
/** method to move drawing object to corresponding invisible layer
@@ -256,13 +252,12 @@ void SwContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
*/
void SwContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
{
- // --> OD 2005-06-08 #i46297# - notify background about the leaving of the object.
+ // #i46297# - notify background about the leaving of the object.
const bool bNotify( GetFmt()->getIDocumentDrawModelAccess()->IsVisibleLayerId( _pDrawObj->GetLayer() ) );
- // <--
_MoveObjToLayer( false, _pDrawObj );
- // --> OD 2005-05-19 #i46297#
+ // #i46297#
if ( bNotify )
{
SwAnchoredObject* pAnchoredObj = GetAnchoredObj( _pDrawObj );
@@ -276,7 +271,6 @@ void SwContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
pAnchoredObj->GetObjRect(), PREP_FLY_LEAVE, sal_True );
}
}
- // <--
}
/** method to move object to visible/invisible layer
@@ -549,7 +543,7 @@ void SwFlyDrawContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
SwFlyFrm* pFlyFrm = static_cast<SwVirtFlyDrawObj*>(_pDrawObj)->GetFlyFrm();
- // --> OD 2005-03-09 #i44464# - consider, that Writer fly frame content
+ // #i44464# - consider, that Writer fly frame content
// already exists - (e.g. WW8 document is inserted into a existing document).
if ( !pFlyFrm->Lower() )
{
@@ -561,7 +555,7 @@ void SwFlyDrawContact::MoveObjToVisibleLayer( SdrObject* _pDrawObj )
{
for ( sal_uInt8 i = 0; i < pFlyFrm->GetDrawObjs()->Count(); ++i)
{
- // --> OD 2004-07-01 #i28701# - consider type of objects in sorted object list.
+ // #i28701# - consider type of objects in sorted object list.
SdrObject* pObj = (*pFlyFrm->GetDrawObjs())[i]->DrawObj();
SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
pContact->MoveObjToVisibleLayer( pObj );
@@ -594,7 +588,7 @@ void SwFlyDrawContact::MoveObjToInvisibleLayer( SdrObject* _pDrawObj )
{
for ( sal_uInt8 i = 0; i < pFlyFrm->GetDrawObjs()->Count(); ++i)
{
- // --> OD 2004-07-01 #i28701# - consider type of objects in sorted object list.
+ // #i28701# - consider type of objects in sorted object list.
SdrObject* pObj = (*pFlyFrm->GetDrawObjs())[i]->DrawObj();
SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
pContact->MoveObjToInvisibleLayer( pObj );
@@ -659,7 +653,6 @@ SwDrawContact::SwDrawContact( SwFrmFmt* pToRegisterIn, SdrObject* pObj ) :
pToRegisterIn->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage(0)->
InsertObject( pObj, pObj->GetOrdNumDirect() );
}
- // <--
//Controls muessen immer im Control-Layer liegen. Das gilt auch fuer
//Gruppenobjekte, wenn diese Controls enthalten.
@@ -1075,30 +1068,26 @@ void lcl_NotifyBackgroundOfObj( SwDrawContact& _rDrawContact,
const SdrObject& _rObj,
const Rectangle* _pOldObjRect )
{
- // --> OD 2004-10-21 #i34640#
+ // #i34640#
SwAnchoredObject* pAnchoredObj =
const_cast<SwAnchoredObject*>(_rDrawContact.GetAnchoredObj( &_rObj ));
if ( pAnchoredObj && pAnchoredObj->GetAnchorFrm() )
- // <--
{
- // --> OD 2004-10-21 #i34640# - determine correct page frame
+ // #i34640# - determine correct page frame
SwPageFrm* pPageFrm = pAnchoredObj->FindPageFrmOfAnchor();
- // <--
if( _pOldObjRect && pPageFrm )
{
SwRect aOldRect( *_pOldObjRect );
if( aOldRect.HasArea() )
{
- // --> OD 2004-10-21 #i34640# - determine correct page frame
+ // #i34640# - determine correct page frame
SwPageFrm* pOldPageFrm = (SwPageFrm*)::FindPage( aOldRect, pPageFrm );
- // <--
::Notify_Background( &_rObj, pOldPageFrm, aOldRect,
PREP_FLY_LEAVE, sal_True);
}
}
- // --> OD 2004-10-21 #i34640# - include spacing for wrapping
+ // #i34640# - include spacing for wrapping
SwRect aNewRect( pAnchoredObj->GetObjRectWithSpaces() );
- // <--
if( aNewRect.HasArea() && pPageFrm )
{
pPageFrm = (SwPageFrm*)::FindPage( aNewRect, pPageFrm );
@@ -1122,14 +1111,13 @@ void SwDrawContact::Changed( const SdrObject& rObj,
return;
}
- // --> OD 2005-03-08 #i44339#
+ // #i44339#
// no event handling, if document is in destruction.
// Exception: It's the SDRUSERCALL_DELETE event
if ( pDoc->IsInDtor() && eType != SDRUSERCALL_DELETE )
{
return;
}
- // <--
//Action aufsetzen, aber nicht wenn gerade irgendwo eine Action laeuft.
ViewShell *pSh = 0, *pOrg;
@@ -1228,7 +1216,6 @@ class NestedUserCallHdl
}
};
-// <--
//
// !!!ACHTUNG!!! The object may commit suicide!!!
//
@@ -1244,15 +1231,14 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
return;
}
// do *not* notify, if document is destructing
- // --> OD 2004-10-21 #i35912# - do *not* notify for as-character anchored
+ // #i35912# - do *not* notify for as-character anchored
// drawing objects.
- // --> OD 2004-11-11 #i35007#
+ // #i35007#
// improvement: determine as-character anchored object flag only once.
const bool bAnchoredAsChar = ObjAnchoredAsChar();
const bool bNotify = !(GetFmt()->GetDoc()->IsInDtor()) &&
( SURROUND_THROUGHT != GetFmt()->GetSurround().GetSurround() ) &&
!bAnchoredAsChar;
- // <--
switch( eType )
{
case SDRUSERCALL_DELETE:
@@ -1263,14 +1249,12 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
// --> #i36181# - background of 'virtual'
// drawing objects have also been notified.
NotifyBackgrdOfAllVirtObjs( pOldBoundRect );
- // <--
}
DisconnectFromLayout( false );
SetMaster( NULL );
delete this;
// --> #i65784# Prevent memory corruption
aNestedUserCallHdl.DrawContactDeleted();
- // <--
break;
}
case SDRUSERCALL_INSERTED:
@@ -1327,7 +1311,6 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
}
}
// fallthrough intended here
- // <--
}
case SDRUSERCALL_MOVEONLY:
case SDRUSERCALL_RESIZE:
@@ -1337,43 +1320,37 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
case SDRUSERCALL_CHILD_DELETE :
case SDRUSERCALL_CHILD_COPY :
{
- // --> OD 2004-08-04 #i31698# - improvement:
+ // #i31698# - improvement
// get instance <SwAnchoredDrawObject> only once
const SwAnchoredDrawObject* pAnchoredDrawObj =
static_cast<const SwAnchoredDrawObject*>( GetAnchoredObj( &rObj ) );
- // <--
// OD 2004-04-06 #i26791# - adjust positioning and alignment attributes,
// if positioning of drawing object isn't in progress.
- // --> OD 2005-08-15 #i53320# - no adjust of positioning attributes,
+ // #i53320# - no adjust of positioning attributes,
// if drawing object isn't positioned.
if ( !pAnchoredDrawObj->IsPositioningInProgress() &&
!pAnchoredDrawObj->NotYetPositioned() )
- // <--
{
- // --> OD 2004-09-29 #i34748# - If no last object rectangle is
+ // #i34748# - If no last object rectangle is
// provided by the anchored object, use parameter <pOldBoundRect>.
const Rectangle& aOldObjRect = pAnchoredDrawObj->GetLastObjRect()
? *(pAnchoredDrawObj->GetLastObjRect())
: *(pOldBoundRect);
- // <--
- // --> OD 2008-02-18 #i79400#
+ // #i79400#
// always invalidate object rectangle inclusive spaces
pAnchoredDrawObj->InvalidateObjRectWithSpaces();
- // <--
- // --> OD 2005-01-28 #i41324# - notify background before
+ // #i41324# - notify background before
// adjusting position
if ( bNotify )
{
- // --> OD 2004-07-20 #i31573# - correction: Only invalidate
+ // #i31573# - correction
// background of given drawing object.
lcl_NotifyBackgroundOfObj( *this, rObj, &aOldObjRect );
}
- // <--
- // --> OD 2004-08-04 #i31698# - determine layout direction
+ // #i31698# - determine layout direction
// via draw frame format.
SwFrmFmt::tLayoutDir eLayoutDir =
pAnchoredDrawObj->GetFrmFmt().GetLayoutDir();
- // <--
// use geometry of drawing object
SwRect aObjRect( rObj.GetSnapRect() );
// If drawing object is a member of a group, the adjustment
@@ -1447,7 +1424,7 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
// keep new object rectangle, to avoid multiple
// changes of the attributes by multiple event from
// the drawing layer - e.g. group objects and its members
- // --> OD 2004-09-29 #i34748# - use new method
+ // #i34748# - use new method
// <SwAnchoredDrawObject::SetLastObjRect(..)>.
const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)
->SetLastObjRect( aObjRect.SVRect() );
@@ -1455,14 +1432,13 @@ void SwDrawContact::_Changed( const SdrObject& rObj,
else if ( aObjRect.SSize() != aOldObjRect.GetSize() )
{
_InvalidateObjs();
- // --> OD 2004-11-11 #i35007# - notify anchor frame
+ // #i35007# - notify anchor frame
// of as-character anchored object
if ( bAnchoredAsChar )
{
const_cast<SwAnchoredDrawObject*>(pAnchoredDrawObj)
->AnchorFrm()->Prepare( PREP_FLY_ATTR_CHG, GetFmt() );
}
- // <--
}
}
}
@@ -1530,7 +1506,6 @@ void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
// rectangle for notification.
aOldRect = maAnchoredDrawObj.GetObjRectWithSpaces().SVRect();
pOldRect = &aOldRect;
- // <--
}
// re-connect to layout due to anchor format change
ConnectToLayout( pNewAnchorFmt );
@@ -1547,7 +1522,6 @@ void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
// --> #i102752#
// assure that a ShapePropertyChangeNotifier exists
maAnchoredDrawObj.DrawObj()->notifyShapePropertyChange( ::svx::eTextShapeAnchorType );
- // <--
}
}
}
@@ -1580,7 +1554,7 @@ void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
}
else if ( RES_UL_SPACE == nWhich || RES_LR_SPACE == nWhich ||
RES_HORI_ORIENT == nWhich || RES_VERT_ORIENT == nWhich ||
- // --> OD 2004-07-01 #i28701# - add attribute 'Follow text flow'
+ // #i28701# - add attribute 'Follow text flow'
RES_FOLLOW_TEXT_FLOW == nWhich ||
( RES_ATTRSET_CHG == nWhich &&
( SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState(
@@ -1598,14 +1572,13 @@ void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
NotifyBackgrdOfAllVirtObjs( 0L );
_InvalidateObjs();
}
- // --> OD 2004-10-26 #i35443#
+ // #i35443#
else if ( RES_ATTRSET_CHG == nWhich )
{
lcl_NotifyBackgroundOfObj( *this, *GetMaster(), 0L );
NotifyBackgrdOfAllVirtObjs( 0L );
_InvalidateObjs();
}
- // <--
else if ( RES_REMOVE_UNO_OBJECT == nWhich )
{
// nothing to do
@@ -1618,13 +1591,12 @@ void SwDrawContact::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
#endif
}
- // --> OD 2005-07-18 #i51474#
+ // #i51474#
GetAnchoredObj( 0L )->ResetLayoutProcessBools();
- // <--
}
// OD 2004-03-31 #i26791#
-// --> OD 2004-07-01 #i28701# - added parameter <_bUpdateSortedObjsList>
+// #i28701# - added parameter <_bUpdateSortedObjsList>
void SwDrawContact::_InvalidateObjs( const bool _bUpdateSortedObjsList )
{
// invalidate position of existing 'virtual' drawing objects
@@ -1633,30 +1605,27 @@ void SwDrawContact::_InvalidateObjs( const bool _bUpdateSortedObjsList )
++aDisconnectIter )
{
SwDrawVirtObj* pDrawVirtObj = (*aDisconnectIter);
- // --> OD 2004-08-23 #i33313# - invalidation only for connected
+ // #i33313# - invalidation only for connected
// 'virtual' drawing objects
if ( pDrawVirtObj->IsConnected() )
{
pDrawVirtObj->AnchoredObj()->InvalidateObjPos();
- // --> OD 2004-07-01 #i28701#
+ // #i28701#
if ( _bUpdateSortedObjsList )
{
pDrawVirtObj->AnchoredObj()->UpdateObjInSortedList();
}
- // <--
}
- // <--
}
// invalidate position of 'master' drawing object
SwAnchoredObject* pAnchoredObj = GetAnchoredObj( 0L );
pAnchoredObj->InvalidateObjPos();
- // --> OD 2004-07-01 #i28701#
+ // #i28701#
if ( _bUpdateSortedObjsList )
{
pAnchoredObj->UpdateObjInSortedList();
}
- // <--
}
/*************************************************************************
@@ -1678,7 +1647,6 @@ void SwDrawContact::DisconnectFromLayout( bool _bMoveMasterToInvisibleLayer )
lcl_NotifyBackgroundOfObj( *this, *GetMaster(), &aOldRect );
NotifyBackgrdOfAllVirtObjs( &aOldRect );
}
- // <--
// remove 'virtual' drawing objects from writer
// layout and from drawing page
@@ -1811,7 +1779,6 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
OSL_FAIL( "<SwDrawContact::ConnectToLayout(..)> - master drawing object not inserted -> no connect to layout. Please inform od@openoffice.org" );
return;
}
- // <--
SwFrmFmt* pDrawFrmFmt = (SwFrmFmt*)GetRegisteredIn();
@@ -1892,7 +1859,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
}
}
}
- // --> OD 2004-06-15 #i29199# - It is possible, that
+ // #i29199# - It is possible, that
// the anchor doesn't exist - E.g., reordering the
// sub-documents in a master document.
// Note: The anchor will be inserted later.
@@ -2264,9 +2231,8 @@ SwDrawVirtObj::SwDrawVirtObj( SdrObject& _rNewObj,
{
// OD 2004-03-29 #i26791#
maAnchoredDrawObj.SetDrawObj( *this );
- // --> OD 2004-11-17 #i35635# - set initial position out of sight
+ // #i35635# - set initial position out of sight
NbcMove( Size( -RECT_EMPTY, -RECT_EMPTY ) );
- // <--
}
SwDrawVirtObj::~SwDrawVirtObj()
@@ -2339,10 +2305,10 @@ void SwDrawVirtObj::AddToDrawingPage()
// insert 'virtual' drawing object into page, set layer and user call.
SdrPage* pDrawPg;
- // --> OD 2004-08-16 #i27030# - apply order number of referenced object
+ // #i27030# - apply order number of referenced object
if ( 0 != ( pDrawPg = pOrgMasterSdrObj->GetPage() ) )
{
- // --> OD 2004-08-16 #i27030# - apply order number of referenced object
+ // #i27030# - apply order number of referenced object
pDrawPg->InsertObject( this, GetReferencedObj().GetOrdNum() );
}
else
@@ -2358,7 +2324,6 @@ void SwDrawVirtObj::AddToDrawingPage()
SetOrdNum( GetReferencedObj().GetOrdNum() );
}
}
- // <--
SetUserCall( &mrDrawContact );
}
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index c6b4886853..302a939990 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -456,6 +456,51 @@ SwFrmFmt *SwVirtFlyDrawObj::GetFmt()
|*
*************************************************************************/
+// --> OD #i102707#
+namespace
+{
+ class RestoreMapMode
+ {
+ public:
+ explicit RestoreMapMode( ViewShell* pViewShell )
+ : mbMapModeRestored( false )
+ , mpOutDev( pViewShell->GetOut() )
+ {
+ if ( pViewShell->getPrePostMapMode() != mpOutDev->GetMapMode() )
+ {
+ mpOutDev->Push(PUSH_MAPMODE);
+
+ GDIMetaFile* pMetaFile = mpOutDev->GetConnectMetaFile();
+ if ( pMetaFile &&
+ pMetaFile->IsRecord() && !pMetaFile->IsPause() )
+ {
+ OSL_FAIL( "MapMode restoration during meta file creation is somehow suspect - using <SetRelativeMapMode(..)>, but not sure, if correct." );
+ mpOutDev->SetRelativeMapMode( pViewShell->getPrePostMapMode() );
+ }
+ else
+ {
+ mpOutDev->SetMapMode( pViewShell->getPrePostMapMode() );
+ }
+
+ mbMapModeRestored = true;
+ }
+ };
+
+ ~RestoreMapMode()
+ {
+ if ( mbMapModeRestored )
+ {
+ mpOutDev->Pop();
+ }
+ };
+
+ private:
+ bool mbMapModeRestored;
+ OutputDevice* mpOutDev;
+ };
+}
+// <--
+
void SwVirtFlyDrawObj::wrap_DoPaintObject() const
{
ViewShell* pShell = pFlyFrm->getRootFrm()->GetCurrShell();
@@ -465,31 +510,29 @@ void SwVirtFlyDrawObj::wrap_DoPaintObject() const
// but no paints. IsPaintInProgress() depends on SW repaint, so, as long
// as SW paints self and calls DrawLayer() for Heaven and Hell, this will
// be correct
- if(pShell && pShell->IsDrawingLayerPaintInProgress())
+ if ( pShell && pShell->IsDrawingLayerPaintInProgress() )
{
sal_Bool bDrawObject(sal_True);
- if(!SwFlyFrm::IsPaint((SdrObject*)this, pShell))
+ if ( !SwFlyFrm::IsPaint( (SdrObject*)this, pShell ) )
{
bDrawObject = sal_False;
}
- if(bDrawObject)
+ if ( bDrawObject )
{
- if(!pFlyFrm->IsFlyInCntFrm())
+ if ( !pFlyFrm->IsFlyInCntFrm() )
{
// it is also necessary to restore the VCL MapMode from ViewInformation since e.g.
// the VCL PixelRenderer resets it at the used OutputDevice. Unfortunately, this
// excludes shears and rotates which are not expressable in MapMode.
- OutputDevice* pOut = pShell->GetOut();
-
- pOut->Push(PUSH_MAPMODE);
- pOut->SetMapMode(pShell->getPrePostMapMode());
+ // OD #i102707#
+ // new helper class to restore MapMode - restoration, only if
+ // needed and consideration of paint for meta file creation .
+ RestoreMapMode aRestoreMapModeIfNeeded( pShell );
// paint the FlyFrame (use standard VCL-Paint)
- pFlyFrm->Paint(GetFlyFrm()->Frm());
-
- pOut->Pop();
+ pFlyFrm->Paint( GetFlyFrm()->Frm() );
}
}
}
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 8b6e6ddb86..d9cb1c2041 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -199,7 +199,7 @@ sal_Bool SwDPage::RequestHelp( Window* pWindow, SdrView* pView,
if ( sTxt.Len() )
{
- // --> OD 2007-07-26 #i80029#
+ // #i80029#
sal_Bool bExecHyperlinks = rDoc.GetDocShell()->IsReadOnly();
if ( !bExecHyperlinks )
{
@@ -213,7 +213,6 @@ sal_Bool SwDPage::RequestHelp( Window* pWindow, SdrView* pView,
}
}
- // <--
if( rEvt.GetMode() & HELPMODE_BALLOON )
{
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index 1abe913e0f..35a662ee9a 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -78,7 +78,7 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
SvxColorTableItem* pColItem = ( SvxColorTableItem* )
( pDocSh->GetItem( SID_COLOR_TABLE ) );
XColorTable *pXCol = pColItem ? pColItem->GetColorTable() :
- XColorTable::GetStdColorTable();
+ &XColorTable::GetStdColorTable();
SetColorTable( pXCol );
if ( !pColItem )
@@ -93,7 +93,7 @@ SwDrawDocument::SwDrawDocument( SwDoc* pD ) :
SetObjectShell( pDocSh );
}
else
- SetColorTable( XColorTable::GetStdColorTable() );
+ SetColorTable( &XColorTable::GetStdColorTable() );
// copy all the default values to the SdrModel
SfxItemPool* pSdrPool = pD->GetAttrPool().GetSecondaryPool();
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index 7d0dea70f5..1f3c7b9637 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -61,10 +61,9 @@
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <vector>
-// --> OD 2004-06-24 #i28701#
+// #i28701#
#include <sortedobjs.hxx>
#include <flyfrms.hxx>
-// <--
using namespace com::sun::star;
@@ -139,12 +138,11 @@ SwDrawView::SwDrawView( SwViewImp &rI, SdrModel *pMd, OutputDevice *pOutDev) :
SetBufferedOutputAllowed(getOptionsDrawinglayer().IsPaintBuffer_Writer());
}
-// --> OD 2009-03-05 #i99665#
+// #i99665#
sal_Bool SwDrawView::IsAntiAliasing() const
{
return getOptionsDrawinglayer().IsAntiAliasing();
}
-// <--
//////////////////////////////////////////////////////////////////////////////
@@ -257,7 +255,7 @@ void SwDrawView::AddCustomHdl()
if ( FLY_AT_CHAR == rAnchor.GetAnchorId() )
{
- // --> OD 2004-06-24 #i28701# - use last character rectangle saved at object
+ // #i28701# - use last character rectangle saved at object
// in order to avoid a format of the anchor frame
SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
SwRect aAutoPos = pAnchoredObj->GetLastCharRect();
@@ -623,14 +621,13 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
const SdrObject* pTmpObj = pDrawPage->GetObj( nNewPos + 1 );
while ( pTmpObj )
{
- // --> OD 2004-12-07 #i38563# - assure, that anchor frame exists.
+ // #i38563# - assure, that anchor frame exists.
// If object is anchored inside a invisible part of the document
// (e.g. page header, whose page style isn't applied, or hidden
// section), no anchor frame exists.
const SwFrm* pTmpAnchorFrm = lcl_FindAnchor( pTmpObj, sal_True );
const SwFlyFrm* pTmpParentObj = pTmpAnchorFrm
? pTmpAnchorFrm->FindFlyFrm() : 0L;
- // <--
if ( pTmpParentObj &&
&(pTmpParentObj->GetFrmFmt()) != pParentFrmFmt )
{
@@ -677,14 +674,13 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
if ( pTmpObj == pObj )
break;
- // --> OD 2004-12-07 #i38563# - assure, that anchor frame exists.
+ // #i38563# - assure, that anchor frame exists.
// If object is anchored inside a invisible part of the document
// (e.g. page header, whose page style isn't applied, or hidden
// section), no anchor frame exists.
const SwFrm* pTmpAnchorFrm = lcl_FindAnchor( pTmpObj, sal_True );
const SwFlyFrm* pTmpParentObj = pTmpAnchorFrm
? pTmpAnchorFrm->FindFlyFrm() : 0L;
- // <--
if ( pTmpParentObj &&
( ( pTmpParentObj == pFlyFrm ) ||
( pFlyFrm->IsUpperOf( *pTmpParentObj ) ) ) )
@@ -729,7 +725,6 @@ void SwDrawView::ObjOrderChanged( SdrObject* pObj, sal_uLong nOldPos,
_MoveRepeatedObjs( *pMovedAnchoredObj, aMovedChildObjs );
}
-// <--
/*************************************************************************
|*
@@ -953,7 +948,6 @@ void SwDrawView::CheckPossibilities()
// TODO/LATER: retrieve Aspect - from where?!
bSzProtect |= ( embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) ? sal_True : sal_False;
- // <--
// #i972: protect position if it is a Math object anchored 'as char' and baseline alignment is activated
SwDoc* pDoc = Imp().GetShell()->GetDoc();
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 210e055b54..bee215fc85 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -456,7 +456,7 @@ void SwAutoCorrExceptWord::CheckChar( const SwPosition& rPos, sal_Unicode cChr )
rPos.nContent.GetIndex() == nCntnt )
{
// die akt. Autokorrektur besorgen:
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
// dann in die Liste aufnehmen:
if( CptlSttWrd & nFlags )
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 559fd69453..cf30fef664 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -29,13 +29,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#define _SVSTDARR_USHORTS
-
#include <ctype.h>
#include <hintids.hxx>
-#include <svl/svstdarr.hxx>
-
#include <unotools/charclass.hxx>
#include <vcl/msgbox.hxx>
@@ -660,7 +656,7 @@ sal_Bool SwAutoFormat::DoTable()
xub_StrLen n = nSttPlus;
const sal_Unicode* pStr = rTmp.GetBuffer() + n;
- SvUShorts aPosArr( 5, 5 );
+ std::vector<sal_uInt16> aPosArr;
while( *pStr )
{
@@ -675,7 +671,7 @@ sal_Bool SwAutoFormat::DoTable()
case '+':
case '|':
- aPosArr.Insert( static_cast<sal_uInt16>(aInfo.GetCharPos(n)), aPosArr.Count() );
+ aPosArr.push_back( static_cast<sal_uInt16>(aInfo.GetCharPos(n)) );
break;
default:
@@ -687,10 +683,10 @@ sal_Bool SwAutoFormat::DoTable()
++pStr;
}
- if( 1 < aPosArr.Count() )
+ if( 1 < aPosArr.size() )
{
// Ausrichtung vom Textnode besorgen:
- sal_uInt16 nColCnt = aPosArr.Count() - 1;
+ sal_uInt16 nColCnt = aPosArr.size() - 1;
SwTwips nSttPos = aPosArr[ 0 ];
sal_Int16 eHori;
switch( pAktTxtNd->GetSwAttrSet().GetAdjust().GetAdjust() )
@@ -704,7 +700,7 @@ sal_Bool SwAutoFormat::DoTable()
eHori = text::HoriOrientation::NONE;
// dann muss als letztes noch die akt. FrameBreite
// ins Array
- aPosArr.Insert( static_cast<sal_uInt16>(pAktTxtFrm->Frm().Width()), aPosArr.Count() );
+ aPosArr.push_back( static_cast<sal_uInt16>(pAktTxtFrm->Frm().Width()) );
}
else
eHori = text::HoriOrientation::LEFT;
@@ -720,7 +716,7 @@ sal_Bool SwAutoFormat::DoTable()
0, &aPosArr );
aDelPam.GetPoint()->nNode = aIdx;
}
- return 1 < aPosArr.Count();
+ return 1 < aPosArr.size();
}
@@ -1467,9 +1463,8 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
// falls die Numerierung gesetzt werden, die akt. besorgen
SwNumRule aRule( pDoc->GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
const SwNumRule* pCur = 0;
if( aFlags.bSetNumRule && 0 != (pCur = pAktTxtNd->GetNumRule()) )
@@ -1507,13 +1502,12 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
cBullChar = nBulletPos < cnPosEmDash
? cStarSymbolEnDash
: cStarSymbolEmDash;
- // --> OD 2008-06-03 #i63395#
+ // #i63395#
// Only apply user defined default bullet font
if ( numfunc::IsDefBulletFontUserDefined() )
{
pBullFnt = &numfunc::GetDefBulletFont();
}
- // <--
}
sal_uInt16 nAbsPos = lBullIndent;
@@ -1874,7 +1868,7 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl )
// dann lasse doch mal das AutoCorrect auf den akt. TextNode los
void SwAutoFormat::AutoCorrect( xub_StrLen nPos )
{
- SvxAutoCorrect* pATst = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pATst = SvxAutoCorrCfg::Get().GetAutoCorrect();
long aSvxFlags = pATst->GetFlags( );
bool bReplaceQuote = ( aSvxFlags & ChgQuotes ) > 0;
bool bReplaceSglQuote = ( aSvxFlags & ChgSglQuotes ) > 0;
diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx
index a7aca2da3d..ca7ae78586 100644
--- a/sw/source/core/edit/edatmisc.cxx
+++ b/sw/source/core/edit/edatmisc.cxx
@@ -44,7 +44,7 @@
*************************************/
-void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs )
+void SwEditShell::ResetAttr( const std::set<sal_uInt16> &attrs )
{
SET_CURR_SHELL( this );
StartAllAction();
@@ -56,7 +56,7 @@ void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs )
FOREACHPAM_START(this)
- GetDoc()->ResetAttrs(*PCURCRSR, sal_True, pAttrs);
+ GetDoc()->ResetAttrs(*PCURCRSR, sal_True, attrs);
FOREACHPAM_END()
if( bUndoGroup )
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index 4b4b229351..c16a165bf2 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -67,7 +67,7 @@ SwTxtFmtColl& SwEditShell::GetTxtFmtColl( sal_uInt16 nFmtColl) const
return *((*(GetDoc()->GetTxtFmtColls()))[nFmtColl]);
}
-// --> OD 2007-11-06 #i62675#
+// #i62675#
void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt,
bool bResetListAttrs )
{
@@ -89,7 +89,6 @@ void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt,
GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_SETFMTCOLL, &aRewriter);
EndAllAction();
}
-// <--
SwTxtFmtColl* SwEditShell::MakeTxtFmtColl(const String& rFmtCollName,
@@ -111,9 +110,8 @@ void SwEditShell::FillByEx(SwTxtFmtColl* pColl, sal_Bool bReset)
{
if( bReset )
{
- // --> OD 2007-01-25 #i73790# - method renamed
+ // #i73790# - method renamed
pColl->ResetAllFmtAttr();
- // <--
}
SwPaM * pCrsr = GetCrsr();
diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx
index 9b9c3fd0b9..9c742fa688 100644
--- a/sw/source/core/edit/edfmt.cxx
+++ b/sw/source/core/edit/edfmt.cxx
@@ -79,9 +79,8 @@ void SwEditShell::FillByEx(SwCharFmt* pCharFmt, sal_Bool bReset)
{
if ( bReset )
{
- // --> OD 2007-01-25 #i73790# - method renamed
+ // #i73790# - method renamed
pCharFmt->ResetAllFmtAttr();
- // <--
}
SwPaM* pPam = GetCrsr();
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 21af3dfe7e..70133b6124 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -295,10 +295,8 @@ const Graphic* SwEditShell::GetGraphic( sal_Bool bWait ) const
#endif
}
}
- // <--
}
return pGrf;
- // <--
}
sal_Bool SwEditShell::IsGrfSwapOut( sal_Bool bOnlyLinked ) const
@@ -668,7 +666,7 @@ void *SwEditShell::GetIMapInventor() const
return (void*)GetCrsr()->GetNode();
}
-// --> OD 2007-03-01 #i73788#
+// #i73788#
// remove default parameter, because method is always called this default value
Graphic SwEditShell::GetIMapGraphic() const
{
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index fece09bc4e..7045003287 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1305,9 +1305,9 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
sal_uInt32 nRedlinePortions = lcl_CountRedlines(rLastPortions);
if((rLastPortions.size() - nRedlinePortions) == rNewPortions.size())
{
- DBG_ASSERT( rNewPortions.size() > 0, "rNewPortions should not be empty here" );
- DBG_ASSERT( rLastPortions.size() > 0, "rLastPortions should not be empty here" );
- DBG_ASSERT( rLastPositions.size() > 0, "rLastPositions should not be empty here" );
+ OSL_ENSURE( !rNewPortions.empty(), "rNewPortions should not be empty here" );
+ OSL_ENSURE( !rLastPortions.empty(), "rLastPortions should not be empty here" );
+ OSL_ENSURE( !rLastPositions.empty(), "rLastPositions should not be empty here" );
//the simple case: the same number of elements on both sides
//each changed element has to be applied to the corresponding source element
@@ -1330,7 +1330,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
}
else
{
- DBG_ASSERT( 0, "ApplyChangedSentence: iterator positions broken" );
+ OSL_FAIL("ApplyChangedSentence: iterator positions broken" );
break;
}
}
@@ -1372,7 +1372,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions,
}
else
{
- DBG_ASSERT( rLastPositions.size() > 0, "rLastPositions should not be empty here" );
+ OSL_ENSURE( !rLastPositions.empty(), "rLastPositions should not be empty here" );
//select the complete sentence
SpellContentPositions::const_iterator aCurrentEndPosition = rLastPositions.end();
diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx
index 8540d4e8c0..7c88a4a945 100644
--- a/sw/source/core/edit/ednumber.cxx
+++ b/sw/source/core/edit/ednumber.cxx
@@ -263,10 +263,9 @@ sal_Bool SwEditShell::NumUpDown( sal_Bool bDown )
}
GetDoc()->SetModified();
- // --> FME 2005-09-19 #i54693# Update marked numbering levels
+ // #i54693# Update marked numbering levels
if ( IsInFrontOfLabel() )
UpdateMarkedListLevel();
- // <--
CallChgLnk();
@@ -299,7 +298,7 @@ sal_Bool SwEditShell::IsFirstOfNumRule(const SwPaM & rPaM) const
// <- #i23726#
// -> #i23725#
-// --> OD 2008-06-09 #i90078#
+// #i90078#
// Remove unused default parameter <nLevel> and <bRelative>.
// Adjust method name and parameter name
void SwEditShell::ChangeIndentOfAllListLevels( short nDiff )
@@ -311,9 +310,8 @@ void SwEditShell::ChangeIndentOfAllListLevels( short nDiff )
if (pCurNumRule)
{
SwNumRule aRule(*pCurNumRule);
- // --> OD 2008-06-09 #i90078#
+ // #i90078#
aRule.ChangeIndent( nDiff );
- // <--
// no start of new list
SetCurNumRule( aRule, false );
@@ -322,10 +320,9 @@ void SwEditShell::ChangeIndentOfAllListLevels( short nDiff )
EndAllAction();
}
-// --> OD 2008-06-09 #i90078#
+// #i90078#
// Adjust method name
void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos)
-// <--
{
StartAllAction();
@@ -336,7 +333,7 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos)
SwPaM aPaM(rPos);
SwTxtNode * pTxtNode = aPaM.GetNode()->GetTxtNode();
- // --> OD 2008-06-09 #i90078#
+ // #i90078#
SwNumRule aRule(*pCurNumRule);
@@ -349,13 +346,11 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos)
aRule.SetIndent( nIndent,
static_cast<sal_uInt16>(pTxtNode->GetActualListLevel()) );
}
- // <--
- // --> OD 2005-02-18 #i42921# - 3rd parameter = false in order to
+ // #i42921# - 3rd parameter = false in order to
// suppress setting of num rule at <aPaM>.
// do not apply any list
GetDoc()->SetNumRule( aPaM, aRule, false, String(), sal_False );
- // <--
}
EndAllAction();
@@ -464,12 +459,11 @@ sal_Bool SwEditShell::MoveNumParas( sal_Bool bUpperLower, sal_Bool bUpperLeft )
{
++nIdx;
}
- // --> OD 2005-11-14 #i57856#
+ // #i57856#
else
{
break;
}
- // <--
}
if( nStt == nIdx || !GetDoc()->GetNodes()[ nIdx ]->IsTxtNode() )
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index 04d2bdbab1..036b20e231 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -328,7 +328,7 @@ const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos)
// the current position
// const SwPosition* pCurrentPos = GetCrsr()->GetPoint();
- DBG_ASSERT( pCurrentPos != NULL, "Strange, we have no position!" );
+ OSL_ENSURE( pCurrentPos != NULL, "Strange, we have no position!" );
const SwNode& rCurrentNode = pCurrentPos->nNode.GetNode();
@@ -361,9 +361,9 @@ const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos)
// Now, pInnermostNode is NULL or the innermost section or table node.
if( (pInnermostNode != NULL) && !pInnermostNode->IsProtect() )
{
- DBG_ASSERT( pInnermostNode->IsTableNode() ||
+ OSL_ENSURE( pInnermostNode->IsTableNode() ||
pInnermostNode->IsSectionNode(), "wrong node found" );
- DBG_ASSERT( ( pInnermostNode->GetIndex() <= rCurrentNode.GetIndex() )&&
+ OSL_ENSURE( ( pInnermostNode->GetIndex() <= rCurrentNode.GetIndex() )&&
( pInnermostNode->EndOfSectionNode()->GetIndex() >=
rCurrentNode.GetIndex() ), "wrong node found" );
@@ -403,7 +403,7 @@ const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos)
}
- DBG_ASSERT( ( pReturn == NULL ) || pReturn->IsStartNode() ||
+ OSL_ENSURE( ( pReturn == NULL ) || pReturn->IsStartNode() ||
pReturn->IsEndNode(),
"SpecialInsertNode failed" );
return pReturn;
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 92763af622..359d01098b 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -153,7 +153,7 @@ void SwAuthorityFieldType::RemoveField(long nHandle)
}
}
#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT(bRemoved, "Field unknown" );
+ OSL_ENSURE(bRemoved, "Field unknown" );
#endif
}
@@ -203,7 +203,7 @@ sal_Bool SwAuthorityFieldType::AddField(long nHandle)
break;
}
}
- DBG_ASSERT(bRet, "::AddField(long) failed");
+ OSL_ENSURE(bRet, "::AddField(long) failed");
return bRet;
}
@@ -547,7 +547,7 @@ const SwTOXSortKey* SwAuthorityFieldType::GetSortKey(sal_uInt16 nIdx) const
SwTOXSortKey* pRet = 0;
if(m_pSortKeyArr->Count() > nIdx)
pRet = (*m_pSortKeyArr)[nIdx];
- DBG_ASSERT(pRet, "Sort key not found");
+ OSL_ENSURE(pRet, "Sort key not found");
return pRet;
}
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index 50ef41f4a0..1bf5974184 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -62,8 +62,8 @@ public:
{}
virtual void Closed();
- virtual void DataChanged( const String& rMimeType,
- const uno::Any & rValue );
+ virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
+ const String& rMimeType, const ::com::sun::star::uno::Any & rValue );
virtual const SwNode* GetAnchor() const;
virtual sal_Bool IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, xub_StrLen nStt = 0,
@@ -71,7 +71,7 @@ public:
};
-void SwIntrnlRefLink::DataChanged( const String& rMimeType,
+::sfx2::SvBaseLink::UpdateResult SwIntrnlRefLink::DataChanged( const String& rMimeType,
const uno::Any & rValue )
{
switch( SotExchange::GetFormatIdFromMimeType( rMimeType ) )
@@ -105,7 +105,7 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
// weitere Formate ...
default:
- return;
+ return SUCCESS;
}
OSL_ENSURE( rFldType.GetDoc(), "Kein pDoc" );
@@ -155,6 +155,8 @@ void SwIntrnlRefLink::DataChanged( const String& rMimeType,
pSh->GetDoc()->SetModified();
}
}
+
+ return SUCCESS;
}
void SwIntrnlRefLink::Closed()
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index 082942f1a2..bc0dbe7f28 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -31,7 +31,6 @@
#include <textapi.hxx>
-#include <tools/pstm.hxx>
#include <hintids.hxx>
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/script/XTypeConverter.hpp>
@@ -618,13 +617,13 @@ String SwTemplNameFieldType::Expand(sal_uLong nFmt) const
String aRet;
SwDocShell *pDocShell(pDoc->GetDocShell());
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
if (pDocShell) {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+ OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
if( FF_UI_NAME == nFmt )
aRet = xDocProps->getTemplateName();
@@ -908,14 +907,14 @@ String SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat,
String aStr;
const LocaleDataWrapper *pAppLocalData = 0, *pLocalData = 0;
SwDocShell *pDocShell(GetDoc()->GetDocShell());
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
if (!pDocShell) { return aStr; }
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+ OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
sal_uInt16 nExtSub = nSub & 0xff00;
nSub &= 0xff; // ExtendedSubTypes nicht beachten
@@ -1113,7 +1112,7 @@ String SwDocInfoField::Expand() const
util::Date aDate;
util::DateTime aDateTime;
util::Duration aDuration;
- if( aAny >>= aDate)
+ if( aAny >>= aDate)
{
SvNumberFormatter* pFormatter = pDocShell->GetDoc()->GetNumberFormatter();
Date* pNullDate = pFormatter->GetNullDate();
@@ -2190,10 +2189,9 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
if( !pFrm ||
pFrm->IsInDocBody() ||
- // --> FME 2004-07-27 #i31868#
+ // #i31868#
// Check if pFrm is not yet connected to the layout.
!pFrm->FindPageFrm() )
- // <--
{
// einen sdbcx::Index fuers bestimmen vom TextNode anlegen
SwNodeIndex aIdx( rTxtNd );
diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 077b66d07e..ac02cf130d 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -609,7 +609,7 @@ sal_uInt16 SwSetExpFieldType::GetSeqFldList( SwSeqFldList& rList )
pNd->GetNodes().IsDocNodes() )
{
_SeqFldLstElem* pNew = new _SeqFldLstElem(
- pNd->GetExpandTxt( 0, (*pF->GetTxtFld()->GetStart()) + 1 ),
+ pNd->GetExpandTxt( 1, (*pF->GetTxtFld()->GetStart()) ),
((SwSetExpField*)pF->GetFld())->GetSeqNumber() );
rList.InsertSort( pNew );
}
@@ -870,7 +870,7 @@ void SwSetExpField::SetSubType(sal_uInt16 nSub)
((SwSetExpFieldType*)GetTyp())->SetType(nSub & 0xff);
nSubType = nSub & 0xff00;
- DBG_ASSERT( (nSub & 0xff) != 3, "SubType ist illegal!" );
+ OSL_ENSURE( (nSub & 0xff) != 3, "SubType ist illegal!" );
}
sal_uInt16 SwSetExpField::GetSubType() const
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index db7170e276..4e482dd895 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -83,7 +83,6 @@ sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFmt,
SvStringsDtor* SwFieldType::pFldNames = 0;
-DBG_NAME(SwFieldType)
sal_uInt16 aTypeTab[] = {
/* RES_DBFLD */ TYP_DBFLD,
@@ -152,18 +151,8 @@ SwFieldType::SwFieldType( sal_uInt16 nWhichId )
: SwModify(0),
nWhich( nWhichId )
{
- DBG_CTOR( SwFieldType, 0 );
}
-#if OSL_DEBUG_LEVEL > 1
-
-SwFieldType::~SwFieldType()
-{
- DBG_DTOR( SwFieldType, 0 );
-}
-
-#endif
-
const String& SwFieldType::GetName() const
{
return aEmptyStr;
diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx
index d41d345255..c00ba76220 100644
--- a/sw/source/core/fields/macrofld.cxx
+++ b/sw/source/core/fields/macrofld.cxx
@@ -105,7 +105,7 @@ String SwMacroField::GetLibName() const
return aMacro.Copy(0, nPos );
}
- DBG_ASSERT(0, "Kein Macroname vorhanden");
+ OSL_FAIL("Kein Macroname vorhanden");
return aEmptyStr;
}
@@ -128,7 +128,7 @@ String SwMacroField::GetMacroName() const
}
}
- DBG_ASSERT(0, "Kein Macroname vorhanden");
+ OSL_FAIL("Kein Macroname vorhanden");
return aEmptyStr;
}
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 3217a00490..2dffacb42e 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -30,7 +30,6 @@
#include "precompiled_sw.hxx"
-#define _SVSTDARR_USHORTSSORT
#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
#include <com/sun/star/text/ReferenceFieldPart.hpp>
@@ -71,6 +70,11 @@
#include <SwNodeNum.hxx>
#include <switerator.hxx>
+#include <set>
+#include <map>
+
+#include <sfx2/childwin.hxx>
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::lang;
@@ -239,7 +243,7 @@ void SwGetRefField::SetSubType( sal_uInt16 n )
nSubType = n;
}
-// --> OD 2007-11-09 #i81002#
+// #i81002#
bool SwGetRefField::IsRefToHeadingCrossRefBookmark() const
{
return GetSubType() == REF_BOOKMARK &&
@@ -258,8 +262,7 @@ const SwTxtNode* SwGetRefField::GetReferencedTxtNode() const
sal_uInt16 nDummy = USHRT_MAX;
return SwGetRefFieldType::FindAnchor( pDoc, sSetRefName, nSubType, nSeqNo, &nDummy );
}
-// <--
-// --> OD 2008-01-09 #i85090#
+// #i85090#
String SwGetRefField::GetExpandedTxtOfReferencedTxtNode() const
{
const SwTxtNode* pReferencedTxtNode( GetReferencedTxtNode() );
@@ -282,7 +285,7 @@ String SwGetRefField::GetFieldName() const
return aStr;
}
-// --> OD 2007-09-07 #i81002# - parameter <pFldTxtAttr> added
+// #i81002# - parameter <pFldTxtAttr> added
void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
{
sTxt.Erase();
@@ -428,7 +431,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
case REF_UPDOWN:
{
- // --> OD 2007-09-07 #i81002#
+ // #i81002#
// simplified: use parameter <pFldTxtAttr>
if( !pFldTxtAttr || !pFldTxtAttr->GetpTxtNode() )
break;
@@ -453,7 +456,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
: aLocaleData.getBelowWord();
}
break;
- // --> OD 2007-08-24 #i81002#
+ // #i81002#
case REF_NUMBER:
case REF_NUMBER_NO_CONTEXT:
case REF_NUMBER_FULL_CONTEXT:
@@ -464,13 +467,12 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
}
}
break;
- // <--
default:
OSL_FAIL("<SwGetRefField::UpdateField(..)> - unknown format type");
}
}
-// --> OD 2007-09-06 #i81002#
+// #i81002#
String SwGetRefField::MakeRefNumStr( const SwTxtNode& rTxtNodeOfField,
const SwTxtNode& rTxtNodeOfReferencedItem,
const sal_uInt32 nRefNumFormat ) const
@@ -544,7 +546,6 @@ String SwGetRefField::MakeRefNumStr( const SwTxtNode& rTxtNodeOfField,
return String();
}
-// <--
SwField* SwGetRefField::Copy() const
{
@@ -594,11 +595,10 @@ bool SwGetRefField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
case REF_ONLYNUMBER : nPart = ReferenceFieldPart::CATEGORY_AND_NUMBER ; break;
case REF_ONLYCAPTION: nPart = ReferenceFieldPart::ONLY_CAPTION ; break;
case REF_ONLYSEQNO : nPart = ReferenceFieldPart::ONLY_SEQUENCE_NUMBER; break;
- // --> OD 2007-09-06 #i81002#
+ // #i81002#
case REF_NUMBER: nPart = ReferenceFieldPart::NUMBER; break;
case REF_NUMBER_NO_CONTEXT: nPart = ReferenceFieldPart::NUMBER_NO_CONTEXT; break;
case REF_NUMBER_FULL_CONTEXT: nPart = ReferenceFieldPart::NUMBER_FULL_CONTEXT; break;
- // <--
}
rAny <<= nPart;
}
@@ -668,11 +668,10 @@ bool SwGetRefField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
case ReferenceFieldPart::CATEGORY_AND_NUMBER: nPart = REF_ONLYNUMBER; break;
case ReferenceFieldPart::ONLY_CAPTION: nPart = REF_ONLYCAPTION; break;
case ReferenceFieldPart::ONLY_SEQUENCE_NUMBER : nPart = REF_ONLYSEQNO; break;
- // --> OD 2007-09-06 #i81002#
+ // #i81002#
case ReferenceFieldPart::NUMBER: nPart = REF_NUMBER; break;
case ReferenceFieldPart::NUMBER_NO_CONTEXT: nPart = REF_NUMBER_NO_CONTEXT; break;
case ReferenceFieldPart::NUMBER_FULL_CONTEXT: nPart = REF_NUMBER_FULL_CONTEXT; break;
- // <--
default: return false;
}
SetFormat(nPart);
@@ -787,9 +786,8 @@ void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew
*pTFld->GetStart() ) );
}
- // --> OD 2007-09-06 #i81002#
+ // #i81002#
pGRef->UpdateField( pFld->GetTxtFld() );
- // <--
}
}
// weiter an die Text-Felder, diese "Expandieren" den Text
@@ -857,14 +855,13 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
if(!pBkmk->IsExpanded())
{
*pEnd = *pStt;
- // --> OD 2007-10-18 #i81002#
+ // #i81002#
if(dynamic_cast< ::sw::mark::CrossRefBookmark const *>(pBkmk))
{
OSL_ENSURE( pTxtNd,
"<SwGetRefFieldType::FindAnchor(..)> - node marked by cross-reference bookmark isn't a text node --> crash" );
*pEnd = pTxtNd->Len();
}
- // <--
}
else if(pBkmk->GetOtherMarkPos().nNode == pBkmk->GetMarkPos().nNode)
*pEnd = pBkmk->GetMarkEnd().nContent.GetIndex();
@@ -908,87 +905,127 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const String& rRefMark,
struct _RefIdsMap
{
+private:
String aName;
- SvUShortsSort aIds, aDstIds, aIdsMap;
- SvUShorts aMap;
+ std::set<sal_uInt16> aIds;
+ std::set<sal_uInt16> aDstIds;
+ std::map<sal_uInt16, sal_uInt16> sequencedIds; /// ID numbers sorted by sequence number.
sal_Bool bInit;
- _RefIdsMap( const String& rName )
- : aName( rName ), aIds( 16, 16 ), aIdsMap( 16, 16 ), aMap( 16, 16 ),
- bInit( sal_False )
- {}
+ void Init(SwDoc& rDoc, SwDoc& rDestDoc, sal_Bool bField );
+ void GetNoteIdsFromDoc( SwDoc& rDoc, std::set<sal_uInt16> &rIds );
+ void GetFieldIdsFromDoc( SwDoc& rDoc, std::set<sal_uInt16> &rIds );
+ void AddId( sal_uInt16 id, sal_uInt16 seqNum );
+ sal_uInt16 GetFirstUnusedId( std::set<sal_uInt16> &rIds );
+
+public:
+ _RefIdsMap( const String& rName ) : aName( rName ), bInit( sal_False ) {}
- void Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
- sal_Bool bField = sal_True );
+ void Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld, sal_Bool bField );
- sal_Bool IsInit() const { return bInit; }
+ String GetName() { return aName; }
};
SV_DECL_PTRARR_DEL( _RefIdsMaps, _RefIdsMap*, 5, 5 )
SV_IMPL_PTRARR( _RefIdsMaps, _RefIdsMap* )
-void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
- sal_Bool bField )
+/// Get a sorted list of the field IDs from a document.
+/// @param[in] rDoc The document to search.
+/// @param[in,out] rIds The list of IDs found in the document.
+void _RefIdsMap::GetFieldIdsFromDoc( SwDoc& rDoc, std::set<sal_uInt16> &rIds)
{
+ const SwTxtNode* pNd;
+ SwFieldType* pType;
- if( !bInit )
+ if( 0 != ( pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
{
- if( bField )
- {
- const SwTxtNode* pNd;
- SwFieldType* pType;
- if( 0 != ( pType = rDestDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
- {
- SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
- for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
- if( pF->GetTxtFld() &&
- 0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
- pNd->GetNodes().IsDocNodes() )
- aIds.Insert( ((SwSetExpField*)pF->GetFld())->GetSeqNumber() );
- }
- if( 0 != ( pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false ) ))
- {
- SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
- for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
- if( pF->GetTxtFld() &&
- 0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
- pNd->GetNodes().IsDocNodes() )
- aDstIds.Insert( ((SwSetExpField*)pF->GetFld())->GetSeqNumber() );
- }
- }
- else
- {
- sal_uInt16 n;
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() )
+ if( pF->GetTxtFld() &&
+ 0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) &&
+ pNd->GetNodes().IsDocNodes() )
+ rIds.insert( ((SwSetExpField*)pF->GetFld())->GetSeqNumber() );
+ }
+}
+
+/// Get a sorted list of the footnote/endnote IDs from a document.
+/// @param[in] rDoc The document to search.
+/// @param[in,out] rIds The list of IDs found in the document.
+void _RefIdsMap::GetNoteIdsFromDoc( SwDoc& rDoc, std::set<sal_uInt16> &rIds)
+{
+ for( sal_uInt16 n = rDoc.GetFtnIdxs().Count(); n; )
+ rIds.insert( rDoc.GetFtnIdxs()[ --n ]->GetSeqRefNo() );
+}
- for( n = rDestDoc.GetFtnIdxs().Count(); n; )
- aIds.Insert( rDestDoc.GetFtnIdxs()[ --n ]->GetSeqRefNo() );
- for( n = rDoc.GetFtnIdxs().Count(); n; )
- aDstIds.Insert( rDoc.GetFtnIdxs()[ --n ]->GetSeqRefNo() );
+/// Initialise the aIds and aDestIds collections from the source documents.
+/// @param[in] rDoc The source document.
+/// @param[in] rDestDoc The destination document.
+/// @param[in] bField True if we're interested in all fields, false for footnotes.
+void _RefIdsMap::Init( SwDoc& rDoc, SwDoc& rDestDoc, sal_Bool bField )
+{
+ if( bInit )
+ return;
+
+ if( bField )
+ {
+ GetFieldIdsFromDoc( rDestDoc, aIds );
+ GetFieldIdsFromDoc( rDoc, aDstIds );
+ }
+ else
+ {
+ GetNoteIdsFromDoc( rDestDoc, aIds );
+ GetNoteIdsFromDoc( rDoc, aDstIds );
+ }
+ bInit = sal_True;
+}
+
+/// Get the lowest unused ID in the passed set.
+/// @param[in] rIds The set of used ID numbers.
+/// @returns The lowest unused ID.
+sal_uInt16 _RefIdsMap::GetFirstUnusedId( std::set<sal_uInt16> &rIds )
+{
+ sal_uInt16 num(0);
+ std::set<sal_uInt16>::iterator it;
+
+ for( it = rIds.begin(); it != rIds.end(); ++it )
+ {
+ if( num != *it )
+ {
+ return num;
}
- bInit = sal_True;
+ ++num;
}
+ return num;
+}
+
+/// Add a new ID and sequence number to the "occupied" collection.
+/// @param[in] id The ID number.
+/// @param[in] seqNum The sequence number.
+void _RefIdsMap::AddId( sal_uInt16 id, sal_uInt16 seqNum )
+{
+ aIds.insert( id );
+ sequencedIds[ seqNum ] = id;
+}
+
+void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
+ sal_Bool bField )
+{
+ Init( rDoc, rDestDoc, bField);
// dann teste mal, ob die Nummer schon vergeben ist
// oder ob eine neue bestimmt werden muss.
- sal_uInt16 nPos, nSeqNo = rFld.GetSeqNo();
- if( aIds.Seek_Entry( nSeqNo ) && aDstIds.Seek_Entry( nSeqNo ))
+ sal_uInt16 nSeqNo = rFld.GetSeqNo();
+ if( aIds.count( nSeqNo ) && aDstIds.count( nSeqNo ))
{
- // ist schon vergeben, also muss eine neue
- // erzeugt werden.
- if( aIdsMap.Seek_Entry( nSeqNo, &nPos ))
- rFld.SetSeqNo( aMap[ nPos ] );
+ // Number already taken, so need a new one.
+ if( sequencedIds.count(nSeqNo) )
+ rFld.SetSeqNo( sequencedIds[nSeqNo] );
else
{
- sal_uInt16 n;
-
- for( n = 0; n < aIds.Count(); ++n )
- if( n != aIds[ n ] )
- break;
+ sal_uInt16 n = GetFirstUnusedId( aIds );
// die neue SeqNo eintragen, damit die "belegt" ist
- aIds.Insert( n );
- aIdsMap.Insert( nSeqNo, nPos );
- aMap.Insert( n, nPos );
+ AddId( n, nSeqNo );
rFld.SetSeqNo( n );
// und noch die Felder oder Fuss-/EndNote auf die neue
@@ -1019,9 +1056,7 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld,
}
else
{
- aIds.Insert( nSeqNo );
- aIdsMap.Insert( nSeqNo, nPos );
- aMap.Insert( nSeqNo, nPos );
+ AddId( nSeqNo, nSeqNo );
}
}
@@ -1047,7 +1082,7 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc )
{
_RefIdsMap* pMap = 0;
for( sal_uInt16 n = aFldMap.Count(); n; )
- if( aFldMap[ --n ]->aName == rRefFld.GetSetRefName() )
+ if( aFldMap[ --n ]->GetName() == rRefFld.GetSetRefName() )
{
pMap = aFldMap[ n ];
break;
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 8ee2d1796f..42e9e5ee19 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -413,13 +413,12 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
// direct positioning
pFmt->SetFmtAttr( SwFmtHoriOrient( aPos.X(), text::HoriOrientation::NONE, text::RelOrientation::FRAME ) );
pFmt->SetFmtAttr( SwFmtVertOrient( aPos.Y(), text::VertOrientation::NONE, text::RelOrientation::FRAME ) );
- // --> OD 2005-04-15 #i47455# - notify draw frame format
+ // #i47455# - notify draw frame format
// that position attributes are already set.
if ( pFmt->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(pFmt)->PosAttrSet();
}
- // <--
}
if( bSelectInsert )
pDestDrwView->MarkObj( pNew, pDestPgView );
@@ -1006,24 +1005,22 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
else
{
OSL_ENSURE( RES_DRAWFRMFMT == pNew->Which(), "Neues Format.");
- // --> OD 2005-09-01 #i52780# - drawing object has
+ // #i52780# - drawing object has
// to be made visible on paste.
{
SwDrawContact* pContact =
static_cast<SwDrawContact*>(pNew->FindContactObj());
pContact->MoveObjToVisibleLayer( pContact->GetMaster() );
}
- // <--
SdrObject *pObj = pNew->FindSdrObject();
SwDrawView *pDV = Imp()->GetDrawView();
pDV->MarkObj( pObj, pDV->GetSdrPageView() );
- // --> OD 2005-04-15 #i47455# - notify draw frame format
+ // #i47455# - notify draw frame format
// that position attributes are already set.
if ( pNew->ISA(SwDrawFrmFmt) )
{
static_cast<SwDrawFrmFmt*>(pNew)->PosAttrSet();
}
- // <--
}
}
}
@@ -1295,7 +1292,7 @@ sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const
return bConvert;
}
-// --> OD 2005-08-03 #i50824#
+// #i50824#
// replace method <lcl_RemoveOleObjsFromSdrModel> by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs>
void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SdrModel* _pModel )
{
@@ -1476,7 +1473,7 @@ void SwFEShell::Paste( SvStream& rStrm, sal_uInt16 nAction, const Point* pPt )
if( !bDesignMode )
pView->SetDesignMode( sal_True );
- // --> OD 2005-08-03 #i50824#
+ // #i50824#
// method <lcl_RemoveOleObjsFromSdrModel> replaced by <lcl_ConvertSdrOle2ObjsToSdrGrafObjs>
lcl_ConvertSdrOle2ObjsToSdrGrafObjs( pModel );
pView->Paste( *pModel, aPos );
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index f8ec5c107f..aec9ebb02a 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -412,7 +412,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
return aRet;
SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- // --> OD 2004-07-16 #i28701#
+ // #i28701#
SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
RndStdIds nAnchorId = rFmt.GetAnchor().GetAnchorId();
@@ -567,15 +567,13 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
rFmt.GetDoc()->SetAttr( aAnch, rFmt );
delete pHandleAnchorNodeChg;
}
- // <--
- // --> OD 2004-06-24 #i28701# - no call of method
+ // #i28701# - no call of method
// <CheckCharRectAndTopOfLine()> for to-character anchored
// Writer fly frame needed. This method call can cause a
// format of the anchor frame, which is no longer intended.
// Instead clear the anchor character rectangle and
// the top of line values for all to-character anchored objects.
pAnchoredObj->ClearCharRectAndTopOfLine();
- // <--
EndAllAction();
}
}
@@ -625,7 +623,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali
// Position gesetzt.
ParkCrsr( SwNodeIndex( *aBoxes[0]->GetSttNd() ));
- // --> FME 2005-12-01 #i127787# pCurCrsr will be deleted in ParkCrsr,
+ // #i127787# pCurCrsr will be deleted in ParkCrsr,
// we better get the current pCurCrsr instead of working with the
// deleted one:
pCrsr = GetCrsr();
@@ -895,10 +893,9 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj,
SfxItemSet rFlyAttrSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange );
rFlyAttrSet.Put( SwFmtAnchor( FLY_AT_PARA ));
- // --> OD 2009-12-29 #i89920#
+ // #i89920#
rFlyAttrSet.Put( SwFmtSurround( SURROUND_THROUGHT ) );
rDrawObj.SetLayer( getIDocumentDrawModelAccess()->GetHeavenId() );
- // <--
// find anchor position
SwPaM aPam( pDoc->GetNodes() );
@@ -1137,7 +1134,7 @@ sal_Bool SwFEShell::SetDrawingAttr( SfxItemSet& rSet )
if ( nNew != pFmt->GetAnchor().GetAnchorId() )
{
ChgAnchor( nNew );
- // --> OD 2004-06-17 #i26791# - clear anchor attribute in item set,
+ // #i26791# - clear anchor attribute in item set,
// because method <ChgAnchor(..)> takes care of it.
rSet.ClearItem( RES_ANCHOR );
}
@@ -1986,7 +1983,7 @@ void SwFEShell::GetConnectableFrmFmts(SwFrmFmt & rFmt,
::std::vector< const SwFrmFmt * >::const_iterator aIt;
- for (aIt = aTmpSpzArray.begin(); aIt != aTmpSpzArray.end(); aIt++)
+ for (aIt = aTmpSpzArray.begin(); aIt != aTmpSpzArray.end(); ++aIt)
{
String aString = (*aIt)->GetName();
@@ -2019,7 +2016,7 @@ void SwFEShell::GetConnectableFrmFmts(SwFrmFmt & rFmt,
EndAction();
}
-// --> OD 2009-07-13 #i73249#
+// #i73249#
const String SwFEShell::GetObjTitle() const
{
String aTitle;
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 87bc266c03..9166661547 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -133,7 +133,6 @@ extern sal_Bool bNoInterrupt; // in swapp.cxx
// --> assure consistent cursor
pSh->KillPams();
pSh->ClearMark();
- // <--
pSh->SetCrsr( pSh->Imp()->GetDrawView()->GetAllMarkedRect().TopLeft(), sal_True);
}
}
@@ -306,7 +305,7 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
if( pOld )
{
SwFrm* pNew = pOld;
- // --> OD 2004-07-16 #i28701#
+ // #i28701#
SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
SwFmtAnchor aAnch( rFmt.GetAnchor() );
@@ -515,8 +514,7 @@ sal_Bool SwFEShell::MoveAnchor( sal_uInt16 nDir )
rFmt.GetDoc()->SetAttr( aAnch, rFmt );
delete pHandleAnchorNodeChg;
}
- // <--
- // --> OD 2004-06-24 #i28701# - no call of method
+ // #i28701# - no call of method
// <CheckCharRectAndTopOfLine()> for to-character anchored
// Writer fly frame needed. This method call can cause a
// format of the anchor frame, which is no longer intended.
@@ -749,7 +747,6 @@ const SwFrmFmt* SwFEShell::SelFlyGrabCrsr()
// --> assure, that the cursor is consistent.
KillPams();
ClearMark();
- // <--
SwPaM *pCrsr = GetCrsr();
pCrsr->GetPoint()->nNode = *pCNode;
@@ -814,9 +811,8 @@ void lcl_NotifyNeighbours( const SdrMarkList *pLst )
if( !pAnch )
continue;
pPage = pAnch->FindPageFrm();
- // --> OD 2006-08-15 #i68520# - naming changed
+ // #i68520# - naming changed
aRect = GetBoundRectOfAnchoredObj( pO );
- // <--
}
sal_uInt32 nCount = pPage->GetSortedObjs() ? pPage->GetSortedObjs()->Count() : 0;
@@ -959,7 +955,6 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
const bool bControlObj = ( pContact && pContact->GetMaster() )
? ::CheckControlLayer( pContact->GetMaster() )
: ::CheckControlLayer( pObj );
- // <--
if ( !bControlObj && pObj->GetLayer() != nLayerId )
{
pObj->SetLayer( nLayerId );
@@ -1142,7 +1137,7 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
if ( bRet && pObj )
{
const IDocumentDrawModelAccess* pIDDMA = getIDocumentDrawModelAccess();
- // --> OD 2009-12-30 #i89920#
+ // #i89920#
// Do not select object in background which is overlapping this text
// at the given position.
bool bObjInBackground( false );
@@ -1198,7 +1193,19 @@ sal_Bool SwFEShell::ShouldObjectBeSelected(const Point& rPt)
}
}
}
- // <--
+
+ // Don't select header / footer objects in body edition and vice-versa
+ SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
+ if ( !pContact->ObjAnchoredAtPage() )
+ {
+ const SwPosition& rPos = pContact->GetCntntAnchor();
+ bool bInHdrFtr = GetDoc()->IsInHeaderFooter( rPos.nNode );
+ if ( ( IsHeaderFooterEdit() && !bInHdrFtr ) ||
+ ( !IsHeaderFooterEdit() && bInHdrFtr ) )
+ {
+ bRet = sal_False;
+ }
+ }
if ( bRet )
{
@@ -1781,9 +1788,8 @@ sal_Bool SwFEShell::ImpEndCreate()
//Erzeugtes Object wegwerfen, so kann der Fly am elegentesten
//ueber vorhandene SS erzeugt werden.
GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(false); // see above
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
SdrPage *pPg = getIDocumentDrawModelAccess()->GetOrCreateDrawModel()->GetPage( 0 );
- // <--
if( !pPg )
{
SdrModel* pTmpSdrModel = getIDocumentDrawModelAccess()->GetDrawModel();
@@ -1853,18 +1859,15 @@ sal_Bool SwFEShell::ImpEndCreate()
SwFmtVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME );
aSet.Put( aVert );
SwDrawFrmFmt* pFmt = (SwDrawFrmFmt*)getIDocumentLayoutAccess()->MakeLayoutFmt( RND_DRAW_OBJECT, &aSet );
- // --> OD 2004-10-25 #i36010# - set layout direction of the position
+ // #i36010# - set layout direction of the position
pFmt->SetPositionLayoutDir(
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
- // <--
- // --> OD 2005-03-11 #i44344#, #i44681# - positioning attributes already set
+ // #i44344#, #i44681# - positioning attributes already set
pFmt->PosAttrSet();
- // <--
SwDrawContact *pContact = new SwDrawContact( pFmt, &rSdrObj );
- // --> OD 2004-11-22 #i35635#
+ // #i35635#
pContact->MoveObjToVisibleLayer( &rSdrObj );
- // <--
if( bCharBound )
{
OSL_ENSURE( aAnch.GetAnchorId() == FLY_AS_CHAR, "wrong AnchorType" );
@@ -2216,7 +2219,6 @@ sal_Bool SwFEShell::IsGroupSelected()
if ( pObj->IsGroupObject() &&
// --> #i38505# No ungroup allowed for 3d objects
!pObj->Is3DObj() &&
- // <--
FLY_AS_CHAR != ((SwDrawContact*)GetUserCall(pObj))->
GetFmt()->GetAnchor().GetAnchorId() )
{
@@ -2525,7 +2527,6 @@ sal_Bool SwFEShell::GetObjAttr( SfxItemSet &rSet ) const
else
rSet.Put( pContact->GetFmt()->GetAttrSet() );
}
- // <--
}
return sal_True;
}
@@ -2639,9 +2640,8 @@ void SwFEShell::CheckUnboundObjects()
SwDrawContact *pContact = new SwDrawContact(
(SwDrawFrmFmt*)pFmt, pObj );
- // --> OD 2004-11-22 #i35635#
+ // #i35635#
pContact->MoveObjToVisibleLayer( pObj );
- // <--
pContact->ConnectToLayout();
EndAllAction();
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index df558c0be4..5de8ee9985 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1608,7 +1608,7 @@ const SwCellFrm *lcl_FindFrm( const SwLayoutFrm *pLay, const Point &rPt,
if ( pFrm ) // Note: this condition should be the same like the while condition!!!
{
- // --> FME 2004-07-30 #i32329# Enhanced table selection
+ // #i32329# Enhanced table selection
// used for hotspot selection of tab/cols/rows
if ( !bMouseMoveRowCols )
{
@@ -1623,7 +1623,6 @@ const SwCellFrm *lcl_FindFrm( const SwLayoutFrm *pLay, const Point &rPt,
break;
}
}
- // <--
else
{
// used for mouse move of columns/rows
@@ -1679,9 +1678,8 @@ const SwFrm* SwFEShell::GetBox( const Point &rPt, bool* pbRow, bool* pbCol ) con
SwTwips nFuzzy = COLFUZZY;
if( pOutWin )
{
- // --> FME 2004-07-30 #i32329# Enhanced table selection
+ // #i32329# Enhanced table selection
SwTwips nSize = pbCol ? ENHANCED_TABLE_SELECTION_FUZZY : RULER_MOUSE_MARGINWIDTH;
- // <--
Size aTmp( nSize, nSize );
aTmp = pOutWin->PixelToLogic( aTmp );
nFuzzy = aTmp.Width();
@@ -1846,7 +1844,7 @@ Point lcl_ProjectOntoClosestTableFrm( const SwTabFrm& rTab, const Point& rPoint,
return aRet;
}
-// --> FME 2004-07-30 #i32329# Enhanced table selection
+// #i32329# Enhanced table selection
bool SwFEShell::SelTblRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag )
{
bool bRet = false;
@@ -1941,11 +1939,10 @@ bool SwFEShell::SelTblRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag
if ( bNewSelection )
{
- // --> FME 2004-10-20 #i35543# SelTblRowCol should remove any existing
+ // #i35543# SelTblRowCol should remove any existing
// table cursor:
if ( IsTableMode() )
TblCrsrToCursor();
- // <--
if ( pbRow[0] && pbCol[0] )
bRet = SwCrsrShell::SelTbl();
@@ -1964,7 +1961,6 @@ bool SwFEShell::SelTblRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag
return bRet;
}
-// <--
/*************************************************************************
@@ -2082,7 +2078,7 @@ sal_Bool SwFEShell::IsNumLabel( const Point &rPt, int nMaxOffset )
}
// <- #i23726#
-// --> OD 2005-02-21 #i42921#
+// #i42921#
bool SwFEShell::IsVerticalModeAtNdAndPos( const SwTxtNode& _rTxtNode,
const Point& _rDocPos ) const
{
@@ -2109,7 +2105,6 @@ bool SwFEShell::IsVerticalModeAtNdAndPos( const SwTxtNode& _rTxtNode,
return bRet;
}
-// <--
/*************************************************************************
|*
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index c7313f7ab4..282f7b6fe0 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -751,14 +751,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
Point aPos;
bool bVertic = false;
sal_Bool bRTL = sal_False;
- // --> OD 2009-09-01 #mongolianlayout#
bool bVerticalL2R = false;
- // <--
if ((FLY_AT_PAGE == _nAnchorId) || (FLY_AT_FLY == _nAnchorId)) // LAYER_IMPL
{
const SwFrm* pTmp = pFrm;
- // OD 06.11.2003 #i22305#
+ // #i22305#
if ((FLY_AT_PAGE == _nAnchorId) ||
((FLY_AT_FLY == _nAnchorId) && !_bFollowTextFlow))
{
@@ -778,14 +776,10 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
else
aPos = (pFrm->Frm().*fnRect->fnGetPos)();
- // --> OD 2009-09-01 #mongolianlayout#
if( bVert || bVertL2R )
- // <--
{
- // --> OD 2009-09-01 #mongolianlayout#
bVertic = bVert ? true : false;
bVerticalL2R = bVertL2R ? true : false;
- // <--
_bMirror = false; // no mirroring in vertical environment
switch ( _eHoriRelOrient )
{
@@ -834,9 +828,8 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
default:break;
}
}
- // --> OD 2009-09-01 #mongolianlayout#
+
if ( bVert && !bVertL2R )
- // <--
{
switch ( _eVertRelOrient )
{
@@ -848,7 +841,6 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
break;
}
}
- // --> OD 2009-09-01 #mongolianlayout#
else if ( bVertL2R )
{
switch ( _eVertRelOrient )
@@ -861,7 +853,6 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
break;
}
}
- // <--
else
{
switch ( _eVertRelOrient )
@@ -882,7 +873,6 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
break;
}
}
- // <--
if ( _opPercent )
*_opPercent = pFrm->Prt().SSize();
}
@@ -926,13 +916,10 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
// to page areas.
if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
{
- // --> OD 2009-09-01 #mongolianlayout#
if ( bVert && !bVertL2R )
- // <--
{
aPos.X() = aVertEnvironRect.Right();
}
- // --> OD 2009-09-01 #mongolianlayout#
else if ( bVertL2R )
{
aPos.X() = aVertEnvironRect.Left();
@@ -948,14 +935,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
OSL_ENSURE( rVertEnvironLayFrm.IsPageFrm(),
"<SwFEShell::CalcBoundRect(..)> - not following text flow, but vertical environment *not* page!" );
aVertEnvironRect = rVertEnvironLayFrm.Frm();
- // OD 19.09.2003 #i18732# - adjustment vertical 'virtual' anchor position
+ // #i18732# - adjustment vertical 'virtual' anchor position
// (<aPos.Y()> respectively <aPos.X()>), if object is vertical aligned
// to page areas.
if ( _eVertRelOrient == text::RelOrientation::PAGE_FRAME || _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
{
- // --> OD 2009-09-01 #mongolianlayout#
if ( bVert && !bVertL2R )
- // <--
{
aPos.X() = aVertEnvironRect.Right();
if ( _eVertRelOrient == text::RelOrientation::PAGE_PRINT_AREA )
@@ -963,7 +948,6 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
aPos.X() -= rVertEnvironLayFrm.GetRightMargin();
}
}
- // --> OD 2009-09-01 #mongolianlayout#
else if ( bVertL2R )
{
aPos.X() = aVertEnvironRect.Left();
@@ -972,7 +956,6 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
aPos.X() += rVertEnvironLayFrm.GetLeftMargin();
}
}
- // <--
else
{
aPos.Y() = aVertEnvironRect.Top();
@@ -993,7 +976,6 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
// #i22341# - adjust vertical 'virtual' anchor position
// (<aPos.Y()> respectively <aPos.X()>), if object is anchored to
// character and vertical aligned at character or top of line
- // --> OD 2005-12-29 #125800#
// <pFrm>, which is the anchor frame or the proposed anchor frame,
// doesn't have to be a text frame (e.g. edit a to-page anchored
// fly frame). Thus, assure this.
@@ -1032,19 +1014,17 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
pTxtFrm->GetTopOfLine( nTop, aDefaultCntntPos );
}
}
- // --> OD 2009-09-01 #mongolianlayout#
if ( bVert || bVertL2R )
{
aPos.X() = nTop;
}
- // <--
else
{
aPos.Y() = nTop;
}
}
- // --> OD 2004-10-05 #i26945# - adjust horizontal 'virtual' anchor
+ // #i26945# - adjust horizontal 'virtual' anchor
// position (<aPos.X()> respectively <aPos.Y()>), if object is
// anchored to character and horizontal aligned at character.
if ( pTxtFrm &&
@@ -1064,22 +1044,16 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
pTxtFrm->GetAutoPos( aChRect, aDefaultCntntPos );
}
nLeft = (aChRect.*fnRect->fnGetLeft)();
- // --> OD 2009-09-01 #mongolianlayout#
if ( bVert || bVertL2R )
{
aPos.Y() = nLeft;
}
- // <--
else
{
aPos.X() = nLeft;
}
}
- // <--
-
- // --> OD 2009-09-01 #mongolianlayout#
if ( bVert || bVertL2R )
- // <--
{
_orRect = SwRect( aVertEnvironRect.Left(),
aHoriEnvironRect.Top(),
@@ -1113,9 +1087,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
// bei zeichengebundenen lieber nur 90% der Hoehe ausnutzen
{
- // --> OD 2009-09-01 #mongolianlayout#
if( bVert || bVertL2R )
- // <--
_orRect.Width( (_orRect.Width()*9)/10 );
else
_orRect.Height( (_orRect.Height()*9)/10 );
@@ -1125,14 +1097,10 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
const SwTwips nBaseOfstForFly = ( pFrm->IsTxtFrm() && pFly ) ?
((SwTxtFrm*)pFrm)->GetBaseOfstForFly( !bWrapThrough ) :
0;
- // --> OD 2009-09-01 #mongolianlayout#
if( bVert || bVertL2R )
- // <--
{
- // --> OD 2009-09-01 #mongolianlayout#
bVertic = bVert ? true : false;
bVerticalL2R = bVertL2R ? true : false;
- // <--
_bMirror = false;
switch ( _eHoriRelOrient )
@@ -1257,10 +1225,8 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
{
if( bVertic && !bVerticalL2R )
_orRect.Pos( aPos.X() - _orRect.Width() - _orRect.Left(), _orRect.Top() - aPos.Y() );
- // --> OD 2009-09-01 #mongolianlayout#
else if( bVerticalL2R )
_orRect.Pos( _orRect.Left() - aPos.X(), _orRect.Top() - aPos.Y() );
- // <--
else if ( bRTL )
_orRect.Pos( - ( _orRect.Right() - aPos.X() ), _orRect.Top() - aPos.Y() );
else
@@ -1276,7 +1242,7 @@ Size SwFEShell::GetGraphicDefaultSize() const
SwFlyFrm *pFly = FindFlyFrm();
if ( pFly )
{
- // --> OD 2004-09-24 #i32951# - due to issue #i28701# no format of a
+ // #i32951# - due to issue #i28701# no format of a
// newly inserted Writer fly frame or its anchor frame is performed
// any more. Thus, it could be possible (e.g. on insert of a horizontal
// line) that the anchor frame isn't formatted and its printing area
@@ -1289,7 +1255,6 @@ Size SwFEShell::GetGraphicDefaultSize() const
{
aRet = pAnchorFrm->GetUpper()->Prt().SSize();
}
- // <--
SwRect aBound;
CalcBoundRect( aBound, pFly->GetFmt()->GetAnchor().GetAnchorId());
@@ -1301,8 +1266,6 @@ Size SwFEShell::GetGraphicDefaultSize() const
return aRet;
}
-// --> OD 2009-08-31 #mongolianlayou#
-// add output parameter <bVertL2R>
sal_Bool SwFEShell::IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRTL, sal_Bool& bVertL2R) const
{
sal_Bool bVert = sal_False;
@@ -1345,11 +1308,22 @@ sal_Bool SwFEShell::IsFrmVertical(const sal_Bool bEnvironment, sal_Bool& bRTL, s
return bVert;
}
-// <--
void SwFEShell::MoveObjectIfActive( svt::EmbeddedObjectRef&, const Point& )
{
// does not do anything, only avoids crash if the method is used for wrong shell
}
+void SwFEShell::ToggleHeaderFooterEdit()
+{
+ // Clear objects selection
+ if ( Imp()->GetDrawView()->AreObjectsMarked() )
+ {
+ Imp()->GetDrawView()->UnmarkAll();
+ ClearMark();
+ }
+
+ SwCrsrShell::ToggleHeaderFooterEdit();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 34fd69d10a..6dc14024af 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -471,7 +471,6 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
OSL_FAIL( "Current box has been deleted during GetTblSel()" );
break;
}
- // <--
i = 0;
rBoxes.Remove( i, rBoxes.Count() );
@@ -524,9 +523,8 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
sal_Bool bTblIsValid, bValidChartSel;
- // --> FME 2006-01-25 #i55421# Reduced value 10
+ // #i55421# Reduced value 10
int nLoopMax = 10; //JP 28.06.99: max 100 loops - Bug 67292
- // <--
sal_uInt16 i = 0;
do {
@@ -1777,7 +1775,6 @@ void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart,
// --> Made code robust. If pTab does not have a lower,
// we would crash here.
if ( !pLastCntnt ) return;
- // <--
while( !rpEnd->IsCellFrm() )
rpEnd = rpEnd->GetUpper();
@@ -1975,7 +1972,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
while ( pRow && !pRow->Frm().IsOver( aUnion ) )
pRow = (SwLayoutFrm*)pRow->GetNext();
- // --> FME 2004-07-26 #i31976#
+ // #i31976#
// A follow flow row may contain emtpy cells. These are not
// considered by FirstCell(). Therefore we have to find
// the first cell manually:
@@ -1990,7 +1987,6 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
}
OSL_ENSURE( !pTmpCell || pTmpCell->IsCellFrm(), "Lower of rowframe != cellframe?!" );
}
- // <--
const SwLayoutFrm* pFirst = pTmpCell ?
static_cast<const SwLayoutFrm*>(pTmpCell) :
@@ -2325,12 +2321,11 @@ void _FndBox::DelFrms( SwTable &rTable )
if ( pPrev )
{
pPrev->SetFollow( pFollow );
- // --> FME 2006-01-31 #i60340# Do not transfer the
+ // #i60340# Do not transfer the
// flag from pUp to pPrev. pUp may still have the
// flag set although there is not more follow flow
// line associated with pUp.
pPrev->SetFollowFlowLine( sal_False );
- // <--
}
else if ( pFollow )
::UnsetFollow( pFollow );
@@ -2462,11 +2457,10 @@ void _FndBox::MakeFrms( SwTable &rTable )
pSibling->GetTabLine() != pLine ||
!lcl_IsLineOfTblFrm( *pTable, *pSibling ) ||
pSibling->IsRepeatedHeadline() ||
- // --> FME 2005-08-24 #i53647# If !pLineBehind,
+ // #i53647# If !pLineBehind,
// IsInSplitTableRow() should be checked.
( pLineBehind && pSibling->IsInFollowFlowRow() ) ||
(!pLineBehind && pSibling->IsInSplitTableRow() ) ) )
- // <--
{
pSibling = aIter.Next();
}
@@ -2585,11 +2579,10 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
// only consider row frames that are not follow flow rows
// 2. case: pLineBefore != 0:
// only consider row frames that are not split table rows
- // --> FME 2004-11-23 #i37476# If !pLineBefore,
+ // #i37476# If !pLineBefore,
// check IsInFollowFlowRow instead of IsInSplitTableRow.
( ( !pLineBefore && pSibling->IsInFollowFlowRow() ) ||
( pLineBefore && pSibling->IsInSplitTableRow() ) ) ) )
- // <--
{
pSibling = aIter.Next();
}
diff --git a/sw/source/core/graphic/grfatr.cxx b/sw/source/core/graphic/grfatr.cxx
index 0a5310f7a5..df65a56733 100644
--- a/sw/source/core/graphic/grfatr.cxx
+++ b/sw/source/core/graphic/grfatr.cxx
@@ -295,9 +295,9 @@ SfxPoolItem* SwTransparencyGrf::Clone( SfxItemPool * ) const
bool SwTransparencyGrf::QueryValue( uno::Any& rVal,
sal_uInt8 ) const
{
- DBG_ASSERT(ISA(SfxByteItem),"Put/QueryValue should be removed!");
+ OSL_ENSURE(ISA(SfxByteItem),"Put/QueryValue should be removed!");
sal_Int16 nRet = GetValue();
- DBG_ASSERT( 0 <= nRet && nRet <= 100, "value out of range" );
+ OSL_ENSURE( 0 <= nRet && nRet <= 100, "value out of range" );
rVal <<= nRet;
return true;
}
@@ -306,7 +306,7 @@ bool SwTransparencyGrf::PutValue( const uno::Any& rVal,
sal_uInt8 )
{
//temporary conversion until this is a SfxInt16Item!
- DBG_ASSERT(ISA(SfxByteItem),"Put/QueryValue should be removed!");
+ OSL_ENSURE(ISA(SfxByteItem),"Put/QueryValue should be removed!");
sal_Int16 nVal = 0;
if(!(rVal >>= nVal) || nVal < -100 || nVal > 100)
return false;
@@ -317,7 +317,7 @@ bool SwTransparencyGrf::PutValue( const uno::Any& rVal,
nVal = ( ( nVal * 128 ) - (99/2) ) / 100;
nVal += 128;
}
- DBG_ASSERT( 0 <= nVal && nVal <= 100, "value out of range" );
+ OSL_ENSURE( 0 <= nVal && nVal <= 100, "value out of range" );
SetValue(static_cast<sal_uInt8>(nVal));
return true;
}
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 0a11a93b01..775c46e844 100644..100755
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -60,9 +60,8 @@
#include <tools/link.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/io/XSeekable.hpp>
-// --> OD 2007-03-28 #i73788#
+// #i73788#
#include <retrieveinputstreamconsumer.hxx>
-// <--
using namespace com::sun::star;
@@ -76,10 +75,9 @@ SwGrfNode::SwGrfNode(
SwGrfFmtColl *pGrfColl,
SwAttrSet* pAutoAttr ) :
SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
- // --> OD 2007-01-23 #i73788#
+ // #i73788#
mbLinkedInputStreamReady( false ),
mbIsStreamReadOnly( sal_False )
- // <--
{
aGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
bInSwapIn = bChgTwipSize = bChgTwipSizeFromPixel = bLoadLowResGrf =
@@ -93,10 +91,9 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
const GraphicObject& rGrfObj,
SwGrfFmtColl *pGrfColl, SwAttrSet* pAutoAttr ) :
SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
- // --> OD 2007-01-23 #i73788#
+ // #i73788#
mbLinkedInputStreamReady( false ),
mbIsStreamReadOnly( sal_False )
- // <--
{
aGrfObj = rGrfObj;
aGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
@@ -116,10 +113,9 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
SwGrfFmtColl *pGrfColl,
SwAttrSet* pAutoAttr ) :
SwNoTxtNode( rWhere, ND_GRFNODE, pGrfColl, pAutoAttr ),
- // --> OD 2007-01-23 #i73788#
+ // #i73788#
mbLinkedInputStreamReady( false ),
mbIsStreamReadOnly( sal_False )
- // <--
{
aGrfObj.SetSwapStreamHdl( LINK( this, SwGrfNode, SwapGraphic ) );
@@ -217,11 +213,10 @@ sal_Bool SwGrfNode::ReRead(
SwMsgPoolItem aMsgHint( RES_GRF_REREAD_AND_INCACHE );
ModifyNotification( &aMsgHint, &aMsgHint );
}
- // --> OD 2006-11-03 #i59688#
+ // #i59688#
// do not load linked graphic, if it isn't a new linked graphic.
// else {
else if ( bNewGrf )
- // <--
{
//TODO refLink->setInputStream(getInputStream());
((SwBaseLink*)&refLink)->SwapIn();
@@ -292,7 +287,6 @@ sal_Bool SwGrfNode::ReRead(
{
((SwBaseLink*)&refLink)->SwapIn();
}
- // <--
}
}
}
@@ -315,9 +309,8 @@ sal_Bool SwGrfNode::ReRead(
SwGrfNode::~SwGrfNode()
{
- // --> OD 2007-03-30 #i73788#
+ // #i73788#
mpThreadConsumer.reset();
- // <--
SwDoc* pDoc = GetDoc();
if( refLink.Is() )
@@ -328,7 +321,7 @@ SwGrfNode::~SwGrfNode()
}
else
{
- // --> OD 2005-01-19 #i40014# - A graphic node, which are in linked
+ // #i40014# - A graphic node, which are in linked
// section, whose link is another section is the document, doesn't
// have to remove the stream from the storage.
// Because it's hard to detect this case here and it would only fix
@@ -339,7 +332,6 @@ SwGrfNode::~SwGrfNode()
// inside one document have to be implemented.
// if( !pDoc->IsInDtor() && HasStreamName() )
// DelStreamName();
- // <--
}
//#39289# Die Frames muessen hier bereits geloescht weil der DTor der
//Frms die Grafik noch fuer StopAnimation braucht.
@@ -394,7 +386,7 @@ Size SwGrfNode::GetTwipSize() const
sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm )
{
Graphic aGraphic;
- if( !GraphicFilter::GetGraphicFilter()->ImportGraphic( aGraphic, String(), rStrm ) )
+ if( !GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, String(), rStrm ) )
{
const String aUserData( aGrfObj.GetUserData() );
@@ -453,7 +445,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
else
{
- // --> OD 2005-05-04 #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
+ // #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
try
{
// #i53025# - needed correction of new method <_GetStreamForEmbedGrf(..)>
@@ -467,15 +459,12 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
nRet = 1;
delete pStrm;
}
- // <--
}
catch ( uno::Exception& )
{
- // --> OD 2005-04-25 #i48434#
+ // #i48434#
OSL_FAIL( "<SwGrfNode::SwapIn(..)> - unhandled exception!" );
- // <--
}
- // <--
}
if( 1 == nRet )
@@ -486,7 +475,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
}
else
nRet = 1;
- DBG_ASSERTWARNING( nRet, "Grafik kann nicht eingeswapt werden" );
+ OSL_ENSURE( nRet, "Grafik kann nicht eingeswapt werden" );
if( nRet )
{
@@ -564,7 +553,7 @@ sal_Bool SwGrfNode::SavePersistentData()
if( HasStreamName() && !SwapIn() )
return sal_False;
- // --> OD 2005-04-19 #i44367#
+ // #i44367#
// Do not delete graphic file in storage, because the graphic file could
// be referenced by other graphic nodes.
// Because it's hard to detect this case here and it would only fix
@@ -576,7 +565,6 @@ sal_Bool SwGrfNode::SavePersistentData()
// Important note: see also fix for #i40014#
// if( HasStreamName() )
// DelStreamName();
- // <--
// Und in TempFile rausswappen
return (sal_Bool) SwapOut();
@@ -744,9 +732,8 @@ void SwGrfNode::DelStreamName()
}
catch ( uno::Exception& )
{
- // --> OD 2005-04-25 #i48434#
+ // #i48434#
OSL_FAIL( "<SwGrfNode::DelStreamName()> - unhandled exception!" );
- // <--
}
}
@@ -812,7 +799,6 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf(
_aStrmName += aExtStr;
}
}
- // <--
// assure that graphic file exist in the storage.
if ( _refPics->hasByName( _aStrmName ) &&
@@ -831,7 +817,7 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf(
}
-// --> OD 2005-08-17 #i53025# - stream couldn't be in a 3.1 - 5.2 storage any more.
+// #i53025# - stream couldn't be in a 3.1 - 5.2 storage any more.
// Thus, removing corresponding code.
void SwGrfNode::_GetStreamStorageNames( String& rStrmName,
String& rStorName ) const
@@ -872,7 +858,6 @@ void SwGrfNode::_GetStreamStorageNames( String& rStrmName,
OSL_ENSURE( STRING_NOTFOUND == rStrmName.Search( '/' ),
"invalid graphic stream name" );
}
-// <--
SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
{
@@ -883,7 +868,7 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
SwBaseLink* pLink = (SwBaseLink*)(::sfx2::SvBaseLink*) refLink;
if( !pLink && HasStreamName() )
{
- // --> OD 2005-05-04 #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
+ // #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
try
{
// #i53025# - needed correction of new method <_GetStreamForEmbedGrf(..)>
@@ -893,18 +878,15 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
SvStream* pStrm = _GetStreamForEmbedGrf( refPics, aStrmName );
if ( pStrm )
{
- GraphicFilter::GetGraphicFilter()->ImportGraphic( aTmpGrf, String(), *pStrm );
+ GraphicFilter::GetGraphicFilter().ImportGraphic( aTmpGrf, String(), *pStrm );
delete pStrm;
}
- // <--
}
catch ( uno::Exception& )
{
- // --> OD 2005-04-25 #i48434#
+ // #i48434#
OSL_FAIL( "<SwGrfNode::MakeCopy(..)> - unhandled exception!" );
- // <--
}
- // <--
}
else
{
@@ -967,7 +949,7 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
if( HasStreamName() )
{
- // --> OD 2005-05-04 #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
+ // #i48434# - usage of new method <_GetStreamForEmbedGrf(..)>
try
{
// #i53025# - needed correction of new method <_GetStreamForEmbedGrf(..)>
@@ -988,15 +970,12 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
}
delete pStrm;
}
- // <--
}
catch ( uno::Exception& )
{
- // --> OD 2005-04-25 #i48434#
+ // #i48434#
OSL_FAIL( "<SwapGraphic> - unhandled exception!" );
- // <--
}
- // <--
}
}
@@ -1115,7 +1094,7 @@ sal_Bool SwGrfNode::IsSelected() const
return bRet;
}
-// --> OD 2006-12-22 #i73788#
+// #i73788#
boost::weak_ptr< SwAsyncRetrieveInputStreamThreadConsumer > SwGrfNode::GetThreadConsumer()
{
return mpThreadConsumer;
@@ -1164,24 +1143,25 @@ void SwGrfNode::ApplyInputStream(
void SwGrfNode::UpdateLinkWithInputStream()
{
- if ( IsLinkedFile() )
+ // --> OD #i85105#
+ // do not work on link, if a <SwapIn> has been triggered.
+ if ( !bInSwapIn && IsLinkedFile() )
+ // <--
{
GetLink()->setStreamToLoadFrom( mxInputStream, mbIsStreamReadOnly );
GetLink()->Update();
SwMsgPoolItem aMsgHint( RES_GRAPHIC_ARRIVED );
ModifyNotification( &aMsgHint, &aMsgHint );
- // --> OD 2008-06-18 #i88291#
+ // #i88291#
mxInputStream.clear();
GetLink()->clearStreamToLoadFrom();
- // <--
mbLinkedInputStreamReady = false;
mpThreadConsumer.reset();
}
}
-// <--
-// --> OD 2008-07-21 #i90395#
+// #i90395#
bool SwGrfNode::IsAsyncRetrieveInputStreamPossible() const
{
bool bRet = false;
@@ -1199,6 +1179,5 @@ bool SwGrfNode::IsAsyncRetrieveInputStreamPossible() const
return bRet;
}
-// <--
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/SwXMLBlockExport.hxx b/sw/source/core/inc/SwXMLBlockExport.hxx
index d1da8ec86d..7b61d696ec 100644
--- a/sw/source/core/inc/SwXMLBlockExport.hxx
+++ b/sw/source/core/inc/SwXMLBlockExport.hxx
@@ -38,7 +38,6 @@ class SwXMLBlockListExport : public SvXMLExport
private:
SwXMLTextBlocks &rBlockList;
public:
- // #110680#
SwXMLBlockListExport(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
SwXMLTextBlocks & rBlocks,
@@ -57,7 +56,6 @@ class SwXMLTextBlockExport : public SvXMLExport
private:
SwXMLTextBlocks &rBlockList;
public:
- // #110680#
SwXMLTextBlockExport(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
SwXMLTextBlocks & rBlocks,
diff --git a/sw/source/core/inc/SwXMLBlockImport.hxx b/sw/source/core/inc/SwXMLBlockImport.hxx
index 1cae68bb29..e81942347e 100644
--- a/sw/source/core/inc/SwXMLBlockImport.hxx
+++ b/sw/source/core/inc/SwXMLBlockImport.hxx
@@ -44,7 +44,6 @@ protected:
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList > & xAttrList );
public:
- // #110680#
SwXMLBlockListImport(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
SwXMLTextBlocks &rBlocks );
@@ -72,8 +71,6 @@ protected:
public:
sal_Bool bTextOnly;
String &m_rText;
-
- // #110680#
SwXMLTextBlockImport(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory,
SwXMLTextBlocks &rBlocks, String &rNewText, sal_Bool bNewTextOnly );
diff --git a/sw/source/core/inc/UndoAttribute.hxx b/sw/source/core/inc/UndoAttribute.hxx
index 849603e2b5..3566eb8687 100644
--- a/sw/source/core/inc/UndoAttribute.hxx
+++ b/sw/source/core/inc/UndoAttribute.hxx
@@ -35,16 +35,13 @@
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
#define _SVSTDARR_ULONGS
-#define _SVSTDARR_BOOLS
-#define _SVSTDARR_BYTES
-#define _SVSTDARR_USHORTSSORT
#include <svl/svstdarr.hxx>
#endif
#include <svl/itemset.hxx>
#include <swtypes.hxx>
#include <calbck.hxx>
-
+#include <set>
class SvxTabStopItem;
class SwFmt;
@@ -82,7 +79,7 @@ public:
class SwUndoResetAttr : public SwUndo, private SwUndRng
{
const ::std::auto_ptr<SwHistory> m_pHistory;
- SvUShortsSort m_Ids;
+ std::set<sal_uInt16> m_Ids;
const sal_uInt16 m_nFormatId; // Format-Id for Redo
public:
@@ -95,7 +92,7 @@ public:
virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual void RepeatImpl( ::sw::RepeatContext & );
- void SetAttrs( const SvUShortsSort& rArr );
+ void SetAttrs( const std::set<sal_uInt16> &rAttrs );
SwHistory& GetHistory() { return *m_pHistory; }
@@ -112,7 +109,7 @@ class SwUndoFmtAttr : public SwUndo
bool IsFmtInDoc( SwDoc* ); //is the attribute format still in the Doc?
void SaveFlyAnchor( bool bSaveDrawPt = false );
- // --> OD 2004-10-26 #i35443# - Add return value, type <bool>.
+ // #i35443# - Add return value, type <bool>.
// Return value indicates, if anchor attribute is restored.
// Notes: - If anchor attribute is restored, all other existing attributes
// are also restored.
@@ -121,10 +118,8 @@ class SwUndoFmtAttr : public SwUndo
// aren't restored.
// This situation occurs for undo of styles.
bool RestoreFlyAnchor(::sw::UndoRedoContext & rContext);
- // <--
// --> OD 2008-02-27 #refactorlists# - removed <rAffectedItemSet>
void Init();
- // <--
public:
// register at the Format and save old attributes
@@ -132,7 +127,6 @@ public:
SwUndoFmtAttr( const SfxItemSet& rOldSet,
SwFmt& rFmt,
bool bSaveDrawPt = true );
- // <--
SwUndoFmtAttr( const SfxPoolItem& rItem,
SwFmt& rFmt,
bool bSaveDrawPt = true );
@@ -168,7 +162,6 @@ class SwUndoFmtResetAttr : public SwUndo
// old attribute which has been reset - needed for undo.
::std::auto_ptr<SfxPoolItem> m_pOldItem;
};
-// <--
class SwUndoDontExpandFmt : public SwUndo
{
diff --git a/sw/source/core/inc/UndoBookmark.hxx b/sw/source/core/inc/UndoBookmark.hxx
index 87d774d0c4..6ae6111c19 100644
--- a/sw/source/core/inc/UndoBookmark.hxx
+++ b/sw/source/core/inc/UndoBookmark.hxx
@@ -53,7 +53,6 @@ protected:
public:
virtual ~SwUndoBookmark();
- // #111827#
/**
Returns the rewriter for this undo object.
diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
index 35abb46f7c..e8fda0516b 100644
--- a/sw/source/core/inc/UndoCore.hxx
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -122,31 +122,26 @@ class SwUndoFmtColl : public SwUndo, private SwUndRng
String aFmtName;
SwHistory* pHistory;
SwFmtColl* pFmtColl;
- // --> OD 2008-04-15 #refactorlists# - for correct <ReDo(..)> and <Repeat(..)>
+ // for correct <ReDo(..)> and <Repeat(..)>
// boolean, which indicates that the attributes are reseted at the nodes
// before the format has been applied.
const bool mbReset;
// boolean, which indicates that the list attributes had been reseted at
// the nodes before the format has been applied.
const bool mbResetListAttrs;
- // <--
void DoSetFmtColl(SwDoc & rDoc, SwPaM & rPaM);
public:
- // --> OD 2008-04-15 #refactorlists#
-// SwUndoFmtColl( const SwPaM&, SwFmtColl* );
SwUndoFmtColl( const SwPaM&, SwFmtColl*,
const bool bReset,
const bool bResetListAttrs );
- // <--
virtual ~SwUndoFmtColl();
virtual void UndoImpl( ::sw::UndoRedoContext & );
virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual void RepeatImpl( ::sw::RepeatContext & );
- // #111827#
/**
Returns the rewriter for this undo object.
@@ -208,9 +203,6 @@ public:
};
-//--------------------------------------------------------------------
-
-// -> #111827#
const int nUndoStringLength = 20;
/**
@@ -238,9 +230,6 @@ const int nUndoStringLength = 20;
*/
String
ShortenString(const String & rStr, xub_StrLen nLength, const String & rFillStr);
-// <- #111827#
-
-// #16487#
/**
Denotes special characters in a string.
diff --git a/sw/source/core/inc/UndoDelete.hxx b/sw/source/core/inc/UndoDelete.hxx
index 7bdfb79c63..20caa88727 100644
--- a/sw/source/core/inc/UndoDelete.hxx
+++ b/sw/source/core/inc/UndoDelete.hxx
@@ -80,8 +80,6 @@ public:
virtual void UndoImpl( ::sw::UndoRedoContext & );
virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual void RepeatImpl( ::sw::RepeatContext & );
-
- // #111827#
/**
Returns rewriter for this undo object.
diff --git a/sw/source/core/inc/UndoDraw.hxx b/sw/source/core/inc/UndoDraw.hxx
index 9d490901c0..a62b7845a7 100644
--- a/sw/source/core/inc/UndoDraw.hxx
+++ b/sw/source/core/inc/UndoDraw.hxx
@@ -41,8 +41,6 @@ class SdrObjGroup;
class SdrUndoAction;
class SwDrawFrmFmt;
-
-
//--------------------------------------------------------------------
// ----------- Undo for Draw Objects ---------------------------------
@@ -79,7 +77,6 @@ public:
void SetGroupFmt( SwDrawFrmFmt* );
};
-// --> OD 2006-11-01 #130889#
// Action "ungroup drawing object" is now splitted into three parts - see
// method <SwDoc::UnGroupSelection(..)>:
// - creation for <SwDrawFrmFmt> instances for the group members of the
@@ -108,7 +105,6 @@ public:
void AddObj( sal_uInt16 nPos, SwDrawFrmFmt* );
};
-// --> OD 2006-11-01 #130889#
class SwUndoDrawUnGroupConnectToLayout : public SwUndo
{
private:
@@ -125,8 +121,6 @@ class SwUndoDrawUnGroupConnectToLayout : public SwUndo
void AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt,
SdrObject* pDrawObject );
};
-// <--
-
class SwUndoDrawDelete : public SwUndo
{
diff --git a/sw/source/core/inc/UndoInsert.hxx b/sw/source/core/inc/UndoInsert.hxx
index a39ba329fd..5995af2972 100644
--- a/sw/source/core/inc/UndoInsert.hxx
+++ b/sw/source/core/inc/UndoInsert.hxx
@@ -74,7 +74,6 @@ public:
virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual void RepeatImpl( ::sw::RepeatContext & );
- // #111827#
/**
Returns rewriter for this undo object.
@@ -111,7 +110,6 @@ public:
virtual void UndoImpl( ::sw::UndoRedoContext & );
virtual void RedoImpl( ::sw::UndoRedoContext & );
- // #111827#
/**
Returns the rewriter of this undo object.
@@ -180,12 +178,11 @@ class SwUndoInsertLabel : public SwUndo
};
String sText;
- // --> PB 2005-01-06 #i39983# the separator is drawn with a character style
+ // #i39983# the separator is drawn with a character style
String sSeparator;
- // <--
String sNumberSeparator;
String sCharacterStyle;
- // OD 2004-04-15 #i26791# - re-store of drawing object position no longer needed
+ // #i26791# - re-store of drawing object position no longer needed
sal_uInt16 nFldId;
SwLabelType eType;
sal_uInt8 nLayerId; // fuer Zeichen-Objekte
@@ -195,9 +192,8 @@ class SwUndoInsertLabel : public SwUndo
public:
SwUndoInsertLabel( const SwLabelType eTyp, const String &rText,
- // --> PB 2005-01-06 #i39983# the separator is drawn with a character style
+ // #i39983# the separator is drawn with a character style
const String& rSeparator,
- // <--
const String& rNumberSeparator, //#i61007# order of captions
const sal_Bool bBefore, const sal_uInt16 nId,
const String& rCharacterStyle,
@@ -208,7 +204,6 @@ public:
virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual void RepeatImpl( ::sw::RepeatContext & );
- // #111827#
/**
Returns the rewriter of this undo object.
diff --git a/sw/source/core/inc/UndoOverwrite.hxx b/sw/source/core/inc/UndoOverwrite.hxx
index 151de9b344..0c56d523de 100644
--- a/sw/source/core/inc/UndoOverwrite.hxx
+++ b/sw/source/core/inc/UndoOverwrite.hxx
@@ -59,7 +59,6 @@ public:
virtual void RedoImpl( ::sw::UndoRedoContext & );
virtual void RepeatImpl( ::sw::RepeatContext & );
- // #111827#
/**
Returns the rewriter of this undo object.
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index d7705a398e..a661bc201a 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -30,16 +30,8 @@
#include <undobj.hxx>
-#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
-#define _SVSTDARR_BOOLS
-#define _SVSTDARR_BYTES
-#define _SVSTDARR_USHORTSSORT
-#include <svl/svstdarr.hxx>
-#endif
-
#include <vector>
+#include <set>
#include <swtypes.hxx>
#include <itabenum.hxx>
@@ -66,7 +58,7 @@ class SwUndoInsTbl : public SwUndo
String sTblNm;
SwInsertTableOptions aInsTblOpts;
SwDDEFieldType* pDDEFldType;
- SvUShorts* pColWidth;
+ std::vector<sal_uInt16> *pColWidth;
SwRedlineData* pRedlData;
SwTableAutoFmt* pAutoFmt;
sal_uLong nSttNode;
@@ -76,7 +68,7 @@ class SwUndoInsTbl : public SwUndo
public:
SwUndoInsTbl( const SwPosition&, sal_uInt16 nCols, sal_uInt16 nRows,
sal_uInt16 eAdjust, const SwInsertTableOptions& rInsTblOpts,
- const SwTableAutoFmt* pTAFmt, const SvUShorts* pColArr,
+ const SwTableAutoFmt* pTAFmt, const std::vector<sal_uInt16> *pColArr,
const String & rName);
virtual ~SwUndoInsTbl();
@@ -93,7 +85,7 @@ class SwUndoTxtToTbl : public SwUndo, public SwUndRng
{
String sTblNm;
SwInsertTableOptions aInsTblOpts;
- SvULongs* pDelBoxes;
+ std::vector<sal_uLong>* pDelBoxes;
SwTableAutoFmt* pAutoFmt;
SwHistory* pHistory;
sal_Unicode cTrenner;
@@ -182,13 +174,16 @@ public:
class SwUndoTblNdsChg : public SwUndo
{
_SaveTable* pSaveTbl;
- SvULongs aBoxes;
-
- union {
- SvULongs* pNewSttNds;
- SwUndoSaveSections* pDelSects;
- } Ptrs;
- std::vector<bool> aMvBoxes; // for SplitRow (split Nodes of Box)
+ std::set<sal_uLong> aBoxes;
+ struct _BoxMove
+ {
+ sal_uLong index; ///< Index of this box.
+ bool hasMoved; ///< Has this box been moved already.
+ _BoxMove(sal_uLong idx, bool moved=false) : index(idx), hasMoved(moved) {};
+ bool operator<(const _BoxMove other) const { return index < other.index; };
+ };
+ std::set<_BoxMove> *pNewSttNds;
+ SwUndoSaveSections *pDelSects;
long nMin, nMax; // for redo of delete column
sal_uLong nSttNode, nCurrBox;
sal_uInt16 nCount, nRelDiff, nAbsDiff, nSetColType;
@@ -212,7 +207,7 @@ public:
void SaveNewBoxes( const SwTableNode& rTblNd, const SwTableSortBoxes& rOld );
void SaveNewBoxes( const SwTableNode& rTblNd, const SwTableSortBoxes& rOld,
- const SwSelBoxes& rBoxes, const SvULongs& rNodeCnts );
+ const SwSelBoxes& rBoxes, const std::vector<sal_uLong> &rNodeCnts );
void SaveSection( SwStartNode* pSttNd );
void ReNewBoxes( const SwSelBoxes& rBoxes );
@@ -233,7 +228,8 @@ class SwUndoTblMerge : public SwUndo, private SwUndRng
{
sal_uLong nTblNode;
_SaveTable* pSaveTbl;
- SvULongs aBoxes, aNewSttNds;
+ std::set<sal_uLong> aBoxes;
+ std::vector<sal_uLong> aNewSttNds;
SwUndoMoves* pMoves;
SwHistory* pHistory;
@@ -250,7 +246,7 @@ public:
void SetSelBoxes( const SwSelBoxes& rBoxes );
void AddNewBox( sal_uLong nSttNdIdx )
- { aNewSttNds.Insert( nSttNdIdx, aNewSttNds.Count() ); }
+ { aNewSttNds.push_back( nSttNdIdx ); }
void SaveCollection( const SwTableBox& rBox );
diff --git a/sw/source/core/inc/ascharanchoredobjectposition.hxx b/sw/source/core/inc/ascharanchoredobjectposition.hxx
index dd84145f2f..16dde41148 100644
--- a/sw/source/core/inc/ascharanchoredobjectposition.hxx
+++ b/sw/source/core/inc/ascharanchoredobjectposition.hxx
@@ -81,8 +81,6 @@ namespace objectpositioning
/** determine the relative position to base line for object position
- @author OD
-
@param _ObjBoundHeight
height including corresponding spacing of the object, for which
the Y-position has to be calculated.
@@ -100,8 +98,6 @@ namespace objectpositioning
/** construtor; provided object to be positioned and needed data
for calculation of the object position
- OD 28.10.2003 #110978#
-
@param _rDrawObj
input parameter - object, that is be positioned.
@@ -121,8 +117,6 @@ namespace objectpositioning
@param _nLineAscent, _nLineDescent, _nLineAscentInclObjs,
_nLineDescentInclObjs - needed line values for the different
alignments.
-
- @author OD
*/
SwAsCharAnchoredObjectPosition( SdrObject& _rDrawObj,
const Point& _rProposedAnchorPos,
@@ -138,33 +132,23 @@ namespace objectpositioning
members <maAnchorPos>, <mnRelPos>, <maObjBoundRect> and
<mnLineAlignment> are calculated.
calculated position is set at the given object.
-
- @author OD
*/
virtual void CalcPosition();
- /** calculated anchored position for object position type AS_CHAR
+ // calculated anchored position for object position type AS_CHAR
- @author OD
- */
Point GetAnchorPos() const;
- /** calculated relative position to base line for object position type AS_CHAR
+ // calculated relative position to base line for object position type AS_CHAR
- @author OD
- */
SwTwips GetRelPosY() const;
- /** determined object rectangle including spacing for object position type AS_CHAR
+ // determined object rectangle including spacing for object position type AS_CHAR
- @author OD
- */
SwRect GetObjBoundRectInclSpacing() const;
- /** determined line alignment relative to line height
+ // determined line alignment relative to line height
- @author OD
- */
sal_uInt8 GetLineAlignment() const;
};
} // namespace objectpositioning
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index 66a2f6d366..c0a6ce64c9 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -53,9 +53,8 @@ public:
SwPrintData const*const pPrintData = NULL ) const;
virtual void CheckDirection( sal_Bool bVert );
- // --> OD 2010-02-17 #i103961#
+ // #i103961#
virtual void Cut();
- // <--
const SwTableBox *GetTabBox() const { return pTabBox; }
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index 898715b20c..147f1de7fd 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -44,14 +44,13 @@ class SwCntntFrm: public SwFrm, public SwFlowFrm
{
friend void MakeNxt( SwFrm *pFrm, SwFrm *pNxt ); //ruft MakePrtArea
- // --> OD 2007-11-26 #b6614158#
// parameter <bObjsInNewUpper>, indicating that objects are existing in
// remaining area of new upper
sal_Bool _WouldFit( SwTwips nSpace,
SwLayoutFrm *pNewUpper,
sal_Bool bTstMove,
const bool bObjsInNewUpper );
- // <--
+
virtual void MakeAll();
void _UpdateAttr( const SfxPoolItem*, const SfxPoolItem*, sal_uInt8 &,
@@ -84,6 +83,8 @@ public:
inline const SwCntntFrm *GetFollow() const;
inline SwCntntFrm *GetFollow();
+ inline const SwCntntFrm *GetPrecede() const;
+ inline SwCntntFrm *GetPrecede();
SwTxtFrm* FindMaster() const;
//Layoutabhaengiges Cursortravelling
@@ -147,6 +148,14 @@ inline SwCntntFrm *SwCntntFrm::GetFollow()
{
return (SwCntntFrm*)SwFlowFrm::GetFollow();
}
+inline const SwCntntFrm *SwCntntFrm::GetPrecede() const
+{
+ return (const SwCntntFrm*)SwFlowFrm::GetPrecede();
+}
+inline SwCntntFrm *SwCntntFrm::GetPrecede()
+{
+ return (SwCntntFrm*)SwFlowFrm::GetPrecede();
+}
#endif
diff --git a/sw/source/core/inc/dbgloop.hxx b/sw/source/core/inc/dbgloop.hxx
deleted file mode 100644
index c399c59927..0000000000
--- a/sw/source/core/inc/dbgloop.hxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _DBGLOOP_HXX
-#define _DBGLOOP_HXX
-
-#ifdef DBG_UTIL
-
-#include <tools/solar.h>
-
-class SvStream;
-
-#define DBG_MAX_STACK 20 // Verschachtelungstiefe
-#define DBG_MAX_LOOP 1000 // das Abbruchkriterium
-
-class DbgLoopStack
-{
- sal_uInt16 aCount[DBG_MAX_STACK];
- sal_uInt16 nPtr;
- const void *pDbg;
- void Reset();
-public:
- DbgLoopStack();
- void Push( const void *pThis );
- void Pop();
- void Print( SvStream &rOS ) const; //$ ostream
-};
-
-class DbgLoop
-{
- friend inline void PrintLoopStack( SvStream &rOS ); //$ ostream
- static DbgLoopStack aDbgLoopStack;
-public:
- inline DbgLoop( const void *pThis ) { aDbgLoopStack.Push( pThis ); }
- inline ~DbgLoop() { aDbgLoopStack.Pop(); }
-};
-
-inline void PrintLoopStack( SvStream &rOS ) //$ ostream
-{
- DbgLoop::aDbgLoopStack.Print( rOS );
-}
-
-#define DBG_LOOP DbgLoop aDbgLoop( (const void*)this );
-#define DBG_LOOP_RESET DbgLoop aDbgLoop( 0 );
-
-#else
-
-#define DBG_LOOP
-#define DBG_LOOP_RESET
-
-#endif
-
-#endif
diff --git a/sw/source/core/inc/doctxm.hxx b/sw/source/core/inc/doctxm.hxx
index 5665634198..86ed8d7059 100644
--- a/sw/source/core/inc/doctxm.hxx
+++ b/sw/source/core/inc/doctxm.hxx
@@ -74,7 +74,7 @@ class SwTOXBaseSection : public SwTOXBase, public SwSection
void InsertAlphaDelimitter( const SwTOXInternational& rIntl );
// Textrumpf generieren
- // OD 18.03.2003 #106329# - add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc>
+ // add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc>
void GenerateText( sal_uInt16 nArrayIdx,
sal_uInt16 nCount,
SvStringsDtor&,
@@ -100,7 +100,7 @@ public:
SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFmt & rFmt);
virtual ~SwTOXBaseSection();
- // OD 19.03.2003 #106329# - add parameter <_bNewTOX> in order to distinguish
+ // add parameter <_bNewTOX> in order to distinguish
// between the creation of a new table-of-content or an update of
// a table-of-content. Default value: false
void Update( const SfxItemSet* pAttr = 0,
diff --git a/sw/source/core/inc/dumpfilter.hxx b/sw/source/core/inc/dumpfilter.hxx
new file mode 100644
index 0000000000..b2472c4400
--- /dev/null
+++ b/sw/source/core/inc/dumpfilter.hxx
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Cedric Bosdonnat <cbosdonnat@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _LAYOUTDUMP_HXX
+#define _LAYOUTDUMP_HXX
+
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/implbase4.hxx>
+
+namespace sw {
+
+ /** Implementation of UNO export service to dump the layout of the
+ document as XML. This filter should be mostly be used for testing
+ purpose.
+ */
+ class LayoutDumpFilter : public cppu::WeakImplHelper4
+ <
+ com::sun::star::document::XFilter,
+ com::sun::star::document::XExporter,
+ com::sun::star::lang::XInitialization,
+ com::sun::star::lang::XServiceInfo
+ >
+ {
+ protected:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > m_xSrcDoc;
+
+
+ public:
+ LayoutDumpFilter();
+ virtual ~LayoutDumpFilter();
+
+ // XFilter
+ virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL cancel( )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // XExporter
+ virtual void SAL_CALL setSourceDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
+ throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+ throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
+ throw (::com::sun::star::uno::RuntimeException);
+
+ };
+} // Namespace sw
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/inc/dview.hxx b/sw/source/core/inc/dview.hxx
index d77a5ffda4..8ac0abfe2e 100644
--- a/sw/source/core/inc/dview.hxx
+++ b/sw/source/core/inc/dview.hxx
@@ -47,7 +47,6 @@ class SwDrawView : public FmFormView
/** determine maximal order number for a 'child' object of given 'parent' object
- OD 2004-08-20 #110810#
The maximal order number will be determined on the current object
order hierarchy. It's the order number of the 'child' object with the
highest order number. The calculation can be influenced by parameter
@@ -60,8 +59,6 @@ class SwDrawView : public FmFormView
@param <_pExclChildObj>
optional input parameter - 'child' object, which will not be considered
on the calculation of the maximal order number
-
- @author OD
*/
sal_uInt32 _GetMaxChildOrdNum( const SwFlyFrm& _rParentObj,
const SdrObject* _pExclChildObj = 0L ) const;
@@ -69,8 +66,6 @@ class SwDrawView : public FmFormView
/** method to move 'repeated' objects of the given moved object to the
according level
- OD 2004-08-23 #110810#
-
@param <_rMovedAnchoredObj>
input parameter - moved object, for which the 'repeated' ones have also
to be moved.
@@ -78,8 +73,6 @@ class SwDrawView : public FmFormView
@param <_rMovedChildsObjs>
input parameter - data collection of moved 'child' objects - the 'repeated'
ones of these 'childs' will also been moved.
-
- @author OD
*/
void _MoveRepeatedObjs( const SwAnchoredObject& _rMovedAnchoredObj,
const std::vector<SdrObject*>& _rMovedChildObjs ) const;
@@ -118,14 +111,12 @@ public:
virtual void DeleteMarked();
- //JP 06.10.98: 2. Versuch
inline void ValidateMarkList() { FlushComeBackTimer(); }
- // --> OD 2009-03-05 #i99665#
+ // #i99665#
sal_Bool IsAntiAliasing() const;
- // <--
- // OD 18.06.2003 #108784# - method to replace marked/selected <SwDrawVirtObj>
+ // method to replace marked/selected <SwDrawVirtObj>
// by its reference object for delete of selection and group selection
static void ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView );
};
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index da3e5ca130..b134d059aa 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -115,6 +115,7 @@ class SwFlowFrm
protected:
SwFlowFrm *pFollow;
+ SwFlowFrm *pPrecede;
sal_Bool bIsFollow :1; //Ist's ein Follow
sal_Bool bLockJoin :1; //Join (und damit deleten) verboten wenn sal_True!
@@ -171,7 +172,11 @@ public:
const SwFlowFrm *GetFollow() const { return pFollow; }
SwFlowFrm *GetFollow() { return pFollow; }
sal_Bool IsAnFollow( const SwFlowFrm *pFlow ) const;
- inline void SetFollow( SwFlowFrm *pNew ) { pFollow = pNew; }
+ inline void SetFollow( SwFlowFrm *pNew );
+
+ const SwFlowFrm *GetPrecede() const { return pPrecede; }
+ SwFlowFrm *GetPrecede() { return pPrecede; }
+
sal_Bool IsJoinLocked() const { return bLockJoin; }
sal_Bool IsAnyJoinLocked() const { return bLockJoin || HasLockedFollow(); }
@@ -249,6 +254,12 @@ inline sal_Bool SwFlowFrm::IsFwdMoveAllowed()
return rThis.GetIndPrev() != 0;
}
+inline void SwFlowFrm::SetFollow( SwFlowFrm *pNew )
+{
+ pFollow = pNew;
+ if ( pFollow != NULL )
+ pFollow->pPrecede = this;
+}
#endif
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 1cdd81714b..4c2fb0da68 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -282,6 +282,8 @@ public:
// 'SwFlyFrmFmt *' after calls to this function. The casting is now done in this function.)
virtual const SwFlyFrmFmt *GetFmt() const;
virtual SwFlyFrmFmt *GetFmt();
+
+ virtual void dumpAsXml( xmlTextWriterPtr writer ) { SwLayoutFrm::dumpAsXml( writer ); };
};
#endif
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index 37513dfaef..59aeda2d38 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -28,7 +28,7 @@
#ifndef _FLYFRMS_HXX
#define _FLYFRMS_HXX
#include "flyfrm.hxx"
-// --> #i28701#
+// #i28701#
class SwFlyAtCntFrm;
//Basisklasse fuer diejenigen Flys, die sich relativ frei Bewegen koennen -
@@ -37,15 +37,15 @@ class SwFlyFreeFrm : public SwFlyFrm
{
SwPageFrm *pPage; //Bei dieser Seite ist der Fly angemeldet.
- // --> #i34753# - flag for at-page anchored Writer fly frames
+ // #i34753# - flag for at-page anchored Writer fly frames
// to prevent a positioning - call of method <MakeObjPos()> -, if Writer
// fly frame is already clipped during its format by the object formatter.
bool mbNoMakePos;
- // <--
- // --> #i37068# - flag to prevent move in method
+
+ // #i37068# - flag to prevent move in method
// <CheckClip(..)>
bool mbNoMoveOnCheckClip;
- // <--
+
void CheckClip( const SwFmtFrmSize &rSz ); //'Emergency' Clipping.
/** determines, if direct environment of fly frame has 'auto' size
@@ -72,14 +72,14 @@ protected:
SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
public:
- // --> #i28701#
+ // #i28701#
TYPEINFO();
virtual ~SwFlyFreeFrm();
virtual void MakeAll();
- // --> #i37068# - accessors for member <mbNoMoveOnCheckClip>
+ // #i37068# - accessors for member <mbNoMoveOnCheckClip>
inline void SetNoMoveOnCheckClip( const bool _bNewNoMoveOnCheckClip )
{
mbNoMoveOnCheckClip = _bNewNoMoveOnCheckClip;
@@ -88,8 +88,7 @@ public:
{
return mbNoMoveOnCheckClip;
}
- // <--
- // --> #i34753# - accessors for member <mbNoMakePos>
+ // #i34753# - accessors for member <mbNoMakePos>
inline void SetNoMakePos( const bool _bNoMakePos )
{
if ( IsFlyLayFrm() )
@@ -108,7 +107,6 @@ public:
return false;
}
}
- // <--
/** method to determine, if a format on the Writer fly frame is possible
@@ -117,8 +115,6 @@ public:
<SwFlyFrm::IsFormatPossible()> by:
format isn't possible, if Writer fly frame isn't registered at a page frame
and its anchor frame isn't inside another Writer fly frame.
-
- @author OD
*/
virtual bool IsFormatPossible() const;
};
@@ -128,7 +124,7 @@ public:
class SwFlyLayFrm : public SwFlyFreeFrm
{
public:
- // --> #i28701#
+ // #i28701#
TYPEINFO();
SwFlyLayFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
@@ -150,14 +146,12 @@ protected:
page frame
#i28701#
-
- @author OD
*/
virtual void RegisterAtCorrectPage();
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
- // --> #i28701#
+ // #i28701#
TYPEINFO();
SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
@@ -173,8 +167,6 @@ public:
refine 'IsFormatPossible'-conditions of method
<SwFlyFreeFrm::IsFormatPossible()> by:
format isn't possible, if method <MakeAll()> is already in progress.
-
- @author OD
*/
virtual bool IsFormatPossible() const;
};
@@ -195,7 +187,7 @@ protected:
virtual void Modify( const SfxPoolItem*, const SfxPoolItem* );
public:
- // --> #i28701#
+ // #i28701#
TYPEINFO();
SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
@@ -231,11 +223,10 @@ public:
// #i26791#
virtual void MakeObjPos();
- // --> #115759# - invalidate anchor frame on invalidation
+ // invalidate anchor frame on invalidation
// of the position, because the position is calculated during the
// format of the anchor frame
virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
- // <--
};
inline void SwFlyInCntFrm::InvalidateLayout() const
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index ba148cc93f..99dc2dc7ed 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -30,6 +30,7 @@
#include <vector>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <svl/svarray.hxx>
#include <editeng/borderline.hxx>
#include "swtypes.hxx" // fuer SwTwips
@@ -38,10 +39,8 @@
#include <svl/brdcst.hxx>
#include "IDocumentDrawModelAccess.hxx"
-#if OSL_DEBUG_LEVEL > 1
#include <libxml/encoding.h>
#include <libxml/xmlwriter.h>
-#endif
class SwLayoutFrm;
class SwRootFrm;
@@ -207,32 +206,8 @@ struct SwRectFnCollection
};
typedef SwRectFnCollection* SwRectFn;
-/*
-extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R;
-#define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
- sal_Bool bRev = pFrm->IsReverse(); \
- SwRectFn fnRect = bVert ? \
- ( bRev ? fnRectVL2R : fnRectVert ): \
- ( bRev ? fnRectB2T : fnRectHori );
-#define SWRECTFNX( pFrm ) sal_Bool bVertX = pFrm->IsVertical(); \
- sal_Bool bRevX = pFrm->IsReverse(); \
- SwRectFn fnRectX = bVertX ? \
- ( bRevX ? fnRectVL2R : fnRectVert ): \
- ( bRevX ? fnRectB2T : fnRectHori );
-#define SWREFRESHFN( pFrm ) { if( bVert != pFrm->IsVertical() || \
- bRev != pFrm->IsReverse() ) \
- bVert = pFrm->IsVertical(); \
- bRev = pFrm->IsReverse(); \
- fnRect = bVert ? \
- ( bRev ? fnRectVL2R : fnRectVert ): \
- ( bRev ? fnRectB2T : fnRectHori ); }
-#define SWRECTFN2( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
- sal_Bool bNeighb = pFrm->IsNeighbourFrm(); \
- SwRectFn fnRect = bVert == bNeighb ? \
- fnRectHori : fnRectVert;
-*/
-//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+// Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
extern SwRectFn fnRectHori, fnRectVert, fnRectB2T, fnRectVL2R, fnRectVertL2R;
#define SWRECTFN( pFrm ) sal_Bool bVert = pFrm->IsVertical(); \
sal_Bool bRev = pFrm->IsReverse(); \
@@ -274,9 +249,6 @@ enum MakePageType
MAKEPAGE_NOSECTION // Don't create section frames
};
-// OD 2004-05-06 #i28701# - replaced by new class <SwSortedObjs>
-//typedef SdrObject* SdrObjectPtr;
-//SV_DECL_PTRARR(SwDrawObjs,SdrObjectPtr,1,1);
class SwFrm: public SwClient, public SfxBroadcaster
{
@@ -306,11 +278,10 @@ class SwFrm: public SwClient, public SfxBroadcaster
//Cache fuer (Umrandungs-)Attribute.
static SwCache *pCache;
- // --> OD 2006-05-10 #i65250#
+ // #i65250#
// frame ID is now in general available - used for layout loop control
static sal_uInt32 mnLastFrmId;
const sal_uInt32 mnFrmId;
- // <--
SwRootFrm *mpRoot;
SwLayoutFrm *pUpper;
@@ -323,7 +294,7 @@ class SwFrm: public SwClient, public SfxBroadcaster
/** method to determine next content frame in the same environment
for a flow frame (content frame, table frame, section frame)
- OD 2005-11-30 #i27138# - adding documentation:
+ #i27138# - adding documentation:
Travelling downwards through the layout to determine the next content
frame in the same environment. There are several environments in a
document, which form a closed context regarding this function. These
@@ -334,13 +305,11 @@ class SwFrm: public SwClient, public SfxBroadcaster
- Each group of linked fly frames
- All footnotes
- All document body frames
- OD 2005-11-30 #i27138# - adding parameter <_bInSameFtn>
+ #i27138# - adding parameter <_bInSameFtn>
Its default value is <false>. If its value is <true>, the environment
'All footnotes' is no longer treated. Instead each footnote is treated
as an own environment.
- @author OD
-
@param _bInSameFtn
input parameter - boolean indicating, that the found next content
frame has to be in the same footnote frame. This parameter is only
@@ -354,7 +323,7 @@ class SwFrm: public SwClient, public SfxBroadcaster
/** method to determine previous content frame in the same environment
for a flow frame (content frame, table frame, section frame)
- OD 2005-11-30 #i27138#
+ #i27138#
Travelling upwards through the layout to determine the previous content
frame in the same environment. There are several environments in a
document, which form a closed context regarding this function. These
@@ -365,13 +334,11 @@ class SwFrm: public SwClient, public SfxBroadcaster
- Each group of linked fly frames
- All footnotes
- All document body frames
- OD 2005-11-30 #i27138# - adding parameter <_bInSameFtn>
+ #i27138# - adding parameter <_bInSameFtn>
Its default value is <false>. If its value is <true>, the environment
'All footnotes' is no longer treated. Instead each footnote is treated
as an own environment.
- @author OD
-
@param _bInSameFtn
input parameter - boolean indicating, that the found previous content
frame has to be in the same footnote frame. This parameter is only
@@ -410,9 +377,8 @@ protected:
sal_uInt16 bInvalidVert: 1;
sal_uInt16 bDerivedVert: 1;
sal_uInt16 bVertical: 1;
- //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ // Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
sal_uInt16 bVertLR: 1;
- //End of SCMS
sal_uInt16 nType: 4; //Who am I?
sal_Bool bValidPos: 1;
@@ -449,12 +415,11 @@ protected:
void PrepareMake();
void OptPrepareMake();
void MakePos();
- // --> OD 2005-09-28 #b6329202#
// method formats next frame of table frame to assure keep attribute.
// in case of nested tables method <SwFrm::MakeAll()> is called to
// avoid format of superior table frame.
friend SwFrm* lcl_FormatNextCntntForKeep( SwTabFrm* pTabFrm );
- // <--
+
virtual void MakeAll() = 0;
//Adjustierung der Frames einer Seite
SwTwips AdjustNeighbourhood( SwTwips nDiff, sal_Bool bTst = sal_False );
@@ -471,10 +436,7 @@ protected:
void CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse );
/** enumeration for the different invalidations
-
- OD 2004-05-19 #i28701#
-
- @author OD
+ #i28701#
*/
enum InvalidationType
{
@@ -482,20 +444,15 @@ protected:
};
/** method to determine, if an invalidation is allowed.
-
- OD 2004-05-19 #i28701
-
- @author OD
+ #i28701
*/
virtual bool _InvalidationAllowed( const InvalidationType _nInvalid ) const;
/** method to perform additional actions on an invalidation
- OD 2004-05-19 #i28701#
+ #i28701#
Method has *only* to contain actions, which has to be performed on
*every* assignment of the corresponding flag to <sal_False>.
-
- @author OD
*/
virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
@@ -547,17 +504,16 @@ public:
sal_Bool WrongPageDesc( SwPageFrm* pNew );
- // --> OD 2004-07-02 #i28701# - new methods to append/remove drawing objects
+ //#i28701# - new methods to append/remove drawing objects
void AppendDrawObj( SwAnchoredObject& _rNewObj );
void RemoveDrawObj( SwAnchoredObject& _rToRemoveObj );
- // <--
//Arbeiten mit der Kette der FlyFrms
void AppendFly( SwFlyFrm *pNew );
void RemoveFly( SwFlyFrm *pToRemove );
const SwSortedObjs *GetDrawObjs() const { return pDrawObjs; }
SwSortedObjs *GetDrawObjs() { return pDrawObjs; }
- // --> OD 2004-07-01 #i28701# - change purpose of method and adjust its name
+ // #i28701# - change purpose of method and adjust its name
void InvalidateObjs( const bool _bInvaPosOnly,
const bool _bNoInvaOfAsCharAnchoredObjs = true );
@@ -572,6 +528,7 @@ public:
void PaintBorderLine( const SwRect&, const SwRect&, const SwPageFrm*,
const Color *pColor, const editeng::SvxBorderStyle = editeng::SOLID ) const;
+ drawinglayer::processor2d::BaseProcessor2D * CreateProcessor2D( ) const;
void ProcessPrimitives( const drawinglayer::primitive2d::Primitive2DSequence& rSequence ) const;
//Retouche, nicht im Bereich des uebergebenen Rect!
@@ -611,14 +568,12 @@ public:
inline sal_Bool IsReverse() const { return bReverse; }
inline void SetReverse( sal_Bool bNew ){ bReverse = bNew ? 1 : 0; }
inline sal_Bool IsVertical() const;
- //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ //Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
inline sal_Bool IsVertLR() const;
- //End of SCMS
inline sal_Bool GetVerticalFlag() const;
inline void SetVertical( sal_Bool bNew ){ bVertical = bNew ? 1 : 0; }
- //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+ //Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
inline void SetbVertLR( sal_Bool bNew ) { bVertLR = bNew ? 1 : 0; }
- //End of SCMS
inline void SetDerivedVert( sal_Bool bNew ){ bDerivedVert = bNew ? 1 : 0; }
inline void SetInvalidVert( sal_Bool bNew) { bInvalidVert = bNew ? 1 : 0; }
inline sal_Bool IsRightToLeft() const;
@@ -634,14 +589,11 @@ public:
/** determine, if frame is moveable in given environment
- OD 08.08.2003 #110978#
method replaced 'old' method <sal_Bool IsMoveable() const>.
Determines, if frame is moveable in given environment. if no environment
is given (parameter _pLayoutFrm == 0L), the movability in the actual
environment (<this->GetUpper()) is checked.
- @author OD
-
@param _pLayoutFrm
input parameter - given environment (layout frame), in which the movability
will be checked. If not set ( == 0L ), actual environment is taken.
@@ -693,9 +645,8 @@ public:
inline SwFlyFrm *FindFlyFrm();
inline SwSectionFrm *FindSctFrm();
inline SwFrm *FindNext();
- // --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
+ // #i27138# - add parameter <_bInSameFtn>
inline SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false );
- // <--
inline SwFrm *FindPrev();
inline const SwPageFrm *FindPageFrm() const;
inline const SwFtnBossFrm *FindFtnBossFrm( sal_Bool bFtn = sal_False ) const;
@@ -706,17 +657,13 @@ public:
inline const SwFlyFrm *FindFlyFrm() const;
inline const SwSectionFrm *FindSctFrm() const;
inline const SwFrm *FindNext() const;
- // --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
+ // #i27138# - add parameter <_bInSameFtn>
inline const SwCntntFrm* FindNextCnt( const bool _bInSameFtn = false ) const;
- // <--
inline const SwFrm *FindPrev() const;
const SwFrm *GetLower() const;
/** inline wrapper method for <_FindPrevCnt(..)>
-
- OD 2005-11-30 #i27138#
-
- @author OD
+ #i27138#
*/
inline SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false )
{
@@ -727,10 +674,7 @@ public:
}
/** inline const wrapper method for <_FindPrevCnt(..)>
-
- OD 2005-11-30 #i27138#
-
- @author OD
+ #i27138#
*/
inline const SwCntntFrm* FindPrevCnt( const bool _bInSameFtn = false ) const
{
@@ -740,12 +684,11 @@ public:
return const_cast<SwFrm*>(this)->_FindPrevCnt( _bInSameFtn );
}
- // --> OD 2007-09-04 #i79774#, #b6596954#
+ // #i79774#
SwFrm* _GetIndPrev() const;
SwFrm* GetIndPrev() const
{ return ( pPrev || !IsInSct() ) ? pPrev : _GetIndPrev(); }
-// const SwFrm* GetIndPrev() const { return ((SwFrm*)this)->GetIndPrev(); }
- // <--
+
SwFrm* GetIndNext()
{ return ( pNext || !IsInSct() ) ? pNext : _GetIndNext(); }
const SwFrm* GetIndNext() const { return ((SwFrm*)this)->GetIndNext(); }
@@ -796,11 +739,11 @@ public:
sal_Bool IsValid() const { return bValidPos && bValidSize && bValidPrtArea; }
//Invalideren nur den Frm
- // OD 2004-05-19 #i28701# - add call to method <_ActionOnInvalidation(..)>
+ // #i28701# - add call to method <_ActionOnInvalidation(..)>
// for all invalidation methods.
- // OD 2004-05-19 #i28701# - use method <_InvalidationAllowed(..)> to
+ // #i28701# - use method <_InvalidationAllowed(..)> to
// decide, if invalidation will to be performed or not.
- // --> OD 2004-10-08 #i26945# - no additional invalidation, if it's already
+ // #i26945# - no additional invalidation, if it's already
// invalidate.
void _InvalidateSize()
{
@@ -843,7 +786,6 @@ public:
_ActionOnInvalidation( INVALID_ALL );
}
}
- // <--
//Benachrichtigen gleich die Seite mit.
inline void InvalidateSize();
inline void InvalidatePrt();
@@ -859,10 +801,7 @@ public:
void ImplInvalidateNextPos( sal_Bool bNoFtn = sal_False );
/** method to invalidate printing area of next frame
-
- OD 09.01.2004 #i11859#
-
- @author OD
+ #i11859#
*/
void InvalidateNextPrtArea();
@@ -949,10 +888,9 @@ public:
inline sal_Bool IsNeighbourFrm() const
{ return GetType() & FRM_NEIGHBOUR ? sal_True : sal_False; }
- // --> OD 2006-05-10 #i65250#
+ // #i65250#
inline sal_uInt32 GetFrmId() const { return mnFrmId; }
inline sal_uInt32 GetLastFrmId() const { return mnLastFrmId; }
- // <--
// NEW TABELS
// Some functions for covered/covering table cells. This way unnessessary
@@ -961,18 +899,20 @@ public:
bool IsCoveredCell() const;
bool IsInCoveredCell() const;
- // FME 2007-08-30 #i81146# new loop control
+ // #i81146# new loop control
bool KnowsFormat( const SwFmt& rFmt ) const;
void RegisterToFormat( SwFmt& rFmt );
void ValidateThisAndAllLowers( const sal_uInt16 nStage );
public:
-#if OSL_DEBUG_LEVEL > 1
- virtual void dumpAsXml(xmlTextWriterPtr writer);
+ /** if writer is NULL, dumps the layout structure as XML in layout.xml
+ */
+ virtual void dumpAsXml(xmlTextWriterPtr writer = NULL );
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
void dumpChildrenAsXml(xmlTextWriterPtr writer);
-#endif
bool IsCollapse() const;
+
+ sal_uInt64 SetHeaderFooterEditMask( OutputDevice* pOut ) const;
};
inline sal_Bool SwFrm::IsInDocBody() const
@@ -1011,7 +951,7 @@ sal_Bool SwFrm::IsVertical() const
((SwFrm*)this)->SetDirFlags( sal_True );
return bVertical != 0;
}
-//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
+//Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
inline sal_Bool SwFrm::IsVertLR() const
{
return bVertLR != 0;
@@ -1099,7 +1039,7 @@ inline void SwFrm::InvalidateAll()
ImplInvalidatePos();
bValidPrtArea = bValidSize = bValidPos = sal_False;
- // OD 2004-05-19 #i28701#
+ // #i28701#
_ActionOnInvalidation( INVALID_ALL );
}
}
@@ -1201,7 +1141,7 @@ inline const SwFrm *SwFrm::FindNext() const
else
return ((SwFrm*)this)->_FindNext();
}
-// --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
+// #i27138# - add parameter <_bInSameFtn>
inline SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn )
{
if ( pNext && pNext->IsCntntFrm() )
@@ -1209,8 +1149,7 @@ inline SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn )
else
return _FindNextCnt( _bInSameFtn );
}
-// <--
-// --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
+// #i27138# - add parameter <_bInSameFtn>
inline const SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn ) const
{
if ( pNext && pNext->IsCntntFrm() )
@@ -1218,7 +1157,6 @@ inline const SwCntntFrm *SwFrm::FindNextCnt( const bool _bInSameFtn ) const
else
return ((SwFrm*)this)->_FindNextCnt( _bInSameFtn );
}
-// <--
inline SwFrm *SwFrm::FindPrev()
{
if ( pPrev && !pPrev->IsSctFrm() )
diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx
index 0e370f0ac4..3df2644658 100644
--- a/sw/source/core/inc/ftnfrm.hxx
+++ b/sw/source/core/inc/ftnfrm.hxx
@@ -69,9 +69,8 @@ class SwFtnFrm: public SwLayoutFrm
sal_Bool bBackMoveLocked : 1; //Absaetze in dieser Fussnote duerfen derzeit
//nicht rueckwaerts fliessen.
- // --> OD 2005-05-18 #i49383# - control unlock of position of lower anchored objects.
+ // #i49383# - control unlock of position of lower anchored objects.
bool mbUnlockPosOfLowerObjs : 1;
- // <--
#if OSL_DEBUG_LEVEL > 1
protected:
virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False );
@@ -122,7 +121,7 @@ public:
inline void ColLock() { bColLocked = sal_True; }
inline void ColUnlock() { bColLocked = sal_False; }
- // --> OD 2005-05-18 #i49383#
+ // #i49383#
inline void UnlockPosOfLowerObjs()
{
mbUnlockPosOfLowerObjs = true;
@@ -135,7 +134,6 @@ public:
{
return mbUnlockPosOfLowerObjs;
}
- // <--
/** search for last content in the current footnote frame
OD 2005-12-02 #i27138#
diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index eb300c0741..ec5e13e8ca 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -39,7 +39,7 @@ class SwTabFrm;
class SwViewImp;
class SwCntntNode;
class SwWait;
-// --> OD 2004-06-28 #i28701#
+// #i28701#
class SfxProgress;
//Die Verwendung der LayAction laeuft immer gleich ab:
@@ -192,10 +192,10 @@ public:
//Auch andere sollen den Wartecrsr einschalten koennen.
void CheckWaitCrsr();
- // --> OD 2004-06-09 #i28701# - method is now public;
+ // #i28701# - method is now public;
// delete 2nd parameter, because its not used;
sal_Bool FormatLayoutFly( SwFlyFrm * );
- // --> OD 2004-06-09 #i28701# - method is now public
+ // #i28701# - method is now public
sal_Bool _FormatFlyCntnt( const SwFlyFrm * );
};
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index c6d17ba405..afb61c915d 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -137,7 +137,6 @@ public:
// --> #i44016# - add parameter <_bUnlockPosOfObjs> to
// force an unlockposition call for the lower objects.
void NotifyLowerObjs( const bool _bUnlockPosOfObjs = false );
- // <--
//Invalidiert diejenigen innenliegenden Frames, deren Breite und/oder
//Hoehe Prozentual berechnet werden. Auch Rahmen, die an this oder an
diff --git a/sw/source/core/inc/layouter.hxx b/sw/source/core/inc/layouter.hxx
index 83f8de5686..d6333d79f9 100644
--- a/sw/source/core/inc/layouter.hxx
+++ b/sw/source/core/inc/layouter.hxx
@@ -41,24 +41,19 @@ class IDocumentLayoutAccess;
// --> #i28701#
class SwMovedFwdFrmsByObjPos;
class SwTxtFrm;
-// <--
// --> #i26945#
class SwRowFrm;
-// <--
// --> #i35911#
class SwObjsMarkedAsTmpConsiderWrapInfluence;
class SwAnchoredObject;
-// <--
// --> #i40155#
#include <vector>
class SwFrm;
-// <--
// --> #i65250#
#include <swtypes.hxx>
#include <boost/unordered_map.hpp>
class SwFlowFrm;
class SwLayoutFrm;
-// <--
#define LOOP_PAGE 1
@@ -71,14 +66,11 @@ class SwLayouter
// --> #i28701#
SwMovedFwdFrmsByObjPos* mpMovedFwdFrms;
- // <--
// --> #i35911#
SwObjsMarkedAsTmpConsiderWrapInfluence* mpObjsTmpConsiderWrapInfl;
- // <--
// --> #i40155# - data structure to collect frames, which are
// marked not to wrap around objects.
std::vector< const SwFrm* > maFrmsNotToWrap;
- // <--
public:
// --> #i65250#
@@ -121,7 +113,6 @@ private:
boost::unordered_map< const tMoveBwdLayoutInfoKey, sal_uInt16,
fMoveBwdLayoutInfoKeyHash,
fMoveBwdLayoutInfoKeyEq > maMoveBwdLayoutInfo;
- // <--
public:
SwLayouter();
~SwLayouter();
@@ -145,35 +136,29 @@ public:
static bool FrmMovedFwdByObjPos( const SwDoc& _rDoc,
const SwTxtFrm& _rTxtFrm,
sal_uInt32& _ornToPageNum );
- // <--
// --> #i40155# - ummark given frame as to be moved forward.
static void RemoveMovedFwdFrm( const SwDoc& _rDoc,
const SwTxtFrm& _rTxtFrm );
- // <--
// --> #i26945#
static bool DoesRowContainMovedFwdFrm( const SwDoc& _rDoc,
const SwRowFrm& _rRowFrm );
- // <--
// --> #i35911#
static void ClearObjsTmpConsiderWrapInfluence( const SwDoc& _rDoc );
static void InsertObjForTmpConsiderWrapInfluence(
const SwDoc& _rDoc,
SwAnchoredObject& _rAnchoredObj );
- // <--
// --> #i40155#
static void ClearFrmsNotToWrap( const SwDoc& _rDoc );
static void InsertFrmNotToWrap( const SwDoc& _rDoc,
const SwFrm& _rFrm );
static bool FrmNotToWrap( const IDocumentLayoutAccess& _rIDLA,
const SwFrm& _rFrm );
- // <--
// --> #i65250#
static bool MoveBwdSuppressed( const SwDoc& p_rDoc,
const SwFlowFrm& p_rFlowFrm,
const SwLayoutFrm& p_rNewUpperFrm );
static void ClearMoveBwdLayoutInfo( const SwDoc& p_rDoc );
- // <--
};
diff --git a/sw/source/core/inc/movedfwdfrmsbyobjpos.hxx b/sw/source/core/inc/movedfwdfrmsbyobjpos.hxx
index 52ea3008bf..e9469d52c6 100644
--- a/sw/source/core/inc/movedfwdfrmsbyobjpos.hxx
+++ b/sw/source/core/inc/movedfwdfrmsbyobjpos.hxx
@@ -35,7 +35,6 @@ class SwTxtNode;
class SwTxtFrm;
// --> #i26945#
class SwRowFrm;
-// <--
typedef std::map< const SwTxtNode*, const sal_uInt32 > NodeMap;
typedef std::map< const SwTxtNode*, const sal_uInt32 >::const_iterator NodeMapIter;
@@ -56,14 +55,12 @@ class SwMovedFwdFrmsByObjPos
// --> #i40155#
void Remove( const SwTxtFrm& _rTxtFrm );
- // <--
bool FrmMovedFwdByObjPos( const SwTxtFrm& _rTxtFrm,
sal_uInt32& _ornToPageNum ) const;
// --> #i26945#
bool DoesRowContainMovedFwdFrm( const SwRowFrm& _rRowFrm ) const;
- // <--
void Clear() { maMovedFwdFrms.clear(); };
};
diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx
index 30453d5d64..ae263ace4a 100644
--- a/sw/source/core/inc/mvsave.hxx
+++ b/sw/source/core/inc/mvsave.hxx
@@ -39,7 +39,6 @@ namespace sfx2 {
}
class SvNumberFormatter;
-class SvULongs;
class SwDoc;
class SwFmtAnchor;
class SwFrmFmt;
@@ -92,11 +91,11 @@ void _DelBookmarks(const SwNodeIndex& rStt,
const SwIndex* pSttIdx =0,
const SwIndex* pEndIdx =0);
void _SaveCntntIdx( SwDoc* pDoc, sal_uLong nNode, xub_StrLen nCntnt,
- SvULongs& rSaveArr, sal_uInt8 nSaveFly = 0 );
-void _RestoreCntntIdx( SwDoc* pDoc, SvULongs& rSaveArr,
+ std::vector<sal_uLong>& rSaveArr, sal_uInt8 nSaveFly = 0 );
+void _RestoreCntntIdx( SwDoc* pDoc, std::vector<sal_uLong>& rSaveArr,
sal_uLong nNode, xub_StrLen nOffset = 0,
sal_Bool bAuto = sal_False );
-void _RestoreCntntIdx( SvULongs& rSaveArr, const SwNode& rNd,
+void _RestoreCntntIdx( std::vector<sal_uLong>& rSaveArr, const SwNode& rNd,
xub_StrLen nLen, xub_StrLen nCorrLen );
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index e7c973cffe..89524e9212 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -209,6 +209,8 @@ public:
void PaintGrid( OutputDevice* pOut, SwRect &rRect ) const;
sal_Bool HasGrid() const { return bHasGrid; }
+ void PaintDecorators( OutputDevice* pOut ) const;
+
//Zeilennummern usw malen
void RefreshExtraData( const SwRect & ) const;
diff --git a/sw/source/core/inc/rolbck.hxx b/sw/source/core/inc/rolbck.hxx
index df9da4bfb9..8d914afde6 100644
--- a/sw/source/core/inc/rolbck.hxx
+++ b/sw/source/core/inc/rolbck.hxx
@@ -29,13 +29,11 @@
#define _ROLBCK_HXX
#include <tools/solar.h>
-#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTSSORT
-#include <svl/svstdarr.hxx>
-#endif
#include <svl/itemset.hxx>
+#include <vector>
+#include <set>
+
//Nur die History anziehen, um das docnew.cxx gegen die CLOOK's zu behaupten.
namespace sfx2 {
@@ -281,12 +279,12 @@ class SwHistoryBookmark : public SwHistoryHint
class SwHistorySetAttrSet : public SwHistoryHint
{
SfxItemSet m_OldSet;
- SvUShorts m_ResetArray;
+ std::vector<sal_uInt16> m_ResetArray;
const sal_uLong m_nNodeIndex;
public:
SwHistorySetAttrSet( const SfxItemSet& rSet, sal_uLong nNode,
- const SvUShortsSort& rSetArr );
+ const std::set<sal_uInt16> &rSetArr );
virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
};
@@ -296,7 +294,7 @@ class SwHistoryResetAttrSet : public SwHistoryHint
const sal_uLong m_nNodeIndex;
const xub_StrLen m_nStart;
const xub_StrLen m_nEnd;
- SvUShorts m_Array;
+ std::vector<sal_uInt16> m_Array;
public:
SwHistoryResetAttrSet( const SfxItemSet& rSet, sal_uLong nNode,
@@ -304,7 +302,7 @@ public:
xub_StrLen nEnd = STRING_MAXLEN );
virtual void SetInDoc( SwDoc* pDoc, bool bTmpSet );
- const SvUShorts& GetArr() const { return m_Array; }
+ const std::vector<sal_uInt16>& GetArr() const { return m_Array; }
sal_uLong GetNode() const { return m_nNodeIndex; }
xub_StrLen GetCntnt() const { return m_nStart; }
@@ -407,7 +405,7 @@ public:
class SwRegHistory : public SwClient
{
private:
- SvUShortsSort m_WhichIdSet;
+ std::set<sal_uInt16> m_WhichIdSet;
SwHistory * const m_pHistory;
sal_uLong m_nNodeIndex;
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index a73b28bf25..0479c8a53c 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -83,7 +83,6 @@ class SwRootFrm: public SwLayoutFrm
sal_uInt16 mnColumns; // the current page layout bases on this number of columns
bool mbBookMode; // the current page layout is in book view
bool mbSidebarChanged; // the notes sidebar state has changed
- // <--
bool mbNeedGrammarCheck; // true when sth needs to be checked (not necessarily started yet!)
@@ -349,7 +348,6 @@ public:
bool IsLeftToRightViewLayout() const;
const SwRect& GetPagesArea() const { return maPagesArea; }
void SetSidebarChanged() { mbSidebarChanged = true; }
- // <--
};
inline long SwRootFrm::GetBrowseWidth() const
diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx
index 3092ed6042..76acb03074 100644
--- a/sw/source/core/inc/rowfrm.hxx
+++ b/sw/source/core/inc/rowfrm.hxx
@@ -44,7 +44,7 @@ class SwRowFrm: public SwLayoutFrm
const SwTableLine *pTabLine;
SwRowFrm* pFollowRow;
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
sal_uInt16 mnTopMarginForLowers;
sal_uInt16 mnBottomMarginForLowers;
sal_uInt16 mnBottomLineSize;
@@ -80,7 +80,7 @@ public:
SwRowFrm* GetFollowRow() const { return pFollowRow; }
void SetFollowRow( SwRowFrm* pNew ) { pFollowRow = pNew; }
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
sal_uInt16 GetTopMarginForLowers() const { return mnTopMarginForLowers; }
void SetTopMarginForLowers( sal_uInt16 nNew ) { mnTopMarginForLowers = nNew; }
sal_uInt16 GetBottomMarginForLowers() const { return mnBottomMarginForLowers; }
@@ -98,11 +98,10 @@ public:
void SetFollowFlowRow( bool bNew ) { bIsFollowFlowRow = bNew; }
// <-- split table rows
- // --> FME 2006-02-10 #131283# Table row keep feature
+ // #131283# Table row keep feature
bool ShouldRowKeepWithNext() const;
- // <--
- // --> FME 2006-10-30 #i4032# NEW TABLES
+ // #i4032# NEW TABLES
bool IsRowSpanLine() const { return mbIsRowSpanLine; }
void SetRowSpanLine( bool bNew ) { mbIsRowSpanLine = bNew; }
diff --git a/sw/source/core/inc/scriptinfo.hxx b/sw/source/core/inc/scriptinfo.hxx
index 636e8843d3..e84b673199 100644
--- a/sw/source/core/inc/scriptinfo.hxx
+++ b/sw/source/core/inc/scriptinfo.hxx
@@ -53,24 +53,25 @@ typedef std::list< xub_StrLen > PositionList;
class SwScanner
{
- XubString aWord;
+ rtl::OUString aWord;
const SwTxtNode& rNode;
- const String& rText;
+ const rtl::OUString& rText;
const LanguageType* pLanguage;
const ModelToViewHelper::ConversionMap* pConversionMap;
- xub_StrLen nStartPos;
- xub_StrLen nEndPos;
- xub_StrLen nBegin;
- xub_StrLen nLen;
+ sal_Int32 nStartPos;
+ sal_Int32 nEndPos;
+ sal_Int32 nBegin;
+ sal_Int32 nLen;
LanguageType aCurrLang;
sal_uInt16 nWordType;
sal_Bool bClip;
public:
- SwScanner( const SwTxtNode& rNd, const String& rTxt, const LanguageType* pLang,
+ SwScanner( const SwTxtNode& rNd, const rtl::OUString& rTxt,
+ const LanguageType* pLang,
const ModelToViewHelper::ConversionMap* pConvMap,
sal_uInt16 nWordType,
- xub_StrLen nStart, xub_StrLen nEnde, sal_Bool bClip = sal_False );
+ sal_Int32 nStart, sal_Int32 nEnde, sal_Bool bClip = sal_False );
// This next word function tries to find the language for the next word
@@ -78,11 +79,11 @@ public:
// ! bReverse
sal_Bool NextWord();
- const XubString& GetWord() const { return aWord; }
+ const rtl::OUString& GetWord() const { return aWord; }
- xub_StrLen GetBegin() const { return nBegin; }
- xub_StrLen GetEnd() const { return nBegin + nLen; }
- xub_StrLen GetLen() const { return nLen; }
+ sal_Int32 GetBegin() const { return nBegin; }
+ sal_Int32 GetEnd() const { return nBegin + nLen; }
+ sal_Int32 GetLen() const { return nLen; }
LanguageType GetCurrentLanguage() const {return aCurrLang;}
};
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index f9f7a2ed89..feb8e85360 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -128,6 +128,8 @@ public:
bool IsBalancedSection() const;
+ virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
+
DECL_FIXEDMEMPOOL_NEWDEL(SwSectionFrm)
};
diff --git a/sw/source/core/inc/swthreadjoiner.hxx b/sw/source/core/inc/swthreadjoiner.hxx
index 950479f865..2289eccecf 100644
--- a/sw/source/core/inc/swthreadjoiner.hxx
+++ b/sw/source/core/inc/swthreadjoiner.hxx
@@ -29,7 +29,6 @@
#define _SWTHREADJOINER_HXX
#include "com/sun/star/util/XJobManager.hpp"
-#include <osl/mutex.hxx>
/** Testing
@@ -45,7 +44,6 @@ class SwThreadJoiner
private:
static ::com::sun::star::uno::Reference< ::com::sun::star::util::XJobManager > mpThreadJoiner;
- static osl::Mutex* mpGetJoinerMutex;
SwThreadJoiner();
};
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index a81b25b744..a00592e2a1 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -81,7 +81,7 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
// is necessary, in order to let the text
// flow into the FollowFlowLine
sal_Bool bRemoveFollowFlowLinePending :1;
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
sal_Bool bConsiderObjsForMinCellHeight :1; // Usually, the floating screen objects
// are considered on the calculation
// for the minimal cell height.
@@ -90,11 +90,9 @@ class SwTabFrm: public SwLayoutFrm, public SwFlowFrm
// screen object for the preparation
// of the re-calculation of the
// last table row.
- // <--
- // --> OD 2004-10-15 #i26945#
+ // #i26945#
sal_Bool bObjsDoesFit :1; // For splitting table rows algorithm, this boolean
// indicates, if the floating screen objects fits
- // <--
sal_Bool bDummy4 :1;
//Split() spaltet den Frm an der angegebenen Stelle, es wird ein
@@ -173,7 +171,7 @@ public:
sal_Bool IsRemoveFollowFlowLinePending() const { return bRemoveFollowFlowLinePending; }
void SetRemoveFollowFlowLinePending( sal_Bool bNew ) { bRemoveFollowFlowLinePending = bNew; }
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
sal_Bool IsConsiderObjsForMinCellHeight() const
{
return bConsiderObjsForMinCellHeight;
@@ -182,8 +180,7 @@ public:
{
bConsiderObjsForMinCellHeight = _bNewConsiderObjsForMinCellHeight;
}
- // <--
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
sal_Bool DoesObjsFit() const
{
return bObjsDoesFit;
@@ -192,7 +189,6 @@ public:
{
bObjsDoesFit = _bNewObjsDoesFit;
}
- // <--
bool RemoveFollowFlowLine();
//
@@ -209,13 +205,15 @@ public:
bool IsLayoutSplitAllowed() const;
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
bool IsCollapsingBorders() const;
// used for collapsing border lines:
sal_uInt16 GetBottomLineSize() const;
// <-- collapsing
+ virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
+
DECL_FIXEDMEMPOOL_NEWDEL(SwTabFrm)
};
diff --git a/sw/source/core/inc/threadmanager.hxx b/sw/source/core/inc/threadmanager.hxx
index 326447b3bd..e849698adc 100644
--- a/sw/source/core/inc/threadmanager.hxx
+++ b/sw/source/core/inc/threadmanager.hxx
@@ -64,7 +64,6 @@ class ThreadManager : public IThreadListenerOwner
// --> IThreadListenerOwner
virtual boost::weak_ptr< IFinishedThreadListener > GetThreadListenerWeakRef();
virtual void NotifyAboutFinishedThread( const oslInterlockedCount nThreadID );
- // <--
/** initialization
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 76f784b216..d5280d21c5 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -459,12 +459,11 @@ public:
SwTxtFrm *FindQuoVadisFrm();
// holt die Formatierug nach, wenn der Idle-Handler zugeschlagen hat.
- // --> FME 2004-10-29 #i29062# GetFormatted() can trigger a full formatting
+ // #i29062# GetFormatted() can trigger a full formatting
// of the paragraph, causing other layout frames to become invalid. This
// has to be avoided during painting. Therefore we need to pass the
// information that we are currently in the paint process.
SwTxtFrm* GetFormatted( bool bForceQuickFormat = false );
- // <--
// wird demnaechst uebertragen
inline void SetFtn( const sal_Bool bNew ) { bFtn = bNew; }
@@ -609,10 +608,8 @@ public:
}
static void repaintTextFrames( const SwTxtNode& rNode );
-
-#if OSL_DEBUG_LEVEL > 1
+
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
-#endif
};
/*************************************************************************
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index af6f8dd33b..d8835143a2 100644..100755
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -59,6 +59,11 @@ class SwPrintData;
class SwPagePreviewLayout;
struct PrevwPage;
class SwTxtFrm;
+// --> OD #i76669#
+namespace sdr { namespace contact {
+ class ViewObjectContactRedirector;
+} }
+// <--
class SwViewImp
{
@@ -206,12 +211,13 @@ public:
// direction at the outliner of the draw view for painting layers <hell>
// and <heaven>.
- // correct type of 1st parameter
+ // #i76669# - added parameter <pRedirector>
void PaintLayer( const SdrLayerID _nLayerID,
SwPrintData const*const pPrintData,
const SwRect& _rRect,
const Color* _pPageBackgrdColor = 0,
- const bool _bIsPageRightToLeft = false ) const;
+ const bool _bIsPageRightToLeft = false,
+ sdr::contact::ViewObjectContactRedirector* pRedirector = 0 ) const;
//wird als Link an die DrawEngine uebergeben, entscheidet was wie
//gepaintet wird oder nicht.
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx
index c8f00097d7..203d0c95e8 100644
--- a/sw/source/core/layout/anchoreddrawobject.cxx
+++ b/sw/source/core/layout/anchoreddrawobject.cxx
@@ -41,18 +41,14 @@
#include <fmtornt.hxx>
// --> #i32795#
#include <txtfrm.hxx>
-// <--
// --> #i32795#
// template class <std::vector>
#include <vector>
-// <--
// --> #i28749#
#include <com/sun/star/text/PositionLayoutDir.hpp>
-// <--
// --> #i44559#
#include <ndtxt.hxx>
-// <--
using namespace ::com::sun::star;
@@ -70,9 +66,8 @@ class SwPosNotify
public:
SwPosNotify( SwAnchoredDrawObject* _pAnchoredDrawObj );
~SwPosNotify();
- // --> OD 2004-08-12 #i32795#
+ // #i32795#
Point LastObjPos() const;
- // <--
};
SwPosNotify::SwPosNotify( SwAnchoredDrawObject* _pAnchoredDrawObj ) :
@@ -81,7 +76,6 @@ SwPosNotify::SwPosNotify( SwAnchoredDrawObject* _pAnchoredDrawObj ) :
maOldObjRect = mpAnchoredDrawObj->GetObjRect();
// --> #i35640# - determine correct page frame
mpOldPageFrm = mpAnchoredDrawObj->GetPageFrm();
- // <--
}
SwPosNotify::~SwPosNotify()
@@ -98,7 +92,6 @@ SwPosNotify::~SwPosNotify()
{
// --> #i35640# - determine correct page frame
SwPageFrm* pNewPageFrm = mpAnchoredDrawObj->GetPageFrm();
- // <--
if( pNewPageFrm )
mpAnchoredDrawObj->NotifyBackground( pNewPageFrm, aNewObjRect,
PREP_FLY_ARRIVE );
@@ -116,7 +109,6 @@ SwPosNotify::~SwPosNotify()
{
mpAnchoredDrawObj->AnchorFrm()->Prepare( PREP_FLY_LEAVE );
}
- // <--
// indicate a restart of the layout process
mpAnchoredDrawObj->SetRestartLayoutProcess( true );
@@ -148,7 +140,6 @@ Point SwPosNotify::LastObjPos() const
{
return maOldObjRect.Pos();
}
-//<--
// ============================================================================
// #i32795#
@@ -231,22 +222,18 @@ SwAnchoredDrawObject::SwAnchoredDrawObject() :
mbValidPos( false ),
// --> #i34748#
mpLastObjRect( 0L ),
- // <--
mbNotYetAttachedToAnchorFrame( true ),
// --> #i28749#
mbNotYetPositioned( true ),
- // <--
// --> #i62875#
mbCaptureAfterLayoutDirChange( false )
- // <--
{
}
SwAnchoredDrawObject::~SwAnchoredDrawObject()
{
- // --> follow-up of #i34748#
+ // #i34748#
delete mpLastObjRect;
- // <--
}
// --> #i62875#
@@ -264,7 +251,6 @@ void SwAnchoredDrawObject::UpdateLayoutDir()
mbCaptureAfterLayoutDirChange = true;
}
}
-// <--
// --> #i62875#
bool SwAnchoredDrawObject::IsOutsidePage() const
@@ -280,7 +266,6 @@ bool SwAnchoredDrawObject::IsOutsidePage() const
return bOutsidePage;
}
-// <--
// =============================================================================
// #i26791# - implementation of pure virtual method declared in
@@ -323,24 +308,20 @@ void SwAnchoredDrawObject::MakeObjPos()
{
// --> #i35635#
pDrawContact->MoveObjToVisibleLayer( DrawObj() );
- // <--
// --> perform conversion of positioning
// attributes only for 'master' drawing objects
- // --> #i44334#, #i44681# - check, if positioning
+ // #i44334#, #i44681# - check, if positioning
// attributes already have been set.
if ( !GetDrawObj()->ISA(SwDrawVirtObj) &&
!static_cast<SwDrawFrmFmt&>(GetFrmFmt()).IsPosAttrSet() )
{
_SetPositioningAttr();
}
- // <--
// -->
// - reset internal flag after all needed actions are performed to
// avoid callbacks from drawing layer
mbNotYetPositioned = false;
- // <--
}
- // <--
// indicate that positioning is in progress
{
@@ -382,7 +363,6 @@ void SwAnchoredDrawObject::MakeObjPos()
// keep, current object rectangle
// --> #i34748# - use new method <SetLastObjRect(..)>
SetLastObjRect( GetObjRect().SVRect() );
- // <--
// Assure for 'master' drawing object, that it's registered at the correct page.
// Perform check not for as-character anchored drawing objects and only if
@@ -416,7 +396,6 @@ void SwAnchoredDrawObject::MakeObjPos()
mbCaptureAfterLayoutDirChange = false;
}
- // <--
}
/** method for the intrinsic positioning of a at-paragraph|at-character
@@ -444,13 +423,11 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
!static_cast<const SwTxtFrm*>( GetAnchorFrmContainingAnchPos() )->IsAnyJoinLocked() &&
!ConsiderObjWrapInfluenceOnObjPos() &&
!ConsiderObjWrapInfluenceOfOtherObjs();
- // <--
if ( bFormatAnchor )
{
// --> #i50356#
GetAnchorFrmContainingAnchPos()->Calc();
- // <--
}
bool bOscillationDetected = false;
@@ -459,7 +436,6 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
// 'straightforward positioning process' for the frame due to its
// overlapping with a previous column.
bool bConsiderWrapInfluenceDueToOverlapPrevCol( false );
- // <--
do {
// indicate that position will be valid after positioning is performed
mbValidPos = true;
@@ -484,7 +460,6 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
bOscillationDetected = aObjPosOscCtrl.OscillationDetected();
}
}
- // <--
// format anchor frame, if requested.
// Note: the format of the anchor frame can cause the object position
// to be invalid.
@@ -492,7 +467,6 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
{
// --> #i50356#
GetAnchorFrmContainingAnchPos()->Calc();
- // <--
}
// --> #i3317#
@@ -501,7 +475,6 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
{
bConsiderWrapInfluenceDueToOverlapPrevCol = true;
}
- // <--
} while ( !mbValidPos && !bOscillationDetected &&
!bConsiderWrapInfluenceDueToOverlapPrevCol );
@@ -513,7 +486,6 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtPara()
SetTmpConsiderWrapInfluence( true );
SetRestartLayoutProcess( true );
}
- // <--
}
/** method for the intrinsic positioning of a at-page|at-frame anchored
@@ -547,16 +519,13 @@ void SwAnchoredDrawObject::_MakeObjPosAnchoredAtLayout()
DrawObj()->SetAnchorPos( aNewAnchorPos );
// --> #i70122# - missing invalidation
InvalidateObjRectWithSpaces();
- // <--
}
- // <--
SetCurrRelPos( aObjPositioning.GetRelPos() );
const SwFrm* pAnchorFrm = GetAnchorFrm();
SWRECTFN( pAnchorFrm );
const Point aAnchPos( (pAnchorFrm->Frm().*fnRect->fnGetPos)() );
SetObjLeft( aAnchPos.X() + GetCurrRelPos().X() );
SetObjTop( aAnchPos.Y() + GetCurrRelPos().Y() );
- // <--
}
void SwAnchoredDrawObject::_SetDrawObjAnchor()
@@ -577,7 +546,6 @@ void SwAnchoredDrawObject::_SetDrawObjAnchor()
DrawObj()->Move( aMove );
// --> #i70122# - missing invalidation
InvalidateObjRectWithSpaces();
- // <--
}
}
@@ -603,7 +571,6 @@ void SwAnchoredDrawObject::_InvalidatePage( SwPageFrm* _pPageFrm )
{
_pPageFrm->InvalidateFlyLayout();
}
- // <--
SwRootFrm* pRootFrm = static_cast<SwRootFrm*>(_pPageFrm->GetUpper());
pRootFrm->DisallowTurbo();
@@ -627,7 +594,6 @@ void SwAnchoredDrawObject::InvalidateObjPos()
mbValidPos = false;
// --> #i68520#
InvalidateObjRectWithSpaces();
- // <--
// --> #i44339# - check, if anchor frame exists.
if ( GetAnchorFrm() )
@@ -646,7 +612,6 @@ void SwAnchoredDrawObject::InvalidateObjPos()
AnchorFrm()->Prepare( PREP_FLY_ATTR_CHG, &GetFrmFmt() );
}
}
- // <--
SwPageFrm* pPageFrm = AnchorFrm()->FindPageFrm();
_InvalidatePage( pPageFrm );
@@ -659,20 +624,17 @@ void SwAnchoredDrawObject::InvalidateObjPos()
{
_InvalidatePage( pPageFrmRegisteredAt );
}
- // <--
- // --> #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
+ // #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
// is replaced by method <FindPageFrmOfAnchor()>. It's return value
// have to be checked.
SwPageFrm* pPageFrmOfAnchor = FindPageFrmOfAnchor();
if ( pPageFrmOfAnchor &&
pPageFrmOfAnchor != pPageFrm &&
pPageFrmOfAnchor != pPageFrmRegisteredAt )
- // <--
{
_InvalidatePage( pPageFrmOfAnchor );
}
}
- // <--
}
}
@@ -701,7 +663,6 @@ const SwRect SwAnchoredDrawObject::GetObjBoundRect() const
{
return GetDrawObj()->GetCurrentBoundRect();
}
-// <--
// --> #i68520#
bool SwAnchoredDrawObject::_SetObjTop( const SwTwips _nTop )
@@ -718,7 +679,6 @@ bool SwAnchoredDrawObject::_SetObjLeft( const SwTwips _nLeft )
return nDiff != 0;
}
-// <--
/** adjust positioning and alignment attributes for new anchor frame
@@ -734,7 +694,6 @@ void SwAnchoredDrawObject::AdjustPositioningAttr( const SwFrm* _pNewAnchorFrm,
const Point aAnchorPos = _pNewAnchorFrm->GetFrmAnchorPos( ::HasWrap( GetDrawObj() ) );
// --> #i33313#
const SwRect aObjRect( _pNewObjRect ? *_pNewObjRect : GetObjRect() );
- // <--
const bool bVert = _pNewAnchorFrm->IsVertical();
const bool bR2L = _pNewAnchorFrm->IsRightToLeft();
if ( bVert )
@@ -762,7 +721,6 @@ const Rectangle* SwAnchoredDrawObject::GetLastObjRect() const
{
return mpLastObjRect;
}
-// <--
// --> #i34748# - change return type.
// If member <mpLastObjRect> is NULL, create one.
@@ -774,13 +732,11 @@ void SwAnchoredDrawObject::SetLastObjRect( const Rectangle& _rNewLastRect )
}
*(mpLastObjRect) = _rNewLastRect;
}
-// <--
void SwAnchoredDrawObject::ObjectAttachedToAnchorFrame()
{
// --> #i31698#
SwAnchoredObject::ObjectAttachedToAnchorFrame();
- // <--
if ( mbNotYetAttachedToAnchorFrame )
{
@@ -810,7 +766,7 @@ void SwAnchoredDrawObject::_SetPositioningAttr()
SwTwips nHoriPos = aObjRect.Left();
SwTwips nVertPos = aObjRect.Top();
- // --> #i44334#, #i44681#
+ // #i44334#, #i44681#
// perform conversion only if position is in horizontal-left-to-right-layout.
if ( GetFrmFmt().GetPositionLayoutDir() ==
text::PositionLayoutDir::PositionInHoriL2R )
@@ -840,7 +796,6 @@ void SwAnchoredDrawObject::_SetPositioningAttr()
}
}
}
- // <--
// --> #i71182#
// only change position - do not lose other attributes
@@ -852,18 +807,15 @@ void SwAnchoredDrawObject::_SetPositioningAttr()
aVert.SetPos( nVertPos );
GetFrmFmt().SetFmtAttr( aVert );
- // <--
// --> #i36010# - set layout direction of the position
GetFrmFmt().SetPositionLayoutDir(
text::PositionLayoutDir::PositionInLayoutDirOfAnchor );
- // <--
}
// --> #i65798# - also for as-character anchored objects
// --> #i45952# - indicate that position
// attributes are set now.
static_cast<SwDrawFrmFmt&>(GetFrmFmt()).PosAttrSet();
- // <--
}
void SwAnchoredDrawObject::NotifyBackground( SwPageFrm* _pPageFrm,
diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx
index e01dc407ab..16db6ee1ab 100644
--- a/sw/source/core/layout/anchoredobject.cxx
+++ b/sw/source/core/layout/anchoredobject.cxx
@@ -44,11 +44,9 @@
#include <editeng/lrspitem.hxx>
#include <sortedobjs.hxx>
#include <pagefrm.hxx>
-// <--
#include <frmatr.hxx>
// --> #i3317#
#include <colfrm.hxx>
-// <--
// --> #i35911#
#include <layouter.hxx>
@@ -56,7 +54,6 @@
using namespace ::com::sun::star;
-// <--
// ============================================================================
// --> #i28701# -
// implementation of helper class <SwObjPositioningInProgress>
@@ -65,23 +62,19 @@ SwObjPositioningInProgress::SwObjPositioningInProgress( SdrObject& _rSdrObj ) :
mpAnchoredObj( 0L ),
// --> #i52904#
mbOldObjPositioningInProgress( false )
- // <--
{
mpAnchoredObj = ::GetUserCall( &_rSdrObj )->GetAnchoredObj( &_rSdrObj );
// --> #i52904#
mbOldObjPositioningInProgress = mpAnchoredObj->IsPositioningInProgress();
- // <--
mpAnchoredObj->SetPositioningInProgress( true );
}
SwObjPositioningInProgress::SwObjPositioningInProgress( SwAnchoredObject& _rAnchoredObj ) :
mpAnchoredObj( &_rAnchoredObj ),
// --> #i52904#
mbOldObjPositioningInProgress( false )
- // <--
{
// --> #i52904#
mbOldObjPositioningInProgress = mpAnchoredObj->IsPositioningInProgress();
- // <--
mpAnchoredObj->SetPositioningInProgress( true );
}
@@ -91,7 +84,6 @@ SwObjPositioningInProgress::~SwObjPositioningInProgress()
{
// --> #i52904#
mpAnchoredObj->SetPositioningInProgress( mbOldObjPositioningInProgress );
- // <--
}
}
@@ -104,7 +96,6 @@ SwAnchoredObject::SwAnchoredObject() :
mpAnchorFrm( 0L ),
// --> #i28701#
mpPageFrm( 0L ),
- // <--
maRelPos(),
maLastCharRect(),
mnLastTopOfLine( 0L ),
@@ -115,20 +106,15 @@ SwAnchoredObject::SwAnchoredObject() :
mbPositionLocked( false ),
// --> #i40147#
mbKeepPositionLockedForSection( false ),
- // <--
mbRestartLayoutProcess( false ),
- // <--
// --> #i35911#
mbClearedEnvironment( false ),
- // <--
// --> #i3317#
mbTmpConsiderWrapInfluence( false ),
- // <--
// --> #i68520#
maObjRectWithSpaces(),
mbObjRectWithSpacesValid( false ),
maLastObjRect()
- // <--
{
}
@@ -263,7 +249,7 @@ void SwAnchoredObject::SetVertPosOrientFrm( const SwLayoutFrm& _rVertPosOrientFr
{
mpVertPosOrientFrm = &_rVertPosOrientFrm;
- // --> OD 2004-07-02 #i28701# - take over functionality of deleted method
+ // #i28701# - take over functionality of deleted method
// <SwFlyAtCntFrm::AssertPage()>: assure for at-paragraph and at-character
// an anchored object, that it is registered at the correct page frame
RegisterAtCorrectPage();
@@ -313,13 +299,11 @@ void SwAnchoredObject::CheckCharRectAndTopOfLine(
// paragraph portion information.
// --> #i26945# - use new method <FindAnchorCharFrm()>
const SwTxtFrm& aAnchorCharFrm = *(FindAnchorCharFrm());
- // <--
if ( !_bCheckForParaPorInf || aAnchorCharFrm.HasPara() )
{
_CheckCharRect( rAnch, aAnchorCharFrm );
_CheckTopOfLine( rAnch, aAnchorCharFrm );
}
- // <--
}
}
}
@@ -375,14 +359,13 @@ void SwAnchoredObject::_CheckCharRect( const SwFmtAnchor& _rAnch,
( (aCharRect.*fnRect->fnGetTop)() !=
(maLastCharRect.*fnRect->fnGetTop)() ) ) )
{
- // --> #i26945#, #i35911# - unlock position of
+ // #i26945#, #i35911# - unlock position of
// anchored object, if it isn't registered at the page,
// where its anchor character frame is on.
if ( GetPageFrm() != _rAnchorCharFrm.FindPageFrm() )
{
UnlockPosition();
}
- // <--
InvalidateObjPos();
}
}
@@ -414,14 +397,13 @@ void SwAnchoredObject::_CheckTopOfLine( const SwFmtAnchor& _rAnch,
// check alignment for invalidation of position
if ( GetFrmFmt().GetVertOrient().GetRelationOrient() == text::RelOrientation::TEXT_LINE )
{
- // --> #i26945#, #i35911# - unlock position of
+ // #i26945#, #i35911# - unlock position of
// anchored object, if it isn't registered at the page,
// where its anchor character frame is on.
if ( GetPageFrm() != _rAnchorCharFrm.FindPageFrm() )
{
UnlockPosition();
}
- // <--
InvalidateObjPos();
}
// keep new top of line value
@@ -533,7 +515,6 @@ bool SwAnchoredObject::ConsiderObjWrapInfluenceOnObjPos() const
bRet = true;
}
else if ( rObjFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) )
- // <--
{
const SwFmtAnchor& rAnchor = rObjFmt.GetAnchor();
if ( ((rAnchor.GetAnchorId() == FLY_AT_CHAR) ||
@@ -544,7 +525,6 @@ bool SwAnchoredObject::ConsiderObjWrapInfluenceOnObjPos() const
// objects in the layer Hell - see the text formatting.
// Thus, it hasn't to be checked here.
bRet = true;
- // <--
}
}
@@ -630,7 +610,6 @@ void SwAnchoredObject::SetClearedEnvironment( const bool _bClearedEnvironment )
{
mbClearedEnvironment = _bClearedEnvironment;
}
-// <--
/** method to determine, if due to anchored object size and wrapping
style, its layout environment is cleared.
@@ -651,7 +630,6 @@ bool SwAnchoredObject::HasClearedEnvironment() const
!static_cast<const SwTxtFrm*>(GetAnchorFrm())->IsFollow() &&
static_cast<const SwTxtFrm*>(GetAnchorFrm())->FindPageFrm()->GetPhyPageNum() >=
GetPageFrm()->GetPhyPageNum() )
- // <--
{
const SwFrm* pTmpFrm = GetVertPosOrientFrm()->Lower();
while ( pTmpFrm && pTmpFrm->IsLayoutFrm() && !pTmpFrm->IsTabFrm() )
@@ -698,7 +676,6 @@ const SwRect& SwAnchoredObject::GetObjRectWithSpaces() const
// use bounding rectangle of anchored objects.
// maObjRectWithSpaces = GetObjRect();
maObjRectWithSpaces = GetObjBoundRect();
- // <--
const SwFrmFmt& rFmt = GetFrmFmt();
const SvxULSpaceItem& rUL = rFmt.GetULSpace();
const SvxLRSpaceItem& rLR = rFmt.GetLRSpace();
@@ -734,7 +711,6 @@ void SwAnchoredObject::SetObjLeft( const SwTwips _nLeft)
mbObjRectWithSpacesValid = false;
}
}
-// <--
/** method to update anchored object in the <SwSortedObjs> lists
@@ -805,7 +781,6 @@ bool SwAnchoredObject::InvalidationOfPosAllowed() const
// --> Check, if page frame layout is in progress,
// isn't needed, because of anchored object, whose are moved forward.
return !PositionLocked();
- // <--
}
/** method to determine the page frame, on which the 'anchor' of
@@ -829,7 +804,6 @@ SwPageFrm* SwAnchoredObject::FindPageFrmOfAnchor()
{
// --> #i26945# - use new method <GetAnchorFrmContainingAnchPos()>
pRetPageFrm = GetAnchorFrmContainingAnchPos()->FindPageFrm();
- // <--
}
return pRetPageFrm;
@@ -861,7 +835,6 @@ SwTxtFrm* SwAnchoredObject::FindAnchorCharFrm()
GetFrmAtOfst( rAnch.GetCntntAnchor()->nContent.GetIndex() ));
}
}
- // <--
return pAnchorCharFrm;
}
@@ -889,14 +862,12 @@ void SwAnchoredObject::SetTmpConsiderWrapInfluence( const bool _bTmpConsiderWrap
SwLayouter::InsertObjForTmpConsiderWrapInfluence( *(GetFrmFmt().GetDoc()),
*this );
}
- // <--
}
bool SwAnchoredObject::IsTmpConsiderWrapInfluence() const
{
return mbTmpConsiderWrapInfluence;
}
-// <--
void SwAnchoredObject::SetTmpConsiderWrapInfluenceOfOtherObjs( const bool bTmpConsiderWrapInfluence )
{
@@ -1018,7 +989,6 @@ Point SwAnchoredObject::GetRelPosToPageFrm( const bool _bFollowTextFlow,
{
aRelPos -= pFrm->Frm().Pos();
}
- // <--
return aRelPos;
}
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index a74ae8af99..f5bd2aed87 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -204,13 +204,12 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt )
{
SwNode *pNode = 0;
{
- // --> OD 2008-10-07 #i92993#
+ // #i92993#
// Begin with start node of page header/footer to assure that
// complete content is checked for cursors and the complete content
// is deleted on below made method call <pDoc->DeleteSection(pNode)>
// SwNodeIndex aIdx( *rCnt.GetCntntIdx(), 1 );
SwNodeIndex aIdx( *rCnt.GetCntntIdx(), 0 );
- // <--
//Wenn in einem der Nodes noch ein Crsr angemeldet ist, muss das
//ParkCrsr einer (beliebigen) Shell gerufen werden.
pNode = & aIdx.GetNode();
@@ -2253,17 +2252,17 @@ bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
rVal.setValue( &bDisplayGrid, ::getBooleanCppuType() );
break;
case MID_GRID_BASEHEIGHT:
- DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
+ OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
"This value needs TWIPS-MM100 conversion" );
rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(nBaseHeight);
break;
case MID_GRID_BASEWIDTH:
- DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
+ OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
"This value needs TWIPS-MM100 conversion" );
rVal <<= (sal_Int32) TWIP_TO_MM100_UNSIGNED(nBaseWidth);
break;
case MID_GRID_RUBYHEIGHT:
- DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
+ OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
"This value needs TWIPS-MM100 conversion" );
rVal <<= (sal_Int32)TWIP_TO_MM100_UNSIGNED(nRubyHeight);
break;
@@ -2339,7 +2338,7 @@ bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
case MID_GRID_BASEWIDTH:
case MID_GRID_RUBYHEIGHT:
{
- DBG_ASSERT( (nMemberId & CONVERT_TWIPS) != 0,
+ OSL_ENSURE( (nMemberId & CONVERT_TWIPS) != 0,
"This value needs TWIPS-MM100 conversion" );
sal_Int32 nTmp = 0;
bRet = (rVal >>= nTmp);
@@ -2603,11 +2602,10 @@ SwContact* SwFrmFmt::FindContactObj()
SdrObject* SwFrmFmt::FindSdrObject()
{
- // --> OD 2005-01-06 #i30669# - use method <FindContactObj()> instead of
+ // #i30669# - use method <FindContactObj()> instead of
// duplicated code.
SwContact* pFoundContact = FindContactObj();
return pFoundContact ? pFoundContact->GetMaster() : 0;
- // <--
}
SdrObject* SwFrmFmt::FindRealSdrObject()
@@ -2677,7 +2675,7 @@ sal_Bool SwFrmFmt::IsLowerOf( const SwFrmFmt& rFmt ) const
return sal_False;
}
-// --> OD 2004-07-27 #i31698#
+// #i31698#
SwFrmFmt::tLayoutDir SwFrmFmt::GetLayoutDir() const
{
return SwFrmFmt::HORI_L2R;
@@ -2687,9 +2685,8 @@ void SwFrmFmt::SetLayoutDir( const SwFrmFmt::tLayoutDir )
{
// empty body, because default implementation does nothing
}
-// <--
-// --> OD 2004-08-06 #i28749#
+// #i28749#
sal_Int16 SwFrmFmt::GetPositionLayoutDir() const
{
return text::PositionLayoutDir::PositionInLayoutDirOfAnchor;
@@ -2698,7 +2695,6 @@ void SwFrmFmt::SetPositionLayoutDir( const sal_Int16 )
{
// empty body, because default implementation does nothing
}
-// <--
String SwFrmFmt::GetDescription() const
{
return SW_RES(STR_FRAME);
@@ -2760,22 +2756,20 @@ void SwFlyFrmFmt::MakeFrms()
//die Suche vom StartNode zum FrameFormat sein.
SwNodeIndex aIdx( aAnchorAttr.GetCntntAnchor()->nNode );
SwCntntNode *pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
- // --> OD 2009-12-28 #i105535#
+ // #i105535#
if ( pCNd == 0 )
{
pCNd = aAnchorAttr.GetCntntAnchor()->nNode.GetNode().GetCntntNode();
}
if ( pCNd )
- // <--
{
if( SwIterator<SwFrm,SwCntntNode>::FirstElement( *pCNd ) )
{
pModify = pCNd;
}
}
- // --> OD 2009-12-28 #i105535#
+ // #i105535#
if ( pModify == 0 )
- // <--
{
const SwNodeIndex &rIdx = aAnchorAttr.GetCntntAnchor()->nNode;
SwSpzFrmFmts& rFmts = *GetDoc()->GetSpzFrmFmts();
@@ -2820,9 +2814,8 @@ void SwFlyFrmFmt::MakeFrms()
{
if ( pPage->GetPhyPageNum() == nPgNum )
{
- // --> OD 2005-06-09 #i50432# - adjust synopsis of <PlaceFly(..)>
+ // #i50432# - adjust synopsis of <PlaceFly(..)>
pPage->PlaceFly( 0, this );
- // <--
break;
}
pPage = (SwPageFrm*)pPage->GetNext();
@@ -2843,7 +2836,7 @@ void SwFlyFrmFmt::MakeFrms()
if ( FLY_AT_FLY == aAnchorAttr.GetAnchorId() && !pFrm->IsFlyFrm() )
{
- // --> OD 2009-12-28 #i105535#
+ // #i105535#
// fallback to anchor type at-paragraph, if no fly frame is found.
// pFrm = pFrm->FindFlyFrm();
SwFrm* pFlyFrm = pFrm->FindFlyFrm();
@@ -2858,16 +2851,15 @@ void SwFlyFrmFmt::MakeFrms()
MakeFrms();
return;
}
- // <--
}
if( pFrm->GetDrawObjs() )
{
- // --> OD 2004-07-01 #i28701# - new type <SwSortedObjs>
+ // #i28701# - new type <SwSortedObjs>
SwSortedObjs &rObjs = *pFrm->GetDrawObjs();
for( sal_uInt16 i = 0; i < rObjs.Count(); ++i)
{
- // --> OD 2004-07-01 #i28701# - consider changed type of
+ // #i28701# - consider changed type of
// <SwSortedObjs> entries.
SwAnchoredObject* pObj = rObjs[i];
if( pObj->ISA(SwFlyFrm) &&
@@ -2945,7 +2937,7 @@ sal_Bool SwFlyFrmFmt::GetInfo( SfxPoolItem& rInfo ) const
return sal_True;
}
-// --> OD 2009-07-14 #i73249#
+// #i73249#
void SwFlyFrmFmt::SetObjTitle( const String& rTitle, bool bBroadcast )
{
SdrObject* pMasterObject = FindSdrObject();
@@ -3017,7 +3009,6 @@ const String SwFlyFrmFmt::GetObjDescription() const
return pMasterObject->GetDescription();
}
-// <--
/** SwFlyFrmFmt::IsBackgroundTransparent - for #99657#
@@ -3083,7 +3074,7 @@ sal_Bool SwFlyFrmFmt::IsBackgroundBrushInherited() const
return bReturn;
}
-// --> OD 2006-02-28 #125892#
+// #125892#
SwHandleAnchorNodeChg::SwHandleAnchorNodeChg( SwFlyFrmFmt& _rFlyFrmFmt,
const SwFmtAnchor& _rNewAnchorFmt,
SwFlyFrm* _pKeepThisFlyFrm )
@@ -3146,7 +3137,6 @@ SwHandleAnchorNodeChg::~SwHandleAnchorNodeChg()
mrFlyFrmFmt.MakeFrms();
}
}
-// <--
// class SwDrawFrmFmt
// Implementierung teilweise inline im hxx
@@ -3173,7 +3163,7 @@ void SwDrawFrmFmt::DelFrms()
pContact->DisconnectFromLayout();
}
-// --> OD 2004-07-27 #i31698#
+// #i31698#
SwFrmFmt::tLayoutDir SwDrawFrmFmt::GetLayoutDir() const
{
return meLayoutDir;
@@ -3183,9 +3173,8 @@ void SwDrawFrmFmt::SetLayoutDir( const SwFrmFmt::tLayoutDir _eLayoutDir )
{
meLayoutDir = _eLayoutDir;
}
-// <--
-// --> OD 2004-08-06 #i28749#
+// #i28749#
sal_Int16 SwDrawFrmFmt::GetPositionLayoutDir() const
{
return mnPositionLayoutDir;
@@ -3206,7 +3195,6 @@ void SwDrawFrmFmt::SetPositionLayoutDir( const sal_Int16 _nPositionLayoutDir )
}
}
}
-// <--
String SwDrawFrmFmt::GetDescription() const
{
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 5e41bd891b..04df070846 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -58,12 +58,11 @@
#include "sectfrm.hxx"
#include "dbg_lay.hxx"
-// --> OD 2004-06-23 #i28701#
+// #i28701#
#include <sortedobjs.hxx>
#include <layouter.hxx>
-// --> OD 2004-11-01 #i36347#
+// #i36347#
#include <flyfrms.hxx>
-// <--
#include <ndtxt.hxx>
@@ -205,7 +204,7 @@ sal_Bool SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool
// _WouldFit kann auch gefragt werden, wenn _nur_ fremdverankerte Flys vorliegen,
// dabei ist sogar die Breite egal, da ein TestFormat in der neuen Umgebung
// vorgenommen wird.
- // --> OD 2007-11-26 #b6614158#
+ //
const sal_uInt8 nBwdMoveNecessaryResult =
BwdMoveNecessary( pNewPage, aRect);
const bool bObjsInNewUpper( nBwdMoveNecessaryResult == 2 ||
@@ -213,7 +212,6 @@ sal_Bool SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool
return _WouldFit( nSpace, pNewUpper, nMoveAnyway == 2,
bObjsInNewUpper );
- // <--
}
//Bei einem spaltigen Bereichsfrischling kann _WouldFit kein
//brauchbares Ergebnis liefern, also muessen wir wirklich
@@ -276,9 +274,8 @@ bool lcl_IsCalcUpperAllowed( const SwFrm& rFrm )
{
return !rFrm.GetUpper()->IsSctFrm() &&
!rFrm.GetUpper()->IsFooterFrm() &&
- // --> OD 2004-11-02 #i23129#, #i36347# - no format of upper Writer fly frame
+ // #i23129#, #i36347# - no format of upper Writer fly frame
!rFrm.GetUpper()->IsFlyFrm() &&
- // <--
!( rFrm.GetUpper()->IsTabFrm() && rFrm.GetUpper()->GetUpper()->IsInTab() ) &&
!( rFrm.IsTabFrm() && rFrm.GetUpper()->IsInTab() );
}
@@ -325,7 +322,7 @@ void SwFrm::PrepareMake()
}
}
- // --> OD 2005-03-04 #i44049# - no format of previous frame, if current
+ // #i44049# - no format of previous frame, if current
// frame is a table frame and its previous frame wants to keep with it.
const bool bFormatPrev = !bTab ||
!GetPrev() ||
@@ -393,10 +390,9 @@ void SwFrm::PrepareMake()
void SwFrm::OptPrepareMake()
{
- // --> OD 2004-11-02 #i23129#, #i36347# - no format of upper Writer fly frame
+ // #i23129#, #i36347# - no format of upper Writer fly frame
if ( GetUpper() && !GetUpper()->IsFooterFrm() &&
!GetUpper()->IsFlyFrm() )
- // <--
{
GetUpper()->Calc();
OSL_ENSURE( GetUpper(), ":-( Layoutgeruest wackelig (Upper wech)." );
@@ -593,7 +589,7 @@ void SwFrm::MakePos()
// NOTE: Footer frame is <ColLocked()> during its
// <FormatSize(..)>, which is called from <Format(..)>, which
// is called from <MakeAll()>, which is called from <Calc()>.
- // --> OD 2005-11-17 #i56850#
+ // #i56850#
// - no format of upper Writer fly frame, which is anchored
// at-paragraph or at-character.
if ( !GetUpper()->IsTabFrm() &&
@@ -606,7 +602,6 @@ void SwFrm::MakePos()
{
GetUpper()->Calc();
}
- // <--
pPrv = lcl_Prev( this, sal_False );
if ( !bUseUpper && pPrv )
{
@@ -667,7 +662,7 @@ void SwFrm::MakePos()
|* SwPageFrm::MakeAll()
|*
|*************************************************************************/
-// --> OD 2004-07-01 #i28701# - new type <SwSortedObjs>
+// #i28701# - new type <SwSortedObjs>
void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* pFrm, long& rBot )
{
//Und dann kann es natuerlich noch Absatzgebundene
@@ -675,7 +670,7 @@ void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* pFrm, long& rBot )
long nMax = 0;
for ( sal_uInt16 i = 0; i < pSortedObjs->Count(); ++i )
{
- // --> OD 2004-07-01 #i28701# - consider changed type of <SwSortedObjs>
+ // #i28701# - consider changed type of <SwSortedObjs>
// entries.
SwAnchoredObject* pObj = (*pSortedObjs)[i];
long nTmp = 0;
@@ -694,7 +689,6 @@ void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* pFrm, long& rBot )
else
nTmp = pObj->GetObjRect().Bottom();
nMax = Max( nTmp, nMax );
- // <--
}
++nMax; //Unterkante vs. Hoehe!
rBot = Max( rBot, nMax );
@@ -813,18 +807,16 @@ void SwPageFrm::MakeAll()
if ( pSortedObjs )
lcl_CheckObjects( pSortedObjs, this, nBot );
nBot -= Frm().Top();
- // --> OD 2004-11-10 #i35143# - If second page frame
+ // #i35143# - If second page frame
// exists, the first page doesn't have to fulfill the
// visible area.
if ( !GetPrev() && !GetNext() )
- // <--
{
nBot = Max( nBot, pSh->VisArea().Height() );
}
- // --> OD 2004-11-10 #i35143# - Assure, that the page
+ // #i35143# - Assure, that the page
// doesn't exceed the defined browse height.
Frm().Height( Min( nBot, BROWSE_HEIGHT ) );
- // <--
}
Prt().Left ( pAttrs->CalcLeftLine() + aBorder.Width() );
Prt().Top ( nTop );
@@ -1032,7 +1024,7 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
for (sal_uInt16 i = 0; GetDrawObjs() && i < GetDrawObjs()->Count();++i)
{
- // --> OD 2004-07-01 #i28701# - consider changed type of
+ // #i28701# - consider changed type of
// <SwSortedObjs> entries
SwAnchoredObject* pObj = (*GetDrawObjs())[i];
const SwFrmFmt& rFmt = pObj->GetFrmFmt();
@@ -1049,7 +1041,6 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
bFly ? rFmt.GetFrmSize().GetWidth()
: pObj->GetObjRect().Width() );
}
- // <--
}
const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
@@ -1129,9 +1120,8 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
|*************************************************************************/
#define STOP_FLY_FORMAT 10
-// --> OD 2006-09-25 #b6448963# - loop prevention
+// - loop prevention
const int cnStopFormat = 15;
-// <--
inline void ValidateSz( SwFrm *pFrm )
{
@@ -1165,9 +1155,8 @@ void SwCntntFrm::MakeAll()
LockJoin();
long nFormatCount = 0;
- // --> OD 2006-09-25 #b6448963# - loop prevention
+ // - loop prevention
int nConsequetiveFormatsWithoutChange = 0;
- // <--
PROTOCOL_ENTER( this, PROT_MAKEALL, 0, 0 )
#if OSL_DEBUG_LEVEL > 1
@@ -1243,16 +1232,15 @@ void SwCntntFrm::MakeAll()
}
}
- // --> OD 2008-08-12 #b6732519#
+ //
if ( GetUpper()->IsSctFrm() &&
HasFollow() &&
GetFollow()->GetFrm() == GetNext() )
{
dynamic_cast<SwTxtFrm*>(this)->JoinFrm();
}
- // <--
- // --> OD 2004-06-23 #i28701# - move master forward, if it has to move,
+ // #i28701# - move master forward, if it has to move,
// because of its object positioning.
if ( !static_cast<SwTxtFrm*>(this)->IsFollow() )
{
@@ -1261,7 +1249,7 @@ void SwCntntFrm::MakeAll()
*(GetAttrSet()->GetDoc()),
*(static_cast<SwTxtFrm*>(this)),
nToPageNum );
- // --> OD 2006-01-27 #i58182#
+ // #i58182#
// Also move a paragraph forward, which is the first one inside a table cell.
if ( bMoveFwdByObjPos &&
FindPageFrm()->GetPhyPageNum() < nToPageNum &&
@@ -1274,9 +1262,7 @@ void SwCntntFrm::MakeAll()
bMovedFwd = sal_True;
MoveFwd( bMakePage, sal_False );
}
- // <--
}
- // <--
//Wenn ein Follow neben seinem Master steht und nicht passt, kann er
//gleich verschoben werden.
@@ -1319,10 +1305,9 @@ void SwCntntFrm::MakeAll()
while ( !bValidPos || !bValidSize || !bValidPrtArea )
{
- // --> OD 2006-09-25 #b6448963# - loop prevention
+ // - loop prevention
SwRect aOldFrm_StopFormat( Frm() );
SwRect aOldPrt_StopFormat( Prt() );
- // <--
if ( sal_True == (bMoveable = IsMoveable()) )
{
SwFrm *pPre = GetIndPrev();
@@ -1354,7 +1339,7 @@ void SwCntntFrm::MakeAll()
//FixSize einstellen, die VarSize wird von Format() justiert.
if ( !bValidSize )
{
- // --> OD 2006-01-03 #125452#
+ // #125452#
// invalidate printing area flag, if the following conditions are hold:
// - current frame width is 0.
// - current printing area width is 0.
@@ -1375,27 +1360,25 @@ void SwCntntFrm::MakeAll()
}
(Frm().*fnRect->fnSetWidth)( nNewFrmWidth );
- // <--
}
if ( !bValidPrtArea )
{
const long nOldW = (Prt().*fnRect->fnGetWidth)();
- // --> OD 2004-09-28 #i34730# - keep current frame height
+ // #i34730# - keep current frame height
const SwTwips nOldH = (Frm().*fnRect->fnGetHeight)();
- // <--
MakePrtArea( rAttrs );
if ( nOldW != (Prt().*fnRect->fnGetWidth)() )
Prepare( PREP_FIXSIZE_CHG );
- // --> OD 2004-09-28 #i34730# - check, if frame height has changed.
+ // #i34730# - check, if frame height has changed.
// If yes, send a PREP_ADJUST_FRM and invalidate the size flag to
// force a format. The format will check in its method
// <SwTxtFrm::CalcPreps()>, if the already formatted lines still
// fit and if not, performs necessary actions.
- // --> OD 2005-01-10 #i40150# - no check, if frame is undersized.
+ // #i40150# - no check, if frame is undersized.
if ( bValidSize && !IsUndersized() &&
nOldH != (Frm().*fnRect->fnGetHeight)() )
{
- // --> OD 2004-11-25 #115759# - no PREP_ADJUST_FRM and size
+ // #115759# - no PREP_ADJUST_FRM and size
// invalidation, if height decreases only by the additional
// lower space as last content of a table cell and an existing
// follow containing one line exists.
@@ -1409,9 +1392,7 @@ void SwCntntFrm::MakeAll()
Prepare( PREP_ADJUST_FRM );
bValidSize = sal_False;
}
- // <--
}
- // <--
}
//Damit die Witwen- und Waisen-Regelung eine Change bekommt muss der
@@ -1447,7 +1428,7 @@ void SwCntntFrm::MakeAll()
++nFormatCount;
if( nFormatCount > STOP_FLY_FORMAT )
SetFlyLock( sal_True );
- // --> OD 2006-09-25 #b6448963# - loop prevention
+ // - loop prevention
// No format any longer, if <cnStopFormat> consequetive formats
// without change occur.
if ( nConsequetiveFormatsWithoutChange <= cnStopFormat )
@@ -1460,7 +1441,6 @@ void SwCntntFrm::MakeAll()
OSL_FAIL( "debug assertion: <SwCntntFrm::MakeAll()> - format of text frame suppressed by fix b6448963" );
}
#endif
- // <--
}
//Wenn ich der erste einer Kette bin koennte ich mal sehen ob
@@ -1544,7 +1524,7 @@ void SwCntntFrm::MakeAll()
//dazu fuehren, dass seine Position obwohl unrichtig valide ist.
if ( bValidPos )
{
- // --> OD 2006-01-23 #i59341#
+ // #i59341#
// Workaround for inadequate layout algorithm:
// suppress invalidation and calculation of position, if paragraph
// has formatted itself at least STOP_FLY_FORMAT times and
@@ -1554,7 +1534,6 @@ void SwCntntFrm::MakeAll()
if ( bFtn &&
nFormatCount <= STOP_FLY_FORMAT &&
!GetDrawObjs() )
- // <--
{
bValidPos = sal_False;
MakePos();
@@ -1563,7 +1542,7 @@ void SwCntntFrm::MakeAll()
}
}
- // --> OD 2006-09-25 #b6448963# - loop prevention
+ // - loop prevention
{
if ( aOldFrm_StopFormat == Frm() &&
aOldPrt_StopFormat == Prt() )
@@ -1575,7 +1554,6 @@ void SwCntntFrm::MakeAll()
nConsequetiveFormatsWithoutChange = 0;
}
}
- // <--
//Wieder ein Wert ungueltig? - dann nochmal das ganze...
if ( !bValidPos || !bValidSize || !bValidPrtArea )
@@ -1779,13 +1757,11 @@ void SwCntntFrm::MakeAll()
LOOPING_LOUIE_LIGHT( bMovedFwd && bMovedBwd && !IsInBalancedSection() &&
(
- // --> FME 2005-01-26 #118572#
+ // #118572#
( bFtn && !FindFtnFrm()->GetRef()->IsInSct() ) ||
- // <--
- // --> FME 2005-01-27 #i33887#
+ // #i33887#
( IsInSct() && bKeep )
- // <--
// ... add your conditions here ...
@@ -1883,12 +1859,11 @@ sal_Bool lcl_IsNextFtnBoss( const SwFrm *pFrm, const SwFrm* pNxt )
return ( pFrm && pNxt && pFrm->GetNext() == pNxt );
}
-// --> OD 2007-11-26 #b6614158#
+//
sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
SwLayoutFrm *pNewUpper,
sal_Bool bTstMove,
const bool bObjsInNewUpper )
-// <--
{
//Damit die Fussnote sich ihren Platz sorgsam waehlt, muss
//sie in jedem Fall gemoved werden, wenn zwischen dem
@@ -1912,11 +1887,10 @@ sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
pTmpPrev = pTmpPrev->GetNext();
do
{
- // --> FME 2005-03-31 #b6236853# #i46181#
+ // #i46181#
SwTwips nSecondCheck = 0;
SwTwips nOldSpace = nSpace;
sal_Bool bOldSplit = bSplit;
- // <--
if ( bTstMove || IsInFly() || ( IsInSct() &&
( pFrm->GetUpper()->IsColBodyFrm() || ( pFtnFrm &&
@@ -1985,7 +1959,7 @@ sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
bCommonBorder = pSct->GetFmt()->GetBalancedColumns().GetValue();
}
- // --> FME 2005-03-31 #b6236853# #i46181#
+ // #i46181#
nSecondCheck = ( 1 == nSecondCheck &&
pFrm == this &&
IsTxtFrm() &&
@@ -1993,7 +1967,6 @@ sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
!static_cast<const SwTxtFrm*>(this)->IsEmpty() ) ?
nUpper :
0;
- // <--
nUpper += bCommonBorder ?
rAttrs.GetBottomLine( *(pFrm) ) :
@@ -2002,9 +1975,8 @@ sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
}
else
{
- // --> FME 2005-03-31 #b6236853# #i46181#
+ // #i46181#
nSecondCheck = 0;
- // <--
if( pFrm->IsVertical() )
nUpper = pFrm->Frm().Width() - pFrm->Prt().Width();
@@ -2018,7 +1990,7 @@ sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
{
bRet = sal_False;
- // --> FME 2005-03-31 #b6236853# #i46181#
+ // #i46181#
if ( nSecondCheck > 0 )
{
// The following code is indented to solve a (rare) problem
@@ -2037,7 +2009,6 @@ sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
bSplit = sal_True;
}
}
- // <--
}
}
@@ -2075,7 +2046,7 @@ sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
pNxt->FindFtnFrm()->GetAttr() == pFtnFrm->GetAttr() ) ) )
{
// ProbeFormatierung vertraegt keine absatz- oder gar zeichengebundene Objekte
- // --> OD 2007-11-26 #b6614158#
+ //
// current solution for the test formatting doesn't work, if
// objects are present in the remaining area of the new upper
if ( bTstMove &&
@@ -2083,7 +2054,6 @@ sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
{
return sal_True;
}
- // <--
if ( !pNxt->IsValid() )
MakeNxt( pFrm, pNxt );
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index bc2aaa7410..1ad377c2de 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -206,14 +206,13 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
{
if ( rOld.GetNumCols() <= 1 && rNew.GetNumCols() <= 1 && !bChgFtn )
return;
- // --> OD 2009-08-12 #i97379#
+ // #i97379#
// If current lower is a no text frame, then columns are not allowed
if ( Lower() && Lower()->IsNoTxtFrm() &&
rNew.GetNumCols() > 1 )
{
return;
}
- // <--
sal_uInt16 nNewNum, nOldNum = 1;
if( Lower() && Lower()->IsColumnFrm() )
@@ -360,12 +359,11 @@ void SwLayoutFrm::AdjustColumns( const SwFmtCol *pAttr, sal_Bool bAdjustAttribut
const sal_Bool bR2L = IsRightToLeft();
SwFrm *pCol = bR2L ? GetLastLower() : Lower();
- // --> FME 2004-07-16 #i27399#
+ // #i27399#
// bOrtho means we have to adjust the column frames manually. Otherwise
// we may use the values returned by CalcColWidth:
const sal_Bool bOrtho = pAttr->IsOrtho() && pAttr->GetNumCols() > 0;
long nGutter = 0;
- // <--
for ( sal_uInt16 i = 0; i < pAttr->GetNumCols(); ++i )
{
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 0005e2e7f0..5cc179773e 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -117,7 +117,6 @@
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTSSORT
#include <svl/svstdarr.hxx>
#endif
@@ -130,8 +129,9 @@
#include "ndtxt.hxx"
#include "dflyobj.hxx"
#include <fntcache.hxx>
-// OD 2004-05-24 #i28701#
-#include <sortedobjs.hxx>
+#include <sortedobjs.hxx> // #i28701#
+
+#include <rtl/strbuf.hxx>
sal_uLong SwProtocol::nRecord = 0;
SwImplProtocol* SwProtocol::pImpl = NULL;
@@ -151,9 +151,9 @@ sal_uLong lcl_GetFrameId( const SwFrm* pFrm )
class SwImplProtocol
{
SvFileStream *pStream; // Ausgabestream
- SvUShortsSort *pFrmIds; // welche FrmIds sollen aufgezeichnet werden ( NULL == alle )
+ std::set<sal_uInt16> *pFrmIds; // welche FrmIds sollen aufgezeichnet werden ( NULL == alle )
std::vector<long> aVars; // Variables
- ByteString aLayer; // Einrueckung der Ausgabe (" " pro Start/End)
+ rtl::OStringBuffer aLayer; // Einrueckung der Ausgabe (" " pro Start/End)
sal_uInt16 nTypes; // welche Typen sollen aufgezeichnet werden
sal_uInt16 nLineCount; // Ausgegebene Zeilen
sal_uInt16 nMaxLines; // Maximal auszugebende Zeilen
@@ -163,7 +163,7 @@ class SwImplProtocol
void _Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong nAct, void* pParam );
sal_Bool NewStream();
void CheckLine( ByteString& rLine );
- void SectFunc( ByteString &rOut, const SwFrm* pFrm, sal_uLong nAct, void* pParam );
+ void SectFunc( rtl::OStringBuffer& rOut, const SwFrm* pFrm, sal_uLong nAct, void* pParam );
public:
SwImplProtocol();
~SwImplProtocol();
@@ -328,6 +328,7 @@ SwImplProtocol::~SwImplProtocol()
pStream->Close();
delete pStream;
}
+ pFrmIds->clear();
delete pFrmIds;
aVars.clear();
}
@@ -349,6 +350,7 @@ void SwImplProtocol::CheckLine( ByteString& rLine )
if( "[frmid" == aTmp ) // Bereich FrmIds
{
nInitFile = 1;
+ pFrmIds->clear();
delete pFrmIds;
pFrmIds = NULL; // Default: Alle Frames aufzeichnen
}
@@ -469,21 +471,21 @@ void SwImplProtocol::FileInit()
* lcl_Start sorgt fuer Einrueckung um zwei Blanks bei ACT_START
* und nimmt diese bei ACT_END wieder zurueck.
* --------------------------------------------------*/
-void lcl_Start( ByteString& rOut, ByteString& rLay, sal_uLong nAction )
+void lcl_Start(rtl::OStringBuffer& rOut, rtl::OStringBuffer& rLay, sal_uLong nAction)
{
if( nAction == ACT_START )
{
- rLay += " ";
- rOut += " On";
+ rLay.append(RTL_CONSTASCII_STRINGPARAM(" "));
+ rOut.append(RTL_CONSTASCII_STRINGPARAM(" On"));
}
else if( nAction == ACT_END )
{
- if( rLay.Len() > 1 )
+ if( rLay.getLength() > 1 )
{
- rLay.Erase( rLay.Len() - 2 );
- rOut.Erase( 0, 2 );
+ rLay.remove(rLay.getLength() - 2, rLay.getLength());
+ rOut.remove(0, 2);
}
- rOut += " Off";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM(" Off"));
}
}
@@ -492,63 +494,63 @@ void lcl_Start( ByteString& rOut, ByteString& rLay, sal_uLong nAction )
* des Frames aus, "+" fuer valid, "-" fuer invalid.
* --------------------------------------------------*/
-void lcl_Flags( ByteString& rOut, const SwFrm* pFrm )
+void lcl_Flags(rtl::OStringBuffer& rOut, const SwFrm* pFrm)
{
- rOut += " Sz";
- rOut += pFrm->GetValidSizeFlag() ? '+' : '-';
- rOut += " Ps";
- rOut += pFrm->GetValidPosFlag() ? '+' : '-';
- rOut += " PA";
- rOut += pFrm->GetValidPrtAreaFlag() ? '+' : '-';
+ rOut.append(RTL_CONSTASCII_STRINGPARAM(" Sz"));
+ rOut.append(pFrm->GetValidSizeFlag() ? '+' : '-');
+ rOut.append(RTL_CONSTASCII_STRINGPARAM(" Ps"));
+ rOut.append(pFrm->GetValidPosFlag() ? '+' : '-');
+ rOut.append(RTL_CONSTASCII_STRINGPARAM(" PA"));
+ rOut.append(pFrm->GetValidPrtAreaFlag() ? '+' : '-');
}
/* --------------------------------------------------
* lcl_FrameType gibt den Typ des Frames in Klartext aus.
* --------------------------------------------------*/
-void lcl_FrameType( ByteString& rOut, const SwFrm* pFrm )
+void lcl_FrameType( rtl::OStringBuffer& rOut, const SwFrm* pFrm )
{
if( pFrm->IsTxtFrm() )
- rOut += "Txt ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Txt "));
else if( pFrm->IsLayoutFrm() )
{
if( pFrm->IsPageFrm() )
- rOut += "Page ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Page "));
else if( pFrm->IsColumnFrm() )
- rOut += "Col ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Col "));
else if( pFrm->IsBodyFrm() )
{
if( pFrm->GetUpper() && pFrm->IsColBodyFrm() )
- rOut += "(Col)";
- rOut += "Body ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("(Col)"));
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Body "));
}
else if( pFrm->IsRootFrm() )
- rOut += "Root ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Root "));
else if( pFrm->IsCellFrm() )
- rOut += "Cell ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Cell "));
else if( pFrm->IsTabFrm() )
- rOut += "Tab ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Tab "));
else if( pFrm->IsRowFrm() )
- rOut += "Row ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Row "));
else if( pFrm->IsSctFrm() )
- rOut += "Sect ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Sect "));
else if( pFrm->IsHeaderFrm() )
- rOut += "Header ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Header "));
else if( pFrm->IsFooterFrm() )
- rOut += "Footer ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Footer "));
else if( pFrm->IsFtnFrm() )
- rOut += "Ftn ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Ftn "));
else if( pFrm->IsFtnContFrm() )
- rOut += "FtnCont ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("FtnCont "));
else if( pFrm->IsFlyFrm() )
- rOut += "Fly ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Fly "));
else
- rOut += "Layout ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Layout "));
}
else if( pFrm->IsNoTxtFrm() )
- rOut += "NoTxt ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("NoTxt "));
else
- rOut += "Not impl. ";
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Not impl. "));
}
/* --------------------------------------------------
@@ -568,7 +570,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
{
case 1: InsertFrm( nId ); break;
case 2: DeleteFrm( nId ); break;
- case 3: delete pFrmIds; pFrmIds = NULL; break;
+ case 3: pFrmIds->clear(); delete pFrmIds; pFrmIds = NULL; break;
case 4: delete pStream; pStream = NULL; break;
}
return;
@@ -576,7 +578,7 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
if( !pStream && !NewStream() )
return; // Immer noch kein Stream
- if( pFrmIds && !pFrmIds->Seek_Entry( sal_uInt16(lcl_GetFrameId( pFrm )) ) )
+ if( pFrmIds && !pFrmIds->count( sal_uInt16(lcl_GetFrameId( pFrm )) ) )
return; // gehoert nicht zu den gewuenschten FrmIds
if( !(pFrm->GetType() & nTypes) )
@@ -585,75 +587,92 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
if( 1 == nTestMode && nFunction != PROT_TESTFORMAT )
return; // Wir sollen nur innerhalb einer Testformatierung aufzeichnen
sal_Bool bTmp = sal_False;
- ByteString aOut = aLayer;
- aOut += ByteString::CreateFromInt64( lcl_GetFrameId( pFrm ) );
- aOut += ' ';
+ rtl::OStringBuffer aOut(aLayer);
+ aOut.append(static_cast<sal_Int64>(lcl_GetFrameId(pFrm)));
+ aOut.append(' ');
lcl_FrameType( aOut, pFrm ); // dann den FrameType
switch ( nFunction ) // und die Funktion
{
case PROT_SNAPSHOT: lcl_Flags( aOut, pFrm );
break;
- case PROT_MAKEALL: aOut += "MakeAll";
+ case PROT_MAKEALL: aOut.append(RTL_CONSTASCII_STRINGPARAM("MakeAll"));
lcl_Start( aOut, aLayer, nAct );
if( nAct == ACT_START )
lcl_Flags( aOut, pFrm );
break;
case PROT_MOVE_FWD: bTmp = sal_True; // NoBreak
- case PROT_MOVE_BWD: aOut += ( nFunction == bTmp ) ? "Fwd" : "Bwd";
+ case PROT_MOVE_BWD:
+ if (nFunction == bTmp)
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("Fwd"));
+ else
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("Bwd"));
lcl_Start( aOut, aLayer, nAct );
if( pParam )
{
- aOut += ' ';
- aOut += ByteString::CreateFromInt32( *((sal_uInt16*)pParam) );
+ aOut.append(' ');
+ aOut.append(static_cast<sal_Int32>(*((sal_uInt16*)pParam)));
}
break;
case PROT_GROW_TST: if( ACT_START != nAct )
return;
- aOut += "TestGrow";
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("TestGrow"));
break;
case PROT_SHRINK_TST: if( ACT_START != nAct )
return;
- aOut += "TestShrink";
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("TestShrink"));
break;
case PROT_ADJUSTN :
case PROT_SHRINK: bTmp = sal_True; // NoBreak
- case PROT_GROW: aOut += !bTmp ? "Grow" :
- ( nFunction == PROT_SHRINK ? "Shrink" : "AdjustNgbhd" );
+ case PROT_GROW:
+ if (!bTmp)
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("Grow"));
+ else
+ {
+ if (nFunction == PROT_SHRINK)
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("Shrink"));
+ else
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("AdjustNgbhd"));
+ }
lcl_Start( aOut, aLayer, nAct );
if( pParam )
{
- aOut += ' ';
- aOut += ByteString::CreateFromInt64( *((long*)pParam) );
+ aOut.append(' ');
+ aOut.append(static_cast<sal_Int64>(*((long*)pParam)));
}
break;
case PROT_POS: break;
- case PROT_PRTAREA: aOut += "PrtArea";
+ case PROT_PRTAREA: aOut.append(RTL_CONSTASCII_STRINGPARAM("PrtArea"));
lcl_Start( aOut, aLayer, nAct );
break;
- case PROT_SIZE: aOut += "Size";
+ case PROT_SIZE: aOut.append(RTL_CONSTASCII_STRINGPARAM("Size"));
lcl_Start( aOut, aLayer, nAct );
- aOut += ' ';
- aOut += ByteString::CreateFromInt64( pFrm->Frm().Height() );
+ aOut.append(' ');
+ aOut.append(static_cast<sal_Int64>(pFrm->Frm().Height()));
break;
- case PROT_LEAF: aOut += "Prev/NextLeaf";
+ case PROT_LEAF: aOut.append(RTL_CONSTASCII_STRINGPARAM("Prev/NextLeaf"));
lcl_Start( aOut, aLayer, nAct );
- aOut += ' ';
+ aOut.append(' ');
if( pParam )
{
- aOut += ' ';
- aOut += ByteString::CreateFromInt64( lcl_GetFrameId( (SwFrm*)pParam ) );
+ aOut.append(' ');
+ aOut.append(static_cast<sal_Int64>(lcl_GetFrameId((SwFrm*)pParam)));
}
break;
case PROT_FILE_INIT: FileInit();
- aOut = "Initialize";
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("Initialize"));
break;
- case PROT_SECTION: SectFunc( aOut, pFrm, nAct, pParam );
+ case PROT_SECTION: SectFunc(aOut, pFrm, nAct, pParam);
break;
case PROT_CUT: bTmp = sal_True; // NoBreak
- case PROT_PASTE: aOut += bTmp ? "Cut from " : "Paste to ";
- aOut += ByteString::CreateFromInt64( lcl_GetFrameId( (SwFrm*)pParam ) );
+ case PROT_PASTE:
+ if (bTmp)
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("Cut from "));
+ else
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("Paste to "));
+ aOut.append(static_cast<sal_Int64>(lcl_GetFrameId((SwFrm*)pParam)));
break;
- case PROT_TESTFORMAT: aOut += "Test";
+ case PROT_TESTFORMAT:
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("Test"));
lcl_Start( aOut, aLayer, nAct );
if( ACT_START == nAct )
nTestMode |= 2;
@@ -665,36 +684,36 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
SwRect& rFrm = *((SwRect*)pParam);
if( pFrm->Frm().Pos() != rFrm.Pos() )
{
- aOut += "PosChg: (";
- aOut += ByteString::CreateFromInt64(rFrm.Left());
- aOut += ", ";
- aOut += ByteString::CreateFromInt64(rFrm.Top());
- aOut += ") (";
- aOut += ByteString::CreateFromInt64(pFrm->Frm().Left());
- aOut += ", ";
- aOut += ByteString::CreateFromInt64(pFrm->Frm().Top());
- aOut += ") ";
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("PosChg: ("));
+ aOut.append(static_cast<sal_Int64>(rFrm.Left()));
+ aOut.append(RTL_CONSTASCII_STRINGPARAM(", "));
+ aOut.append(static_cast<sal_Int64>(rFrm.Top()));
+ aOut.append(RTL_CONSTASCII_STRINGPARAM(") ("));
+ aOut.append(static_cast<sal_Int64>(pFrm->Frm().Left()));
+ aOut.append(RTL_CONSTASCII_STRINGPARAM(", "));
+ aOut.append(static_cast<sal_Int64>(pFrm->Frm().Top()));
+ aOut.append(RTL_CONSTASCII_STRINGPARAM(") "));
}
if( pFrm->Frm().Height() != rFrm.Height() )
{
- aOut += "Height: ";
- aOut += ByteString::CreateFromInt64(rFrm.Height());
- aOut += " -> ";
- aOut += ByteString::CreateFromInt64(pFrm->Frm().Height());
- aOut += " ";
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("Height: "));
+ aOut.append(static_cast<sal_Int64>(rFrm.Height()));
+ aOut.append(RTL_CONSTASCII_STRINGPARAM(" -> "));
+ aOut.append(static_cast<sal_Int64>(pFrm->Frm().Height()));
+ aOut.append(RTL_CONSTASCII_STRINGPARAM(" "));
}
if( pFrm->Frm().Width() != rFrm.Width() )
{
- aOut += "Width: ";
- aOut += ByteString::CreateFromInt64(rFrm.Width());
- aOut += " -> ";
- aOut += ByteString::CreateFromInt64(pFrm->Frm().Width());
- aOut += " ";
+ aOut.append(RTL_CONSTASCII_STRINGPARAM("Width: "));
+ aOut.append(static_cast<sal_Int64>(rFrm.Width()));
+ aOut.append(RTL_CONSTASCII_STRINGPARAM(" -> "));
+ aOut.append(static_cast<sal_Int64>(pFrm->Frm().Width()));
+ aOut.append(' ');
}
break;
}
}
- *pStream << aOut.GetBuffer() << endl; // Ausgabe
+ *pStream << aOut.getStr() << endl; // Ausgabe
pStream->Flush(); // Gleich auf die Platte, damit man mitlesen kann
if( ++nLineCount >= nMaxLines ) // Maximale Ausgabe erreicht?
SwProtocol::SetRecord( 0 ); // => Ende der Aufzeichnung
@@ -705,23 +724,29 @@ void SwImplProtocol::_Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong
* hier werden die Ausgaben rund um SectionFrms abgehandelt.
* --------------------------------------------------*/
-void SwImplProtocol::SectFunc( ByteString &rOut, const SwFrm* , sal_uLong nAct, void* pParam )
+void SwImplProtocol::SectFunc(rtl::OStringBuffer &rOut, const SwFrm* , sal_uLong nAct, void* pParam)
{
sal_Bool bTmp = sal_False;
switch( nAct )
{
- case ACT_MERGE: rOut += "Merge Section ";
- rOut += ByteString::CreateFromInt64( lcl_GetFrameId( (SwFrm*)pParam ) );
+ case ACT_MERGE: rOut.append(RTL_CONSTASCII_STRINGPARAM("Merge Section "));
+ rOut.append(static_cast<sal_Int64>(lcl_GetFrameId((SwFrm*)pParam)));
break;
case ACT_CREATE_MASTER: bTmp = sal_True; // NoBreak
- case ACT_CREATE_FOLLOW: rOut += "Create Section ";
- rOut += bTmp ? "Master to " : "Follow from ";
- rOut += ByteString::CreateFromInt64( lcl_GetFrameId( (SwFrm*)pParam ) );
+ case ACT_CREATE_FOLLOW: rOut.append(RTL_CONSTASCII_STRINGPARAM("Create Section "));
+ if (bTmp)
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Master to "));
+ else
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Follow from "));
+ rOut.append(static_cast<sal_Int64>(lcl_GetFrameId((SwFrm*)pParam)));
break;
case ACT_DEL_MASTER: bTmp = sal_True; // NoBreak
- case ACT_DEL_FOLLOW: rOut += "Delete Section ";
- rOut += bTmp ? "Master to " : "Follow from ";
- rOut += ByteString::CreateFromInt64( lcl_GetFrameId( (SwFrm*)pParam ) );
+ case ACT_DEL_FOLLOW: rOut.append(RTL_CONSTASCII_STRINGPARAM("Delete Section "));
+ if (bTmp)
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Master to "));
+ else
+ rOut.append(RTL_CONSTASCII_STRINGPARAM("Follow from "));
+ rOut.append(static_cast<sal_Int64>(lcl_GetFrameId((SwFrm*)pParam)));
break;
}
}
@@ -735,10 +760,10 @@ void SwImplProtocol::SectFunc( ByteString &rOut, const SwFrm* , sal_uLong nAct,
sal_Bool SwImplProtocol::InsertFrm( sal_uInt16 nId )
{
if( !pFrmIds )
- pFrmIds = new SvUShortsSort(5,5);
- if( pFrmIds->Seek_Entry( nId ) )
+ pFrmIds = new std::set<sal_uInt16>;
+ if( pFrmIds->count( nId ) )
return sal_False;
- pFrmIds->Insert( nId );
+ pFrmIds->insert( nId );
return sal_True;
}
@@ -748,11 +773,11 @@ sal_Bool SwImplProtocol::InsertFrm( sal_uInt16 nId )
* --------------------------------------------------*/
sal_Bool SwImplProtocol::DeleteFrm( sal_uInt16 nId )
{
- sal_uInt16 nPos;
- if( !pFrmIds || !pFrmIds->Seek_Entry( nId, &nPos ) )
+ if( !pFrmIds )
return sal_False;
- pFrmIds->Remove( nPos );
- return sal_True;
+ if ( pFrmIds->erase(nId) )
+ return sal_True;
+ return sal_False;
}
/*--------------------------------------------------
@@ -766,7 +791,7 @@ void SwImplProtocol::SnapShot( const SwFrm* pFrm, sal_uLong nFlags )
_Record( pFrm, PROT_SNAPSHOT, 0, 0);
if( pFrm->GetDrawObjs() && nFlags & SNAP_FLYFRAMES )
{
- aLayer += "[ ";
+ aLayer.append(RTL_CONSTASCII_STRINGPARAM("[ "));
const SwSortedObjs &rObjs = *pFrm->GetDrawObjs();
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
@@ -774,16 +799,16 @@ void SwImplProtocol::SnapShot( const SwFrm* pFrm, sal_uLong nFlags )
if ( pObj->ISA(SwFlyFrm) )
SnapShot( static_cast<SwFlyFrm*>(pObj), nFlags );
}
- if( aLayer.Len() > 1 )
- aLayer.Erase( aLayer.Len() - 2 );
+ if (aLayer.getLength() > 1)
+ aLayer.remove(aLayer.getLength() - 2, aLayer.getLength());
}
if( pFrm->IsLayoutFrm() && nFlags & SNAP_LOWER &&
( !pFrm->IsTabFrm() || nFlags & SNAP_TABLECONT ) )
{
- aLayer += " ";
+ aLayer.append(RTL_CONSTASCII_STRINGPARAM(" "));
SnapShot( ((SwLayoutFrm*)pFrm)->Lower(), nFlags );
- if( aLayer.Len() > 1 )
- aLayer.Erase( aLayer.Len() - 2 );
+ if (aLayer.getLength() > 1)
+ aLayer.remove(aLayer.getLength() - 2, aLayer.getLength());
}
pFrm = pFrm->GetNext();
}
@@ -863,6 +888,6 @@ void SwFrmChangesLeave::Leave()
SwProtocol::Record( pFrm, PROT_FRMCHANGES, 0, &aFrm );
}
-#endif // DBG_UTIL
+#endif // OSL_DEBUG_LEVEL > 1
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/dumpfilter.cxx b/sw/source/core/layout/dumpfilter.cxx
new file mode 100644
index 0000000000..b5ee4eeb49
--- /dev/null
+++ b/sw/source/core/layout/dumpfilter.cxx
@@ -0,0 +1,210 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Novell Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Cedric Bosdonnat <cbosdonnat@novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include "dumpfilter.hxx"
+
+#include <wrtsh.hxx>
+#include <docsh.hxx>
+#include <rootfrm.hxx>
+#include <unotxdoc.hxx>
+#include <unobaseclass.hxx>
+#include <cppuhelper/weak.hxx>
+#include <vcl/svapp.hxx>
+
+#include <comphelper/mediadescriptor.hxx>
+
+#include <libxml/xmlwriter.h>
+
+using namespace ::com::sun::star;
+
+::rtl::OUString SAL_CALL LayoutDumpFilter_getImplementationName() throw( uno::RuntimeException )
+{
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Writer.LayoutDump" ) );
+}
+
+uno::Sequence< rtl::OUString > SAL_CALL LayoutDumpFilter_getSupportedServiceNames() throw( uno::RuntimeException )
+{
+ uno::Sequence< rtl::OUString > aSeq( 1 );
+ aSeq[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.ExportFilter" ) );
+ return aSeq;
+}
+
+uno::Reference< uno::XInterface > SAL_CALL LayoutDumpFilter_createInstance(
+ const uno::Reference< lang::XMultiServiceFactory > & )
+{
+ return static_cast< cppu::OWeakObject* >( new sw::LayoutDumpFilter( ) );
+}
+
+namespace
+{
+ int writeCallback( void* pContext, const char* sBuffer, int nLen )
+ {
+ int written = nLen;
+
+ // Actually write bytes to XOutputSream
+ try
+ {
+ uno::XInterface* pObj = ( uno::XInterface* )pContext;
+ uno::Reference< io::XOutputStream > xOut( pObj, uno::UNO_QUERY_THROW );
+
+ // Don't output the terminating \0 to the xml or the file will be invalid
+ uno::Sequence< sal_Int8 > seq( nLen );
+ strncpy( ( char * ) seq.getArray() , sBuffer, nLen );
+ xOut->writeBytes( seq );
+ }
+ catch (const uno::Exception&)
+ {
+ written = -1;
+ }
+
+ return written;
+ }
+
+ int closeCallback( void* pContext )
+ {
+ int result = 0;
+ try
+ {
+ uno::XInterface* pObj = ( uno::XInterface* )pContext;
+ uno::Reference< io::XOutputStream > xOut( pObj, uno::UNO_QUERY_THROW );
+ xOut->closeOutput( );
+ }
+ catch (const uno::Exception&)
+ {
+ result = -1;
+ }
+ return result;
+ }
+}
+
+namespace sw
+{
+
+ LayoutDumpFilter::LayoutDumpFilter( )
+ {
+ }
+
+ LayoutDumpFilter::~LayoutDumpFilter( )
+ {
+ }
+
+ // XFilter
+ sal_Bool LayoutDumpFilter::filter( const uno::Sequence< beans::PropertyValue >& aDescriptor )
+ throw (uno::RuntimeException)
+ {
+ sal_Bool bRet = sal_False;
+
+ comphelper::MediaDescriptor aMediaDesc = aDescriptor;
+
+ // Get the output stream
+ uno::Reference< io::XOutputStream > xOut = aMediaDesc.getUnpackedValueOrDefault(
+ comphelper::MediaDescriptor::PROP_OUTPUTSTREAM(),
+ uno::Reference< io::XOutputStream >() );
+
+ // Actually get the SwRootFrm to call dumpAsXml
+ uno::Reference< lang::XUnoTunnel > xDocTunnel( m_xSrcDoc, uno::UNO_QUERY );
+ SwXTextDocument* pXDoc = UnoTunnelGetImplementation< SwXTextDocument >( xDocTunnel );
+ if ( pXDoc )
+ {
+ SwRootFrm* pLayout = pXDoc->GetDocShell()->GetWrtShell()->GetLayout();
+
+ // Get sure that the whole layout is processed: set a visible area
+ // even though there isn't any need of it
+ pXDoc->GetDocShell()->GetWrtShell()->StartAction();
+ Rectangle aRect( 0, 0, 26000, 21000 );
+ pXDoc->GetDocShell()->SetVisArea( aRect );
+ pLayout->InvalidateAllCntnt( );
+ pXDoc->GetDocShell()->GetWrtShell()->EndAction();
+
+ // Dump the layout XML into the XOutputStream
+ xmlOutputBufferPtr outBuffer = xmlOutputBufferCreateIO(
+ writeCallback, closeCallback, ( void* ) xOut.get(), NULL );
+
+ xmlTextWriterPtr writer = xmlNewTextWriter( outBuffer );
+ xmlTextWriterStartDocument( writer, NULL, NULL, NULL );
+
+ // TODO This doesn't export the whole XML file, whereas dumpAsXML() does it nicely
+ pLayout->dumpAsXml( writer );
+
+ xmlTextWriterEndDocument( writer );
+ xmlFreeTextWriter( writer );
+
+ bRet = sal_True;
+ }
+
+ return bRet;
+ }
+
+ void LayoutDumpFilter::cancel( ) throw (uno::RuntimeException)
+ {
+ }
+
+ // XExporter
+ void LayoutDumpFilter::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
+ throw (lang::IllegalArgumentException, uno::RuntimeException)
+ {
+ m_xSrcDoc = xDoc;
+ }
+
+ // XInitialization
+ void LayoutDumpFilter::initialize( const uno::Sequence< uno::Any >& )
+ throw (uno::Exception, uno::RuntimeException)
+ {
+ }
+
+ // XServiceInfo
+ ::rtl::OUString LayoutDumpFilter::getImplementationName( )
+ throw (uno::RuntimeException)
+ {
+ return LayoutDumpFilter_getImplementationName();
+ }
+
+ sal_Bool LayoutDumpFilter::supportsService( const ::rtl::OUString& rServiceName )
+ throw (uno::RuntimeException)
+ {
+ uno::Sequence< rtl::OUString > seqServiceNames = getSupportedServiceNames();
+ const rtl::OUString* pArray = seqServiceNames.getConstArray();
+ for ( sal_Int32 nCounter=0; nCounter < seqServiceNames.getLength(); nCounter++ )
+ {
+ if ( pArray[nCounter] == rServiceName )
+ {
+ return sal_True ;
+ }
+ }
+ return sal_False ;
+ }
+
+ uno::Sequence< ::rtl::OUString > LayoutDumpFilter::getSupportedServiceNames()
+ throw (uno::RuntimeException)
+ {
+ return LayoutDumpFilter_getSupportedServiceNames();
+ }
+
+} // Namespace sw
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 0b84532e73..6eb8520ab3 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -158,7 +158,7 @@ const SwCellFrm *SwLayoutFrm::FirstCell() const
|*
|*************************************************************************/
-// --> OD 2006-02-01 #130797#
+// #130797#
// New parameter <_bInvestigateFtnForSections> controls investigation of
// content of footnotes for sections.
const SwFrm *SwLayoutFrm::ContainsAny( const bool _bInvestigateFtnForSections ) const
@@ -169,9 +169,8 @@ const SwFrm *SwLayoutFrm::ContainsAny( const bool _bInvestigateFtnForSections )
// Oder bis wir einen SectionFrm oder TabFrm gefunden haben
const SwLayoutFrm *pLayLeaf = this;
- // --> OD 2006-02-01 #130797#
+ // #130797#
const bool bNoFtn = IsSctFrm() && !_bInvestigateFtnForSections;
- // <--
do
{
while ( ( (!pLayLeaf->IsSctFrm() && !pLayLeaf->IsTabFrm())
@@ -457,7 +456,7 @@ SwPageFrm* SwFrm::FindPageFrm()
pRet = pRet->GetUpper();
else if ( pRet->IsFlyFrm() )
{
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
if ( static_cast<SwFlyFrm*>(pRet)->GetPageFrm() )
pRet = static_cast<SwFlyFrm*>(pRet)->GetPageFrm();
else
@@ -482,7 +481,7 @@ SwFtnBossFrm* SwFrm::FindFtnBossFrm( sal_Bool bFootnotes )
pRet = pRet->GetUpper();
else if ( pRet->IsFlyFrm() )
{
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
if ( static_cast<SwFlyFrm*>(pRet)->GetPageFrm() )
pRet = static_cast<SwFlyFrm*>(pRet)->GetPageFrm();
else
@@ -831,7 +830,7 @@ SwFrm *SwFrm::_FindNext()
return pRet;
}
-// --> OD 2005-12-01 #i27138# - add parameter <_bInSameFtn>
+// #i27138# - add parameter <_bInSameFtn>
SwCntntFrm *SwFrm::_FindNextCnt( const bool _bInSameFtn )
{
SwFrm *pThis = this;
@@ -870,9 +869,8 @@ SwCntntFrm *SwFrm::_FindNextCnt( const bool _bInSameFtn )
SwCntntFrm *pNxtCnt = ((SwCntntFrm*)pThis)->GetNextCntntFrm();
if ( pNxtCnt )
{
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
if ( bBody || ( bFtn && !_bInSameFtn ) )
- // <--
{
// handling for environments 'footnotes' and 'document body frames':
while ( pNxtCnt )
@@ -883,7 +881,7 @@ SwCntntFrm *SwFrm::_FindNextCnt( const bool _bInSameFtn )
pNxtCnt = pNxtCnt->GetNextCntntFrm();
}
}
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
else if ( bFtn && _bInSameFtn )
{
// handling for environments 'each footnote':
@@ -916,7 +914,6 @@ SwCntntFrm *SwFrm::_FindNextCnt( const bool _bInSameFtn )
return 0L;
}
}
- // <--
else if ( pThis->IsInFly() )
// handling for environments 'unlinked fly frame' and
// 'group of linked fly frames':
@@ -1044,14 +1041,13 @@ SwCntntFrm* SwFrm::_FindPrevCnt( const bool _bInSameFtn )
SwFtnFrm* pMasterFtnFrmOfCurr(
const_cast<SwFtnFrm*>(pFtnFrmOfCurr) );
pPrevCntntFrm = 0L;
- // --> OD 2007-07-05 #146872#
+ // #146872#
// correct wrong loop-condition
do {
pMasterFtnFrmOfCurr = pMasterFtnFrmOfCurr->GetMaster();
pPrevCntntFrm = pMasterFtnFrmOfCurr->FindLastCntnt();
} while ( !pPrevCntntFrm &&
pMasterFtnFrmOfCurr->GetMaster() );
- // <--
}
else
{
@@ -1398,12 +1394,12 @@ void SwFrm::SetInfFlags()
} while ( pFrm && !pFrm->IsPageFrm() ); //Oberhalb der Seite kommt nix
}
-/*-----------------22.8.2001 14:30------------------
+/*
* SwFrm::SetDirFlags( sal_Bool )
* actualizes the vertical or the righttoleft-flags.
* If the property is derived, it's from the upper or (for fly frames) from
* the anchor. Otherwise we've to call a virtual method to check the property.
- * --------------------------------------------------*/
+ */
void SwFrm::SetDirFlags( sal_Bool bVert )
{
@@ -1715,7 +1711,7 @@ const SwRowFrm* SwFrm::IsInSplitTableRow() const
OSL_ENSURE( pRow->GetUpper()->IsTabFrm(), "Confusion in table layout" );
const SwTabFrm* pTab = (SwTabFrm*)pRow->GetUpper();
- // --> OD 2006-06-28 #b6443897#
+ //
// If most upper row frame is a headline row, the current frame
// can't be in a splitted table row. Thus, add corresponding condition.
if ( pRow->GetNext() ||
@@ -1724,7 +1720,6 @@ const SwRowFrm* SwFrm::IsInSplitTableRow() const
!pTab->HasFollowFlowLine() ||
!pTab->GetFollow() )
return NULL;
- // <--
// skip headline
const SwRowFrm* pFollowRow = pTab->GetFollow()->GetFirstNonHeadlineRow();
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 9ba82022bd..db3b6546b5 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -216,7 +216,7 @@ sal_Bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldK
if( 0 != (pNxt = rThis.FindNextCnt()) &&
(!pFollow || pNxt != pFollow->GetFrm()))
{
- // --> FME 2006-05-15 #135914#
+ // #135914#
// The last row of a table only keeps with the next content
// it they are in the same section:
if ( bCheckIfLastRowShouldKeep )
@@ -235,7 +235,6 @@ sal_Bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldK
if ( pThisSection != pNextSection )
bKeep = sal_False;
}
- // <--
if ( bKeep )
{
@@ -311,12 +310,12 @@ sal_uInt8 SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRe
} while ( !nRet && pTmp );
if ( pPage->GetSortedObjs() )
{
- // --> OD 2004-07-01 #i28701# - new type <SwSortedObjs>
+ // #i28701# - new type <SwSortedObjs>
const SwSortedObjs &rObjs = *pPage->GetSortedObjs();
sal_uLong nIndex = ULONG_MAX;
for ( sal_uInt16 i = 0; nRet < 3 && i < rObjs.Count(); ++i )
{
- // --> OD 2004-07-01 #i28701# - consider changed type of
+ // #i28701# - consider changed type of
// <SwSortedObjs> entries.
SwAnchoredObject* pObj = rObjs[i];
const SwFrmFmt& rFmt = pObj->GetFrmFmt();
@@ -405,7 +404,7 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart )
if ( pLay->IsInFtn() )
pLay = pLay->FindFtnFrm();
- // --> OD 2006-05-08 #i58846#
+ // #i58846#
// <pPrepare( PREP_QUOVADIS )> only for frames in footnotes
if( pStart->IsInFtn() )
{
@@ -413,7 +412,6 @@ SwLayoutFrm *SwFlowFrm::CutTree( SwFrm *pStart )
if( pTmp )
pTmp->Prepare( PREP_QUOVADIS );
}
- // <--
//Nur fix auschneiden und zwar so, dass klare Verhaeltnisse bei den
//Verlassenen herrschen. Die Pointer der ausgeschnittenen Kette zeigen
@@ -594,13 +592,12 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
if ( pPre )
{
pPre->SetRetouche();
- // --> OD 2004-11-23 #115759# - follow-up of #i26250#
+ // #115759# - follow-up of #i26250#
// invalidate printing area of previous frame, if it's in a table
if ( pPre->GetUpper()->IsInTab() )
{
pPre->_InvalidatePrt();
}
- // <--
pPre->InvalidatePage();
}
else
@@ -617,13 +614,12 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
// Wenn durch das Cut&Paste ein leerer SectionFrm entstanden ist, sollte
// dieser automatisch verschwinden.
SwSectionFrm *pSct;
- // --> OD 2006-01-04 #126020# - adjust check for empty section
- // --> OD 2006-02-01 #130797# - correct fix #126020#
+ // #126020# - adjust check for empty section
+ // #130797# - correct fix #126020#
if ( pOldParent && !pOldParent->Lower() &&
( pOldParent->IsInSct() &&
!(pSct = pOldParent->FindSctFrm())->ContainsCntnt() &&
!pSct->ContainsAny( true ) ) )
- // <--
{
pSct->DelEmpty( sal_False );
}
@@ -691,16 +687,12 @@ SwTxtFrm* SwCntntFrm::FindMaster() const
{
OSL_ENSURE( IsFollow(), "SwCntntFrm::FindMaster(): !IsFollow" );
- const SwCntntFrm* pCnt = GetPrevCntntFrm();
+ const SwCntntFrm* pPrec = GetPrecede();
- while ( pCnt )
+ if ( pPrec && pPrec->HasFollow() && pPrec->GetFollow() == this )
{
- if ( pCnt->HasFollow() && pCnt->GetFollow() == this )
- {
- OSL_ENSURE( pCnt->IsTxtFrm(), "NoTxtFrm with follow found" );
- return (SwTxtFrm*)pCnt;
- }
- pCnt = pCnt->GetPrevCntntFrm();
+ OSL_ENSURE( pPrec->IsTxtFrm(), "NoTxtFrm with follow found" );
+ return ( SwTxtFrm* )pPrec;
}
OSL_FAIL( "Follow ist lost in Space." );
@@ -816,7 +808,7 @@ SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, sal_Bool bFwd )
if ( IsInFtn() )
return bFwd ? GetNextFtnLeaf( eMakePage ) : GetPrevFtnLeaf( eMakePage );
- // --> OD 2005-08-16 #i53323#
+ // #i53323#
// A frame could be inside a table AND inside a section.
// Thus, it has to be determined, which is the first parent.
bool bInTab( IsInTab() );
@@ -848,7 +840,6 @@ SwLayoutFrm *SwFrm::GetLeaf( MakePageType eMakePage, sal_Bool bFwd )
if ( bInSct )
return bFwd ? GetNextSctLeaf( eMakePage ) : GetPrevSctLeaf( eMakePage );
- // <--
return bFwd ? GetNextLeaf( eMakePage ) : GetPrevLeaf( eMakePage );
}
@@ -997,11 +988,10 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
const ViewShell *pSh = getRootFrm()->GetCurrShell();
// #111704# The pagedesc check does not make sense for frames in fly frames
if ( pNew != FindPageFrm() && !bNewPg && !IsInFly() &&
- // --> FME 2005-05-10 #i46683#
+ // #i46683#
// Do not consider page descriptions in browse mode (since
// MoveBwd ignored them)
!(pSh && pSh->GetViewOptions()->getBrowseMode() ) )
- // <--
{
if( WrongPageDesc( pNew ) )
{
@@ -1144,21 +1134,20 @@ sal_Bool SwFlowFrm::IsPrevObjMove() const
pPreUp->GetUpper()->GetUpper()->IsSctFrm() )
pPreUp = pPreUp->GetUpper()->GetUpper()->GetUpper();
}
- // --> OD 2004-10-15 #i26945# - re-factoring:
+ // #i26945# - re-factoring
// use <GetVertPosOrientFrm()> to determine, if object has followed the
// text flow to the next layout frame
for ( sal_uInt16 i = 0; i < pPre->GetDrawObjs()->Count(); ++i )
{
- // --> OD 2004-07-01 #i28701# - consider changed type of
+ // #i28701# - consider changed type of
// <SwSortedObjs> entries.
const SwAnchoredObject* pObj = (*pPre->GetDrawObjs())[i];
// OD 2004-01-20 #110582# - do not consider hidden objects
- // --> OD 2004-10-15 #i26945# - do not consider object, which
+ // #i26945# - do not consider object, which
// doesn't follow the text flow.
if ( pObj->GetFrmFmt().GetDoc()->IsVisibleLayerId(
pObj->GetDrawObj()->GetLayer() ) &&
pObj->GetFrmFmt().GetFollowTextFlow().GetValue() )
- // <--
{
const SwLayoutFrm* pVertPosOrientFrm = pObj->GetVertPosOrientFrm();
if ( pVertPosOrientFrm &&
@@ -1169,7 +1158,6 @@ sal_Bool SwFlowFrm::IsPrevObjMove() const
}
}
}
- // <--
}
return sal_False;
}
@@ -1458,12 +1446,11 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs,
// values of found previous frame and use these values.
SwTwips nPrevLowerSpace = 0;
SwTwips nPrevLineSpacing = 0;
- // --> OD 2009-08-28 #i102458#
+ // #i102458#
bool bPrevLineSpacingPorportional = false;
GetSpacingValuesOfFrm( (*pPrevFrm),
nPrevLowerSpace, nPrevLineSpacing,
bPrevLineSpacingPorportional );
- // <--
if( pIDSA->get(IDocumentSettingAccess::PARA_SPACE_MAX) )
{
nUpper = nPrevLowerSpace + pAttrs->GetULSpace().GetUpper();
@@ -1488,7 +1475,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs,
// building its maximum.
if ( pOwn->IsTxtFrm() )
{
- // --> OD 2009-08-28 #i102458#
+ // #i102458#
// Correction:
// A proportional line spacing of the previous text frame
// is added up to a own leading line spacing.
@@ -1503,7 +1490,6 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs,
{
nAdd = Max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) );
}
- // <--
}
nUpper += nAdd;
}
@@ -1535,7 +1521,7 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs,
SwTwips nAdd = nPrevLineSpacing;
if ( pOwn->IsTxtFrm() )
{
- // --> OD 2009-08-28 #i102458#
+ // #i102458#
// Correction:
// A proportional line spacing of the previous text frame
// is added up to a own leading line spacing.
@@ -1550,7 +1536,6 @@ SwTwips SwFlowFrm::CalcUpperSpace( const SwBorderAttrs *pAttrs,
{
nAdd = Max( nAdd, static_cast<SwTxtFrm&>(rThis).GetLineSpace( true ) );
}
- // <--
}
nUpper += nAdd;
}
@@ -1654,10 +1639,9 @@ SwTwips SwFlowFrm::_GetUpperSpaceAmountConsideredForPrevFrm() const
{
SwTwips nPrevLowerSpace = 0;
SwTwips nPrevLineSpacing = 0;
- // --> OD 2009-08-28 #i102458#
+ // #i102458#
bool bDummy = false;
GetSpacingValuesOfFrm( (*pPrevFrm), nPrevLowerSpace, nPrevLineSpacing, bDummy );
- // <--
if ( nPrevLowerSpace > 0 || nPrevLineSpacing > 0 )
{
const IDocumentSettingAccess* pIDSA = rThis.GetUpper()->GetFmt()->getIDocumentSettingAccess();
@@ -1725,18 +1709,16 @@ SwTwips SwFlowFrm::CalcLowerSpace( const SwBorderAttrs* _pAttrs ) const
_pAttrs->GetBottomLine( rThis ) :
_pAttrs->CalcBottomLine();
- // --> OD 2004-07-16 #i26250#
+ // #i26250#
// - correct consideration of table frames
// - use new method <CalcAddLowerSpaceAsLastInTableCell(..)>
if ( ( ( rThis.IsTabFrm() && rThis.GetUpper()->IsInTab() ) ||
- // --> OD 2004-11-16 #115759# - no lower spacing, if frame has a follow
+ // #115759# - no lower spacing, if frame has a follow
( rThis.IsInTab() && !GetFollow() ) ) &&
- // <--
!rThis.GetIndNext() )
{
nLowerSpace += CalcAddLowerSpaceAsLastInTableCell( _pAttrs );
}
- // <--
delete pAttrAccess;
@@ -1972,7 +1954,7 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
// First, we move the footnotes.
sal_Bool bFtnMoved = sal_False;
- // --> FME 2004-07-15 #i26831#
+ // #i26831#
// If pSect has just been created, the printing area of pSect has
// been calculated based on the first content of its follow.
// In this case we prefer to call a SimpleFormat for this new
@@ -1981,7 +1963,6 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
// in SwSectionFrm::Format, which can cause loops.
const bool bForceSimpleFormat = pSect && pSect->HasFollow() &&
!pSect->ContainsAny();
- // <--
if ( pNewBoss != pOldBoss )
{
@@ -2007,17 +1988,16 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
// MoveSubTree bzw. PasteTree ist auf so etwas nicht vorbereitet.
if( pNewUpper != rThis.GetUpper() )
{
- // --> FME 2004-04-19 #i27145#
+ // #i27145#
SwSectionFrm* pOldSct = 0;
if ( rThis.GetUpper()->IsSctFrm() )
{
pOldSct = static_cast<SwSectionFrm*>(rThis.GetUpper());
}
- // <--
MoveSubTree( pNewUpper, pNewUpper->Lower() );
- // --> FME 2004-04-19 #i27145#
+ // #i27145#
if ( pOldSct && pOldSct->GetSection() )
{
// Prevent loops by setting the new height at
@@ -2031,14 +2011,12 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
// for these.
pOldSct->SimpleFormat();
}
- // <--
- // --> FME 2004-07-15 #i26831#
+ // #i26831#
if ( bForceSimpleFormat )
{
pSect->SimpleFormat();
}
- // <--
if ( bFtnMoved && !bSamePage )
{
@@ -2067,7 +2045,7 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
if ( !( pSh && pSh->GetViewOptions()->getBrowseMode() ) )
{
- // --> OD 2009-12-31 #i106452#
+ // #i106452#
// check page description not only in situation with sections.
if ( !bSamePage &&
( rThis.GetAttrSet()->GetPageDesc().GetPageDesc() ||
@@ -2075,7 +2053,6 @@ sal_Bool SwFlowFrm::MoveFwd( sal_Bool bMakePage, sal_Bool bPageBreak, sal_Bool b
{
SwFrm::CheckPageDescs( pNewPage, sal_False );
}
- // <--
}
}
return bSamePage;
@@ -2100,7 +2077,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
if ( pFtn && pFtn->IsBackMoveLocked() )
return sal_False;
- // --> OD 2004-11-29 #115759# - text frames, which are directly inside
+ // #115759# - text frames, which are directly inside
// tables aren't allowed to move backward.
if ( rThis.IsTxtFrm() && rThis.IsInTab() )
{
@@ -2118,7 +2095,6 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
pUpperFrm = pUpperFrm->GetUpper();
}
}
- // <--
SwFtnBossFrm * pOldBoss = rThis.FindFtnBossFrm();
SwPageFrm * const pOldPage = pOldBoss->FindPageFrm();
@@ -2132,7 +2108,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
//steht, ist nix mit zurueckfliessen. Die breaks brauche fuer die
//Fussnoten nicht geprueft zu werden.
- // --> FME 2004-11-15 #i37084# FindLastCntnt does not necessarily
+ // #i37084# FindLastCntnt does not necessarily
// have to have a result != 0
SwFrm* pRef = 0;
const bool bEndnote = pFtn->GetAttr()->GetFtn().IsEndNote();
@@ -2144,7 +2120,6 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
}
if( !pRef )
pRef = pFtn->GetRef();
- // <--
OSL_ENSURE( pRef, "MoveBwd: Endnote for an empty section?" );
@@ -2181,21 +2156,21 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
if ( nDiff > 1 )
{
pNewUpper = rThis.GetLeaf( MAKEPAGE_NONE, sal_False );
- // --> OD 2006-05-08 #i53139#
+ // #i53139#
// Now <pNewUpper> is a previous layout frame, which contains
// content. But the new upper layout frame has to be the next one.
// Thus, hack for issue i14206 no longer needed, but fix for issue 114442
- // --> OD 2006-05-17 #136024# - correct fix for i53139:
+ // #136024# - correct fix for i53139
// Check for wrong page description before using next new upper.
- // --> OD 2006-06-06 #i66051# - further correction of fix for i53139
+ // #i66051# - further correction of fix for i53139
// Check for correct type of new next upper layout frame
- // --> OD 2006-06-08 #136538# - another correction of fix for i53139
+ // #136538# - another correction of fix for i53139
// Assumption, that in all cases <pNewUpper> is a previous
// layout frame, which contains content, is wrong.
- // --> OD 2006-07-05 #136538# - another correction of fix for i53139
+ // #136538# - another correction of fix for i53139
// Beside type check, check also, if proposed new next upper
// frame is inside the same frame types.
- // --> OD 2007-01-10 #i73194# - and yet another correction
+ // #i73194# - and yet another correction
// of fix for i53139:
// Assure that the new next upper layout frame doesn't
// equal the current one.
@@ -2219,7 +2194,6 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
bCheckPageDescOfNextPage = true;
}
}
- // <--
bCheckPageDescs = sal_True;
}
@@ -2242,20 +2216,19 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
{
pNewUpper = 0;
}
- // --> OD 2006-05-08 #i53139#
- // --> OD 2006-09-11 #i69409# - check <pNewUpper>
- // --> OD 2006-11-02 #i71065# - check <SwFlowFrm::IsMoveBwdJump()>
+ // #i53139#
+ // #i69409# - check <pNewUpper>
+ // #i71065# - check <SwFlowFrm::IsMoveBwdJump()>
else if ( pNewUpper && !SwFlowFrm::IsMoveBwdJump() )
- // <--
{
// Now <pNewUpper> is a previous layout frame, which
// contains content. But the new upper layout frame
// has to be the next one.
- // --> OD 2006-05-17 #136024# - correct fix for i53139
+ // #136024# - correct fix for i53139
// Check for wrong page description before using next new upper.
- // --> OD 2006-06-06 #i66051# - further correction of fix for i53139
+ // #i66051# - further correction of fix for i53139
// Check for correct type of new next upper layout frame
- // --> OD 2006-07-05 #136538# - another correction of fix for i53139
+ // #136538# - another correction of fix for i53139
// Beside type check, check also, if proposed new next upper
// frame is inside the same frame types.
SwLayoutFrm* pNewNextUpper = pNewUpper->GetLeaf( MAKEPAGE_NOSECTION, sal_True );
@@ -2270,7 +2243,6 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
pNewUpper = pNewNextUpper;
}
}
- // <--
}
else
{
@@ -2299,18 +2271,18 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
if( SwFlowFrm::IsMoveBwdJump() )
{
pNewUpper = pColBody;
- // --> OD 2006-05-08 #i53139#
+ // #i53139#
// Now <pNewUpper> is a previous layout frame, which
// contains content. But the new upper layout frame
// has to be the next one.
- // --> OD 2006-05-17 #136024# - correct fix for i53139
+ // #136024# - correct fix for i53139
// Check for wrong page description before using next new upper.
- // --> OD 2006-06-06 #i66051# - further correction of fix for i53139
+ // #i66051# - further correction of fix for i53139
// Check for correct type of new next upper layout frame
- // --> OD 2006-07-05 #136538# - another correction of fix for i53139
+ // #136538# - another correction of fix for i53139
// Beside type check, check also, if proposed new next upper
// frame is inside the same frame types.
- // --> OD 2006-11-02 #i71065#
+ // #i71065#
// Check that the proposed new next upper layout
// frame isn't the current one.
SwLayoutFrm* pNewNextUpper = pNewUpper->GetLeaf( MAKEPAGE_NONE, sal_True );
@@ -2325,7 +2297,6 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
{
pNewUpper = pNewNextUpper;
}
- // <--
}
}
else
@@ -2344,12 +2315,12 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
else //Keine Breaks also kann ich zurueckfliessen
pNewUpper = rThis.GetLeaf( MAKEPAGE_NONE, sal_False );
- // --> OD 2004-06-23 #i27801# - no move backward of 'master' text frame,
+ // #i27801# - no move backward of 'master' text frame,
// if - due to its object positioning - it isn't allowed to be on the new page frame
- // --> OD 2005-03-07 #i44049# - add another condition for not moving backward:
+ // #i44049# - add another condition for not moving backward
// If one of its objects has restarted the layout process, moving backward
// isn't sensible either.
- // --> OD 2005-04-19 #i47697# - refine condition made for issue i44049:
+ // #i47697# - refine condition made for issue i44049
// - allow move backward as long as the anchored object is only temporarily
// positions considering its wrapping style.
if ( pNewUpper &&
@@ -2365,7 +2336,7 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
{
pNewUpper = 0;
}
- // --> OD 2005-03-07 #i44049# - check, if one of its anchored objects
+ // #i44049# - check, if one of its anchored objects
// has restarted the layout process.
else if ( rThis.GetDrawObjs() )
{
@@ -2373,26 +2344,23 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
for ( ; i < rThis.GetDrawObjs()->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*rThis.GetDrawObjs())[i];
- // --> OD 2005-04-19 #i47697# - refine condition - see above
+ // #i47697# - refine condition - see above
if ( pAnchoredObj->RestartLayoutProcess() &&
!pAnchoredObj->IsTmpConsiderWrapInfluence() )
- // <--
{
pNewUpper = 0;
break;
}
}
}
- // <--
}
- // <--
//Fuer Follows ist das zurueckfliessen nur dann erlaubt wenn in der
//neuen Umgebung kein Nachbar existiert (denn dieses waere der Master).
//(6677)Wenn allerdings leere Blaetter uebersprungen wurden wird doch gemoved.
if ( pNewUpper && IsFollow() && pNewUpper->Lower() )
{
- // --> OD 2007-09-05 #i79774#, #b6596954#
+ // #i79774#
// neglect empty sections in proposed new upper frame
bool bProposedNewUpperContainsOnlyEmptySections( true );
{
@@ -2428,7 +2396,6 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
else
pNewUpper = 0;
}
- // <--
}
if ( pNewUpper && !ShouldBwdMoved( pNewUpper, sal_True, rbReformat ) )
{
@@ -2442,11 +2409,10 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
else
{
SwSectionFrm* pSectFrm = pNewUpper->FindSctFrm();
- // --> OD 2006-01-04 #126020# - adjust check for empty section
- // --> OD 2006-02-01 #130797# - correct fix #126020#
+ // #126020# - adjust check for empty section
+ // #130797# - correct fix #126020#
if ( pSectFrm && !pSectFrm->IsColLocked() &&
!pSectFrm->ContainsCntnt() && !pSectFrm->ContainsAny( true ) )
- // <--
{
pSectFrm->DelEmpty( sal_True );
delete pSectFrm;
@@ -2459,13 +2425,13 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
// OD 2004-05-26 #i21478# - don't move backward, if flow frame wants to
// keep with next frame and next frame is locked.
- // --> OD 2004-12-08 #i38232# - If next frame is a table, do *not* check,
+ // #i38232# - If next frame is a table, do *not* check,
// if it's locked.
if ( pNewUpper && !IsFollow() &&
rThis.GetAttrSet()->GetKeep().GetValue() && rThis.GetIndNext() )
{
SwFrm* pIndNext = rThis.GetIndNext();
- // --> OD 2004-12-08 #i38232#
+ // #i38232#
if ( !pIndNext->IsTabFrm() )
{
// get first content of section, while empty sections are skipped
@@ -2490,10 +2456,9 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
pNewUpper = 0L;
}
}
- // <--
}
- // --> OD 2006-05-10 #i65250#
+ // #i65250#
// layout loop control for flowing content again and again moving
// backward under the same layout condition.
if ( pNewUpper && !IsFollow() &&
@@ -2506,12 +2471,11 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
? MAKEPAGE_NOSECTION
: MAKEPAGE_NONE,
sal_True );
- // --> OD 2007-01-10 #i73194# - make code robust
+ // #i73194# - make code robust
OSL_ENSURE( pNextNewUpper, "<SwFlowFrm::MoveBwd(..)> - missing next new upper" );
if ( pNextNewUpper &&
( pNextNewUpper == rThis.GetUpper() ||
pNextNewUpper->GetType() != rThis.GetUpper()->GetType() ) )
- // <--
{
pNewUpper = 0L;
#if OSL_DEBUG_LEVEL > 1
@@ -2519,7 +2483,6 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
#endif
}
}
- // <--
OSL_ENSURE( pNewUpper != rThis.GetUpper(),
"<SwFlowFrm::MoveBwd(..)> - moving backward to the current upper frame!? -> Please inform OD." );
@@ -2583,29 +2546,26 @@ sal_Bool SwFlowFrm::MoveBwd( sal_Bool &rbReformat )
}
pNewUpper->Calc();
rThis.Cut();
- // --> OD 2005-02-23 #b6229852#
+ //
// optimization: format section, if its size is invalidated and if it's
// the new parent of moved backward frame.
bool bFormatSect( false );
- // <--
if( bUnlock )
{
pSect->ColUnlock();
if( pSect->HasFollow() != bFollow )
{
pSect->InvalidateSize();
- // --> OD 2005-02-23 #b6229852# - optimization
+ // - optimization
if ( pSect == pNewUpper )
bFormatSect = true;
- // <--
}
}
rThis.Paste( pNewUpper );
- // --> OD 2005-02-23 #b6229852# - optimization
+ // - optimization
if ( bFormatSect )
pSect->Calc();
- // <--
SwPageFrm *pNewPage = rThis.FindPageFrm();
if( pNewPage != pOldPage )
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 47cb131b9a..e0a6830411 100644..100755
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -125,15 +125,12 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
//Grosseneinstellung, Fixe groesse ist immer die Breite
const SwFmtFrmSize &rFrmSize = pFmt->GetFrmSize();
- sal_Bool bVert = sal_False;
sal_uInt16 nDir =
((SvxFrameDirectionItem&)pFmt->GetFmtAttr( RES_FRAMEDIR )).GetValue();
if( FRMDIR_ENVIRONMENT == nDir )
{
bDerivedVert = 1;
bDerivedR2L = 1;
- if( pAnch && pAnch->IsVertical() )
- bVert = sal_True;
}
else
{
@@ -166,7 +163,6 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
}
}
- bVert = bVertical;
bInvalidR2L = 0;
if( FRMDIR_HORI_RIGHT_TOP == nDir )
bRightToLeft = 1;
@@ -257,7 +253,7 @@ void SwFlyFrm::InsertCnt()
// OD 2004-02-12 #110582#-2
void SwFlyFrm::InsertColumns()
{
- // --> OD 2009-08-12 #i97379#
+ // #i97379#
// Check, if column are allowed.
// Columns are not allowed for fly frames, which represent graphics or embedded objects.
const SwFmtCntnt& rCntnt = GetFmt()->GetCntnt();
@@ -267,7 +263,6 @@ void SwFlyFrm::InsertCnt()
{
return;
}
- // <--
const SwFmtCol &rCol = GetFmt()->GetCol();
if ( rCol.GetNumCols() > 1 )
@@ -414,11 +409,10 @@ sal_uInt32 SwFlyFrm::_GetOrdNumForNewRef( const SwFlyDrawContact* pContact )
else
{
// no other Writer fly frame found. Take order number of 'master' object
- // --> OD 2004-11-11 #i35748# - use method <GetOrdNumDirect()> instead
+ // #i35748# - use method <GetOrdNumDirect()> instead
// of method <GetOrdNum()> to avoid a recalculation of the order number,
// which isn't intended.
nOrdNum = pContact->GetMaster()->GetOrdNumDirect();
- // <--
}
return nOrdNum;
@@ -440,18 +434,16 @@ SwVirtFlyDrawObj* SwFlyFrm::CreateNewRef( SwFlyDrawContact *pContact )
const sal_uInt32 nOrdNum = pContact->GetMaster()->GetOrdNum();
pPg->ReplaceObject( pDrawObj, nOrdNum );
}
- // --> OD 2004-08-16 #i27030# - insert new <SwVirtFlyDrawObj> instance
+ // #i27030# - insert new <SwVirtFlyDrawObj> instance
// into drawing page with correct order number
else
{
pContact->GetFmt()->getIDocumentDrawModelAccess()->GetDrawModel()->GetPage( 0 )->
InsertObject( pDrawObj, _GetOrdNumForNewRef( pContact ) );
}
- // <--
- // --> OD 2004-12-13 #i38889# - assure, that new <SwVirtFlyDrawObj> instance
+ // #i38889# - assure, that new <SwVirtFlyDrawObj> instance
// is in a visible layer.
pContact->MoveObjToVisibleLayer( pDrawObj );
- // <--
return pDrawObj;
}
@@ -467,10 +459,9 @@ void SwFlyFrm::InitDrawObj( sal_Bool bNotify )
SwFlyDrawContact *pContact = SwIterator<SwFlyDrawContact,SwFmt>::FirstElement( *GetFmt() );
if ( !pContact )
{
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
pContact = new SwFlyDrawContact( (SwFlyFrmFmt*)GetFmt(),
pIDDMA->GetOrCreateDrawModel() );
- // <--
}
OSL_ENSURE( pContact, "InitDrawObj failed" );
// OD 2004-03-22 #i26791#
@@ -762,9 +753,8 @@ sal_Bool SwFlyFrm::FrmSizeChg( const SwFmtFrmSize &rFrmSize )
const SwTwips nDiffWidth = Frm().Width() - rFrmSize.GetWidth();
aFrm.Height( aFrm.Height() - nDiffHeight );
aFrm.Width ( aFrm.Width() - nDiffWidth );
- // --> OD 2006-08-16 #i68520#
+ // #i68520#
InvalidateObjRectWithSpaces();
- // <--
aPrt.Height( aPrt.Height() - nDiffHeight );
aPrt.Width ( aPrt.Width() - nDiffWidth );
ChgLowersProp( aOldSz );
@@ -819,16 +809,14 @@ void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
if ( nInvFlags & 0x01 )
{
_InvalidatePos();
- // --> OD 2006-08-16 #i68520#
+ // #i68520#
InvalidateObjRectWithSpaces();
- // <--
}
if ( nInvFlags & 0x02 )
{
_InvalidateSize();
- // --> OD 2006-08-16 #i68520#
+ // #i68520#
InvalidateObjRectWithSpaces();
- // <--
}
if ( nInvFlags & 0x04 )
_InvalidatePrt();
@@ -841,18 +829,16 @@ void SwFlyFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
SwRootFrm *pRoot;
if ( nInvFlags & 0x20 && 0 != (pRoot = getRootFrm()) )
pRoot->InvalidateBrowseWidth();
- // --> OD 2004-06-28 #i28701#
+ // #i28701#
if ( nInvFlags & 0x80 )
{
// update sorted object lists, the Writer fly frame is registered at.
UpdateObjInSortedList();
}
- // <--
- }
- // --> OD 2005-07-18 #i51474# - reset flags for the layout process
- ResetLayoutProcessBools();
- // <--
+ // #i87645# - reset flags for the layout process (only if something has been invalidated)
+ ResetLayoutProcessBools();
+ }
}
void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
@@ -902,7 +888,7 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
if ( pNd->HasContour() )
pNd->SetContour( 0 );
}
- // --> OD 2004-06-28 #i28701# - perform reorder of object lists
+ // #i28701# - perform reorder of object lists
// at anchor frame and at page frame.
rInvFlags |= 0x80;
}
@@ -1019,7 +1005,7 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
}
}
- // --> OD 2004-06-28 #i28701# - perform reorder of object lists
+ // #i28701# - perform reorder of object lists
// at anchor frame and at page frame.
rInvFlags |= 0x80;
@@ -1080,7 +1066,7 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
pSh->Imp()->AddAccessibleFrm( this );
}
}
- // --> OD 2004-06-28 #i28701# - perform reorder of object lists
+ // #i28701# - perform reorder of object lists
// at anchor frame and at page frame.
rInvFlags |= 0x80;
}
@@ -1202,7 +1188,7 @@ void SwFlyFrm::_Invalidate( SwPageFrm *pPage )
pFrm->InvalidateSize();
}
- // --> OD 2008-01-21 #i85216#
+ // #i85216#
// if vertical position is oriented at a layout frame inside a ghost section,
// assure that the position is invalidated and that the information about
// the vertical position oriented frame is cleared
@@ -1215,7 +1201,6 @@ void SwFlyFrm::_Invalidate( SwPageFrm *pPage )
ClearVertPosOrientFrm();
}
}
- // <--
}
/*************************************************************************
@@ -1242,7 +1227,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos )
SwFmtVertOrient aVert( pFmt->GetVertOrient() );
SwTxtFrm *pAutoFrm = NULL;
- // --> OD 2004-11-12 #i34948# - handle also at-page and at-fly anchored
+ // #i34948# - handle also at-page and at-fly anchored
// Writer fly frames
const RndStdIds eAnchorType = GetFrmFmt().GetAnchor().GetAnchorId();
if ( eAnchorType == FLY_AT_PAGE )
@@ -1255,7 +1240,6 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos )
aVert.SetVertOrient( text::VertOrientation::NONE );
aVert.SetRelationOrient( text::RelOrientation::FRAME );
}
- // <--
else if ( IsFlyAtCntFrm() || text::VertOrientation::NONE != aVert.GetVertOrient() )
{
if( text::RelOrientation::CHAR == aVert.GetRelationOrient() && IsAutoPos() )
@@ -1296,7 +1280,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos )
const SwTwips nNewX = bVert ? rNewPos.Y() : rNewPos.X();
SwTwips nTmpX = nNewX == LONG_MAX ? 0 : nNewX;
SwFmtHoriOrient aHori( pFmt->GetHoriOrient() );
- // --> OD 2004-11-12 #i34948# - handle also at-page and at-fly anchored
+ // #i34948# - handle also at-page and at-fly anchored
// Writer fly frames
if ( eAnchorType == FLY_AT_PAGE )
{
@@ -1310,7 +1294,6 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos )
aHori.SetRelationOrient( text::RelOrientation::FRAME );
aHori.SetPosToggle( sal_False );
}
- // <--
else if ( IsFlyAtCntFrm() || text::HoriOrientation::NONE != aHori.GetHoriOrient() )
{
aHori.SetHoriOrient( text::HoriOrientation::NONE );
@@ -1363,9 +1346,8 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
{
//Sicherheitsschaltung wegnehmen (siehe SwFrm::CTor)
Frm().Pos().X() = Frm().Pos().Y() = 0;
- // --> OD 2006-08-16 #i68520#
+ // #i68520#
InvalidateObjRectWithSpaces();
- // <--
}
//Breite der Spalten pruefen und ggf. einstellen.
@@ -1412,14 +1394,13 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
nRemaining += ((SwSectionFrm*)pFrm)->Undersize();
pFrm = pFrm->GetNext();
}
- // --> OD 2006-02-09 #130878#
+ // #130878#
// Do not keep old height, if content has no height.
// The old height could be wrong due to wrong layout cache
// and isn't corrected in the further formatting, because
// the fly frame doesn't become invalid anymore.
// if( !nRemaining )
// nRemaining = nOldHeight - nUL;
- // <--
}
if ( GetDrawObjs() )
{
@@ -1462,12 +1443,11 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
(Prt().*fnRect->fnSetHeight)( nRemaining );
nRemaining -= (Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnAddBottom)( nRemaining + nUL );
- // --> OD 2006-08-16 #i68520#
+ // #i68520#
if ( nRemaining + nUL != 0 )
{
InvalidateObjRectWithSpaces();
}
- // <--
bValidSize = sal_True;
}
else
@@ -1481,12 +1461,11 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
(Prt().*fnRect->fnSetHeight)( nNewSize );
nNewSize += nUL - (Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnAddBottom)( nNewSize );
- // --> OD 2006-08-16 #i68520#
+ // #i68520#
if ( nNewSize != 0 )
{
InvalidateObjRectWithSpaces();
}
- // <--
}
if ( !bFormatHeightOnly )
@@ -1514,12 +1493,11 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
(Prt().*fnRect->fnSetWidth)( nNewSize );
nNewSize += nLR - (Frm().*fnRect->fnGetWidth)();
(Frm().*fnRect->fnAddRight)( nNewSize );
- // --> OD 2006-08-16 #i68520#
+ // #i68520#
if ( nNewSize != 0 )
{
InvalidateObjRectWithSpaces();
}
- // <--
}
}
ColUnlock();
@@ -1635,9 +1613,9 @@ void CalcCntnt( SwLayoutFrm *pLay,
// of the prev to be invalid:
// OD 2004-03-15 #116560# - Do not consider invalid previous frame
// due to its keep-attribute, if current frame is a follow or is locked.
- // --> OD 2005-03-08 #i44049# - do not consider invalid previous
+ // #i44049# - do not consider invalid previous
// frame due to its keep-attribute, if it can't move forward.
- // --> OD 2006-01-27 #i57765# - do not consider invalid previous
+ // #i57765# - do not consider invalid previous
// frame, if current frame has a column/page break before attribute.
SwFrm* pTmpPrev = pFrm->FindPrev();
SwFlowFrm* pTmpPrevFlowFrm = pTmpPrev && pTmpPrev->IsFlowFrm() ? SwFlowFrm::CastFlowFrm(pTmpPrev) : 0;
@@ -1651,7 +1629,6 @@ void CalcCntnt( SwLayoutFrm *pLay,
pLay->IsAnLower( pTmpPrev ) &&
pTmpPrevFlowFrm->IsKeep( *pTmpPrev->GetAttrSet() ) &&
pTmpPrevFlowFrm->IsKeepFwdMoveAllowed();
- // <--
// format floating screen objects anchored to the frame.
bool bRestartLayoutProcess = false;
@@ -1662,7 +1639,7 @@ void CalcCntnt( SwLayoutFrm *pLay,
sal_uInt32 nCnt = pFrm->GetDrawObjs()->Count();
for ( sal_uInt16 i = 0; i < nCnt; ++i )
{
- // --> OD 2004-07-01 #i28701#
+ // #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
// determine, if anchored object has to be formatted.
if ( pAnchoredObj->PositionLocked() )
@@ -1673,25 +1650,23 @@ void CalcCntnt( SwLayoutFrm *pLay,
// format anchored object
if ( pAnchoredObj->IsFormatPossible() )
{
- // --> OD 2005-05-17 #i43737# - no invalidation of
+ // #i43737# - no invalidation of
// anchored object needed - causes loops for as-character
// anchored objects.
//pAnchoredObj->InvalidateObjPos();
- // <--
SwRect aRect( pAnchoredObj->GetObjRect() );
if ( !SwObjectFormatter::FormatObj( *pAnchoredObj, pFrm, pPageFrm ) )
{
bRestartLayoutProcess = true;
break;
}
- // --> OD 2004-08-25 #i3317# - restart layout process,
+ // #i3317# - restart layout process,
// if the position of the anchored object is locked now.
if ( pAnchoredObj->PositionLocked() )
{
bRestartLayoutProcess = true;
break;
}
- // <--
if ( aRect != pAnchoredObj->GetObjRect() )
{
@@ -1740,7 +1715,7 @@ void CalcCntnt( SwLayoutFrm *pLay,
}
}
- // --> OD 2004-06-11 #i28701# - restart layout process, if
+ // #i28701# - restart layout process, if
// requested by floating screen object formatting
if ( bRestartLayoutProcess )
{
@@ -1756,7 +1731,6 @@ void CalcCntnt( SwLayoutFrm *pLay,
{
pFrm->Calc();
}
- // <--
if ( bAgain )
{
@@ -1869,17 +1843,15 @@ void SwFlyFrm::MakeObjPos()
aObjPositioning( *GetVirtDrawObj() );
aObjPositioning.CalcPosition();
- // --> OD 2006-10-05 #i58280#
+ // #i58280#
// update relative position
SetCurrRelPos( aObjPositioning.GetRelPos() );
- // <--
SWRECTFN( GetAnchorFrm() );
aFrm.Pos( aObjPositioning.GetRelPos() );
aFrm.Pos() += (GetAnchorFrm()->Frm().*fnRect->fnGetPos)();
- // --> OD 2006-09-11 #i69335#
+ // #i69335#
InvalidateObjRectWithSpaces();
- // <--
}
}
@@ -1927,7 +1899,7 @@ SwTwips SwFlyFrm::_Grow( SwTwips nDist, sal_Bool bTst )
//das Wachstum (wg. des Ausgleichs).
if ( !bTst )
{
- // --> OD 2004-06-09 #i28701# - unlock position of Writer fly frame
+ // #i28701# - unlock position of Writer fly frame
UnlockPosition();
_InvalidatePos();
InvalidateSize();
@@ -1943,14 +1915,14 @@ SwTwips SwFlyFrm::_Grow( SwTwips nDist, sal_Bool bTst )
Unlock();
if ( IsFlyFreeFrm() )
{
- // --> OD 2004-11-12 #i37068# - no format of position here
+ // #i37068# - no format of position here
// and prevent move in method <CheckClip(..)>.
// This is needed to prevent layout loop caused by nested
// Writer fly frames - inner Writer fly frames format its
// anchor, which grows/shrinks the outer Writer fly frame.
// Note: position will be invalidated below.
bValidPos = sal_True;
- // --> OD 2005-10-10 #i55416#
+ // #i55416#
// Suppress format of width for autowidth frame, because the
// format of the width would call <SwTxtFrm::CalcFitToContent()>
// for the lower frame, which initiated this grow.
@@ -1960,17 +1932,14 @@ SwTwips SwFlyFrm::_Grow( SwTwips nDist, sal_Bool bTst )
{
bFormatHeightOnly = sal_True;
}
- // <--
static_cast<SwFlyFreeFrm*>(this)->SetNoMoveOnCheckClip( true );
((SwFlyFreeFrm*)this)->SwFlyFreeFrm::MakeAll();
static_cast<SwFlyFreeFrm*>(this)->SetNoMoveOnCheckClip( false );
- // --> OD 2005-10-10 #i55416#
+ // #i55416#
if ( rFrmSz.GetWidthSizeType() != ATT_FIX_SIZE )
{
bFormatHeightOnly = bOldFormatHeightOnly;
}
- // <--
- // <--
}
else
MakeAll();
@@ -2016,12 +1985,11 @@ SwTwips SwFlyFrm::_Shrink( SwTwips nDist, sal_Bool bTst )
{
SwRect aOld( GetObjRectWithSpaces() );
(Frm().*fnRect->fnSetHeight)( nHeight - nVal );
- // --> OD 2006-08-16 #i68520#
+ // #i68520#
if ( nHeight - nVal != 0 )
{
InvalidateObjRectWithSpaces();
}
- // <--
nHeight = (Prt().*fnRect->fnGetHeight)();
(Prt().*fnRect->fnSetHeight)( nHeight - nVal );
_InvalidatePos();
@@ -2042,14 +2010,14 @@ SwTwips SwFlyFrm::_Shrink( SwTwips nDist, sal_Bool bTst )
Unlock();
if ( IsFlyFreeFrm() )
{
- // --> OD 2004-11-12 #i37068# - no format of position here
+ // #i37068# - no format of position here
// and prevent move in method <CheckClip(..)>.
// This is needed to prevent layout loop caused by nested
// Writer fly frames - inner Writer fly frames format its
// anchor, which grows/shrinks the outer Writer fly frame.
// Note: position will be invalidated below.
bValidPos = sal_True;
- // --> OD 2005-10-10 #i55416#
+ // #i55416#
// Suppress format of width for autowidth frame, because the
// format of the width would call <SwTxtFrm::CalcFitToContent()>
// for the lower frame, which initiated this shrink.
@@ -2059,17 +2027,14 @@ SwTwips SwFlyFrm::_Shrink( SwTwips nDist, sal_Bool bTst )
{
bFormatHeightOnly = sal_True;
}
- // <--
static_cast<SwFlyFreeFrm*>(this)->SetNoMoveOnCheckClip( true );
((SwFlyFreeFrm*)this)->SwFlyFreeFrm::MakeAll();
static_cast<SwFlyFreeFrm*>(this)->SetNoMoveOnCheckClip( false );
- // --> OD 2005-10-10 #i55416#
+ // #i55416#
if ( rFrmSz.GetWidthSizeType() != ATT_FIX_SIZE )
{
bFormatHeightOnly = bOldFormatHeightOnly;
}
- // <--
- // <--
}
else
MakeAll();
@@ -2100,7 +2065,7 @@ SwTwips SwFlyFrm::_Shrink( SwTwips nDist, sal_Bool bTst )
Size SwFlyFrm::ChgSize( const Size& aNewSize )
{
- // --> OD 2006-01-19 #i53298#
+ // #i53298#
// If the fly frame anchored at-paragraph or at-character contains an OLE
// object, assure that the new size fits into the current clipping area
// of the fly frame
@@ -2122,18 +2087,16 @@ Size SwFlyFrm::ChgSize( const Size& aNewSize )
}
}
}
- // <--
if ( aAdjustedNewSize != Frm().SSize() )
{
SwFrmFmt *pFmt = GetFmt();
SwFmtFrmSize aSz( pFmt->GetFrmSize() );
aSz.SetWidth( aAdjustedNewSize.Width() );
- // --> OD 2006-01-19 #i53298# - no tolerance any more.
+ // #i53298# - no tolerance any more.
// If it reveals that the tolerance is still needed, then suppress a
// <SetAttr> call, if <aSz> equals the current <SwFmtFrmSize> attribute.
// if ( Abs(aAdjustedNewSize.Height() - aSz.GetHeight()) > 1 )
aSz.SetHeight( aAdjustedNewSize.Height() );
- // <--
// uebers Doc fuers Undo!
pFmt->GetDoc()->SetAttr( aSz, *pFmt );
return aSz.GetSize();
@@ -2232,7 +2195,7 @@ void SwFrm::RemoveFly( SwFlyFrm *pToRemove )
{
pPage->RemoveFlyFromPage( pToRemove );
}
- // --> OD 2008-05-19 #i73201#
+ // #i73201#
else
{
if ( pToRemove->IsAccessibleFrm() &&
@@ -2250,7 +2213,6 @@ void SwFrm::RemoveFly( SwFlyFrm *pToRemove )
}
}
}
- // <--
pDrawObjs->Remove( *pToRemove );
if ( !pDrawObjs->Count() )
@@ -2294,7 +2256,7 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj )
_rNewObj.ChgAnchorFrm( this );
}
- // --> OD 2010-09-14 #i113730#
+ // #i113730#
// Assure the control objects and group objects containing controls are on the control layer
if ( ::CheckControlLayer( _rNewObj.DrawObj() ) )
{
@@ -2316,7 +2278,6 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj )
}
}
}
- // <--
// no direct positioning needed, but invalidate the drawing object position
_rNewObj.InvalidateObjPos();
@@ -2366,18 +2327,17 @@ void SwFrm::RemoveDrawObj( SwAnchoredObject& _rToRemoveObj )
|* SwFrm::InvalidateObjs()
|*
|*************************************************************************/
-// --> OD 2004-07-01 #i28701# - change purpose of method and adjust its name
+// #i28701# - change purpose of method and adjust its name
void SwFrm::InvalidateObjs( const bool _bInvaPosOnly,
const bool _bNoInvaOfAsCharAnchoredObjs )
{
if ( GetDrawObjs() )
{
- // --> OD 2004-10-08 #i26945# - determine page the frame is on,
+ // #i26945# - determine page the frame is on,
// in order to check, if anchored object is registered at the same
// page.
const SwPageFrm* pPageFrm = FindPageFrm();
- // <--
- // --> OD 2004-07-01 #i28701# - re-factoring
+ // #i28701# - re-factoring
sal_uInt32 i = 0;
for ( ; i < GetDrawObjs()->Count(); ++i )
{
@@ -2388,7 +2348,7 @@ void SwFrm::InvalidateObjs( const bool _bInvaPosOnly,
{
continue;
}
- // --> OD 2004-10-08 #i26945# - no invalidation, if anchored object
+ // #i26945# - no invalidation, if anchored object
// isn't registered at the same page and instead is registered at
// the page, where its anchor character text frame is on.
if ( pAnchoredObj->GetPageFrm() &&
@@ -2400,7 +2360,7 @@ void SwFrm::InvalidateObjs( const bool _bInvaPosOnly,
{
continue;
}
- // --> OD 2004-11-24 #115759# - unlock its position, if anchored
+ // #115759# - unlock its position, if anchored
// object isn't registered at the page, where its anchor
// character text frame is on, respectively if it has no
// anchor character text frame.
@@ -2408,10 +2368,8 @@ void SwFrm::InvalidateObjs( const bool _bInvaPosOnly,
{
pAnchoredObj->UnlockPosition();
}
- // <--
}
- // <--
- // --> OD 2005-07-18 #i51474# - reset flag, that anchored object
+ // #i51474# - reset flag, that anchored object
// has cleared environment, and unlock its position, if the anchored
// object is registered at the same page as the anchor frame is on.
if ( pAnchoredObj->ClearedEnvironment() &&
@@ -2421,7 +2379,6 @@ void SwFrm::InvalidateObjs( const bool _bInvaPosOnly,
pAnchoredObj->UnlockPosition();
pAnchoredObj->SetClearedEnvironment( false );
}
- // <--
// distinguish between writer fly frames and drawing objects
if ( pAnchoredObj->ISA(SwFlyFrm) )
{
@@ -2445,11 +2402,11 @@ void SwFrm::InvalidateObjs( const bool _bInvaPosOnly,
|* SwLayoutFrm::NotifyLowerObjs()
|*
|*************************************************************************/
-// --> OD 2004-07-01 #i28701# - change purpose of method and its name
-// --> OD 2004-10-08 #i26945# - correct check, if anchored object is a lower
+// #i28701# - change purpose of method and its name
+// #i26945# - correct check, if anchored object is a lower
// of the layout frame. E.g., anchor character text frame can be a follow text
// frame.
-// --> OD 2005-03-11 #i44016# - add parameter <_bUnlockPosOfObjs> to
+// #i44016# - add parameter <_bUnlockPosOfObjs> to
// force an unlockposition call for the lower objects.
void SwLayoutFrm::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
{
@@ -2461,14 +2418,13 @@ void SwLayoutFrm::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
for ( sal_uInt32 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
- // --> OD 2004-10-08 #i26945# - check, if anchored object is a lower
+ // #i26945# - check, if anchored object is a lower
// of the layout frame is changed to check, if its anchor frame
// is a lower of the layout frame.
// determine the anchor frame - usually it's the anchor frame,
// for at-character/as-character anchored objects the anchor character
// text frame is taken.
const SwFrm* pAnchorFrm = pObj->GetAnchorFrmContainingAnchPos();
- // <--
if ( pObj->ISA(SwFlyFrm) )
{
SwFlyFrm* pFly = static_cast<SwFlyFrm*>(pObj);
@@ -2479,22 +2435,20 @@ void SwLayoutFrm::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
if ( pFly->IsAnLower( this ) )
continue;
- // --> OD 2004-10-08 #i26945# - use <pAnchorFrm> to check, if
+ // #i26945# - use <pAnchorFrm> to check, if
// fly frame is lower of layout frame resp. if fly frame is
// at a different page registered as its anchor frame is on.
const bool bLow = IsAnLower( pAnchorFrm );
if ( bLow || pAnchorFrm->FindPageFrm() != pPageFrm )
- // <--
{
pFly->_Invalidate( pPageFrm );
if ( !bLow || pFly->IsFlyAtCntFrm() )
{
- // --> OD 2005-03-11 #i44016#
+ // #i44016#
if ( _bUnlockPosOfObjs )
{
pFly->UnlockPosition();
}
- // <--
pFly->_InvalidatePos();
}
else
@@ -2505,19 +2459,17 @@ void SwLayoutFrm::NotifyLowerObjs( const bool _bUnlockPosOfObjs )
{
OSL_ENSURE( pObj->ISA(SwAnchoredDrawObject),
"<SwLayoutFrm::NotifyFlys() - anchored object of unexcepted type" );
- // --> OD 2004-10-08 #i26945# - use <pAnchorFrm> to check, if
+ // #i26945# - use <pAnchorFrm> to check, if
// fly frame is lower of layout frame resp. if fly frame is
// at a different page registered as its anchor frame is on.
if ( IsAnLower( pAnchorFrm ) ||
pAnchorFrm->FindPageFrm() != pPageFrm )
- // <--
{
- // --> OD 2005-03-11 #i44016#
+ // #i44016#
if ( _bUnlockPosOfObjs )
{
pObj->UnlockPosition();
}
- // <--
pObj->InvalidateObjPos();
}
}
@@ -2788,9 +2740,8 @@ SwVirtFlyDrawObj* SwFlyFrm::GetVirtDrawObj()
void SwFlyFrm::InvalidateObjPos()
{
InvalidatePos();
- // --> OD 2006-08-10 #i68520#
+ // #i68520#
InvalidateObjRectWithSpaces();
- // <--
}
SwFrmFmt& SwFlyFrm::GetFrmFmt()
@@ -2811,15 +2762,14 @@ const SwRect SwFlyFrm::GetObjRect() const
return Frm();
}
-// --> OD 2006-10-05 #i70122#
+// #i70122#
// for Writer fly frames the bounding rectangle equals the object rectangles
const SwRect SwFlyFrm::GetObjBoundRect() const
{
return GetObjRect();
}
-// <--
-// --> OD 2006-08-10 #i68520#
+// #i68520#
bool SwFlyFrm::_SetObjTop( const SwTwips _nTop )
{
const bool bChanged( Frm().Pos().Y() != _nTop );
@@ -2836,7 +2786,6 @@ bool SwFlyFrm::_SetObjLeft( const SwTwips _nLeft )
return bChanged;
}
-// <--
/** method to assure that anchored object is registered at the correct
page frame
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 0991a12388..7da7e342b1 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -584,10 +584,10 @@ public:
SwDistance() { nMain = nSub = 0; }
SwDistance& operator=( const SwDistance &rTwo )
{ nMain = rTwo.nMain; nSub = rTwo.nSub; return *this; }
- sal_Bool operator<( const SwDistance& rTwo )
+ sal_Bool operator<( const SwDistance& rTwo ) const
{ return nMain < rTwo.nMain || ( nMain == rTwo.nMain && nSub &&
rTwo.nSub && nSub < rTwo.nSub ); }
- sal_Bool operator<=( const SwDistance& rTwo )
+ sal_Bool operator<=( const SwDistance& rTwo ) const
{ return nMain < rTwo.nMain || ( nMain == rTwo.nMain && ( !nSub ||
!rTwo.nSub || nSub <= rTwo.nSub ) ); }
};
@@ -1191,8 +1191,7 @@ const SwCntntFrm *FindAnchor( const SwFrm *pOldAnch, const Point &rNew,
//sich weiter zu suchen.
if ( pDownLst->IsInTab() && pDownFrm->IsInTab() )
{
- while ( pDownFrm && ( ( nDown.nMain != LONG_MAX && nDownLst < nDownLst
- && pDownFrm->IsInTab()) || bBody != pDownFrm->IsInDocBody() ) )
+ while ( pDownFrm && ( ( nDown.nMain != LONG_MAX && pDownFrm->IsInTab()) || bBody != pDownFrm->IsInDocBody() ) )
{
pDownFrm = pDownFrm->GetNextCntntFrm();
if ( pDownFrm )
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index b3a8b6a36f..905524e297 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -74,9 +74,8 @@ SwFlyInCntFrm::~SwFlyInCntFrm()
}
}
-// --> OD 2004-06-29 #i28701#
+// #i28701#
TYPEINIT1(SwFlyInCntFrm,SwFlyFrm);
-// <--
/*************************************************************************
|*
|* SwFlyInCntFrm::SetRefPoint(),
@@ -97,9 +96,8 @@ void SwFlyInCntFrm::SetRefPoint( const Point& rPoint,
SetCurrRelPos( rRelAttr );
SWRECTFN( GetAnchorFrm() )
(Frm().*fnRect->fnSetPos)( rPoint + rRelPos );
- // --> OD 2006-08-25 #i68520#
+ // #i68520#
InvalidateObjRectWithSpaces();
- // <--
if( pNotify )
{
InvalidatePage();
@@ -212,13 +210,12 @@ void SwFlyInCntFrm::MakeObjPos()
}
}
-// --> OD 2004-12-02 #115759#
+// #115759#
void SwFlyInCntFrm::_ActionOnInvalidation( const InvalidationType _nInvalid )
{
if ( INVALID_POS == _nInvalid || INVALID_ALL == _nInvalid )
AnchorFrm()->Prepare( PREP_FLY_ATTR_CHG, &GetFrmFmt() );
}
-// <--
/*************************************************************************
|*
|* SwFlyInCntFrm::NotifyBackground()
@@ -315,7 +312,7 @@ void SwFlyInCntFrm::MakeAll()
MakeObjPos();
}
- // --> OD 2006-04-13 #b6402800#
+ //
// re-activate clipping of as-character anchored Writer fly frames
// depending on compatibility option <ClipAsCharacterAnchoredWriterFlyFrames>
if ( bValidPos && bValidSize &&
@@ -330,7 +327,6 @@ void SwFlyInCntFrm::MakeAll()
bWidthClipped = sal_True;
}
}
- // <--
}
Unlock();
}
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 8a9e401bf0..2e276bc0b5 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -273,10 +273,9 @@ SwFrmNotify::~SwFrmNotify()
bool bNotifySize = false;
SwAnchoredObject* pObj = rObjs[i];
SwContact* pContact = ::GetUserCall( pObj->GetDrawObj() );
- // --> OD 2004-12-08 #115759#
+ // #115759#
const bool bAnchoredAsChar = pContact->ObjAnchoredAsChar();
if ( !bAnchoredAsChar )
- // <--
{
// Notify object, which aren't anchored as-character:
@@ -357,24 +356,22 @@ SwFrmNotify::~SwFrmNotify()
SwFlyFrm* pFlyFrm = static_cast<SwFlyFrm*>(pObj);
if ( bNotifySize )
pFlyFrm->_InvalidateSize();
- // --> OD 2004-12-08 #115759# - no invalidation of
+ // #115759# - no invalidation of
// position for as-character anchored objects.
if ( !bAnchoredAsChar )
{
pFlyFrm->_InvalidatePos();
}
- // <--
pFlyFrm->_Invalidate();
}
else if ( pObj->ISA(SwAnchoredDrawObject) )
{
- // --> OD 2004-12-08 #115759# - no invalidation of
+ // #115759# - no invalidation of
// position for as-character anchored objects.
if ( !bAnchoredAsChar )
{
pObj->InvalidateObjPos();
}
- // <--
}
else
{
@@ -396,12 +393,11 @@ SwFrmNotify::~SwFrmNotify()
// #i9046# Automatic frame width
SwFlyFrm* pFly = 0;
- // --> FME 2004-10-21 #i35879# Do not trust the inf flags. pFrm does not
+ // #i35879# Do not trust the inf flags. pFrm does not
// necessarily have to have an upper!
if ( !pFrm->IsFlyFrm() && 0 != ( pFly = pFrm->ImplFindFlyFrm() ) )
- // <--
{
- // --> OD 2006-05-08 #i61999#
+ // #i61999#
// no invalidation of columned Writer fly frames, because automatic
// width doesn't make sense for such Writer fly frames.
if ( pFly->Lower() && !pFly->Lower()->IsColumnFrm() )
@@ -417,18 +413,16 @@ SwFrmNotify::~SwFrmNotify()
// way:
if ( ATT_FIX_SIZE != rFrmSz.GetWidthSizeType() )
{
- // --> OD 2005-07-29 #i50668#, #i50998# - invalidation of position
+ // #i50668#, #i50998# - invalidation of position
// of as-character anchored fly frames not needed and can cause
// layout loops
if ( !pFly->ISA(SwFlyInCntFrm) )
{
pFly->InvalidatePos();
}
- // <--
pFly->InvalidateSize();
}
}
- // <--
}
}
@@ -473,12 +467,11 @@ void lcl_InvalidatePosOfLowers( SwLayoutFrm& _rLayoutFrm )
SwLayNotify::~SwLayNotify()
{
- // --> OD 2005-07-29 #i49383#
+ // #i49383#
if ( mbFrmDeleted )
{
return;
}
- // <--
SwLayoutFrm *pLay = GetLay();
SWRECTFN( pLay )
@@ -608,11 +601,11 @@ SwLayNotify::~SwLayNotify()
pLay->Lower() && pLay->Lower()->IsColumnFrm()) &&
(bPos || bNotify) && !(pLay->GetType() & 0x1823) ) //Tab, Row, FtnCont, Root, Page
{
- // --> OD 2005-03-11 #i44016# - force unlock of position of lower objects.
- // --> OD 2005-03-30 #i43913# - no unlock of position of objects,
+ // #i44016# - force unlock of position of lower objects.
+ // #i43913# - no unlock of position of objects,
// if <pLay> is a cell frame, and its table frame resp. its parent table
// frame is locked.
- // --> OD 2005-04-15 #i47458# - force unlock of position of lower objects,
+ // #i47458# - force unlock of position of lower objects,
// only if position of layout frame has changed.
bool bUnlockPosOfObjs( bPos );
if ( bUnlockPosOfObjs && pLay->IsCellFrm() )
@@ -626,21 +619,18 @@ SwLayNotify::~SwLayNotify()
bUnlockPosOfObjs = false;
}
}
- // --> OD 2005-05-18 #i49383# - check for footnote frame, if unlock
+ // #i49383# - check for footnote frame, if unlock
// of position of lower objects is allowed.
else if ( bUnlockPosOfObjs && pLay->IsFtnFrm() )
{
bUnlockPosOfObjs = static_cast<SwFtnFrm*>(pLay)->IsUnlockPosOfLowerObjs();
}
- // <--
- // --> OD 2005-07-29 #i51303# - no unlock of object positions for sections
+ // #i51303# - no unlock of object positions for sections
else if ( bUnlockPosOfObjs && pLay->IsSctFrm() )
{
bUnlockPosOfObjs = false;
}
- // <--
pLay->NotifyLowerObjs( bUnlockPosOfObjs );
- // <--
}
if ( bPos && pLay->IsFtnFrm() && pLay->Lower() )
{
@@ -656,10 +646,9 @@ SwLayNotify::~SwLayNotify()
SwFlyNotify::SwFlyNotify( SwFlyFrm *pFlyFrm ) :
SwLayNotify( pFlyFrm ),
- // --> OD 2004-11-24 #115759# - keep correct page frame - the page frame
+ // #115759# - keep correct page frame - the page frame
// the Writer fly frame is currently registered at.
pOldPage( pFlyFrm->GetPageFrm() ),
- // <--
aFrmAndSpace( pFlyFrm->GetObjRectWithSpaces() )
{
}
@@ -668,12 +657,11 @@ SwFlyNotify::SwFlyNotify( SwFlyFrm *pFlyFrm ) :
SwFlyNotify::~SwFlyNotify()
{
- // --> OD 2005-07-29 #i49383#
+ // #i49383#
if ( mbFrmDeleted )
{
return;
}
- // <--
SwFlyFrm *pFly = GetFly();
if ( pFly->IsNotifyBack() )
@@ -685,14 +673,13 @@ SwFlyNotify::~SwFlyNotify()
//Wenn in der LayAction das IsAgain gesetzt ist kann es sein,
//dass die alte Seite inzwischen vernichtet wurde!
::Notify( pFly, pOldPage, aFrmAndSpace, &aPrt );
- // --> OD 2004-10-20 #i35640# - additional notify anchor text frame,
+ // #i35640# - additional notify anchor text frame,
// if Writer fly frame has changed its page
if ( pFly->GetAnchorFrm()->IsTxtFrm() &&
pFly->GetPageFrm() != pOldPage )
{
pFly->AnchorFrm()->Prepare( PREP_FLY_LEAVE );
}
- // <--
}
pFly->ResetNotifyBack();
}
@@ -724,28 +711,25 @@ SwFlyNotify::~SwFlyNotify()
}
}
- // --> OD 2004-11-05 #i26945# - notify anchor.
+ // #i26945# - notify anchor.
// Needed for negative positioned Writer fly frames
if ( pFly->GetAnchorFrm()->IsTxtFrm() )
{
pFly->AnchorFrm()->Prepare( PREP_FLY_LEAVE );
}
- // <--
}
// OD 2004-05-13 #i28701#
- // --> OD 2005-03-21 #i45180# - no adjustment of layout process flags and
+ // #i45180# - no adjustment of layout process flags and
// further notifications/invalidations, if format is called by grow/shrink
if ( pFly->ConsiderObjWrapInfluenceOnObjPos() &&
( !pFly->ISA(SwFlyFreeFrm) ||
!static_cast<SwFlyFreeFrm*>(pFly)->IsNoMoveOnCheckClip() ) )
- // <--
{
- // --> OD 2005-09-05 #i54138# - suppress restart of the layout process
+ // #i54138# - suppress restart of the layout process
// on changed frame height.
// Note: It doesn't seem to be necessary and can cause layout loops.
if ( bPosChgd )
- // <--
{
// indicate a restart of the layout process
pFly->SetRestartLayoutProcess( true );
@@ -805,12 +789,11 @@ SwCntntNotify::SwCntntNotify( SwCntntFrm *pCntntFrm ) :
SwCntntNotify::~SwCntntNotify()
{
- // --> OD 2005-07-29 #i49383#
+ // #i49383#
if ( mbFrmDeleted )
{
return;
}
- // <--
SwCntntFrm *pCnt = GetCnt();
if ( bSetCompletePaintOnInvalidate )
@@ -1013,14 +996,13 @@ SwCntntNotify::~SwCntntNotify()
}
}
- // --> OD 2005-03-07 #i44049#
+ // #i44049#
if ( pCnt->IsTxtFrm() && POS_DIFF( aFrm, pCnt->Frm() ) )
{
pCnt->InvalidateObjs( true );
}
- // <--
- // --> OD 2005-04-12 #i43255# - move code to invalidate at-character
+ // #i43255# - move code to invalidate at-character
// anchored objects due to a change of its anchor character from
// method <SwTxtFrm::Format(..)>.
if ( pCnt->IsTxtFrm() )
@@ -1043,7 +1025,6 @@ SwCntntNotify::~SwCntntNotify()
}
}
}
- // <--
}
/*************************************************************************/
@@ -1331,7 +1312,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
pPageMaker->CheckInsert( nIndex );
pFrm->InsertBehind( pLay, pPrv );
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for next paragraph will change
@@ -1347,17 +1328,15 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
pViewShell->InvalidateAccessibleParaFlowRelation(
dynamic_cast<SwTxtFrm*>(pFrm->FindNextCnt( true )),
dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
- // --> OD 2006-08-28 #i68958#
+ // #i68958#
// The information flags of the text frame are validated
// in methods <FindNextCnt(..)> and <FindPrevCnt(..)>.
// The information flags have to be invalidated, because
// it is possible, that the one of its upper frames
// isn't inserted into the layout.
pFrm->InvalidateInfFlags();
- // <--
}
}
- // <--
// OD 12.08.2003 #i17969# - consider horizontal/vertical layout
// for setting position at newly inserted frame
lcl_SetPos( *pFrm, *pLay );
@@ -1384,7 +1363,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
pPageMaker->CheckInsert( nIndex );
pFrm->InsertBehind( pLay, pPrv );
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for next paragraph will change
@@ -1401,7 +1380,6 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
}
}
- // <--
if ( bObjsDirect && pTbl->Count() )
((SwTabFrm*)pFrm)->RegistFlys();
// OD 12.08.2003 #i17969# - consider horizontal/vertical layout
@@ -1448,12 +1426,11 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
// after insertion in the layout
static_cast<SwSectionFrm*>(pFrm)->Init();
- // --> FME 2004-09-08 #i33963#
+ // #i33963#
// Do not trust the IsInFtn flag. If we are currently
// building up a table, the upper of pPrv may be a cell
// frame, but the cell frame does not have an upper yet.
if( pPrv && 0 != pPrv->ImplFindFtnFrm() )
- // <--
{
if( pPrv->IsSctFrm() )
pPrv = ((SwSectionFrm*)pPrv)->ContainsCntnt();
@@ -1461,7 +1438,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
((SwTxtFrm*)pPrv)->Prepare( PREP_QUOVADIS, 0, sal_False );
}
}
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for next paragraph will change
@@ -1478,7 +1455,6 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
}
}
- // <--
pFrm->CheckDirChange();
// OD 12.08.2003 #i17969# - consider horizontal/vertical layout
@@ -1864,15 +1840,14 @@ SwBorderAttrs::SwBorderAttrs( const SwModify *pMod, const SwFrm *pConstructor )
? ((SwCntntFrm*)pConstructor)->GetNode()->GetSwAttrSet()
: ((SwLayoutFrm*)pConstructor)->GetFmt()->GetAttrSet() ),
rUL ( rAttrSet.GetULSpace() ),
- // --> OD 2008-12-04 #i96772#
+ // #i96772#
// LRSpaceItem is copied due to the possibility that it is adjusted - see below
rLR ( rAttrSet.GetLRSpace() ),
- // <--
rBox ( rAttrSet.GetBox() ),
rShadow ( rAttrSet.GetShadow() ),
aFrmSize( rAttrSet.GetFrmSize().GetSize() )
{
- // --> OD 2008-12-02 #i96772#
+ // #i96772#
const SwTxtFrm* pTxtFrm = dynamic_cast<const SwTxtFrm*>(pConstructor);
if ( pTxtFrm )
{
@@ -2390,7 +2365,7 @@ const SdrObject *SwOrderIter::Prev()
//verboten.
//Unterwegs werden die Flys bei der Seite abgemeldet.
-// --> OD 2004-11-29 #115759# - 'remove' also drawing object from page and
+// #115759# - 'remove' also drawing object from page and
// at-fly anchored objects from page
void MA_FASTCALL lcl_RemoveObjsFromPage( SwFrm* _pFrm )
{
@@ -2399,26 +2374,23 @@ void MA_FASTCALL lcl_RemoveObjsFromPage( SwFrm* _pFrm )
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
SwAnchoredObject* pObj = rObjs[i];
- // --> OD 2004-11-29 #115759# - reset member, at which the anchored
+ // #115759# - reset member, at which the anchored
// object orients its vertical position
pObj->ClearVertPosOrientFrm();
- // <--
- // --> OD 2005-03-03 #i43913#
+ // #i43913#
pObj->ResetLayoutProcessBools();
- // <--
- // --> OD 2004-11-29 #115759# - remove also lower objects of as-character
+ // #115759# - remove also lower objects of as-character
// anchored Writer fly frames from page
if ( pObj->ISA(SwFlyFrm) )
{
SwFlyFrm* pFlyFrm = static_cast<SwFlyFrm*>(pObj);
- // --> OD 2004-11-29 #115759# - remove also direct lowers of Writer
+ // #115759# - remove also direct lowers of Writer
// fly frame from page
if ( pFlyFrm->GetDrawObjs() )
{
::lcl_RemoveObjsFromPage( pFlyFrm );
}
- // <--
SwCntntFrm* pCnt = pFlyFrm->ContainsCntnt();
while ( pCnt )
@@ -2429,12 +2401,11 @@ void MA_FASTCALL lcl_RemoveObjsFromPage( SwFrm* _pFrm )
}
if ( pFlyFrm->IsFlyFreeFrm() )
{
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
pFlyFrm->GetPageFrm()->RemoveFlyFromPage( pFlyFrm );
}
}
- // <--
- // --> OD 2004-11-29 #115759# - remove also drawing objects from page
+ // #115759# - remove also drawing objects from page
else if ( pObj->ISA(SwAnchoredDrawObject) )
{
if (pObj->GetFrmFmt().GetAnchor().GetAnchorId() != FLY_AS_CHAR)
@@ -2443,7 +2414,6 @@ void MA_FASTCALL lcl_RemoveObjsFromPage( SwFrm* _pFrm )
*(static_cast<SwAnchoredDrawObject*>(pObj)) );
}
}
- // <--
}
}
@@ -2558,7 +2528,7 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
return bGo ? pStart : NULL;
}
-// --> OD 2004-11-29 #115759# - add also drawing objects to page and at-fly
+// #115759# - add also drawing objects to page and at-fly
// anchored objects to page
void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
{
@@ -2568,11 +2538,10 @@ void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
{
SwAnchoredObject* pObj = rObjs[i];
- // --> OD 2004-11-29 #115759# - unlock position of anchored object
+ // #115759# - unlock position of anchored object
// in order to get the object's position calculated.
pObj->UnlockPosition();
- // <--
- // --> OD 2004-11-29 #115759# - add also lower objects of as-character
+ // #115759# - add also lower objects of as-character
// anchored Writer fly frames from page
if ( pObj->ISA(SwFlyFrm) )
{
@@ -2585,13 +2554,12 @@ void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
pFlyFrm->_InvalidateSize();
pFlyFrm->InvalidatePage( _pPage );
- // --> OD 2004-11-29 #115759# - add also at-fly anchored objects
+ // #115759# - add also at-fly anchored objects
// to page
if ( pFlyFrm->GetDrawObjs() )
{
::lcl_AddObjsToPage( pFlyFrm, _pPage );
}
- // <--
SwCntntFrm *pCnt = pFlyFrm->ContainsCntnt();
while ( pCnt )
@@ -2601,8 +2569,7 @@ void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
pCnt = pCnt->GetNextCntntFrm();
}
}
- // <--
- // --> OD 2004-11-29 #115759# - remove also drawing objects from page
+ // #115759# - remove also drawing objects from page
else if ( pObj->ISA(SwAnchoredDrawObject) )
{
if (pObj->GetFrmFmt().GetAnchor().GetAnchorId() != FLY_AS_CHAR)
@@ -2612,7 +2579,6 @@ void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
*(static_cast<SwAnchoredDrawObject*>(pObj)) );
}
}
- // <--
}
}
@@ -2781,7 +2747,7 @@ void MA_FASTCALL lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
{
SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pObj);
//Ggf. ummelden, nicht anmelden wenn bereits bekannt.
- // --> OD 2004-06-30 #i28701# - use new method <GetPageFrm()>
+ // #i28701# - use new method <GetPageFrm()>
SwPageFrm *pPg = pFly->IsFlyFreeFrm()
? pFly->GetPageFrm() : pFly->FindPageFrm();
if ( pPg != pPage )
@@ -2794,16 +2760,14 @@ void MA_FASTCALL lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
}
else
{
- // --> OD 2008-04-22 #i87493#
+ // #i87493#
if ( pPage != pObj->GetPageFrm() )
{
- // --> OD 2004-07-02 #i28701#
+ // #i28701#
if ( pObj->GetPageFrm() )
pObj->GetPageFrm()->RemoveDrawObjFromPage( *pObj );
pPage->AppendDrawObjToPage( *pObj );
- // <--
}
- // <--
}
const SwFlyFrm* pFly = pAnch->FindFlyFrm();
@@ -2865,14 +2829,13 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld,
if( pSh && rOld.HasArea() )
pSh->InvalidateWindows( rOld );
- // --> OD 2005-08-19 #i51941# - consider case that fly frame isn't
+ // #i51941# - consider case that fly frame isn't
// registered at the old page <pOld>
SwPageFrm* pPageFrm = pFly->FindPageFrm();
if ( pOld != pPageFrm )
{
pFly->NotifyBackground( pPageFrm, aFrm, PREP_FLY_ARRIVE );
}
- // <--
if ( rOld.Left() != aFrm.Left() )
{
@@ -2951,16 +2914,14 @@ void MA_FASTCALL lcl_NotifyCntnt( const SdrObject *pThis, SwCntntFrm *pCnt,
aCntPrt.Pos() += pCnt->Frm().Pos();
if ( eHint == PREP_FLY_ATTR_CHG )
{
- // --> OD 2004-10-20 #i35640# - use given rectangle <rRect> instead
+ // #i35640# - use given rectangle <rRect> instead
// of current bound rectangle
if ( aCntPrt.IsOver( rRect ) )
- // <--
pCnt->Prepare( PREP_FLY_ATTR_CHG );
}
- // --> OD 2004-11-01 #i23129# - only invalidate, if the text frame
+ // #i23129# - only invalidate, if the text frame
// printing area overlaps with the given rectangle.
else if ( aCntPrt.IsOver( rRect ) )
- // <--
pCnt->Prepare( eHint, (void*)&aCntPrt._Intersection( rRect ) );
if ( pCnt->GetDrawObjs() )
{
@@ -3032,12 +2993,11 @@ void Notify_Background( const SdrObject* pObj,
// on the object positioning, the complete area has to be processed,
// because content frames before the anchor frame also have to consider
// the object for the text wrapping.
- // --> OD 2004-08-25 #i3317# - The complete area has always been
+ // #i3317# - The complete area has always been
// processed.
{
pCnt = pArea->ContainsCntnt();
}
- // <--
}
SwFrm *pLastTab = 0;
@@ -3047,13 +3007,12 @@ void Notify_Background( const SdrObject* pObj,
if ( pCnt->IsInTab() )
{
SwLayoutFrm* pCell = pCnt->GetUpper();
- // --> OD 2005-01-14 #i40606# - use <GetLastBoundRect()>
+ // #i40606# - use <GetLastBoundRect()>
// instead of <GetCurrentBoundRect()>, because a recalculation
// of the bounding rectangle isn't intended here.
if ( pCell->IsCellFrm() &&
( pCell->Frm().IsOver( pObj->GetLastBoundRect() ) ||
pCell->Frm().IsOver( rRect ) ) )
- // <--
{
const SwFmtVertOrient &rOri = pCell->GetFmt()->GetVertOrient();
if ( text::VertOrientation::NONE != rOri.GetVertOrient() )
@@ -3063,12 +3022,11 @@ void Notify_Background( const SdrObject* pObj,
if ( pTab != pLastTab )
{
pLastTab = pTab;
- // --> OD 2005-01-14 #i40606# - use <GetLastBoundRect()>
+ // #i40606# - use <GetLastBoundRect()>
// instead of <GetCurrentBoundRect()>, because a recalculation
// of the bounding rectangle isn't intended here.
if ( pTab->Frm().IsOver( pObj->GetLastBoundRect() ) ||
pTab->Frm().IsOver( rRect ) )
- // <--
{
if ( !pFlyFrm || !pFlyFrm->IsLowerOf( pTab ) )
pTab->InvalidatePrt();
@@ -3089,9 +3047,8 @@ void Notify_Background( const SdrObject* pObj,
// pFrm->Frm().IsOver( rRect ) ) ) )
// pFrm->InvalidateSize();
// }
- // --> OD 2007-07-24 #128702# - make code robust
+ // #128702# - make code robust
if ( pPage && pPage->GetSortedObjs() )
- // <--
{
pObj->GetOrdNum();
const SwSortedObjs &rObjs = *pPage->GetSortedObjs();
@@ -3152,14 +3109,13 @@ void Notify_Background( const SdrObject* pObj,
if ( pFlyFrm && pAnchor->GetUpper() && pAnchor->IsInTab() )//MA_FLY_HEIGHT
pAnchor->GetUpper()->InvalidateSize();
- // --> OD 2008-01-30 #i82258# - make code robust
+ // #i82258# - make code robust
ViewShell* pSh = 0;
if ( bInva && pPage &&
0 != (pSh = pPage->getRootFrm()->GetCurrShell()) )
{
pSh->InvalidateWindows( rRect );
}
- // <--
}
/*************************************************************************
@@ -3420,7 +3376,7 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt1
if( bCalcFrm )
{
- // --> OD 2005-03-04 #b6234250# - format parent Writer
+ // - format parent Writer
// fly frame, if it isn't been formatted yet.
// Note: The Writer fly frame could be the frame itself.
SwFlyFrm* pFlyFrm( pTmpFrm->FindFlyFrm() );
@@ -3430,7 +3386,6 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt1
{
SwObjectFormatter::FormatObj( *pFlyFrm );
}
- // <--
pTmpFrm->Calc();
}
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index a8e1b46bba..9f6927797b 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -496,9 +496,8 @@ SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwCntntFrm *pCnt, SwTxtFtn *pAt
pRef( pCnt ),
pAttr( pAt ),
bBackMoveLocked( sal_False ),
- // --> OD 2005-08-11 #i49383#
+ // #i49383#
mbUnlockPosOfLowerObjs( true )
- // <--
{
nType = FRMC_FTN;
}
@@ -1778,20 +1777,19 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
pSect->InvalidateSize();
else
{
- // --> OD 2005-05-18 #i49383# - disable unlock of position of
+ // #i49383# - disable unlock of position of
// lower objects during format of footnote content.
const bool bOldFtnFrmLocked( pNew->IsColLocked() );
pNew->ColLock();
pNew->KeepLockPosOfLowerObjs();
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// no extra notify for footnote frame
// SwLayNotify* pFtnFrmNotitfy = new SwLayNotify( pNew );
- // <--
SwCntntFrm *pCnt = pNew->ContainsCntnt();
while ( pCnt && pCnt->FindFtnFrm()->GetAttr() == pAttr )
{
pCnt->Calc();
- // --> OD 2005-05-17 #i49383# - format anchored objects
+ // #i49383# - format anchored objects
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
{
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
@@ -1802,31 +1800,27 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
continue;
}
}
- // <--
pCnt = (SwCntntFrm*)pCnt->FindNextCnt();
}
- // --> OD 2005-05-18 #i49383#
+ // #i49383#
if ( !bOldFtnFrmLocked )
{
pNew->ColUnlock();
}
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// enable lock of lower object position before format of footnote frame.
pNew->UnlockPosOfLowerObjs();
- // <--
pNew->Calc();
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// no extra notify for footnote frame
// pNew->UnlockPosOfLowerObjs();
// delete pFtnFrmNotitfy;
- // <--
if ( !bOldFtnFrmLocked && !pNew->GetLower() &&
!pNew->IsColLocked() && !pNew->IsBackMoveLocked() )
{
pNew->Cut();
delete pNew;
}
- // <--
}
pMyPage->UpdateFtnNum();
}
@@ -2168,7 +2162,7 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
const sal_uInt16 nMyCol = lcl_ColumnNum( this );
SWRECTFN( this )
- // --> OD 2004-06-11 #i21478# - keep last inserted footnote in order to
+ // #i21478# - keep last inserted footnote in order to
// format the content of the following one.
SwFtnFrm* pLastInsertedFtn = 0L;
for ( sal_uInt16 i = 0; i < rFtnArr.Count(); ++i )
@@ -2223,19 +2217,18 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
sal_Bool bUnlock = !pFtn->IsBackMoveLocked();
pFtn->LockBackMove();
- // --> OD 2005-05-18 #i49383# - disable unlock of position of
+ // #i49383# - disable unlock of position of
// lower objects during format of footnote content.
pFtn->KeepLockPosOfLowerObjs();
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// no extra notify for footnote frame
// SwLayNotify aFtnFrmNotitfy( pFtn );
- // <--
while ( pCnt && pCnt->FindFtnFrm()->GetAttr() == pAttr )
{
pCnt->_InvalidatePos();
pCnt->Calc();
- // --> OD 2005-05-17 #i49383# - format anchored objects
+ // #i49383# - format anchored objects
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
{
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
@@ -2246,7 +2239,6 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
continue;
}
}
- // <--
if( pCnt->IsSctFrm() )
{ // Wenn es sich um einen nichtleeren Bereich handelt,
// iterieren wir auch ueber seinen Inhalt
@@ -2266,45 +2258,43 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
{
pFtn->Cut();
delete pFtn;
- // --> OD 2004-06-10 #i21478#
+ // #i21478#
pFtn = 0L;
}
}
- // --> OD 2005-05-18 #i49383#
+ // #i49383#
if ( pFtn )
{
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// enable lock of lower object position before format of footnote frame.
pFtn->UnlockPosOfLowerObjs();
pFtn->Calc();
// pFtn->UnlockPosOfLowerObjs();
- // <--
}
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// no extra notify for footnote frame
// else
// {
// aFtnFrmNotitfy.FrmDeleted();
// }
- // <--
}
}
else
{ OSL_ENSURE( !pFtn->GetMaster() && !pFtn->GetFollow(),
"DelFtn und Master/Follow?" );
delete pFtn;
- // --> OD 2004-06-10 #i21478#
+ // #i21478#
pFtn = 0L;
}
- // --> OD 2004-06-10 #i21478#
+ // #i21478#
if ( pFtn )
{
pLastInsertedFtn = pFtn;
}
}
- // --> OD 2004-06-10 #i21478# - format content of footnote following
+ // #i21478# - format content of footnote following
// the new inserted ones.
if ( bCalc && pLastInsertedFtn )
{
@@ -2316,19 +2306,18 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
sal_Bool bUnlock = !pNextFtn->IsBackMoveLocked();
pNextFtn->LockBackMove();
- // --> OD 2005-05-18 #i49383# - disable unlock of position of
+ // #i49383# - disable unlock of position of
// lower objects during format of footnote content.
pNextFtn->KeepLockPosOfLowerObjs();
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// no extra notify for footnote frame
// SwLayNotify aFtnFrmNotitfy( pNextFtn );
- // <--
while ( pCnt && pCnt->FindFtnFrm()->GetAttr() == pAttr )
{
pCnt->_InvalidatePos();
pCnt->Calc();
- // --> OD 2005-05-17 #i49383# - format anchored objects
+ // #i49383# - format anchored objects
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
{
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
@@ -2339,7 +2328,6 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
continue;
}
}
- // <--
if( pCnt->IsSctFrm() )
{ // Wenn es sich um einen nichtleeren Bereich handelt,
// iterieren wir auch ueber seinen Inhalt
@@ -2356,13 +2344,12 @@ void SwFtnBossFrm::_MoveFtns( SvPtrarr &rFtnArr, sal_Bool bCalc )
{
pNextFtn->UnlockBackMove();
}
- // --> OD 2005-05-18 #i49383#
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i49383#
+ // #i57914# - adjust fix #i49383#
// enable lock of lower object position before format of footnote frame.
pNextFtn->UnlockPosOfLowerObjs();
pNextFtn->Calc();
// pNextFtn->UnlockPosOfLowerObjs();
- // <--
}
}
}
@@ -2437,13 +2424,12 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
pFirst->LockBackMove();
pFirst->Calc();
pCntnt->Calc();
- // --> OD 2005-05-17 #i49383# - format anchored objects
+ // #i49383# - format anchored objects
if ( pCntnt->IsTxtFrm() && pCntnt->IsValid() )
{
SwObjectFormatter::FormatObjsAtFrm( *pCntnt,
*(pCntnt->FindPageFrm()) );
}
- // <--
if( bUnlock )
pFirst->UnlockBackMove();
}
@@ -2456,15 +2442,14 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
{
sal_Bool bMore = sal_True;
sal_Bool bStart = pAttr == 0; // wenn kein Attribut uebergeben wird, alle bearbeiten
- // --> OD 2005-05-18 #i49383# - disable unlock of position of
+ // #i49383# - disable unlock of position of
// lower objects during format of footnote and footnote content.
SwFtnFrm* pLastFtnFrm( 0L );
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// no extra notify for footnote frame
// SwLayNotify* pFtnFrmNotify( 0L );
// footnote frame needs to be locked, if <bLock> isn't set.
bool bUnlockLastFtnFrm( false );
- // <--
do
{
if( !bStart )
@@ -2476,7 +2461,7 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
pCnt->_InvalidateSize();
pCnt->Prepare( PREP_ADJUST_FRM );
SwFtnFrm* pFtnFrm = pCnt->FindFtnFrm();
- // --> OD 2005-05-18 #i49383#
+ // #i49383#
if ( pFtnFrm != pLastFtnFrm )
{
if ( pLastFtnFrm )
@@ -2485,14 +2470,13 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
{
pLastFtnFrm->ColUnlock();
}
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// enable lock of lower object position before format of footnote frame.
pLastFtnFrm->UnlockPosOfLowerObjs();
pLastFtnFrm->Calc();
// pLastFtnFrm->UnlockPosOfLowerObjs();
// no extra notify for footnote frame
// delete pFtnFrmNotify;
- // <--
if ( !bLock && bUnlockLastFtnFrm &&
!pLastFtnFrm->GetLower() &&
!pLastFtnFrm->IsColLocked() &&
@@ -2510,12 +2494,10 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
}
pFtnFrm->KeepLockPosOfLowerObjs();
pLastFtnFrm = pFtnFrm;
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// no extra notify for footnote frame
// pFtnFrmNotify = new SwLayNotify( pLastFtnFrm );
- // <--
}
- // <--
// OD 30.10.2002 #97265# - invalidate position of footnote
// frame, if it's below its footnote container, in order to
// assure its correct position, probably calculating its previous
@@ -2534,7 +2516,7 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
pFtnFrm->LockBackMove();
pFtnFrm->Calc();
pCnt->Calc();
- // --> OD 2005-05-17 #i49383# - format anchored objects
+ // #i49383# - format anchored objects
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
{
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
@@ -2545,22 +2527,20 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
continue;
}
}
- // <--
if( bUnlock )
{
pFtnFrm->UnlockBackMove();
if( !pFtnFrm->Lower() &&
!pFtnFrm->IsColLocked() )
{
- // --> OD 2005-08-10 #i49383#
+ // #i49383#
OSL_ENSURE( pLastFtnFrm == pFtnFrm,
"<SwFtnBossFrm::RearrangeFtns(..)> - <pLastFtnFrm> != <pFtnFrm>" );
pLastFtnFrm = 0L;
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// no extra notify for footnote frame
// pFtnFrmNotify->FrmDeleted();
// delete pFtnFrmNotify;
- // <--
pFtnFrm->Cut();
delete pFtnFrm;
}
@@ -2570,7 +2550,7 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
{
pFtnFrm->Calc();
pCnt->Calc();
- // --> OD 2005-05-17 #i49383# - format anchored objects
+ // #i49383# - format anchored objects
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
{
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
@@ -2581,7 +2561,6 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
continue;
}
}
- // <--
}
}
SwSectionFrm *pDel = NULL;
@@ -2625,21 +2604,20 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
bMore = sal_False;
}
} while ( bMore );
- // --> OD 2005-05-18 #i49383#
+ // #i49383#
if ( pLastFtnFrm )
{
if ( !bLock && bUnlockLastFtnFrm )
{
pLastFtnFrm->ColUnlock();
}
- // --> OD 2006-02-02 #i57914# - adjust fix #i49383#
+ // #i57914# - adjust fix #i49383#
// enable lock of lower object position before format of footnote frame.
pLastFtnFrm->UnlockPosOfLowerObjs();
pLastFtnFrm->Calc();
// pLastFtnFrm->UnlockPosOfLowerObjs();
// no extra notify for footnote frame
// delete pFtnFrmNotify;
- // <--
if ( !bLock && bUnlockLastFtnFrm &&
!pLastFtnFrm->GetLower() &&
!pLastFtnFrm->IsColLocked() &&
@@ -2649,7 +2627,6 @@ void SwFtnBossFrm::RearrangeFtns( const SwTwips nDeadLine, const sal_Bool bLock,
delete pLastFtnFrm;
}
}
- // <--
}
}
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 8571e1f26e..e52b518557 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -48,9 +48,8 @@
#include "hfspacingitem.hxx"
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-// --> OD 2005-03-03 #i43771#
+// #i43771#
#include <objectformatter.hxx>
-// <--
extern sal_Bool bObjsDirect; //frmtool.cxx
@@ -257,30 +256,28 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
SwTwips nMaxHeight = LONG_MAX;
SwTwips nRemaining, nOldHeight;
- // --> OD 2006-05-24 #i64301#
+ // #i64301#
// use the position of the footer printing area to control invalidation
// of the first footer content.
Point aOldFooterPrtPos;
- // <--
do
{
nOldHeight = Prt().Height();
SwFrm* pFrm = Lower();
- // --> OD 2006-05-24 #i64301#
+ // #i64301#
if ( pFrm &&
aOldFooterPrtPos != ( Frm().Pos() + Prt().Pos() ) )
{
pFrm->_InvalidatePos();
aOldFooterPrtPos = Frm().Pos() + Prt().Pos();
}
- // <--
while( pFrm )
{
pFrm->Calc();
- // --> OD 2005-03-03 #i43771# - format also object anchored
+ // #i43771# - format also object anchored
// at the frame
- // --> OD 2005-05-03 #i46941# - frame has to be valid.
+ // #i46941# - frame has to be valid.
// Note: frame could be invalid after calling its format,
// if it's locked
OSL_ENSURE( StackHack::IsLocked() || !pFrm->IsTxtFrm() ||
@@ -297,7 +294,6 @@ void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
continue;
}
}
- // <--
pFrm = pFrm->GetNext();
}
nRemaining = 0;
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index e462b7229a..efe64b19c7 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -85,13 +85,12 @@
#include "sectfrm.hxx"
#include "lineinfo.hxx"
#include <acmplwrd.hxx>
-// --> OD 2004-06-28 #i28701#
+// #i28701#
#include <sortedobjs.hxx>
#include <objectformatter.hxx>
#include <PostItMgr.hxx>
#include <vector>
-// <--
//#pragma optimize("ity",on)
/*************************************************************************
@@ -526,7 +525,7 @@ SwPageFrm* SwLayAction::CheckFirstVisPage( SwPageFrm *pPage )
}
// OD 2004-05-12 #i28701#
-// --> OD 2004-11-03 #i114798# - unlock position on start and end of page
+// #i114798# - unlock position on start and end of page
// layout process.
class NotifyLayoutOfPageInProgress
{
@@ -559,7 +558,6 @@ class NotifyLayoutOfPageInProgress
_UnlockPositionOfObjs();
}
};
-// <--
void SwLayAction::InternalAction()
{
@@ -710,19 +708,17 @@ void SwLayAction::InternalAction()
{
pPage->ValidateFlyInCnt();
pPage->ValidateCntnt();
- // --> OD 2004-05-10 #i28701#
+ // #i28701#
pPage->ValidateFlyLayout();
pPage->ValidateFlyCntnt();
- // <--
if ( !FormatCntnt( pPage ) )
{
XCHECKPAGE;
pPage->InvalidateCntnt();
pPage->InvalidateFlyInCnt();
- // --> OD 2004-05-10 #i28701#
+ // #i28701#
pPage->InvalidateFlyLayout();
pPage->InvalidateFlyCntnt();
- // <--
if ( IsBrowseActionStop() )
bInput = sal_True;
}
@@ -840,14 +836,13 @@ void SwLayAction::InternalAction()
// OD 14.04.2003 #106346# - set flag for interrupt content formatting
mbFormatCntntOnInterrupt = IsInput() && !IsStopPrt();
long nBottom = rVis.Bottom();
- // --> OD 2005-02-15 #i42586# - format current page, if idle action is active
+ // #i42586# - format current page, if idle action is active
// This is an optimization for the case that the interrupt is created by
// the move of a form control object, which is represented by a window.
while ( pPg && ( pPg->Frm().Top() < nBottom ||
( IsIdle() && pPg == pPage ) ) )
- // <--
{
- // --> OD 2004-10-11 #i26945# - follow-up of #i28701#
+ // #i26945# - follow-up of #i28701#
NotifyLayoutOfPageInProgress aLayoutOfPageInProgress( *pPg );
XCHECKPAGE;
@@ -857,10 +852,10 @@ void SwLayAction::InternalAction()
const sal_uInt16 nLoopControlMax = 20;
// OD 14.04.2003 #106346# - special case: interrupt content formatting
- // --> OD 2004-07-08 #i28701# - conditions, introduced by #106346#,
+ // #i28701# - conditions, introduced by #106346#,
// are incorrect (marcos IS_FLYS and IS_INVAFLY only works for <pPage>)
// and are too strict.
- // --> OD 2005-06-09 #i50432# - adjust interrupt formatting to
+ // #i50432# - adjust interrupt formatting to
// normal page formatting - see above.
while ( ( mbFormatCntntOnInterrupt &&
( pPg->IsInvalid() ||
@@ -868,16 +863,14 @@ void SwLayAction::InternalAction()
( !mbFormatCntntOnInterrupt && pPg->IsInvalidLayout() ) )
{
XCHECKPAGE;
- // --> OD 2005-06-09 #i50432# - format also at-page anchored objects
+ // #i50432# - format also at-page anchored objects
SwObjectFormatter::FormatObjsAtFrm( *pPg, *pPg, this );
- // <--
- // --> OD 2005-06-09 #i50432#
+ // #i50432#
if ( !pPg->GetSortedObjs() )
{
pPg->ValidateFlyLayout();
pPg->ValidateFlyCntnt();
}
- // <--
// FME 2007-08-30 #i81146# new loop control
sal_uInt16 nLoopControlRuns_3 = 0;
@@ -898,18 +891,16 @@ void SwLayAction::InternalAction()
XCHECKPAGE;
}
- // --> OD 2005-06-09 #i50432#
+ // #i50432#
if ( mbFormatCntntOnInterrupt &&
( pPg->IsInvalidCntnt() ||
( pPg->GetSortedObjs() && pPg->IsInvalidFly() ) ) )
- // <--
{
pPg->ValidateFlyInCnt();
pPg->ValidateCntnt();
- // --> OD 2004-05-10 #i26945# - follow-up of fix #117736#
+ // #i26945# - follow-up of fix #117736#
pPg->ValidateFlyLayout();
pPg->ValidateFlyCntnt();
- // <--
if ( ++nLoopControlRuns_2 > nLoopControlMax )
{
@@ -924,21 +915,18 @@ void SwLayAction::InternalAction()
XCHECKPAGE;
pPg->InvalidateCntnt();
pPg->InvalidateFlyInCnt();
- // --> OD 2004-05-10 #i26945# - follow-up of fix #117736#
+ // #i26945# - follow-up of fix #117736#
pPg->InvalidateFlyLayout();
pPg->InvalidateFlyCntnt();
- // <--
}
- // --> OD 2005-04-06 #i46807# - we are statisfied, if the
+ // #i46807# - we are statisfied, if the
// content is formatted once complete.
else
{
break;
}
- // <--
}
}
- // <--
pPg = (SwPageFrm*)pPg->GetNext();
}
// OD 14.04.2003 #106346# - reset flag for special interrupt content formatting.
@@ -1122,7 +1110,7 @@ static const SwFrm *lcl_FindFirstInvaCntnt( const SwLayoutFrm *pLay, long nBotto
return 0;
}
-// --> OD 2005-02-21 #i37877# - consider drawing objects
+// #i37877# - consider drawing objects
static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage,
long _nBottom )
{
@@ -1155,7 +1143,6 @@ static const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage,
}
return 0;
}
-// <--
sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
{
@@ -1246,7 +1233,7 @@ sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
if ( bTstCnt )
{
- // --> OD 2004-06-04 #i27756# - check after each frame calculation,
+ // #i27756# - check after each frame calculation,
// if the content frame has changed the page. If yes, no other
// frame calculation is performed
bool bPageChg = false;
@@ -1260,7 +1247,7 @@ sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
pSct->SetCompletePaint();
if ( IsAgain() )
return sal_False;
- // --> OD 2004-06-04 #i27756#
+ // #i27756#
bPageChg = pCntnt->FindPageFrm() != p2ndPage &&
prPage->GetPrev();
}
@@ -1272,7 +1259,7 @@ sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
pCntnt->SetCompletePaint();
if ( IsAgain() )
return sal_False;
- // --> OD 2004-06-04 #i27756#
+ // #i27756#
bPageChg = pCntnt->FindPageFrm() != p2ndPage &&
prPage->GetPrev();
}
@@ -1286,7 +1273,7 @@ sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
pTab->SetCompletePaint();
if ( IsAgain() )
return sal_False;
- // --> OD 2004-06-04 #i27756#
+ // #i27756#
bPageChg = pCntnt->FindPageFrm() != p2ndPage &&
prPage->GetPrev();
}
@@ -1301,13 +1288,13 @@ sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
pSct->SetCompletePaint();
if ( IsAgain() )
return sal_False;
- // --> OD 2004-06-04 #i27756#
+ // #i27756#
bPageChg = pCntnt->FindPageFrm() != p2ndPage &&
prPage->GetPrev();
}
}
- // --> OD 2004-06-04 #i27756#
+ // #i27756#
if ( bPageChg )
{
bRet = sal_False;
@@ -1322,7 +1309,7 @@ sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
prPage = (SwPageFrm*)prPage->GetPrev();
}
}
- // --> OD 2005-04-25 #121980# - no shortcut, if at previous page
+ // #121980# - no shortcut, if at previous page
// an anchored object is registered, whose anchor is <pCntnt>.
else if ( prPage->GetPrev() &&
static_cast<SwPageFrm*>(prPage->GetPrev())->GetSortedObjs() )
@@ -1343,7 +1330,6 @@ sal_Bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
}
}
}
- // <--
}
}
}
@@ -1828,22 +1814,20 @@ sal_Bool SwLayAction::FormatCntnt( const SwPageFrm *pPage )
const sal_Bool bOldPaint = IsPaint();
bPaint = bOldPaint && !(pTab && pTab == pOptTab);
_FormatCntnt( pCntnt, pPage );
- // --> OD 2004-11-05 #i26945# - reset <bPaint> before format objects
+ // #i26945# - reset <bPaint> before format objects
bPaint = bOldPaint;
- // <--
// OD 2004-05-10 #i28701# - format floating screen object at content frame.
// No format, if action flag <bAgain> is set or action is interrupted.
// OD 2004-08-30 #117736# - allow format on interruption of action, if
// it's the format for this interrupt
- // --> OD 2004-11-01 #i23129#, #i36347# - pass correct page frame
+ // #i23129#, #i36347# - pass correct page frame
// to the object formatter.
if ( !IsAgain() &&
( !IsInterrupt() || mbFormatCntntOnInterrupt ) &&
pCntnt->IsTxtFrm() &&
!SwObjectFormatter::FormatObjsAtFrm( *(const_cast<SwCntntFrm*>(pCntnt)),
*(pCntnt->FindPageFrm()), this ) )
- // <--
{
return sal_False;
}
@@ -2043,21 +2027,19 @@ sal_Bool SwLayAction::_FormatFlyCntnt( const SwFlyFrm *pFly )
// OD 2004-05-10 #i28701#
_FormatCntnt( pCntnt, pCntnt->FindPageFrm() );
- // --> OD 2004-07-23 #i28701# - format floating screen objects
+ // #i28701# - format floating screen objects
// at content text frame
- // --> OD 2004-11-02 #i23129#, #i36347# - pass correct page frame
+ // #i23129#, #i36347# - pass correct page frame
// to the object formatter.
if ( pCntnt->IsTxtFrm() &&
!SwObjectFormatter::FormatObjsAtFrm(
*(const_cast<SwCntntFrm*>(pCntnt)),
*(pCntnt->FindPageFrm()), this ) )
- // <--
{
// restart format with first content
pCntnt = pFly->ContainsCntnt();
continue;
}
- // <--
if ( !pCntnt->GetValidLineNumFlag() && pCntnt->IsTxtFrm() )
{
@@ -2403,7 +2385,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewImp *pI ) :
SwRect aTmp( pSh->VisArea() );
pSh->UISizeNotify();
- // --> FME 2006-08-03 #137134#
+ // #137134#
// Are we supposed to crash if pSh isn't a cursor shell?!
// bActions |= aTmp != pSh->VisArea() ||
// aBools[nBoolIdx] != ((SwCrsrShell*)pSh)->GetCharRect().IsOver( pSh->VisArea() );
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 850e38bc5e..03c6515355 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -61,7 +61,7 @@
#include <flyfrm.hxx>
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
-// --> OD 2006-03-22 #b6375613#
+//
#include <pam.hxx>
#include <docsh.hxx>
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
@@ -71,11 +71,10 @@
using namespace ::com::sun::star;
-// <--
SV_IMPL_PTRARR( SwPageFlyCache, SwFlyCachePtr )
-/*-----------------28.5.2001 10:06------------------
+/*
* Reading and writing of the layout cache.
* The layout cache is not necessary, but it improves
* the performance and reduces the text flow during
@@ -84,7 +83,7 @@ SV_IMPL_PTRARR( SwPageFlyCache, SwFlyCachePtr )
* at the top of every page, so it's possible to create
* the right count of pages and to distribute the document content
* to this pages before the formatting starts.
- *--------------------------------------------------*/
+ */
void SwLayoutCache::Read( SvStream &rStream )
{
@@ -103,8 +102,8 @@ void SwLayoutCache::Read( SvStream &rStream )
void SwLayCacheImpl::Insert( sal_uInt16 nType, sal_uLong nIndex, xub_StrLen nOffset )
{
- aType.Insert( nType, aType.Count() );
- SvULongs::Insert( nIndex, SvULongs::Count() );
+ aType.push_back( nType );
+ std::vector<sal_uLong>::push_back( nIndex );
aOffset.push_back( nOffset );
}
@@ -175,7 +174,7 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream )
return !aIo.HasError();
}
-/*-----------------28.5.2001 10:19------------------
+/*
* SwLayoutCache::Write(..)
* writes the index (more precise: the difference between
* the index and the first index of the document content)
@@ -185,7 +184,7 @@ sal_Bool SwLayCacheImpl::Read( SvStream& rStream )
* number is stored, too.
* The position, size and page number of the text frames
* are stored, too
- * --------------------------------------------------*/
+ */
void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
{
@@ -364,7 +363,7 @@ sal_Bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const
pPage = (SwPageFrm*)pPage->GetNext();
while( pPage )
{
- if( nIndex >= pImpl->Count() )
+ if( nIndex >= pImpl->size() )
{
if( bRet )
bRet = sal_False;
@@ -481,11 +480,11 @@ SwLayoutCache::~SwLayoutCache()
delete pImpl;
}
-/*-----------------28.5.2001 10:47------------------
+/*
* SwActualSection,
* a help class to create not nested section frames
* for nested sections.
- * --------------------------------------------------*/
+ */
SwActualSection::SwActualSection( SwActualSection *pUp,
SwSectionFrm *pSect,
@@ -501,14 +500,14 @@ SwActualSection::SwActualSection( SwActualSection *pUp,
}
}
-/*-----------------28.5.2001 11:09------------------
+/*
* SwLayHelper
* is the helper class, which utilizes the layout cache information
* to distribute the document content to the rigth pages.
* It's used by the _InsertCnt(..)-function.
* If there's no layout cache, the distibution to the pages is more
* a guess, but a guess with statistical background.
- * --------------------------------------------------*/
+ */
SwLayHelper::SwLayHelper( SwDoc *pD, SwFrm* &rpF, SwFrm* &rpP, SwPageFrm* &rpPg,
SwLayoutFrm* &rpL, SwActualSection* &rpA, sal_Bool &rB,
@@ -526,9 +525,9 @@ SwLayHelper::SwLayHelper( SwDoc *pD, SwFrm* &rpF, SwFrm* &rpP, SwPageFrm* &rpPg,
nNodeIndex -= nStartOfContent;
nIndex = 0;
nFlyIdx = 0;
- while( nIndex < pImpl->Count() && (*pImpl)[ nIndex ] < nNodeIndex )
+ while( nIndex < pImpl->size() && (*pImpl)[ nIndex ] < nNodeIndex )
++nIndex;
- if( nIndex >= pImpl->Count() )
+ if( nIndex >= pImpl->size() )
{
pDoc->GetLayoutCache()->UnlockImpl();
pImpl = NULL;
@@ -550,11 +549,11 @@ SwLayHelper::~SwLayHelper()
}
}
-/*-----------------23.5.2001 16:40------------------
+/*
* SwLayHelper::CalcPageCount() does not really calculate the page count,
* it returns the page count value from the layout cache, if available,
* otherwise it estimates the page count.
- * --------------------------------------------------*/
+ */
sal_uLong SwLayHelper::CalcPageCount()
{
@@ -563,7 +562,7 @@ sal_uLong SwLayHelper::CalcPageCount()
pDoc->GetLayoutCache()->LockImpl() : NULL;
if( pCache )
{
- nPgCount = pCache->Count() + 1;
+ nPgCount = pCache->size() + 1;
pDoc->GetLayoutCache()->UnlockImpl();
}
else
@@ -593,11 +592,7 @@ sal_uLong SwLayHelper::CalcPageCount()
{
nMaxParaPerPage = Max( sal_uLong(20),
sal_uLong(20 + nNdCount / 1000 * 3) );
-#ifdef PM2
- const sal_uLong nMax = 49;
-#else
const sal_uLong nMax = 53;
-#endif
nMaxParaPerPage = Min( nMaxParaPerPage, nMax );
nPgCount = nNdCount / nMaxParaPerPage;
}
@@ -613,7 +608,7 @@ sal_uLong SwLayHelper::CalcPageCount()
return nPgCount;
}
-/*-----------------23.5.2001 16:44------------------
+/*
* SwLayHelper::CheckInsertPage()
* inserts a page and return sal_True, if
* - the break after flag is set
@@ -622,7 +617,7 @@ sal_uLong SwLayHelper::CalcPageCount()
*
* The break after flag is set, if the actual content
* wants a break after.
- * --------------------------------------------------*/
+ */
sal_Bool SwLayHelper::CheckInsertPage()
{
@@ -630,13 +625,12 @@ sal_Bool SwLayHelper::CheckInsertPage()
const SwAttrSet* pAttr = rpFrm->GetAttrSet();
const SvxFmtBreakItem& rBrk = pAttr->GetBreak();
const SwFmtPageDesc& rDesc = pAttr->GetPageDesc();
- // --> FME 2004-10-26 #118195# Do not evaluate page description if frame
+ // #118195# Do not evaluate page description if frame
// is a follow frame!
const SwPageDesc* pDesc = rpFrm->IsFlowFrm() &&
SwFlowFrm::CastFlowFrm( rpFrm )->IsFollow() ?
0 :
rDesc.GetPageDesc();
- // <--
sal_Bool bBrk = nParagraphCnt > nMaxParaPerPage || rbBreakAfter;
rbBreakAfter = rBrk.GetBreak() == SVX_BREAK_PAGE_AFTER ||
@@ -689,7 +683,7 @@ sal_Bool SwLayHelper::CheckInsertPage()
return sal_False;
}
-// --> OD 2006-03-22 #b6375613#
+//
bool lcl_HasTextFrmAnchoredObjs( SwTxtFrm* p_pTxtFrm )
{
bool bHasTextFrmAnchoredObjs( false );
@@ -751,9 +745,8 @@ void lcl_ApplyWorkaroundForB6375613( SwFrm* p_pFirstFrmOnNewPage )
}
}
}
-// <--
-/*-----------------28.5.2001 11:31------------------
+/*
* SwLayHelper::CheckInsert
* is the entry point for the _InsertCnt-function.
* The document content index is checked either it is
@@ -761,7 +754,7 @@ void lcl_ApplyWorkaroundForB6375613( SwFrm* p_pFirstFrmOnNewPage )
* cause the maximal estimation of content per page is reached.
* A really big table or long paragraph may contains more than
* one page, in this case the needed count of pages will inserted.
- * --------------------------------------------------*/
+ */
sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
{
@@ -811,14 +804,14 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
}
else
++nParagraphCnt;
- if( bFirst && pImpl && nIndex < pImpl->Count() &&
+ if( bFirst && pImpl && nIndex < pImpl->size() &&
pImpl->GetBreakIndex( nIndex ) == nNodeIndex &&
( pImpl->GetBreakOfst( nIndex ) < STRING_LEN ||
- ( ++nIndex < pImpl->Count() &&
+ ( ++nIndex < pImpl->size() &&
pImpl->GetBreakIndex( nIndex ) == nNodeIndex ) ) )
bFirst = sal_False;
#if OSL_DEBUG_LEVEL > 1
- sal_uLong nBreakIndex = ( pImpl && nIndex < pImpl->Count() ) ?
+ sal_uLong nBreakIndex = ( pImpl && nIndex < pImpl->size() ) ?
pImpl->GetBreakIndex(nIndex) : 0xffff;
(void)nBreakIndex;
#endif
@@ -833,7 +826,7 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
if( pImpl || bLongTab )
{
#if OSL_DEBUG_LEVEL > 1
- sal_uLong nBrkIndex = ( pImpl && nIndex < pImpl->Count() ) ?
+ sal_uLong nBrkIndex = ( pImpl && nIndex < pImpl->size() ) ?
pImpl->GetBreakIndex(nIndex) : 0xffff;
(void)nBrkIndex;
#endif
@@ -846,10 +839,10 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
}
else
{
- while( nIndex < pImpl->Count() &&
+ while( nIndex < pImpl->size() &&
pImpl->GetBreakIndex(nIndex) < nNodeIndex)
++nIndex;
- if( nIndex < pImpl->Count() &&
+ if( nIndex < pImpl->size() &&
pImpl->GetBreakIndex(nIndex) == nNodeIndex )
{
nType = pImpl->GetBreakType( nIndex );
@@ -883,9 +876,8 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
if( rpFrm->IsTabFrm() )
{
SwTabFrm* pTab = (SwTabFrm*)rpFrm;
- // --> OD 2004-09-23 #i33629#, #i29955#
+ // #i33629#, #i29955#
::RegistFlys( pTab->FindPageFrm(), pTab );
- // <--
SwFrm *pRow = pTab->Lower();
SwTabFrm *pFoll = new SwTabFrm( *pTab );
@@ -947,12 +939,11 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
SwPageFrm* pLastPage = rpPage;
if( CheckInsertPage() )
{
- // --> OD 2006-03-21 #b6375613#
+ //
if ( pDoc->ApplyWorkaroundForB6375613() )
{
lcl_ApplyWorkaroundForB6375613( rpFrm );
}
- // <--
_CheckFlyCache( pLastPage );
if( rpPrv && rpPrv->IsTxtFrm() && !rpPrv->GetValidSizeFlag() )
rpPrv->Frm().Height( rpPrv->GetUpper()->Prt().Height() );
@@ -991,7 +982,7 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
rpLay = rpLay->GetNextLayoutLeaf();
}
}
- } while( bLongTab || ( pImpl && nIndex < pImpl->Count() &&
+ } while( bLongTab || ( pImpl && nIndex < pImpl->size() &&
(*pImpl)[ nIndex ] == nNodeIndex ) );
}
bFirst = sal_False;
@@ -1014,12 +1005,12 @@ struct FlyCacheCompare
}
};
- /*-----------------28.6.2001 14:40------------------
+ /*
* SwLayHelper::_CheckFlyCache(..)
* If a new page is inserted, the last page is analysed.
* If there are text frames with default position, the fly cache
* is checked, if these frames are stored in the cache.
- * --------------------------------------------------*/
+ */
void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
{
@@ -1106,14 +1097,14 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
}
}
-/*-----------------28.6.2001 14:48------------------
+/*
* SwLayHelper::CheckPageFlyCache(..)
* looks for the given text frame in the fly cache and sets
* the position and size, if possible.
* The fly cache is sorted by pages and we start searching with the given page.
* If we found the page number in the fly cache, we set
* the rpPage parameter to the right page, if possible.
- * --------------------------------------------------*/
+ */
sal_Bool SwLayHelper::CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly )
{
@@ -1145,7 +1136,7 @@ sal_Bool SwLayHelper::CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly )
SwPageFrm *pPage = rpPage;
while( pPage && pPage->GetPhyPageNum() < pFlyC->nPageNum )
pPage = (SwPageFrm*)pPage->GetNext();
- // --> OD 2005-02-22 #i43266# - if the found page is an empty page,
+ // #i43266# - if the found page is an empty page,
// take the previous one (take next one, if previous one doesn't exists)
if ( pPage && pPage->IsEmptyPage() )
{
@@ -1153,7 +1144,6 @@ sal_Bool SwLayHelper::CheckPageFlyCache( SwPageFrm* &rpPage, SwFlyFrm* pFly )
? pPage->GetPrev()
: pPage->GetNext() );
}
- // <--
if( pPage )
{
rpPage = pPage;
diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx
index 10195f68e1..ad0da71993 100644
--- a/sw/source/core/layout/layhelp.hxx
+++ b/sw/source/core/layout/layhelp.hxx
@@ -28,8 +28,6 @@
#ifndef _LAYHELP_HXX
#define _LAYHELP_HXX
#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
#define _SVSTDARR_XUB_STRLEN
#include <svl/svstdarr.hxx>
#endif
@@ -63,19 +61,19 @@ class SwFlyCache;
typedef SwFlyCache* SwFlyCachePtr;
SV_DECL_PTRARR_DEL( SwPageFlyCache, SwFlyCachePtr, 0, 4 )
-class SwLayCacheImpl : public SvULongs
+class SwLayCacheImpl : public std::vector<sal_uLong>
{
SvXub_StrLens aOffset;
- SvUShorts aType;
+ std::vector<sal_uInt16> aType;
SwPageFlyCache aFlyCache;
sal_Bool bUseFlyCache;
void Insert( sal_uInt16 nType, sal_uLong nIndex, xub_StrLen nOffset );
public:
- SwLayCacheImpl() : SvULongs( 20, 10 ), aType( 20, 10 ) {}
+ SwLayCacheImpl() {}
sal_Bool Read( SvStream& rStream );
- sal_uLong GetBreakIndex( sal_uInt16 nIdx ) const { return GetObject( nIdx ); }
+ sal_uLong GetBreakIndex( sal_uInt16 nIdx ) const { return std::vector<sal_uLong>::operator[]( nIdx ); }
xub_StrLen GetBreakOfst( size_t nIdx ) const { return aOffset[ nIdx ]; }
sal_uInt16 GetBreakType( sal_uInt16 nIdx ) const { return aType[ nIdx ]; }
diff --git a/sw/source/core/layout/layouter.cxx b/sw/source/core/layout/layouter.cxx
index 0cb03c3973..ba09484a9b 100644
--- a/sw/source/core/layout/layouter.cxx
+++ b/sw/source/core/layout/layouter.cxx
@@ -38,12 +38,10 @@
#include "ftnfrm.hxx"
#include "txtfrm.hxx"
-// --> OD 2004-06-23 #i28701#
+// #i28701#
#include <movedfwdfrmsbyobjpos.hxx>
-// <--
-// --> OD 2004-10-22 #i35911#
+// #i35911#
#include <objstmpconsiderwrapinfl.hxx>
-// <--
#define LOOP_DETECT 250
@@ -228,12 +226,10 @@ void SwLooping::Control( SwPageFrm* pPage )
SwLayouter::SwLayouter()
: pEndnoter( NULL ),
pLooping( NULL ),
- // --> OD 2004-06-23 #i28701#
+ // #i28701#
mpMovedFwdFrms( 0L ),
- // <--
- // --> OD 2004-10-22 #i35911#
+ // #i35911#
mpObjsTmpConsiderWrapInfl( 0L )
- // <--
{
}
@@ -241,14 +237,12 @@ SwLayouter::~SwLayouter()
{
delete pEndnoter;
delete pLooping;
- // --> OD 2004-06-23 #i28701#
+ // #i28701#
delete mpMovedFwdFrms;
mpMovedFwdFrms = 0L;
- // <--
- // --> OD 2004-10-22 #i35911#
+ // #i35911#
delete mpObjsTmpConsiderWrapInfl;
mpObjsTmpConsiderWrapInfl = 0L;
- // <--
}
void SwLayouter::_CollectEndnotes( SwSectionFrm* pSect )
@@ -339,7 +333,7 @@ sal_Bool SwLayouter::StartLoopControl( SwDoc* pDoc, SwPageFrm *pPage )
pDoc->GetLayouter()->StartLooping( pPage );
}
-// --> OD 2004-06-23 #i28701#
+// #i28701#
// -----------------------------------------------------------------------------
// methods to manage text frames, which are moved forward by the positioning
// of its anchored objects
@@ -372,7 +366,7 @@ void SwLayouter::InsertMovedFwdFrm( const SwDoc& _rDoc,
_nToPageNum );
}
-// --> OD 2005-01-12 #i40155#
+// #i40155#
void SwLayouter::RemoveMovedFwdFrm( const SwDoc& _rDoc,
const SwTxtFrm& _rTxtFrm )
{
@@ -382,7 +376,6 @@ void SwLayouter::RemoveMovedFwdFrm( const SwDoc& _rDoc,
_rDoc.GetLayouter()->mpMovedFwdFrms->Remove( _rTxtFrm );
}
}
-// <--
bool SwLayouter::FrmMovedFwdByObjPos( const SwDoc& _rDoc,
const SwTxtFrm& _rTxtFrm,
@@ -404,8 +397,7 @@ bool SwLayouter::FrmMovedFwdByObjPos( const SwDoc& _rDoc,
FrmMovedFwdByObjPos( _rTxtFrm, _ornToPageNum );
}
}
-// <--
-// --> OD 2004-10-05 #i26945#
+// #i26945#
bool SwLayouter::DoesRowContainMovedFwdFrm( const SwDoc& _rDoc,
const SwRowFrm& _rRowFrm )
{
@@ -423,9 +415,8 @@ bool SwLayouter::DoesRowContainMovedFwdFrm( const SwDoc& _rDoc,
mpMovedFwdFrms->DoesRowContainMovedFwdFrm( _rRowFrm );
}
}
-// <--
-// --> OD 2004-10-22 #i35911#
+// #i35911#
void SwLayouter::ClearObjsTmpConsiderWrapInfluence( const SwDoc& _rDoc )
{
if ( _rDoc.GetLayouter() &&
@@ -451,8 +442,7 @@ void SwLayouter::InsertObjForTmpConsiderWrapInfluence(
_rDoc.GetLayouter()->mpObjsTmpConsiderWrapInfl->Insert( _rAnchoredObj );
}
-// <--
-// --> OD 2005-01-12 #i40155#
+// #i40155#
void SwLayouter::ClearFrmsNotToWrap( const SwDoc& _rDoc )
{
if ( _rDoc.GetLayouter() )
@@ -500,7 +490,6 @@ bool SwLayouter::FrmNotToWrap( const IDocumentLayoutAccess& _rDLA,
return bFrmNotToWrap;
}
}
-// <--
void LOOPING_LOUIE_LIGHT( bool bCondition, const SwTxtFrm& rTxtFrm )
{
@@ -514,7 +503,7 @@ void LOOPING_LOUIE_LIGHT( bool bCondition, const SwTxtFrm& rTxtFrm )
}
}
-// --> OD 2006-05-10 #i65250#
+// #i65250#
bool SwLayouter::MoveBwdSuppressed( const SwDoc& p_rDoc,
const SwFlowFrm& p_rFlowFrm,
const SwLayoutFrm& p_rNewUpperFrm )
@@ -560,6 +549,5 @@ void SwLayouter::ClearMoveBwdLayoutInfo( const SwDoc& _rDoc )
if ( _rDoc.GetLayouter() )
const_cast<SwDoc&>(_rDoc).GetLayouter()->maMoveBwdLayoutInfo.clear();
}
-// <--
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
index 60611e8693..3a83cb1e64 100644
--- a/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
+++ b/sw/source/core/layout/movedfwdfrmsbyobjpos.cxx
@@ -73,7 +73,7 @@ bool SwMovedFwdFrmsByObjPos::FrmMovedFwdByObjPos( const SwTxtFrm& _rTxtFrm,
return false;
}
-// --> OD 2004-10-05 #i26945#
+// #i26945#
bool SwMovedFwdFrmsByObjPos::DoesRowContainMovedFwdFrm( const SwRowFrm& _rRowFrm ) const
{
bool bDoesRowContainMovedFwdFrm( false );
@@ -89,10 +89,9 @@ bool SwMovedFwdFrmsByObjPos::DoesRowContainMovedFwdFrm( const SwRowFrm& _rRowFrm
SwIterator<SwTxtFrm,SwTxtNode> aFrmIter( *rEntry.first );
for( SwTxtFrm* pTxtFrm = aFrmIter.First(); pTxtFrm; pTxtFrm = (SwTxtFrm*)aFrmIter.Next() )
{
- // --> OD 2004-12-03 #115759# - assure that found text frame
+ // #115759# - assure that found text frame
// is the first one.
if ( _rRowFrm.IsAnLower( pTxtFrm ) && !pTxtFrm->GetIndPrev() )
- // <--
{
bDoesRowContainMovedFwdFrm = true;
break;
@@ -103,6 +102,5 @@ bool SwMovedFwdFrmsByObjPos::DoesRowContainMovedFwdFrm( const SwRowFrm& _rRowFrm
return bDoesRowContainMovedFwdFrm;
}
-// <--
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 86eefcb9a2..703b5809e3 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -355,9 +355,8 @@ SwRectFn fnRectVertL2R = &aVerticalLeftToRight;
SwRectFn fnRectB2T = &aBottomToTop;
SwRectFn fnRectVL2R = &aVerticalRightToLeft;
-// --> OD 2006-05-10 #i65250#
+// #i65250#
sal_uInt32 SwFrm::mnLastFrmId=0;
-// <--
TYPEINIT1(SwFrm,SwClient); //rtti fuer SwFrm
TYPEINIT1(SwCntntFrm,SwFrm); //rtti fuer SwCntntFrm
@@ -486,7 +485,6 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
mbBookMode( false ),
mbSidebarChanged( false ),
mbNeedGrammarCheck( false ),
- // <--
nBrowseWidth( MM50*4 ), //2cm Minimum
pTurbo( 0 ),
pLastPage( 0 ),
@@ -534,9 +532,8 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
SwDoc* pDoc = pFmt->GetDoc();
SwNodeIndex aIndex( *pDoc->GetNodes().GetEndOfContent().StartOfSectionNode() );
SwCntntNode *pNode = pDoc->GetNodes().GoNextSection( &aIndex, sal_True, sal_False );
- // --> FME 2005-05-25 #123067# pNode = 0 can really happen:
+ // #123067# pNode = 0 can really happen
SwTableNode *pTblNd= pNode ? pNode->FindTableNode() : 0;
- // <--
//PageDesc besorgen (entweder vom FrmFmt des ersten Node oder den
//initialen.)
@@ -585,7 +582,6 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
SwDocPosUpdate aMsgHnt( pPage->Frm().Top() );
pFieldsAccess->UpdatePageFlds( &aMsgHnt );
}
- // <---
pTimerAccess->StartIdling();
bCallbackActionEnabled = sal_True;
diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx
index ced4d82e78..ca1ab4c478 100644
--- a/sw/source/core/layout/objectformatter.cxx
+++ b/sw/source/core/layout/objectformatter.cxx
@@ -79,7 +79,7 @@ class SwPageNumAndTypeOfAnchors
{
tEntry* pNewEntry = new tEntry();
pNewEntry->mpAnchoredObj = &_rAnchoredObj;
- // --> #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
+ // #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
// is replaced by method <FindPageFrmOfAnchor()>. It's return value
// have to be checked.
SwPageFrm* pPageFrmOfAnchor = _rAnchoredObj.FindPageFrmOfAnchor();
@@ -91,7 +91,6 @@ class SwPageNumAndTypeOfAnchors
{
pNewEntry->mnPageNumOfAnchor = 0;
}
- // <--
// --> #i26945# - collect type of anchor
SwTxtFrm* pAnchorCharFrm = _rAnchoredObj.FindAnchorCharFrm();
if ( pAnchorCharFrm )
@@ -102,7 +101,6 @@ class SwPageNumAndTypeOfAnchors
{
pNewEntry->mbAnchoredAtMaster = true;
}
- // <--
maObjList.push_back( pNewEntry );
}
@@ -142,7 +140,6 @@ class SwPageNumAndTypeOfAnchors
return bAnchoredAtMaster;
}
- // <--
inline sal_uInt32 Count() const
{
@@ -162,7 +159,6 @@ SwObjectFormatter::SwObjectFormatter( const SwPageFrm& _rPageFrm,
mpLayAction( _pLayAction ),
// --> #i26945#
mpPgNumAndTypeOfAnchors( _bCollectPgNumOfAnchors ? new SwPageNumAndTypeOfAnchors() : 0L )
- // <--
{
}
@@ -249,7 +245,6 @@ bool SwObjectFormatter::FormatObj( SwAnchoredObject& _rAnchoredObj,
// format given floating screen object
// --> #i40147# - check for moved forward anchor frame
bSuccess = pObjFormatter->DoFormatObj( _rAnchoredObj, true );
- // <--
}
delete pObjFormatter;
@@ -306,13 +301,12 @@ void SwObjectFormatter::_FormatObjCntnt( SwAnchoredObject& _rAnchoredObj )
pCntnt->OptCalc();
// format floating screen objects at content text frame
- // --> #i23129#, #i36347# - pass correct page frame to
+ // #i23129#, #i36347# - pass correct page frame to
// the object formatter
if ( pCntnt->IsTxtFrm() &&
!SwObjectFormatter::FormatObjsAtFrm( *pCntnt,
*(pCntnt->FindPageFrm()),
GetLayAction() ) )
- // <--
{
// restart format with first content
pCntnt = rFlyFrm.ContainsCntnt();
@@ -354,7 +348,6 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
{
static_cast<SwFlyLayFrm&>(rFlyFrm).SetNoMakePos( false );
}
- // <--
// #i81146# new loop control
sal_uInt16 nLoopControlRuns = 0;
@@ -370,7 +363,6 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
{
break;
}
- // <--
}
else
{
@@ -382,13 +374,11 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
{
static_cast<SwFlyLayFrm&>(rFlyFrm).SetNoMakePos( true );
}
- // <--
- // --> #i23129#, #i36347# - pass correct page frame
+ // #i23129#, #i36347# - pass correct page frame
// to the object formatter
SwObjectFormatter::FormatObjsAtFrm( rFlyFrm,
*(rFlyFrm.FindPageFrm()),
mpLayAction );
- // <--
if ( mpLayAction )
{
mpLayAction->_FormatFlyCntnt( &rFlyFrm );
@@ -398,7 +388,6 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
{
break;
}
- // <--
}
else
{
@@ -419,7 +408,6 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj )
} while ( !rFlyFrm.IsValid() &&
!_rAnchoredObj.RestartLayoutProcess() &&
rFlyFrm.GetAnchorFrm() == &GetAnchorFrm() );
- // <--
}
else if ( _rAnchoredObj.ISA(SwAnchoredDrawObject) )
{
@@ -452,7 +440,6 @@ bool SwObjectFormatter::_FormatObjsAtFrm( SwTxtFrm* _pMasterTxtFrm )
{
pAnchorFrm = &GetAnchorFrm();
}
- // <--
if ( !pAnchorFrm->GetDrawObjs() )
{
// nothing to do, if no floating screen object is registered at the anchor frame.
@@ -485,8 +472,7 @@ bool SwObjectFormatter::_FormatObjsAtFrm( SwTxtFrm* _pMasterTxtFrm )
{
continue;
}
- // <--
- // --> #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
+ // #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
// is replaced by method <FindPageFrmOfAnchor()>. It's return value
// have to be checked.
SwPageFrm* pPageFrmOfAnchor = pAnchoredObj->FindPageFrmOfAnchor();
@@ -494,7 +480,6 @@ bool SwObjectFormatter::_FormatObjsAtFrm( SwTxtFrm* _pMasterTxtFrm )
"<SwObjectFormatter::_FormatObjsAtFrm()> - missing page frame." );
// --> #i26945#
if ( pPageFrmOfAnchor && pPageFrmOfAnchor == &mrPageFrm )
- // <--
{
// if format of object fails, stop formatting and pass fail to
// calling method via the return value.
diff --git a/sw/source/core/layout/objectformatterlayfrm.cxx b/sw/source/core/layout/objectformatterlayfrm.cxx
index 77643a76e3..0e84027006 100644
--- a/sw/source/core/layout/objectformatterlayfrm.cxx
+++ b/sw/source/core/layout/objectformatterlayfrm.cxx
@@ -34,9 +34,8 @@
#include <layfrm.hxx>
#include <pagefrm.hxx>
-// --> OD 2005-07-13 #124218#
+// #124218#
#include <layact.hxx>
-// <--
// =============================================================================
// implementation of class <SwObjectFormatterLayFrm>
@@ -85,18 +84,16 @@ SwFrm& SwObjectFormatterLayFrm::GetAnchorFrm()
return mrAnchorLayFrm;
}
-// --> OD 2005-01-10 #i40147# - add parameter <_bCheckForMovedFwd>.
+// #i40147# - add parameter <_bCheckForMovedFwd>.
// Not relevant for objects anchored at layout frame.
bool SwObjectFormatterLayFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj,
const bool )
-// <--
{
_FormatObj( _rAnchoredObj );
- // --> OD 2005-07-13 #124218# - consider that the layout action has to be
+ // #124218# - consider that the layout action has to be
// restarted due to a deleted page frame.
return GetLayAction() ? !GetLayAction()->IsAgain() : true;
- // <--
}
bool SwObjectFormatterLayFrm::DoFormatObjs()
@@ -133,13 +130,12 @@ bool SwObjectFormatterLayFrm::_AdditionalFormatObjsOnPage()
return true;
}
- // --> OD 2005-07-13 #124218# - consider, if the layout action
+ // #124218# - consider, if the layout action
// has to be restarted due to a delete of a page frame.
if ( GetLayAction() && GetLayAction()->IsAgain() )
{
return false;
}
- // <--
SwPageFrm& rPageFrm = static_cast<SwPageFrm&>(GetAnchorFrm());
@@ -157,26 +153,23 @@ bool SwObjectFormatterLayFrm::_AdditionalFormatObjsOnPage()
{
SwAnchoredObject* pAnchoredObj = (*rPageFrm.GetSortedObjs())[i];
- // --> OD 2005-08-18 #i51941# - do not format object, which are anchored
+ // #i51941# - do not format object, which are anchored
// inside or at fly frame.
if ( pAnchoredObj->GetAnchorFrm()->FindFlyFrm() )
{
continue;
}
- // <--
- // --> OD 2004-09-23 #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
+ // #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
// is replaced by method <FindPageFrmOfAnchor()>. It's return value
// have to be checked.
SwPageFrm* pPageFrmOfAnchor = pAnchoredObj->FindPageFrmOfAnchor();
- // --> OD 2004-10-08 #i26945# - check, if the page frame of the
+ // #i26945# - check, if the page frame of the
// object's anchor frame isn't the given page frame
OSL_ENSURE( pPageFrmOfAnchor,
"<SwObjectFormatterLayFrm::_AdditionalFormatObjsOnPage()> - missing page frame" );
if ( pPageFrmOfAnchor &&
- // --> OD 2004-10-22 #i35911#
+ // #i35911#
pPageFrmOfAnchor->GetPhyPageNum() < rPageFrm.GetPhyPageNum() )
- // <--
- // <--
{
// if format of object fails, stop formatting and pass fail to
// calling method via the return value.
diff --git a/sw/source/core/layout/objectformatterlayfrm.hxx b/sw/source/core/layout/objectformatterlayfrm.hxx
index 10f12a53a6..ba47df6cf3 100644
--- a/sw/source/core/layout/objectformatterlayfrm.hxx
+++ b/sw/source/core/layout/objectformatterlayfrm.hxx
@@ -66,11 +66,10 @@ class SwObjectFormatterLayFrm : public SwObjectFormatter
public:
virtual ~SwObjectFormatterLayFrm();
- // --> OD 2005-01-10 #i40147# - add parameter <_bCheckForMovedFwd>.
+ // #i40147# - add parameter <_bCheckForMovedFwd>.
// Not relevant for objects anchored at layout frame.
virtual bool DoFormatObj( SwAnchoredObject& _rAnchoredObj,
const bool _bCheckForMovedFwd = false );
- // <--
virtual bool DoFormatObjs();
static SwObjectFormatterLayFrm* CreateObjFormatter(
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 3b18c1634c..e6152afba7 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -497,7 +497,7 @@ void SwPageFrm::PreparePage( sal_Bool bFtn )
{
SetFtnPage( bFtn );
- // --> OD 2008-01-30 #i82258#
+ // #i82258#
// Due to made change on OOo 2.0 code line, method <::lcl_FormatLay(..)> has
// the side effect, that the content of page header and footer are formatted.
// For this formatting it is needed that the anchored objects are registered
@@ -509,7 +509,6 @@ void SwPageFrm::PreparePage( sal_Bool bFtn )
{
::lcl_FormatLay( this );
}
- // <--
//Flys und DrawObjekte die noch am Dokument bereitstehen.
//Fussnotenseiten tragen keine Seitengebundenen Flys!
@@ -902,7 +901,7 @@ void SwPageFrm::Cut()
for ( int i = 0; GetSortedObjs() &&
(sal_uInt16)i < GetSortedObjs()->Count(); ++i )
{
- // --> OD 2004-06-29 #i28701#
+ // #i28701#
SwAnchoredObject* pAnchoredObj = (*GetSortedObjs())[i];
if ( pAnchoredObj->ISA(SwFlyAtCntFrm) )
@@ -918,7 +917,6 @@ void SwPageFrm::Cut()
pFly->_InvalidatePos();
}
}
- // <--
}
}
//Window aufraeumen
@@ -1011,7 +1009,7 @@ void lcl_PrepFlyInCntRegister( SwCntntFrm *pFrm )
{
for( sal_uInt16 i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
{
- // --> OD 2004-06-29 #i28701#
+ // #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
if ( pAnchoredObj->ISA(SwFlyInCntFrm) )
{
@@ -1023,7 +1021,6 @@ void lcl_PrepFlyInCntRegister( SwCntntFrm *pFrm )
pCnt = pCnt->GetNextCntntFrm();
}
}
- // <--
}
}
}
@@ -1042,7 +1039,7 @@ void SwPageFrm::PrepareRegisterChg()
{
for( sal_uInt16 i = 0; i < GetSortedObjs()->Count(); ++i )
{
- // --> OD 2004-06-29 #i28701#
+ // #i28701#
SwAnchoredObject* pAnchoredObj = (*GetSortedObjs())[i];
if ( pAnchoredObj->ISA(SwFlyFrm) )
{
@@ -1474,7 +1471,7 @@ void SwRootFrm::RemoveSuperfluous()
SwSortedObjs &rObjs = *pPage->GetSortedObjs();
for ( sal_uInt16 i = 0; bOnlySuperfluosObjs && i < rObjs.Count(); ++i )
{
- // --> OD 2004-06-29 #i28701#
+ // #i28701#
SwAnchoredObject* pAnchoredObj = rObjs[i];
// OD 2004-01-19 #110582# - do not consider hidden objects
if ( pPage->GetFmt()->GetDoc()->IsVisibleLayerId(
@@ -1483,7 +1480,6 @@ void SwRootFrm::RemoveSuperfluous()
{
bOnlySuperfluosObjs = false;
}
- // <--
}
bExistEssentialObjs = !bOnlySuperfluosObjs;
}
@@ -1495,14 +1491,13 @@ void SwRootFrm::RemoveSuperfluous()
pPage->FindFtnCont() ||
( 0 != ( pBody = pPage->FindBodyCont() ) &&
( pBody->ContainsCntnt() ||
- // --> FME 2005-05-18 #i47580#
+ // #i47580#
// Do not delete page if there's an empty tabframe
// left. I think it might be correct to use ContainsAny()
// instead of ContainsCntnt() to cover the empty-table-case,
// but I'm not fully sure, since ContainsAny() also returns
// SectionFrames. Therefore I prefer to do it the safe way:
( pBody->Lower() && pBody->Lower()->IsTabFrm() ) ) ) )
- // <--
{
if ( pPage->IsFtnPage() )
{
@@ -1641,7 +1636,7 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage )
pPage->GetSortedObjs() && sal_uInt16(i) < pPage->GetSortedObjs()->Count();
++i)
{
- // --> OD 2004-06-29 #i28701#
+ // #i28701#
SwFrmFmt& rFmt = (*pPage->GetSortedObjs())[i]->GetFrmFmt();
const SwFmtAnchor &rAnch = rFmt.GetAnchor();
const sal_uInt16 nPg = rAnch.GetPageNum();
@@ -1796,7 +1791,7 @@ void SwRootFrm::ImplCalcBrowseWidth()
{
for ( sal_uInt16 i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
{
- // --> OD 2004-06-29 #i28701#
+ // #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
const SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt();
const sal_Bool bFly = pAnchoredObj->ISA(SwFlyFrm);
@@ -1815,7 +1810,7 @@ void SwRootFrm::ImplCalcBrowseWidth()
break;
case FLY_AT_PARA:
{
- // --> FME 2004-09-13 #i33170#
+ // #i33170#
// Reactivated old code because
// nWidth = pAnchoredObj->GetObjRect().Right()
// gives wrong results for objects that are still
@@ -1844,7 +1839,6 @@ void SwRootFrm::ImplCalcBrowseWidth()
//aktuelle Groesse bestimmt werden.
nWidth = pAnchoredObj->GetObjRect().Right() -
pAnchoredObj->GetDrawObj()->GetAnchorPos().X();
- // <--
}
break;
default: /* do nothing */;
@@ -1905,12 +1899,12 @@ void SwRootFrm::UnoRemoveAllActions()
if ( pSh )
do
{
- // --> OD 2008-05-16 #i84729#
+ // #i84729#
// No end action, if <ViewShell> instance is currently in its end action.
// Recursives calls to <::EndAction()> are not allowed.
if ( !pSh->IsInEndAction() )
{
- DBG_ASSERT(!pSh->GetRestoreActions(), "Restore action count is already set!");
+ OSL_ENSURE(!pSh->GetRestoreActions(), "Restore action count is already set!");
sal_Bool bCrsr = pSh->ISA( SwCrsrShell );
sal_Bool bFE = pSh->ISA( SwFEShell );
sal_uInt16 nRestore = 0;
@@ -1929,7 +1923,6 @@ void SwRootFrm::UnoRemoveAllActions()
}
pSh->SetRestoreActions(nRestore);
}
- // <--
pSh->LockView(sal_True);
pSh = (ViewShell*)pSh->GetNext();
@@ -2019,7 +2012,6 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset )
}
}
}
- // <--
}
else if ( pAnchoredObj->ISA(SwAnchoredDrawObject) )
{
@@ -2035,10 +2027,9 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset )
pAnchoredDrawObj->DrawObj()->SetAnchorPos( aNewAnchorPos );
pAnchoredDrawObj->SetLastObjRect( pAnchoredDrawObj->GetObjRect().SVRect() );
}
- // --> OD 2009-08-20 #i92511#
+ // #i92511#
// cache for object rectangle inclusive spaces has to be invalidated.
pAnchoredObj->InvalidateObjRectWithSpaces();
- // <--
}
}
@@ -2078,7 +2069,7 @@ void lcl_MoveAllLowers( SwFrm* pFrm, const Point& rOffset )
// PAGES01: Calculate how the pages have to be positioned
void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVisArea )
{
- // --> OD 2008-07-07 #i91432#
+ // #i91432#
// No calculation of page positions, if only an empty page is present.
// This situation occurs when <SwRootFrm> instance is in construction
// and the document contains only left pages.
@@ -2087,7 +2078,6 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
{
return;
}
- // <--
if ( !pVisArea )
{
@@ -2411,14 +2401,13 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
bool SwRootFrm::IsLeftToRightViewLayout() const
{
// Layout direction determined by layout direction of the first page.
- // --> OD 2008-04-08 #i88036#
+ // #i88036#
// Only ask a non-empty page frame for its layout direction
// const SwPageFrm* pPage = dynamic_cast<const SwPageFrm*>(Lower());
// return !pPage->IsRightToLeft() && !pPage->IsVertical();
const SwPageFrm& rPage =
dynamic_cast<const SwPageFrm*>(Lower())->GetFormatPage();
return !rPage.IsRightToLeft() && !rPage.IsVertical();
- // <--
}
const SwPageFrm& SwPageFrm::GetFormatPage() const
@@ -2427,7 +2416,7 @@ const SwPageFrm& SwPageFrm::GetFormatPage() const
if ( IsEmptyPage() )
{
pRet = static_cast<const SwPageFrm*>( OnRightPage() ? GetNext() : GetPrev() );
- // --> OD 2008-04-08 #i88035#
+ // #i88035#
// Typically a right empty page frame has a next non-empty page frame and
// a left empty page frame has a previous non-empty page frame.
// But under certain cirsumstances this assumption is not true -
@@ -2447,7 +2436,6 @@ const SwPageFrm& SwPageFrm::GetFormatPage() const
}
OSL_ENSURE( pRet,
"<SwPageFrm::GetFormatPage()> - inconsistent layout: empty page without previous and next page frame --> crash." );
- // <--
}
return *pRet;
}
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index 6eda0e1f99..31189c84dc 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -153,9 +153,8 @@ void SwPageDesc::ResetAllAttr( sal_Bool bLeft )
{
SwFrmFmt& rFmt = bLeft ? GetLeft() : GetMaster();
- // --> OD 2007-01-25 #i73790# - method renamed
+ // #i73790# - method renamed
rFmt.ResetAllFmtAttr();
- // <--
rFmt.SetFmtAttr( SvxFrameDirectionItem(FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR) );
}
@@ -224,7 +223,7 @@ const SwTxtFmtColl* SwPageDesc::GetRegisterFmtColl() const
void SwPageDesc::RegisterChange()
{
- // --> OD 2004-06-15 #117072# - During destruction of the document <SwDoc>
+ // #117072# - During destruction of the document <SwDoc>
// the page description is modified. Thus, do nothing, if the document
// is in destruction respectively if no viewshell exists.
SwDoc* pDoc = GetMaster().GetDoc();
diff --git a/sw/source/core/layout/pagefrm.src b/sw/source/core/layout/pagefrm.src
index 1c5cafc38c..4b0c4b2df7 100644
--- a/sw/source/core/layout/pagefrm.src
+++ b/sw/source/core/layout/pagefrm.src
@@ -4,4 +4,3 @@ Bitmap BMP_PAGE_SHADOW_MASK
{
File = "page-shadow-mask.png";
};
-
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 144d2b0585..c7b297558d 100644..100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <hintids.hxx>
#include <vcl/sound.hxx>
+#include <vcl/lazydelete.hxx>
#include <tools/poly.hxx>
#include <svl/svstdarr.hxx>
#include <svx/xoutbmp.hxx>
@@ -85,6 +86,17 @@
#include <svx/svdogrp.hxx>
#include <sortedobjs.hxx>
#include <EnhancedPDFExportHelper.hxx>
+#include <fesh.hxx>
+#include <svx/svdpage.hxx>
+#include <hffrm.hxx>
+#include <fmtpdsc.hxx>
+// <--
+// --> OD #i76669#
+#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
+#include <svx/sdr/contact/viewobjectcontact.hxx>
+#include <svx/sdr/contact/viewcontact.hxx>
+// <--
+
#include <ndole.hxx>
#include <svtools/chartprettypainter.hxx>
#include <PostItMgr.hxx>
@@ -101,11 +113,16 @@
#include <drawinglayer/geometry/viewinformation2d.hxx>
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
#include <drawinglayer/primitive2d/borderlineprimitive2d.hxx>
#include <drawinglayer/primitive2d/discreteshadowprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textprimitive2d.hxx>
+#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <svx/sdr/contact/objectcontacttools.hxx>
#include <svx/unoapi.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
using namespace ::editeng;
using namespace ::com::sun::star;
@@ -322,9 +339,8 @@ class SwSavePaintStatics
*pSFlyOnlyDraw;
SwLineRects *pSLines;
SwSubsRects *pSSubsLines;
- // --> OD 2005-07-04 #123196#
+ // #123196#
SwSubsRects* pSSpecSubsLines;
- // <--
SfxProgress *pSProgress;
long nSPixelSzW,
nSPixelSzH,
@@ -349,9 +365,8 @@ SwSavePaintStatics::SwSavePaintStatics() :
pSFlyOnlyDraw ( pFlyOnlyDraw ),
pSLines ( pLines ),
pSSubsLines ( pSubsLines ),
- // --> OD 2005-07-04 #123196#
+ // #123196#
pSSpecSubsLines ( pSpecSubsLines ),
- // <--
pSProgress ( pProgress ),
nSPixelSzW ( nPixelSzW ),
nSPixelSzH ( nPixelSzH ),
@@ -375,9 +390,8 @@ SwSavePaintStatics::SwSavePaintStatics() :
aEdgeScale = 0.5;
pLines = 0;
pSubsLines = 0;
- // --> OD 2005-07-04 #123196#
+ // #123196#
pSpecSubsLines = 0L;
- // <--
pProgress = 0;
}
@@ -391,9 +405,8 @@ SwSavePaintStatics::~SwSavePaintStatics()
pFlyOnlyDraw = pSFlyOnlyDraw;
pLines = pSLines;
pSubsLines = pSSubsLines;
- // --> OD 2005-07-04 #123196#
+ // #123196#
pSpecSubsLines = pSSpecSubsLines;
- // <--
pProgress = pSProgress;
nPixelSzW = nSPixelSzW;
nPixelSzH = nSPixelSzH;
@@ -779,9 +792,9 @@ void lcl_DrawDashedRect( OutputDevice * pOut, SwLineRect & rLRect )
}
long startX = rLRect.Left( );
- long startY = rLRect.Top( ) + nHalfLWidth;
+ long startY = rLRect.Top( ) + static_cast<long>(nHalfLWidth);
long endX = rLRect.Left( ) + rLRect.Width( );
- long endY = rLRect.Top( ) + nHalfLWidth;
+ long endY = rLRect.Top( ) + static_cast<long>(nHalfLWidth);
if ( rLRect.Height( ) > rLRect.Width( ) )
{
@@ -794,9 +807,9 @@ void lcl_DrawDashedRect( OutputDevice * pOut, SwLineRect & rLRect )
{
nHalfLWidth = 1;
}
- startX = rLRect.Left( ) + nHalfLWidth;
+ startX = rLRect.Left( ) + static_cast<long>(nHalfLWidth);
startY = rLRect.Top( );
- endX = rLRect.Left( ) + nHalfLWidth;
+ endX = rLRect.Left( ) + static_cast<long>(nHalfLWidth);
endY = rLRect.Top( ) + rLRect.Height( );
}
@@ -811,9 +824,8 @@ void SwLineRects::PaintLines( OutputDevice *pOut )
//der Tabellen.
if ( Count() != nLastCount )
{
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pOut );
- // <--
// OD 2004-04-23 #116347#
pOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
@@ -929,9 +941,8 @@ void SwSubsRects::PaintSubsidiary( OutputDevice *pOut,
{
if ( Count() )
{
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pOut );
- // <--
//Alle Hilfslinien, die sich fast decken entfernen (Tabellen)
for ( sal_uInt16 i = 0; i < Count(); ++i )
@@ -1278,7 +1289,7 @@ void MA_FASTCALL lcl_CalcBorderRect( SwRect &rRect, const SwFrm *pFrm,
if ( bBottom )
{
SwTwips nDiff = 0;
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
if ( pFrm->IsTabFrm() &&
((SwTabFrm*)pFrm)->IsCollapsingBorders() )
{
@@ -1691,10 +1702,9 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
if( rSh.GetViewOptions()->IsGraphic() )
{
//#125488#: load graphic directly in PDF import
- // --> OD 2006-08-25 #i68953# - also during print load graphic directly.
+ // #i68953# - also during print load graphic directly.
if ( (rSh).GetViewOptions()->IsPDFExport() ||
rSh.GetOut()->GetOutDevType() == OUTDEV_PRINTER )
- // <--
{
((SvxBrushItem*)pBrush)->PurgeMedium();
((SvxBrushItem*)pBrush)->SetDoneLink( Link() );
@@ -1801,7 +1811,7 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
// calculate paint offset
Point aPaintOffset( aAlignedPaintRect.Pos() - aGrf.Pos() );
// draw background graphic tiled for aligned paint rectangle
- // --> OD 2005-02-15 #i42643# - apply fix #104004# for Calc
+ // #i42643# - apply fix #104004# for Calc
// also for Writer - see /sc/source/view/printfun.cxx
// For PDF export, every draw operation for bitmaps takes a
// noticeable amount of place (~50 characters). Thus, optimize
@@ -1832,7 +1842,6 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
Size( aPaintOffset.X(), aPaintOffset.Y() ),
NULL, GRFMGR_DRAW_STANDARD,
::std::max( 128, static_cast<int>( sqrt(sqrt( Abitmap)) + .5 ) ) );
- // <--
}
// reset clipping at output device
pOutDev->Pop();
@@ -1912,7 +1921,7 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
( ( aColor.GetTransparency() != 0) ||
bTransparentGrfWithNoFillBackgrd );
- // --> OD 2008-06-02 #i75614#
+ // #i75614#
// reset draw mode in high contrast mode in order to get fill color set
const sal_uLong nOldDrawMode = pOutDev->GetDrawMode();
if ( pGlobalShell->GetWin() &&
@@ -1920,7 +1929,6 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
{
pOutDev->SetDrawMode( 0 );
}
- // <--
/// OD 06.08.2002 #99657# - if background region have to be drawn
/// transparent, set only the RGB values of the background color as
@@ -1936,10 +1944,9 @@ void MA_FASTCALL DrawGraphic( const SvxBrushItem *pBrush,
pOutDev->SetFillColor( aColor );
}
- // --> OD 2008-06-02 #i75614#
+ // #i75614#
// restore draw mode
pOutDev->SetDrawMode( nOldDrawMode );
- // <--
/// OD 02.09.2002 #99657#
if ( bDrawTransparent )
@@ -2256,9 +2263,8 @@ void SwTabFrmPainter::HandleFrame( const SwLayoutFrm& rLayoutFrm )
void SwTabFrmPainter::PaintLines( OutputDevice& rDev, const SwRect& rRect ) const
{
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, rDev );
- // <--
const SwFrm* pTmpFrm = &mrTabFrm;
const bool bVert = pTmpFrm->IsVertical();
@@ -2734,6 +2740,46 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori )
// FUNCTIONS USED FOR COLLAPSING TABLE BORDER LINES END
//
+// --> OD #i76669#
+namespace
+{
+ class SwViewObjectContactRedirector : public ::sdr::contact::ViewObjectContactRedirector
+ {
+ private:
+ const ViewShell& mrViewShell;
+
+ public:
+ SwViewObjectContactRedirector( const ViewShell& rSh )
+ : mrViewShell( rSh )
+ {};
+
+ virtual ~SwViewObjectContactRedirector()
+ {}
+
+ virtual drawinglayer::primitive2d::Primitive2DSequence createRedirectedPrimitive2DSequence(
+ const sdr::contact::ViewObjectContact& rOriginal,
+ const sdr::contact::DisplayInfo& rDisplayInfo)
+ {
+ sal_Bool bPaint( sal_True );
+
+ SdrObject* pObj = rOriginal.GetViewContact().TryToGetSdrObject();
+ if ( pObj )
+ {
+ bPaint = SwFlyFrm::IsPaint( pObj, &mrViewShell );
+ }
+
+ if ( !bPaint )
+ {
+ return drawinglayer::primitive2d::Primitive2DSequence();
+ }
+
+ return sdr::contact::ViewObjectContactRedirector::createRedirectedPrimitive2DSequence(
+ rOriginal, rDisplayInfo );
+ }
+ };
+
+} // end of anonymous namespace
+// <--
/*************************************************************************
|*
|* SwRootFrm::Paint()
@@ -2751,7 +2797,7 @@ void SwTabFrmPainter::Insert( SwLineEntry& rNew, bool bHori )
void
SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
{
- OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "Lower der Root keine Seite." );
+ OSL_ENSURE( Lower() && Lower()->IsPageFrm(), "Lower der Root keine Seite." );
PROTOCOL( this, PROT_FILE_INIT, 0, 0)
@@ -2787,7 +2833,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
//Ggf. eine Action ausloesen um klare Verhaeltnisse zu schaffen.
//Durch diesen Kunstgriff kann in allen Paints davon ausgegangen werden,
//das alle Werte gueltigt sind - keine Probleme, keine Sonderbehandlung(en).
- // --> OD 2008-10-07 #i92745#
+ // #i92745#
// Extend check on certain states of the 'current' <ViewShell> instance to
// all existing <ViewShell> instances.
bool bPerformLayoutAction( true );
@@ -2806,7 +2852,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
} while ( bPerformLayoutAction && pTmpViewShell != pSh );
}
if ( bPerformLayoutAction )
- // <--
{
((SwRootFrm*)this)->ResetTurbo();
SwLayAction aAction( (SwRootFrm*)this, pSh->Imp() );
@@ -2842,10 +2887,10 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
// #i68597#
const bool bGridPainting(pSh->GetWin() && pSh->Imp()->HasDrawView() && pSh->Imp()->GetDrawView()->IsGridVisible());
- // --> OD 2008-05-16 #i84659#
-// while ( pPage && !::IsShortCut( aRect, pPage->Frm() ) )
+ // #i76669#
+ SwViewObjectContactRedirector aSwRedirector( *pSh );
+
while ( pPage )
- // <--
{
const bool bPaintRightShadow = pPage->IsRightShadowNeeded();
const bool bPaintLeftShadow = pPage->IsLeftShadowNeeded();
@@ -2858,12 +2903,10 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
if ( aRect.IsOver( aPaintRect ) )
- // <--
{
if ( pSh->GetWin() )
{
pSubsLines = new SwSubsRects;
- // OD 18.11.2002 #99672# - create array for special sub-lines
pSpecSubsLines = new SwSubsRects;
}
@@ -2884,13 +2927,11 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
aPageRectRegion.Exclude( aPaintRect.SVRect() );
pSh->GetWin()->Invalidate( aPageRectRegion, INVALIDATE_CHILDREN );
}
- // <--
- // --> OD 2007-08-20 #i80793#
+ // #i80793#
// enlarge paint rectangle for objects overlapping the same pixel
// in all cases and before the DrawingLayer overlay is initialized.
lcl_AdjustRectToPixelSize( aPaintRect, *(pSh->GetOut()) );
- // <--
// #i68597#
// moved paint pre-process for DrawingLayer overlay here since the above
@@ -2928,33 +2969,56 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
if ( pSh->Imp()->HasDrawView() )
{
+ // Loop over the drawing object to mark them as in or outside a group
+ if ( !pGlobalShell->GetViewOptions()->IsPDFExport() &&
+ !pGlobalShell->GetViewOptions()->IsPrinting() &&
+ !pGlobalShell->IsPreView() )
+ {
+ SdrObjList* pObjs = pSh->Imp()->GetPageView()->GetObjList();
+ for ( sal_uInt32 i = 0; pObjs && i < pObjs->GetObjCount(); i++ )
+ {
+ SdrObject* pDrawObj = pObjs->GetObj( i );
+ const SwContact* pContact = ::GetUserCall( pDrawObj );
+ const SwAnchoredObject* pObj = pContact->GetAnchoredObj( pDrawObj );
+
+ const SwFrm* pAnchorFrm = pObj->GetAnchorFrm();
+ bool bInHeaderFooter = false;
+
+ // Handle all non anchored as character objects... others are handled elsewere
+ if ( pAnchorFrm )
+ bInHeaderFooter = pAnchorFrm->FindFooterOrHeader() != NULL;
+ bool bHeaderFooterEdit = pSh->IsHeaderFooterEdit();
+
+ pDrawObj->SetGhosted( bHeaderFooterEdit ^ bInHeaderFooter );
+ }
+ }
+
pLines->LockLines( sal_True );
- // OD 29.08.2002 #102450# - add 3rd parameter
- // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction.
const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
- pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), pPrintData, aPaintRect,
- &aPageBackgrdColor, (pPage->IsRightToLeft() ? true : false) );
+ pSh->Imp()->PaintLayer( pIDDMA->GetHellId(),
+ pPrintData,
+ aPaintRect,
+ &aPageBackgrdColor,
+ (pPage->IsRightToLeft() ? true : false),
+ &aSwRedirector );
pLines->PaintLines( pSh->GetOut() );
pLines->LockLines( sal_False );
}
if( pSh->GetWin() )
{
- // OD 18.11.2002 #99672# - collect sub-lines
+ // collect sub-lines
pPage->RefreshSubsidiary( aPaintRect );
- // OD 18.11.2002 #99672# - paint special sub-lines
+ // paint special sub-lines
pSpecSubsLines->PaintSubsidiary( pSh->GetOut(), NULL );
}
pPage->Paint( aPaintRect );
- // OD 20.12.2002 #94627# - no paint of page border and shadow, if
- // writer is in place mode.
+ // no paint of page border and shadow, if writer is in place mode.
if( pSh->GetWin() && pSh->GetDoc()->GetDocShell() &&
!pSh->GetDoc()->GetDocShell()->IsInPlaceActive() )
{
- // OD 12.02.2003 #i9719#, #105645# - use new method
- // <SwPageFrm::PaintBorderAndShadow(..)>.
SwPageFrm::PaintBorderAndShadow( pPage->Frm(), pSh, bPaintLeftShadow, bPaintRightShadow, bRightSidebar );
SwPageFrm::PaintNotesSidebar( pPage->Frm(), pSh, pPage->GetPhyPageNum(), bRightSidebar);
}
@@ -2965,14 +3029,19 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const
{
/// OD 29.08.2002 #102450# - add 3rd parameter
// OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction.
- pSh->Imp()->PaintLayer( pSh->GetDoc()->GetHeavenId(), pPrintData, aPaintRect,
+ pSh->Imp()->PaintLayer( pSh->GetDoc()->GetHeavenId(),
+ pPrintData,
+ aPaintRect,
&aPageBackgrdColor,
- (pPage->IsRightToLeft() ? true : false) );
+ (pPage->IsRightToLeft() ? true : false),
+ &aSwRedirector );
}
if ( bExtraData )
pPage->RefreshExtraData( aPaintRect );
+ pPage->PaintDecorators( pSh->GetOut() );
+
if ( pSh->GetWin() )
{
pSubsLines->PaintSubsidiary( pSh->GetOut(), pLines );
@@ -3146,10 +3215,9 @@ void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
ViewShell *pSh = getRootFrm()->GetCurrShell();
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
Frm_Info aFrmInfo( *this );
SwTaggedPDFHelper aTaggedPDFHelper( 0, &aFrmInfo, 0, *pSh->GetOut() );
- // <--
const SwFrm *pFrm = Lower();
if ( !pFrm )
@@ -3251,11 +3319,143 @@ void SwLayoutFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
::lcl_EmergencyFormatFtnCont( (SwFtnContFrm*)pFrm->GetNext() );
pFrm = pFrm->GetNext();
+
if ( pFrm && (sal_True == (bCnt = pFrm->IsCntntFrm())) )
pFrm->Calc();
}
}
+drawinglayer::primitive2d::Primitive2DSequence lcl_CreateHeaderFooterSeparatorPrimitives(
+ OutputDevice* pOut, drawinglayer::processor2d::BaseProcessor2D* pProcessor,
+ double nLeft, double nRight, double nLineY,
+ bool bHeader, const String& rStyleName )
+{
+ drawinglayer::primitive2d::Primitive2DSequence aSeq( 4 );
+
+ basegfx::B2DPoint aLeft ( nLeft, nLineY );
+ basegfx::B2DPoint aRight( nRight, nLineY );
+
+ // Compute the text to show
+ String aText = SW_RESSTR( STR_HEADER );
+ if ( !bHeader )
+ aText = SW_RESSTR( STR_FOOTER );
+ aText += rStyleName;
+
+ // Colors
+ basegfx::BColor aLineColor( 3.0 / 255.0, 105.0 / 255.0, 163.0 / 255.0 );
+ basegfx::BColor aFillColor( 170.0 / 255.0, 220.0 / 255.0, 247.0 / 255.0 );
+
+ // Dashed line in twips
+ std::vector< double > aStrokePattern;
+ aStrokePattern.push_back( 110 );
+ aStrokePattern.push_back( 110 );
+
+
+ // Compute the dashed line primitive
+ basegfx::B2DPolygon aLinePolygon;
+ aLinePolygon.append( aLeft );
+ aLinePolygon.append( aRight );
+
+ drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D * pLine =
+ new drawinglayer::primitive2d::PolyPolygonStrokePrimitive2D (
+ basegfx::B2DPolyPolygon( aLinePolygon ),
+ drawinglayer::attribute::LineAttribute( aLineColor, 20.0 ),
+ drawinglayer::attribute::StrokeAttribute( aStrokePattern ) );
+
+ aSeq[1] = drawinglayer::primitive2d::Primitive2DReference( pLine );
+
+ // Compute the text primitive
+ basegfx::B2DVector aFontSize;
+
+ Font aFont = pOut->GetSettings().GetStyleSettings().GetAppFont();
+ aFont.SetHeight( 8 * 20 ); // 8pt to twips
+
+ drawinglayer::attribute::FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont(
+ aFontSize, aFont, false, false );
+
+ FontMetric aFontMetric = pOut->GetFontMetric( aFont );
+
+ double nTextOffsetY = aFontMetric.GetHeight() - aFontMetric.GetDescent() + 70.0;
+ if ( !bHeader )
+ nTextOffsetY = - aFontMetric.GetDescent() - 70.0;
+ basegfx::B2DHomMatrix aTextMatrix( basegfx::tools::createScaleTranslateB2DHomMatrix(
+ aFontSize.getX(), aFontSize.getY(),
+ nLeft + 80.0, nLineY + nTextOffsetY ) );
+
+
+ drawinglayer::primitive2d::TextSimplePortionPrimitive2D * pText =
+ new drawinglayer::primitive2d::TextSimplePortionPrimitive2D(
+ aTextMatrix,
+ aText, 0, aText.Len(),
+ std::vector< double >(),
+ aFontAttr,
+ lang::Locale(),
+ aLineColor );
+ aSeq[3] = drawinglayer::primitive2d::Primitive2DReference( pText );
+ basegfx::B2DRange aTextRange = pText->getB2DRange( pProcessor->getViewInformation2D() );
+
+ // Draw the polygon around the flag
+ basegfx::B2DPolygon aFlagPolygon;
+ basegfx::B2DVector aFlagVector( 0, 1 );
+
+ double nFlagHeight = aTextRange.getMaxY() - nLineY + 60.0;
+
+ if ( !bHeader )
+ {
+ aFlagVector = - aFlagVector;
+ nFlagHeight = nLineY - aTextRange.getMinY() + 60.0;
+ }
+ basegfx::B2DPoint aStartPt( aTextRange.getMinX() - 60.0, nLineY );
+ aFlagPolygon.append( aStartPt );
+ basegfx::B2DPoint aNextPt = aStartPt + aFlagVector * ( nFlagHeight );
+ aFlagPolygon.append( aNextPt );
+ aNextPt += ( aTextRange.getWidth() + 120.0 ) * basegfx::B2DVector( 1, 0 );
+ aFlagPolygon.append( aNextPt );
+ aNextPt.setY( nLineY );
+ aFlagPolygon.append( aNextPt );
+
+ // Compute the flag background color primitive
+ aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
+ new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+ basegfx::B2DPolyPolygon( aFlagPolygon ),
+ aFillColor ) );
+
+ drawinglayer::primitive2d::PolygonHairlinePrimitive2D * pBoxLine =
+ new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
+ aFlagPolygon, aLineColor );
+ aSeq[2] = drawinglayer::primitive2d::Primitive2DReference( pBoxLine );
+
+ return aSeq;
+}
+
+void SwPageFrm::PaintDecorators( OutputDevice *pOut ) const
+{
+ const SwLayoutFrm* pBody = FindBodyCont();
+ if ( pBody )
+ {
+ SwRect aBodyRect( pBody->Frm() );
+
+ if ( !pGlobalShell->GetViewOptions()->IsPrinting() &&
+ !pGlobalShell->GetViewOptions()->IsPDFExport() &&
+ !pGlobalShell->IsPreView() &&
+ pGlobalShell->IsHeaderFooterEdit( ) )
+ {
+ const String aStyleName = FindPageFrm()->GetPageDesc()->GetName();
+ drawinglayer::processor2d::BaseProcessor2D* pProcessor = CreateProcessor2D();
+
+ pProcessor->process( lcl_CreateHeaderFooterSeparatorPrimitives(
+ pOut, pProcessor, double( Frm().Left() ), double( Frm().Right() ),
+ double( aBodyRect.Top() ), true, aStyleName ) );
+
+ pProcessor->process( lcl_CreateHeaderFooterSeparatorPrimitives(
+ pOut, pProcessor, double( Frm().Left() ), double( Frm().Right() ),
+ double( aBodyRect.Bottom() ), false, aStyleName ) );
+
+ delete pProcessor;
+ }
+ }
+}
+
/** FlyFrm::IsBackgroundTransparent - for feature #99657#
OD 12.08.2002
@@ -3453,6 +3653,8 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
aRect._Intersection( Frm() );
OutputDevice* pOut = pGlobalShell->GetOut();
+ sal_uInt64 nOldDrawMode = SetHeaderFooterEditMask( pOut );
+
pOut->Push( PUSH_CLIPREGION );
pOut->SetClipRegion();
const SwPageFrm* pPage = FindPageFrm();
@@ -3484,11 +3686,10 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
bContour = GetContour( aPoly, sal_True );
}
- // --> OD 2005-06-08 #i47804# - distinguish complete background paint
+ // #i47804# - distinguish complete background paint
// and margin paint.
// paint complete background for Writer text fly frames
bool bPaintCompleteBack( !pNoTxt );
- // <--
// paint complete background for transparent graphic and contour,
// if own background color exists.
const bool bIsGraphicTransparent = pNoTxt ? pNoTxt->IsTransparent() : false;
@@ -3507,7 +3708,7 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
const bool bPaintMarginOnly( !bPaintCompleteBack &&
Prt().SSize() != Frm().SSize() );
- // --> OD 2005-06-08 #i47804# - paint background of parent fly frame
+ // #i47804# - paint background of parent fly frame
// for transparent graphics in layer Hell, if parent fly frame isn't
// in layer Hell. It's only painted the intersection between the
// parent fly frame area and the paint area <aRect>
@@ -3551,12 +3752,11 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
// paint background
{
SwRegionRects aRegion( aRect );
- // --> OD 2007-12-13 #i80822#
+ // #i80822#
// suppress painting of background in printing area for
// non-transparent graphics.
if ( bPaintMarginOnly ||
( pNoTxt && !bIsGraphicTransparent ) )
- // <--
{
//Was wir eigentlich Painten wollen ist der schmale Streifen
//zwischen PrtArea und aeusserer Umrandung.
@@ -3566,14 +3766,13 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if ( bContour )
{
pOut->Push();
- // --> OD 2007-12-13 #i80822#
+ // #i80822#
// apply clip region under the same conditions, which are
// used in <SwNoTxtFrm::Paint(..)> to set the clip region
// for painting the graphic/OLE. Thus, the clip region is
// also applied for the PDF export.
ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( !pOut->GetConnectMetaFile() || !pSh || !pSh->GetWin() )
- // <--
{
pOut->SetClipRegion( aPoly );
}
@@ -3663,6 +3862,8 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
pOut->Pop();
+ pOut->SetDrawMode( nOldDrawMode );
+
if ( pProgress && pNoTxt )
pProgress->Reschedule();
}
@@ -3674,9 +3875,10 @@ void SwFlyFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
+ sal_uInt64 nOldDrawMode = SetHeaderFooterEditMask( pGlobalShell->GetOut() );
if ( pGlobalShell->GetViewOptions()->IsTable() )
{
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
if ( IsCollapsingBorders() )
{
SwBorderAttrAccess aAccess( SwFrm::GetCache(), (SwFrm*)this );
@@ -3710,6 +3912,8 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
DrawRect( pGlobalShell->GetOut(), aTabOutRect, COL_LIGHTGRAY );
}
((SwTabFrm*)this)->ResetComplete();
+
+ pGlobalShell->GetOut()->SetDrawMode( nOldDrawMode );
}
/*************************************************************************
@@ -4085,26 +4289,6 @@ void MA_FASTCALL lcl_SubTopBottom( SwRect& _iorRect,
}
}
-// method called for top and bottom border rectangles.
-void MA_FASTCALL lcl_SubLeftRight( SwRect& rRect,
- const SvxBoxItem& rBox,
- const SwRectFn& rRectFn )
-{
- if ( rBox.GetLeft() && rBox.GetLeft()->GetInWidth() )
- {
- const long nDist = ::lcl_MinWidthDist( rBox.GetLeft()->GetDistance() )
- + ::lcl_AlignWidth( rBox.GetLeft()->GetOutWidth() );
- (rRect.*rRectFn->fnSubLeft)( -nDist );
- }
-
- if ( rBox.GetRight() && rBox.GetRight()->GetInWidth() )
- {
- const long nDist = ::lcl_MinWidthDist( rBox.GetRight()->GetDistance() )
- + ::lcl_AlignWidth( rBox.GetRight()->GetOutWidth() );
- (rRect.*rRectFn->fnAddRight)( -nDist );
- }
-}
-
sal_uInt16 lcl_GetLineWidth( const SvxBorderLine* pLine )
{
sal_uInt16 result = 0;
@@ -4509,7 +4693,7 @@ const SwFrm* lcl_GetCellFrmForBorderAttrs( const SwFrm* _pCellFrm,
{
if ( _bTop && !_rCellBorderAttrs.GetBox().GetTop() )
{
- // #b4779636#-hack:
+ //-hack
// Cell frame has no top border and no border inside the table, but
// it is at the top border of a table frame, which is a follow.
// Thus, use border attributes of cell frame in first row of complete table.
@@ -4530,7 +4714,7 @@ const SwFrm* lcl_GetCellFrmForBorderAttrs( const SwFrm* _pCellFrm,
}
else if ( !_bTop && !_rCellBorderAttrs.GetBox().GetBottom() )
{
- // #b4779636#-hack:
+ //-hack
// Cell frame has no bottom border and no border inside the table,
// but it is at the bottom border of a table frame, which has a follow.
// Thus, use border attributes of cell frame in last row of complete table.
@@ -4566,7 +4750,7 @@ const SwFrm* lcl_GetCellFrmForBorderAttrs( const SwFrm* _pCellFrm,
return pRet;
}
-void SwFrm::ProcessPrimitives( const drawinglayer::primitive2d::Primitive2DSequence& rSequence ) const
+drawinglayer::processor2d::BaseProcessor2D * SwFrm::CreateProcessor2D( ) const
{
basegfx::B2DRange aViewRange;
@@ -4579,10 +4763,14 @@ void SwFrm::ProcessPrimitives( const drawinglayer::primitive2d::Primitive2DSeque
0.0,
uno::Sequence< beans::PropertyValue >() );
- drawinglayer::processor2d::BaseProcessor2D * pProcessor2D =
- sdr::contact::createBaseProcessor2DFromOutputDevice(
+ return sdr::contact::createBaseProcessor2DFromOutputDevice(
*getRootFrm()->GetCurrShell()->GetOut(),
aNewViewInfos );
+}
+
+void SwFrm::ProcessPrimitives( const drawinglayer::primitive2d::Primitive2DSequence& rSequence ) const
+{
+ drawinglayer::processor2d::BaseProcessor2D * pProcessor2D = CreateProcessor2D();
if ( pProcessor2D )
{
@@ -4602,7 +4790,7 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
!pGlobalShell->GetViewOptions()->IsTable() )
return;
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
if ( IsTabFrm() || IsCellFrm() || IsRowFrm() )
{
const SwTabFrm* pTabFrm = FindTabFrm();
@@ -4612,15 +4800,14 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
if ( pTabFrm->GetTable()->IsNewModel() && ( !IsCellFrm() || IsCoveredCell() ) )
return;
}
- // <--
const bool bLine = rAttrs.IsLine() ? true : false;
const bool bShadow = rAttrs.GetShadow().GetLocation() != SVX_SHADOW_NONE;
- // OD 24.02.2003 #b4779636#, #107692# - flag to control,
- // if #b4779636#-hack has to be used.
+ // - flag to control,
+ //-hack has to be used.
const bool bb4779636HackActive = true;
- // OD 21.02.2003 #b4779636#, #107692#
+ //
const SwFrm* pCellFrmForBottomBorderAttrs = 0;
const SwFrm* pCellFrmForTopBorderAttrs = 0;
bool bFoundCellForTopOrBorderAttrs = false;
@@ -4634,8 +4821,8 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
bFoundCellForTopOrBorderAttrs = true;
}
- // OD 24.02.2003 #b4779636#, #107692# - add condition <bFoundCellForTopOrBorderAttrs>
- // for #b4779636#-hack
+ // - add condition <bFoundCellForTopOrBorderAttrs>
+ //-hack
if ( bLine || bShadow || bFoundCellForTopOrBorderAttrs )
{
//Wenn das Rechteck vollstandig innerhalb der PrtArea liegt,
@@ -4680,8 +4867,8 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
PaintShadow( rRect, aRect, rAttrs );
// OD 27.09.2002 #103636# - suspend drawing of border
// add condition < NOT bDrawOnlyShadowForTransparentFrame > - see above
- // OD 24.02.2003 #b4779636#, #107692# - add condition <bFoundCellForTopOrBorderAttrs>
- // for #b4779636#-hack.
+ // - add condition <bFoundCellForTopOrBorderAttrs>
+ //-hack.
if ( ( bLine || bFoundCellForTopOrBorderAttrs ) &&
!bDrawOnlyShadowForTransparentFrame )
{
@@ -4691,8 +4878,8 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
::lcl_PaintLeftRightLine ( sal_False, *(this), *(pPage), aRect, rRect, rAttrs, fnRect );
if ( !IsCntntFrm() || rAttrs.GetTopLine( *(this) ) )
{
- // OD 21.02.2003 #b4779636#, #107692# -
- // #b4779636#-hack: If another cell frame for top border
+ // -
+ //-hack
// paint is found, paint its top border.
if ( IsCellFrm() && pCellFrmForTopBorderAttrs != this )
{
@@ -4708,8 +4895,8 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
}
if ( !IsCntntFrm() || rAttrs.GetBottomLine( *(this) ) )
{
- // OD 21.02.2003 #b4779636#, #107692# -
- // #b4779636#-hack: If another cell frame for bottom border
+ // -
+ //-hack
// paint is found, paint its bottom border.
if ( IsCellFrm() && pCellFrmForBottomBorderAttrs != this )
{
@@ -5286,19 +5473,28 @@ sal_Bool SwPageFrm::IsLeftShadowNeeded() const
// No shadow in prefs
if( !SwViewOption::IsShadow() ) return;
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *_pViewShell->GetOut() );
- // <--
-
- static drawinglayer::primitive2d::DiscreteShadow shadowMask( SW_RES( BMP_PAGE_SHADOW_MASK ) );
- static BitmapEx aPageTopRightShadow;
- static BitmapEx aPageBottomRightShadow;
- static BitmapEx aPageBottomLeftShadow;
- static BitmapEx aPageBottomShadowBase;
- static BitmapEx aPageRightShadowBase;
- static BitmapEx aPageTopShadowBase;
- static BitmapEx aPageTopLeftShadow;
- static BitmapEx aPageLeftShadowBase;
+
+ static vcl::DeleteOnDeinit< drawinglayer::primitive2d::DiscreteShadow > shadowMaskObj
+ ( new drawinglayer::primitive2d::DiscreteShadow( SW_RES( BMP_PAGE_SHADOW_MASK ) ));
+ static drawinglayer::primitive2d::DiscreteShadow& shadowMask = *shadowMaskObj.get();
+ static vcl::DeleteOnDeinit< BitmapEx > aPageTopRightShadowObj( new BitmapEx );
+ static vcl::DeleteOnDeinit< BitmapEx > aPageBottomRightShadowObj( new BitmapEx );
+ static vcl::DeleteOnDeinit< BitmapEx > aPageBottomLeftShadowObj( new BitmapEx );
+ static vcl::DeleteOnDeinit< BitmapEx > aPageBottomShadowBaseObj( new BitmapEx );
+ static vcl::DeleteOnDeinit< BitmapEx > aPageRightShadowBaseObj( new BitmapEx );
+ static vcl::DeleteOnDeinit< BitmapEx > aPageTopShadowBaseObj( new BitmapEx );
+ static vcl::DeleteOnDeinit< BitmapEx > aPageTopLeftShadowObj( new BitmapEx );
+ static vcl::DeleteOnDeinit< BitmapEx > aPageLeftShadowBaseObj( new BitmapEx );
+ static BitmapEx& aPageTopRightShadow = *aPageTopRightShadowObj.get();
+ static BitmapEx& aPageBottomRightShadow = *aPageBottomRightShadowObj.get();
+ static BitmapEx& aPageBottomLeftShadow = *aPageBottomLeftShadowObj.get();
+ static BitmapEx& aPageBottomShadowBase = *aPageBottomShadowBaseObj.get();
+ static BitmapEx& aPageRightShadowBase = *aPageRightShadowBaseObj.get();
+ static BitmapEx& aPageTopShadowBase = *aPageTopShadowBaseObj.get();
+ static BitmapEx& aPageTopLeftShadow = *aPageTopLeftShadowObj.get();
+ static BitmapEx& aPageLeftShadowBase = *aPageLeftShadowBaseObj.get();
static Color aShadowColor( COL_AUTO );
SwRect aAlignedPageRect( _rPageRect );
@@ -5598,9 +5794,8 @@ void SwFrm::PaintBaBo( const SwRect& rRect, const SwPageFrm *pPage,
OutputDevice *pOut = pGlobalShell->GetOut();
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pOut );
- // <--
// OD 2004-04-23 #116347#
pOut->Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
@@ -5661,9 +5856,8 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
ViewShell *pSh = pGlobalShell;
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() );
- // <--
const SvxBrushItem* pItem;
/// OD 05.09.2002 #102912#
@@ -5743,6 +5937,9 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
aRect.Intersection( rRect );
OutputDevice *pOut = pSh->GetOut();
+ sal_uInt64 nOldDrawMode = pOut->GetDrawMode();
+ if ( !IsPageFrm() && !IsRootFrm() )
+ SetHeaderFooterEditMask( pOut );
if ( aRect.HasArea() )
{
@@ -5781,6 +5978,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
if( pCol )
delete pNewItem;
}
+ pOut->SetDrawMode( nOldDrawMode );
}
else
bLowMode = bLowerMode ? sal_True : sal_False;
@@ -6064,7 +6262,7 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
{
bool bNewTableModel = false;
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
if ( IsTabFrm() || IsCellFrm() || IsRowFrm() )
{
const SwTabFrm* pTabFrm = FindTabFrm();
@@ -6374,9 +6572,8 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
aRegion -= rRect;
ViewShell *pSh = getRootFrm()->GetCurrShell();
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() );
- // <--
for ( sal_uInt16 i = 0; i < aRegion.Count(); ++i )
{
@@ -6391,21 +6588,20 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
SwRect aRetouchePart( rRetouche );
if ( aRetouchePart.HasArea() )
{
- // OD 30.08.2002 #102450#
- // determine background color of page for <PaintLayer> method
- // calls, painting <hell> or <heaven>
const Color aPageBackgrdColor = pPage->GetDrawBackgrdColor();
- // OD 29.08.2002 #102450#
- // add 3rd parameter to <PaintLayer> method calls
- // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction.
const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
+ // --> OD #i76669#
+ SwViewObjectContactRedirector aSwRedirector( *pSh );
+ // <--
pSh->Imp()->PaintLayer( pIDDMA->GetHellId(), 0,
aRetouchePart, &aPageBackgrdColor,
- (pPage->IsRightToLeft() ? true : false) );
+ (pPage->IsRightToLeft() ? true : false),
+ &aSwRedirector );
pSh->Imp()->PaintLayer( pIDDMA->GetHeavenId(), 0,
aRetouchePart, &aPageBackgrdColor,
- (pPage->IsRightToLeft() ? true : false) );
+ (pPage->IsRightToLeft() ? true : false),
+ &aSwRedirector );
}
SetRetouche();
@@ -6491,9 +6687,8 @@ sal_Bool SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
rBack.GetGraphicPos() == GPOS_NONE &&
!pOpt->IsPagePreview() &&
!pOpt->IsReadonly() &&
- // --> FME 2004-06-29 #114856# Formular view
+ // #114856# Formular view
!pOpt->IsFormView() &&
- // <--
SwViewOption::IsIndexShadings() &&
!pOpt->IsPDFExport() &&
pSh->GetOut()->GetOutDevType() != OUTDEV_PRINTER )
@@ -6637,22 +6832,22 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
// OD 09.12.2002 #103045# - determine page, fly frame is on
const SwPageFrm* pFlyPage = pFly->FindPageFrm();
- // OD 30.08.2002 #102450#
- // determine color of page, the fly frame is on, for <PaintLayer> method
- // calls, painting <hell> or <heaven>
const Color aPageBackgrdColor = pFlyPage->GetDrawBackgrdColor();
- // OD 30.08.2002 #102450# - add 3rd parameter
- // OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction.
const IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
+ // --> OD #i76669#
+ SwViewObjectContactRedirector aSwRedirector( *pSh );
+ // <--
pImp->PaintLayer( pIDDMA->GetHellId(), 0, aOut, &aPageBackgrdColor,
- (pFlyPage->IsRightToLeft() ? true : false) );
+ (pFlyPage->IsRightToLeft() ? true : false),
+ &aSwRedirector );
pLines->PaintLines( &aDev );
if ( pFly->IsFlyInCntFrm() )
pFly->Paint( aOut );
pLines->PaintLines( &aDev );
/// OD 30.08.2002 #102450# - add 3rd parameter
pImp->PaintLayer( pIDDMA->GetHeavenId(), 0, aOut, &aPageBackgrdColor,
- (pFlyPage->IsRightToLeft() ? true : false) );
+ (pFlyPage->IsRightToLeft() ? true : false),
+ &aSwRedirector );
pLines->PaintLines( &aDev );
DELETEZ( pLines );
pFlyOnlyDraw = 0;
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 6f8bf2f3d8..45283a9a17 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -192,7 +192,7 @@ void SwSectionFrm::DelEmpty( sal_Bool bRemove )
SwFrm* pUp = GetUpper();
if( pUp )
{
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for current next paragraph will change
@@ -207,7 +207,6 @@ void SwSectionFrm::DelEmpty( sal_Bool bRemove )
dynamic_cast<SwTxtFrm*>(FindPrevCnt( true )) );
}
}
- // <--
_Cut( bRemove );
}
if( IsFollow() )
@@ -347,7 +346,7 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
//In den Baum einhaengen.
SwSectionFrm* pSect = pParent->FindSctFrm();
- // --> OD 2008-06-23 #156927#
+ // #156927#
// Assure that parent is not inside a table frame, which is inside the found section frame.
if ( pSect )
{
@@ -358,7 +357,6 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
pSect = 0;
}
}
- // <--
SWRECTFN( pParent )
if( pSect && HasToBreak( pSect ) )
@@ -1135,10 +1133,9 @@ void SwSectionFrm::SimpleFormat()
SWRECTFN( this )
if( GetPrev() || GetUpper() )
{
- // --> OD 2009-09-28 #b6882166#
+ //
// assure notifications on position changes.
const SwLayNotify aNotify( this );
- // <--
(this->*fnRect->fnMakePos)( GetUpper(), GetPrev(), sal_False );
bValidPos = sal_True;
}
@@ -1158,7 +1155,7 @@ void SwSectionFrm::SimpleFormat()
UnlockJoin();
}
-// --> OD 2005-01-11 #i40147# - helper class to perform extra section format
+// #i40147# - helper class to perform extra section format
// to position anchored objects and to keep the position of whose objects locked.
class ExtraFormatToPositionObjs
{
@@ -1195,7 +1192,7 @@ class ExtraFormatToPositionObjs
}
}
- // --> OD 2008-06-20 #i81555#
+ // #i81555#
void InitObjs( SwFrm& rFrm )
{
SwSortedObjs* pObjs = rFrm.GetDrawObjs();
@@ -1222,7 +1219,6 @@ class ExtraFormatToPositionObjs
}
}
}
- // <--
void FormatSectionToPositionObjs()
{
@@ -1238,13 +1234,12 @@ class ExtraFormatToPositionObjs
(mpSectFrm->GetUpper()->*fnRect->fnGetPrtBottom)() );
(mpSectFrm->Frm().*fnRect->fnAddBottom)( nDiff );
(mpSectFrm->*fnRect->fnSetYMargins)( nTopMargin, 0 );
- // --> OD 2006-05-08 #i59789#
+ // #i59789#
// suppress formatting, if printing area of section is too narrow
if ( (mpSectFrm->Prt().*fnRect->fnGetHeight)() <= 0 )
{
return;
}
- // <--
mpSectFrm->ChgLowersProp( aOldSectPrtSize );
// format column frames and its body and footnote container
@@ -1262,12 +1257,11 @@ class ExtraFormatToPositionObjs
}
// unlock position of lower floating screen objects for the extra format
- // --> OD 2008-06-20 #i81555#
+ // #i81555#
// Section frame can already have changed the page and its content
// can still be on the former page.
// Thus, initialize objects via lower-relationship
InitObjs( *mpSectFrm );
- // <--
// format content - first with collecting its foot-/endnotes before content
// format, second without collecting its foot-/endnotes.
@@ -1353,7 +1347,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
// OD 2004-05-17 #i28701# - If the wrapping style has to be considered
// on object positioning, an extra formatting has to be performed
// to determine the correct positions the floating screen objects.
- // --> OD 2005-01-11 #i40147#
+ // #i40147#
// use new helper class <ExtraFormatToPositionObjs>.
// This class additionally keep the locked position of the objects
// and releases this position lock keeping on destruction.
@@ -1364,7 +1358,6 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
{
aExtraFormatToPosObjs.FormatSectionToPositionObjs();
}
- // <--
// Column widths have to be adjusted before calling _CheckClipping.
// _CheckClipping can cause the formatting of the lower frames
@@ -1404,18 +1397,16 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
{
if( pFrm->IsColumnFrm() && pFrm->GetNext() )
{
- // --> OD 2006-05-08 #i61435#
+ // #i61435#
// suppress formatting, if upper frame has height <= 0
if ( (GetUpper()->Frm().*fnRect->fnGetHeight)() > 0 )
{
FormatWidthCols( *pAttr, nRemaining, MINLAY );
}
- // <--
- // --> OD 2006-01-04 #126020# - adjust check for empty section
- // --> OD 2006-02-01 #130797# - correct fix #126020#
+ // #126020# - adjust check for empty section
+ // #130797# - correct fix #126020#
while( HasFollow() && !GetFollow()->ContainsCntnt() &&
!GetFollow()->ContainsAny( true ) )
- // <--
{
SwFrm* pOld = GetFollow();
GetFollow()->DelEmpty( sal_False );
@@ -1826,7 +1817,7 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
// this table.
SwSectionFrm *pSect = FindSctFrm();
- // --> OD 2009-01-16 #i95698#
+ // #i95698#
// A table cell containing directly a section does not break - see lcl_FindSectionsInRow(..)
// Thus, a table inside a section, which is inside another table can only
// flow backward in the columns of its section.
@@ -1835,7 +1826,6 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType )
{
return pCol;
}
- // <--
{
SwFrm *pPrv;
@@ -2093,7 +2083,7 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, sal_Bool bTst )
pFrm->InvalidatePos();
}
}
- // --> OD 2004-07-05 #i28701# - Due to the new object positioning
+ // #i28701# - Due to the new object positioning
// the frame on the next page/column can flow backward (e.g. it
// was moved forward due to the positioning of its objects ).
// Thus, invalivate this next frame, if document compatibility
@@ -2102,7 +2092,6 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, sal_Bool bTst )
{
InvalidateNextPos();
}
- // <--
}
return nGrow;
}
@@ -2280,13 +2269,12 @@ sal_Bool SwSectionFrm::MoveAllowed( const SwFrm* pFrm) const
SwFrm* SwFrm::_GetIndPrev() const
{
SwFrm *pRet = NULL;
- // --> OD 2007-09-04 #i79774#, #b659654#
+ // #i79774#
// Do not assert, if the frame has a direct previous frame, because it
// could be an empty section frame. The caller has to assure, that the
// frame has no direct previous frame or only empty section frames as
// previous frames.
OSL_ENSURE( /*!pPrev &&*/ IsInSct(), "Why?" );
- // <--
const SwFrm* pSct = GetUpper();
if( !pSct )
return NULL;
@@ -2443,7 +2431,7 @@ void SwSectionFrm::SwClientNotify( const SwModify& rMod, const SfxHint& rHint )
{
// #i117863#: The hint needs to indicate whether to keep the SwSectionFrm
// content or not.
- const SwSectionFrmMoveAndDeleteHint* pHint =
+ const SwSectionFrmMoveAndDeleteHint* pHint =
dynamic_cast<const SwSectionFrmMoveAndDeleteHint*>(&rHint);
if ( pHint && pHint->GetId() == SFX_HINT_DYING && &rMod == GetRegisteredIn() )
{
diff --git a/sw/source/core/layout/sortedobjsimpl.cxx b/sw/source/core/layout/sortedobjsimpl.cxx
index fee4d3a310..479784a6cf 100644
--- a/sw/source/core/layout/sortedobjsimpl.cxx
+++ b/sw/source/core/layout/sortedobjsimpl.cxx
@@ -158,7 +158,6 @@ struct ObjAnchorOrder
return false;
}
}
- // <--
// objects anchored at the same content and at the same content anchor
// node position with the same anchor type
@@ -192,15 +191,13 @@ struct ObjAnchorOrder
&(rFmtListed.GetWrapInfluenceOnObjPos());
const SwFmtWrapInfluenceOnObjPos* pWrapInfluenceOnObjPosNew =
&(rFmtNew.GetWrapInfluenceOnObjPos());
- // --> OD 2004-10-18 #i35017# - handle ITERATIVE as ONCE_SUCCESSIVE
+ // #i35017# - handle ITERATIVE as ONCE_SUCCESSIVE
if ( pWrapInfluenceOnObjPosListed->GetWrapInfluenceOnObjPos( true ) !=
pWrapInfluenceOnObjPosNew->GetWrapInfluenceOnObjPos( true ) )
- // <--
{
- // --> OD 2004-10-18 #i35017# - constant name has changed
+ // #i35017# - constant name has changed
if ( pWrapInfluenceOnObjPosListed->GetWrapInfluenceOnObjPos( true )
== text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE )
- // <--
return true;
else
return false;
@@ -215,7 +212,7 @@ struct ObjAnchorOrder
bool SwSortedObjsImpl::Insert( SwAnchoredObject& _rAnchoredObj )
{
- // --> OD 2005-08-18 #i51941#
+ // #i51941#
if ( Contains( _rAnchoredObj ) )
{
// list already contains object
@@ -298,12 +295,11 @@ sal_uInt32 SwSortedObjsImpl::ListPosOf( const SwAnchoredObject& _rAnchoredObj )
if ( aIter != maSortedObjLst.end() )
{
- // --> OD 2005-08-18 #i51941#
+ // #i51941#
// nRetLstPos = aIter - maSortedObjLst.begin();
std::vector< SwAnchoredObject* >::difference_type nPos =
aIter - maSortedObjLst.begin();
nRetLstPos = sal_uInt32( nPos );
- // <--
}
return nRetLstPos;
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index b2dc3898a4..2d3e07c35b 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -287,7 +287,7 @@ void SwFrm::CheckDirChange()
else if( IsTxtFrm() )
((SwTxtFrm*)this)->Prepare( PREP_CLEAR );
- // --> OD 2004-07-27 #i31698# - notify anchored objects also for page frames.
+ // #i31698# - notify anchored objects also for page frames.
// Remove code above for special handling of page frames
if ( GetDrawObjs() )
{
@@ -305,13 +305,12 @@ void SwFrm::CheckDirChange()
// invalidate
pAnchoredObj->InvalidateObjPos();
}
- // --> OD 2004-07-27 #i31698# - update layout direction of
+ // #i31698# - update layout direction of
// anchored object
{
::setContextWritingMode( pAnchoredObj->DrawObj(), pAnchoredObj->GetAnchorFrmContainingAnchPos() );
pAnchoredObj->UpdateLayoutDir();
}
- // <--
}
}
}
@@ -506,7 +505,7 @@ void SwCntntFrm::DelFrms( const SwCntntNode& rNode )
SwIterator<SwCntntFrm,SwCntntNode> aIter( rNode );
for( SwCntntFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() )
{
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed
// CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for current next paragraph will change
@@ -522,7 +521,6 @@ void SwCntntFrm::DelFrms( const SwCntntNode& rNode )
dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
}
}
- // <--
if( pFrm->HasFollow() )
pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() );
if( pFrm->IsFollow() )
@@ -580,7 +578,7 @@ SwLayoutFrm::~SwLayoutFrm()
while ( pFrm->GetDrawObjs() && pFrm->GetDrawObjs()->Count() )
{
nCnt = pFrm->GetDrawObjs()->Count();
- // --> OD 2004-06-30 #i28701#
+ // #i28701#
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[0];
if ( pAnchoredObj->ISA(SwFlyFrm) )
delete pAnchoredObj;
@@ -601,7 +599,6 @@ SwLayoutFrm::~SwLayoutFrm()
{
pFrm->GetDrawObjs()->Remove( *pAnchoredObj );
}
- // <--
}
pFrm->Remove();
delete pFrm;
@@ -613,7 +610,7 @@ SwLayoutFrm::~SwLayoutFrm()
{
nCnt = GetDrawObjs()->Count();
- // --> OD 2004-06-30 #i28701#
+ // #i28701#
SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[0];
if ( pAnchoredObj->ISA(SwFlyFrm) )
delete pAnchoredObj;
@@ -633,7 +630,6 @@ SwLayoutFrm::~SwLayoutFrm()
{
GetDrawObjs()->Remove( *pAnchoredObj );
}
- // <--
}
}
else
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index aaa73cab89..343dce3691 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -95,10 +95,9 @@ SwTabFrm::SwTabFrm( SwTable &rTab, SwFrm* pSib ):
bComplete = bCalcLowers = bONECalcLowers = bLowersFormatted = bLockBackMove =
bResizeHTMLTable = bHasFollowFlowLine = bIsRebuildLastLine =
bRestrictTableGrowth = bRemoveFollowFlowLinePending = sal_False;
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
bConsiderObjsForMinCellHeight = sal_True;
bObjsDoesFit = sal_True;
- // <--
bFixSize = sal_False; //Nicht nochmal auf die Importfilter hereinfallen.
nType = FRMC_TAB;
@@ -128,10 +127,9 @@ SwTabFrm::SwTabFrm( SwTabFrm &rTab ) :
bLockJoin = bComplete = bONECalcLowers = bCalcLowers = bLowersFormatted = bLockBackMove =
bResizeHTMLTable = bHasFollowFlowLine = bIsRebuildLastLine =
bRestrictTableGrowth = bRemoveFollowFlowLinePending = sal_False;
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
bConsiderObjsForMinCellHeight = sal_True;
bObjsDoesFit = sal_True;
- // <--
bFixSize = sal_False; //Nicht nochmal auf die Importfilter hereinfallen.
nType = FRMC_TAB;
@@ -205,19 +203,17 @@ void SwTabFrm::RegistFlys()
void MA_FASTCALL SwInvalidateAll( SwFrm *pFrm, long nBottom );
void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom );
sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva );
-// --> OD 2004-10-15 #i26945# - add parameter <_bOnlyRowsAndCells> to control
+// #i26945# - add parameter <_bOnlyRowsAndCells> to control
// that only row and cell frames are formatted.
sal_Bool MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm,
long nBottom,
bool _bOnlyRowsAndCells = false );
-// <--
// OD 2004-02-18 #106629# - correct type of 1st parameter
-// --> OD 2004-10-04 #i26945# - add parameter <_bConsiderObjs> in order to
+// #i26945# - add parameter <_bConsiderObjs> in order to
// control, if floating screen objects have to be considered for the minimal
// cell height.
SwTwips MA_FASTCALL lcl_CalcMinRowHeight( const SwRowFrm *pRow,
const sal_Bool _bConsiderObjs );
-// <--
SwTwips lcl_CalcTopAndBottomMargin( const SwLayoutFrm&, const SwBorderAttrs& );
/*************************************************************************
@@ -265,7 +261,7 @@ SwRowFrm* lcl_InsertNewFollowFlowLine( SwTabFrm& rTab, const SwFrm& rTmpRow, boo
return pFollowFlowLine;
}
-// --> OD 2004-11-05 #i26945# - local helper function to invalidate all lower
+// #i26945# - local helper function to invalidate all lower
// objects. By parameter <_bMoveObjsOutOfRange> it can be controlled, if
// additionally the objects are moved 'out of range'.
void lcl_InvalidateLowerObjs( SwLayoutFrm& _rLayoutFrm,
@@ -313,7 +309,7 @@ void lcl_InvalidateLowerObjs( SwLayoutFrm& _rLayoutFrm,
// due to the movement
SwObjPositioningInProgress aObjPosInProgress( *pAnchoredObj );
pAnchoredObj->SetObjLeft( _pPageFrm->Frm().Right() );
- // --> OD 2004-11-24 #115759# - reset character rectangle,
+ // #115759# - reset character rectangle,
// top of line and relative position in order to assure,
// that anchored object is correctly positioned.
pAnchoredObj->ClearCharRectAndTopOfLine();
@@ -325,7 +321,6 @@ void lcl_InvalidateLowerObjs( SwLayoutFrm& _rLayoutFrm,
->Prepare( PREP_FLY_ATTR_CHG,
&(pAnchoredObj->GetFrmFmt()) );
}
- // <--
if ( pAnchoredObj->ISA(SwFlyFrm) )
{
SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
@@ -345,7 +340,6 @@ void lcl_InvalidateLowerObjs( SwLayoutFrm& _rLayoutFrm,
pLowerFrm = pLowerFrm->GetNext();
}
}
-// <--
//
// Local helper function to shrink all lowers of rRow to 0 height
//
@@ -361,12 +355,11 @@ void lcl_ShrinkCellsAndAllContent( SwRowFrm& rRow )
const_cast<SwCellFrm&>(pCurrMasterCell->FindStartEndOfRowSpanCell( true, true )) :
*pCurrMasterCell;
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
// all lowers should have the correct position
lcl_ArrangeLowers( &rToAdjust,
(rToAdjust.*fnRect->fnGetPrtTop)(),
sal_False );
- // <--
// TODO: Optimize number of frames which are set to 0 height
// we have to start with the last lower frame, otherwise
// the shrink will not shrink the current cell
@@ -383,7 +376,7 @@ void lcl_ShrinkCellsAndAllContent( SwRowFrm& rRow )
while ( pTmp )
{
// the frames have to be shrunk
- if ( pTmp && pTmp->IsTabFrm() )
+ if ( pTmp->IsTabFrm() )
{
SwRowFrm* pTmpRow = (SwRowFrm*)((SwTabFrm*)pTmp)->Lower();
while ( pTmpRow )
@@ -430,12 +423,11 @@ void lcl_MoveRowContent( SwRowFrm& rSourceLine, SwRowFrm& rDestLine )
SwRowFrm* pTmpSourceRow = (SwRowFrm*)pCurrSourceCell->Lower();
while ( pTmpSourceRow )
{
- // --> FME 2006-01-10 #125926# Achtung! It is possible,
+ // #125926# Achtung! It is possible,
// that pTmpSourceRow->IsFollowFlowRow() but pTmpDestRow
// cannot be found. In this case, we have to move the complete
// row.
SwRowFrm* pTmpDestRow = (SwRowFrm*)pCurrDestCell->Lower();
- // <--
if ( pTmpSourceRow->IsFollowFlowRow() && pTmpDestRow )
{
@@ -515,20 +507,18 @@ void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine,
SwTwips nTmpCut = nRemain;
SwRowFrm* pTmpLastLineRow = (SwRowFrm*)pCurrLastLineCell->Lower();
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
SwTwips nCurrentHeight =
lcl_CalcMinRowHeight( pTmpLastLineRow,
rTab.IsConsiderObjsForMinCellHeight() );
- // <--
while ( pTmpLastLineRow && pTmpLastLineRow->GetNext() && nTmpCut > nCurrentHeight )
{
nTmpCut -= nCurrentHeight;
pTmpLastLineRow = (SwRowFrm*)pTmpLastLineRow->GetNext();
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
nCurrentHeight =
lcl_CalcMinRowHeight( pTmpLastLineRow,
rTab.IsConsiderObjsForMinCellHeight() );
- // <--
}
//
@@ -675,24 +665,21 @@ bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
// Here the recalculation process starts:
//
rTab.SetRebuildLastLine( sal_True );
- // --> OD 2004-10-15 #i26945#
+ // #i26945#
rTab.SetDoesObjsFit( sal_True );
- // <--
SWRECTFN( rTab.GetUpper() )
- // --> OD 2004-11-05 #i26945# - invalidate and move floating screen
+ // #i26945# - invalidate and move floating screen
// objects 'out of range'
::lcl_InvalidateLowerObjs( rLastLine, true );
- // <--
//
// manipulate row and cell sizes
//
- // --> OD 2004-10-04 #i26945# - Do *not* consider floating screen objects
+ // #i26945# - Do *not* consider floating screen objects
// for the minimal cell height.
rTab.SetConsiderObjsForMinCellHeight( sal_False );
::lcl_ShrinkCellsAndAllContent( rLastLine );
rTab.SetConsiderObjsForMinCellHeight( sal_True );
- // <--
//
// invalidate last line
@@ -720,11 +707,10 @@ bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
// Do the recalculation
//
lcl_RecalcRow( rLastLine, LONG_MAX );
- // --> OD 2004-11-23 #115759# - force a format of the last line in order to
+ // #115759# - force a format of the last line in order to
// get the correct height.
rLastLine.InvalidateSize();
rLastLine.Calc();
- // <--
//
// Unlock this tab frame and its follow
@@ -750,13 +736,12 @@ bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
//
// 1. Check if table fits to its upper.
- // --> OD 2004-10-15 #i26945# - include check, if objects fit
+ // #i26945# - include check, if objects fit
//
const SwTwips nDistanceToUpperPrtBottom =
(rTab.Frm().*fnRect->fnBottomDist)( (rTab.GetUpper()->*fnRect->fnGetPrtBottom)());
if ( nDistanceToUpperPrtBottom < 0 || !rTab.DoesObjsFit() )
bRet = false;
- // <--
//
// 2. Check if each cell in the last line has at least one content frame.
@@ -822,9 +807,8 @@ bool lcl_RecalcSplitLine( SwRowFrm& rLastLine, SwRowFrm& rFollowLine,
}
rTab.SetRebuildLastLine( sal_False );
- // --> OD 2004-10-15 #i26945#
+ // #i26945#
rTab.SetDoesObjsFit( sal_True );
- // <--
return bRet;
}
@@ -910,7 +894,7 @@ bool SwTabFrm::RemoveFollowFlowLine()
// this flag is set.
SetFollowFlowLine( sal_False );
- // --> FME 2007-07-19 #140081# Make code robust.
+ // #140081# Make code robust.
if ( !pFollowFlowLine || !pLastLine )
return true;
@@ -963,7 +947,7 @@ bool SwTabFrm::RemoveFollowFlowLine()
return bJoin;
}
-// --> OD 2004-10-04 #i26945# - Floating screen objects are no longer searched.
+// #i26945# - Floating screen objects are no longer searched.
bool lcl_FindSectionsInRow( const SwRowFrm& rRow )
{
bool bRet = false;
@@ -982,9 +966,8 @@ bool lcl_FindSectionsInRow( const SwRowFrm& rRow )
}
else
{
- // --> OD 2004-10-04 #i26945# - search only for sections
+ // #i26945# - search only for sections
bRet = pTmpFrm->IsSctFrm();
- // <--
}
if ( bRet )
@@ -1008,15 +991,13 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
SWRECTFN( this )
- // --> OD 2004-10-14 #i26745# - format row and cell frames of table
+ // #i26745# - format row and cell frames of table
{
this->Lower()->_InvalidatePos();
- // --> OD 2005-03-30 #i43913# - correction:
+ // #i43913# - correction
// call method <lcl_InnerCalcLayout> with first lower.
lcl_InnerCalcLayout( this->Lower(), LONG_MAX, true );
- // <--
}
- // <--
//Um die Positionen der Zellen mit der CutPos zu vergleichen muessen sie
//ausgehend von der Tabelle nacheinander berechnet werden. Sie koennen
@@ -1059,8 +1040,8 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
//
bool bSplitRowAllowed = pRow->IsRowSplitAllowed();
- // --> FME 2004-06-03 #i29438#
- // --> OD 2004-10-04 #i26945# - Floating screen objects no longer forbid
+ // #i29438#
+ // #i26945# - Floating screen objects no longer forbid
// a splitting of the table row.
// Special DoNotSplit case 1:
// Search for sections inside pRow:
@@ -1069,9 +1050,8 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
{
bTryToSplit = false;
}
- // <--
- // --> FME 2004-06-07 #i29771#
+ // #i29771#
// To avoid loops, we do some checks before actually trying to split
// the row. Maybe we should keep the next row in this table.
// Note: This is only done if we are at the beginning of our upper
@@ -1180,7 +1160,7 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
if ( pRow == pFirstNonHeadlineRow )
return false;
- // --> OD 2008-10-21 #i91764#
+ // #i91764#
// Ignore row span lines
SwRowFrm* pTmpRow = pFirstNonHeadlineRow;
while ( pTmpRow && pTmpRow->IsRowSpanLine() )
@@ -1191,7 +1171,6 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
{
return false;
}
- // <--
}
//
@@ -1417,9 +1396,8 @@ void MA_FASTCALL SwInvalidatePositions( SwFrm *pFrm, long nBottom )
if ( ((SwLayoutFrm*)pFrm)->Lower() )
{
::SwInvalidatePositions( ((SwLayoutFrm*)pFrm)->Lower(), nBottom);
- // --> OD 2004-11-05 #i26945#
+ // #i26945#
::lcl_InvalidateLowerObjs( *(static_cast<SwLayoutFrm*>(pFrm)) );
- // <--
}
}
else
@@ -1465,7 +1443,7 @@ void MA_FASTCALL SwInvalidateAll( SwFrm *pFrm, long nBottom )
(*fnRect->fnYDiff)( (pFrm->Frm().*fnRect->fnGetTop)(), nBottom ) < 0 ) );
}
-// --> collapsing borders FME 2005-05-27 #i29550#
+// #i29550#
void lcl_InvalidateAllLowersPrt( SwLayoutFrm* pLayFrm )
{
pLayFrm->_InvalidatePrt();
@@ -1509,7 +1487,7 @@ bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
while ( pCnt && pDontLeave->IsAnLower( pCnt ) )
{
- // --> OD 2004-11-23 #115759# - check, if a format of content frame is
+ // #115759# - check, if a format of content frame is
// possible. Thus, 'copy' conditions, found at the beginning of
// <SwCntntFrm::MakeAll(..)>, and check these.
const bool bFormatPossible = !pCnt->IsJoinLocked() &&
@@ -1531,14 +1509,13 @@ bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
if ( bFormatPossible && !bSkipContent )
{
bRet |= !pCnt->IsValid();
- // --> OD 2004-10-06 #i26945# - no extra invalidation of floating
+ // #i26945# - no extra invalidation of floating
// screen objects needed.
// Thus, delete call of method <SwFrm::InvalidateObjs( true )>
- // <--
pCnt->Calc();
// OD 2004-05-11 #i28701# - usage of new method <::FormatObjsAtFrm(..)>
// to format the floating screen objects
- // --> OD 2005-05-03 #i46941# - frame has to be valid
+ // #i46941# - frame has to be valid
// Note: frame could be invalid after calling its format, if it's locked.
OSL_ENSURE( !pCnt->IsTxtFrm() ||
pCnt->IsValid() ||
@@ -1546,11 +1523,10 @@ bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
"<SwCntntFrm::CalcLowers(..)> - text frame invalid and not locked." );
if ( pCnt->IsTxtFrm() && pCnt->IsValid() )
{
- // --> OD 2004-11-02 #i23129#, #i36347# - pass correct page frame to
+ // #i23129#, #i36347# - pass correct page frame to
// the object formatter
if ( !SwObjectFormatter::FormatObjsAtFrm( *pCnt,
*(pCnt->FindPageFrm()) ) )
- // <--
{
if ( pCnt->GetRegisteredIn() == pLoopControlCond )
++nLoopControlRuns;
@@ -1574,7 +1550,6 @@ bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
}
pCnt->GetUpper()->Calc();
}
- // <--
if( ! bAll && (*fnRect->fnYDiff)((pCnt->Frm().*fnRect->fnGetTop)(), nBottom) > 0 )
break;
pCnt = pCnt->GetNextCntntFrm();
@@ -1582,7 +1557,7 @@ bool SwCntntFrm::CalcLowers( SwLayoutFrm* pLay, const SwLayoutFrm* pDontLeave,
return bRet;
}
-// --> OD 2004-10-15 #i26945# - add parameter <_bOnlyRowsAndCells> to control
+// #i26945# - add parameter <_bOnlyRowsAndCells> to control
// that only row and cell frames are formatted.
sal_Bool MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm,
long nBottom,
@@ -1595,17 +1570,15 @@ sal_Bool MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm,
SWRECTFN( pFrm )
do
{
- // --> OD 2004-10-15 #i26945# - parameter <_bOnlyRowsAndCells> controls,
+ // #i26945# - parameter <_bOnlyRowsAndCells> controls,
// if only row and cell frames are formatted.
if ( pFrm->IsLayoutFrm() &&
( !_bOnlyRowsAndCells || pFrm->IsRowFrm() || pFrm->IsCellFrm() ) )
- // <--
{
- // --> FME 2006-02-23 #130744# An invalid locked table frame will
+ // #130744# An invalid locked table frame will
// not be calculated => It will not become valid =>
// Loop in lcl_RecalcRow(). Therefore we do not consider them for bRet.
bRet |= !pFrm->IsValid() && ( !pFrm->IsTabFrm() || !static_cast<SwTabFrm*>(pFrm)->IsJoinLocked() );
- // <--
pFrm->Calc();
if( static_cast<SwLayoutFrm*>(pFrm)->Lower() )
bRet |= lcl_InnerCalcLayout( static_cast<SwLayoutFrm*>(pFrm)->Lower(), nBottom);
@@ -1631,7 +1604,7 @@ sal_Bool MA_FASTCALL lcl_InnerCalcLayout( SwFrm *pFrm,
void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
{
- // --> OD 2004-10-05 #i26945# - For correct appliance of the 'straightforward
+ // #i26945# - For correct appliance of the 'straightforward
// object positioning process, it's needed to notify that the page frame,
// on which the given layout frame is in, is in its layout process.
SwPageFrm* pPageFrm = rRow.FindPageFrm();
@@ -1639,7 +1612,6 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
pPageFrm->SetLayoutInProgress( true );
else
pPageFrm = 0L;
- // <--
// FME 2007-08-30 #i81146# new loop control
sal_uInt16 nLoopControlRuns_1 = 0;
@@ -1673,10 +1645,9 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
if( bCheck )
{
- // --> OD 2004-11-23 #115759# - force another format of the
+ // #115759# - force another format of the
// lowers, if at least one of it was invalid.
bCheck = SwCntntFrm::CalcLowers( &rRow, rRow.GetUpper(), nBottom, true );
- // <--
// NEW TABLES
// First we calculate the cells with row span of < 1, afterwards
@@ -1723,10 +1694,9 @@ void MA_FASTCALL lcl_RecalcRow( SwRowFrm& rRow, long nBottom )
break;
} while( true );
- // --> OD 2004-10-05 #i26945#
+ // #i26945#
if ( pPageFrm )
pPageFrm->SetLayoutInProgress( false );
- // <--
}
void MA_FASTCALL lcl_RecalcTable( SwTabFrm& rTab,
@@ -1750,7 +1720,7 @@ void MA_FASTCALL lcl_RecalcTable( SwTabFrm& rTab,
// GetIndPrev(), which did not work correctly for #i5947#
bool lcl_NoPrev( const SwFrm& rFrm )
{
- // --> OD 2007-09-04 #i79774#, #b6596954#
+ // #i79774#
// skip empty sections on investigation of direct previous frame.
// use information, that at least one empty section is skipped in the following code.
bool bSkippedDirectPrevEmptySection( false );
@@ -1776,7 +1746,6 @@ bool lcl_NoPrev( const SwFrm& rFrm )
{
return true;
}
- // <--
// I do not have a direct prev, but I have an indirect prev.
// In section frames I have to check if I'm located inside
@@ -1800,7 +1769,7 @@ bool lcl_NoPrev( const SwFrm& rFrm )
#define KEEPTAB ( !GetFollow() && !IsFollow() )
-// --> OD 2005-09-28 #b6329202# - helper method to find next content frame of
+// - helper method to find next content frame of
// a table frame and format it to assure keep attribute.
// method return true, if a next content frame is formatted.
// Precondition: The given table frame hasn't a follow and isn't a follow.
@@ -1922,7 +1891,7 @@ void SwTabFrm::MakeAll()
// table rows.
bool bTryToSplit = true;
- // --> FME 2006-02-16 #131283#
+ // #131283#
// Indicates that two individual rows may keep together, based on the keep
// attribute set at the first paragraph in the first cell.
const bool bTableRowKeep = !bDontSplit && GetFmt()->GetDoc()->get(IDocumentSettingAccess::TABLE_ROW_KEEP);
@@ -1991,11 +1960,10 @@ void SwTabFrm::MakeAll()
{
bMovedFwd = sal_True;
bCalcLowers = sal_True;
- // --> OD 2009-08-12 #i99267#
+ // #i99267#
// reset <bSplit> after forward move to assure that follows
// can be joined, if further space is available.
bSplit = sal_False;
- // <--
}
Point aOldPos( (Frm().*fnRect->fnGetPos)() );
@@ -2023,11 +1991,10 @@ void SwTabFrm::MakeAll()
pPre->GetAttrSet()->GetKeep().GetValue()) )
{
bCalcLowers = sal_True;
- // --> OD 2009-03-06 #i99267#
+ // #i99267#
// reset <bSplit> after forward move to assure that follows
// can be joined, if further space is available.
bSplit = sal_False;
- // <--
}
}
@@ -2121,7 +2088,7 @@ void SwTabFrm::MakeAll()
bLowersFormatted = sal_True;
if ( bKeep && KEEPTAB )
{
- // --> OD 2005-09-28 #b6329202#
+ //
// Consider case that table is inside another table,
// because it has to be avoided, that superior table
// is formatted.
@@ -2132,7 +2099,6 @@ void SwTabFrm::MakeAll()
{
bValidPos = sal_False;
}
- // <--
}
}
}
@@ -2293,13 +2259,12 @@ void SwTabFrm::MakeAll()
{
delete pAccess;
- // --> OD 2005-09-28 #b6329202#
+ //
// Consider case that table is inside another table, because
// it has to be avoided, that superior table is formatted.
// Thus, find next content, table or section and, if a section
// is found, get its first content.
const SwFrm* pTmpNxt = lcl_FormatNextCntntForKeep( this );
- // <--
pAccess= new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
@@ -2382,7 +2347,7 @@ void SwTabFrm::MakeAll()
( !bTableRowKeep || pFirstNonHeadlineRow->GetNext() || !pFirstNonHeadlineRow->ShouldRowKeepWithNext() ) &&
( !bDontSplit || !pIndPrev ) )
{
- // --> FME 2004-06-03 #i29438#
+ // #i29438#
// Special DoNotSplit case:
// We better avoid splitting of a row frame if we are inside a columned
// section which has a height of 0, because this is not growable and thus
@@ -2393,7 +2358,6 @@ void SwTabFrm::MakeAll()
{
bTryToSplit = false;
}
- // <--
// 1. Try: bTryToSplit = true => Try to split the row.
// 2. Try: bTryToSplit = false => Split the table between the rows.
@@ -2419,7 +2383,7 @@ void SwTabFrm::MakeAll()
// Set to false again as early as possible.
bLastRowHasToMoveToFollow = false;
- // --> FME 2005-08-03 #i52781#
+ // #i52781#
// YaSC - Yet another special case:
// If our upper is inside a table cell which is not allowed
// to split, we do not try to split:
@@ -2431,7 +2395,6 @@ void SwTabFrm::MakeAll()
if ( pTmpRow && !static_cast<const SwRowFrm*>(pTmpRow)->IsRowSplitAllowed() )
continue;
}
- // <--
sal_uInt16 nMinNumOfLines = nRepeat;
@@ -2476,7 +2439,7 @@ void SwTabFrm::MakeAll()
if( !bTryToSplit && !bSplitError && nUnSplitted > 0 )
--nUnSplitted;
- // --> FME 2004-06-09 #i29771# Two tries to split the table:
+ // #i29771# Two tries to split the table
// If an error occurred during splitting. We start a second
// try, this time without splitting of table rows.
if ( bSplitError )
@@ -2485,12 +2448,11 @@ void SwTabFrm::MakeAll()
RemoveFollowFlowLine();
}
- // --> FME 2005-02-10 #119477#
+ // #119477#
// If splitting the table was successfull or not,
// we do not want to have 'empty' follow tables.
if ( GetFollow() && !GetFollow()->GetFirstNonHeadlineRow() )
Join();
- // <--
// We want to restore the situation before the failed
@@ -2504,7 +2466,6 @@ void SwTabFrm::MakeAll()
bTryToSplit = false;
continue;
}
- // <--
bTryToSplit = !bSplitError;
@@ -2512,7 +2473,7 @@ void SwTabFrm::MakeAll()
//Follow gleich gueltig gemacht werden.
if ( GetFollow() )
{
- // --> OD 2007-11-30 #i80924#
+ // #i80924#
// After a successful split assure that the first row
// is invalid. When graphics are present, this isn't hold.
// Note: defect i80924 could also be fixed, if it is
@@ -2522,7 +2483,6 @@ void SwTabFrm::MakeAll()
{
GetFollow()->GetLower()->InvalidatePos();
}
- // <--
SWRECTFNX( GetFollow() )
static sal_uInt8 nStack = 0;
@@ -2538,20 +2498,18 @@ void SwTabFrm::MakeAll()
pAttrs = pAccess->Get();
((SwTabFrm*)GetFollow())->SetLowersFormatted(sal_False);
- // --> OD 2005-03-30 #i43913# - lock follow table
+ // #i43913# - lock follow table
// to avoid its formatting during the format of
// its content.
const bool bOldJoinLock = GetFollow()->IsJoinLocked();
GetFollow()->LockJoin();
- // <--
::lcl_RecalcRow( static_cast<SwRowFrm&>(*GetFollow()->Lower()),
(GetFollow()->GetUpper()->Frm().*fnRectX->fnGetBottom)() );
- // --> OD 2005-03-30 #i43913#
- // --> FME 2006-04-05 #i63632# Do not unlock the
+ // #i43913#
+ // #i63632# Do not unlock the
// follow if it wasn't locked before.
if ( !bOldJoinLock )
GetFollow()->UnlockJoin();
- // <--
if ( !GetFollow()->GetFollow() )
{
@@ -2597,21 +2555,19 @@ void SwTabFrm::MakeAll()
((SwSectionFrm*)GetUpper()->GetUpper()->GetUpper())->MoveAllowed(this) )
bMovedFwd = sal_False;
- // --> FME 2004-06-09 #i29771# Reset bTryToSplit flag on change of upper
+ // #i29771# Reset bTryToSplit flag on change of upper
const SwFrm* pOldUpper = GetUpper();
- // <--
//Mal sehen ob ich irgenwo Platz finde...
if ( !bMovedFwd && !MoveFwd( bMakePage, sal_False ) )
bMakePage = sal_False;
- // --> FME 2004-06-09 #i29771# Reset bSplitError flag on change of upper
+ // #i29771# Reset bSplitError flag on change of upper
if ( GetUpper() != pOldUpper )
{
bTryToSplit = true;
nUnSplitted = 5;
}
- // <--
SWREFRESHFN( this )
bMovedFwd = bCalcLowers = sal_True;
@@ -2644,7 +2600,7 @@ void SwTabFrm::MakeAll()
if ( bCalcLowers && IsValid() )
{
- // --> OD 2005-05-11 #i44910# - format of lower frames unnecessary
+ // #i44910# - format of lower frames unnecessary
// and can cause layout loops, if table doesn't fit and isn't
// allowed to split.
SwTwips nDistToUpperPrtBottom =
@@ -2661,7 +2617,6 @@ void SwTabFrm::MakeAll()
OSL_FAIL( "debug assertion: <SwTabFrm::MakeAll()> - format of table lowers suppressed by fix i44910" );
}
#endif
- // <--
}
} //while ( !bValidPos || !bValidSize || !bValidPrtArea )
@@ -2704,7 +2659,6 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
const IDocumentSettingAccess* pIDSA = GetFmt()->getIDocumentSettingAccess();
const bool bWrapAllowed = pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) ||
( !IsInFtn() && 0 == FindFooterOrHeader() );
- // <--
if ( pPage->GetSortedObjs() && bWrapAllowed )
{
@@ -2723,7 +2677,7 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
{
SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pAnchoredObj);
const SwRect aFlyRect = pFly->GetObjRectWithSpaces();
- // --> OD 2004-10-07 #i26945# - correction of conditions,
+ // #i26945# - correction of conditions,
// if Writer fly frame has to be considered:
// - no need to check, if top of Writer fly frame differs
// from WEIT_WECH, because its also check, if the Writer
@@ -2741,10 +2695,9 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
// text frame has already changed its page.
const SwTxtFrm* pAnchorCharFrm = pFly->FindAnchorCharFrm();
bool bConsiderFly =
- // --> OD 2005-04-06 #i46807# - do not consider invalid
+ // #i46807# - do not consider invalid
// Writer fly frames.
pFly->IsValid() &&
- // <--
// fly anchored at character
pFly->IsFlyAtCntFrm() &&
// fly overlaps with corresponding table rectangle
@@ -2756,14 +2709,13 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
// table isn't lower of fly
!pFly->IsAnLower( this ) &&
// fly is lower of fly, the table is in
- // --> OD 2005-05-31 #123274# - correction:
+ // #123274# - correction
// assure that fly isn't a lower of a fly, the table isn't in.
// E.g., a table in the body doesn't wrap around a graphic,
// which is inside a frame.
( ( !pMyFly ||
pMyFly->IsAnLower( pFly ) ) &&
pMyFly == pFly->GetAnchorFrmContainingAnchPos()->FindFlyFrm() ) &&
- // <--
// anchor frame not on following page
pPage->GetPhyPageNum() >=
pFly->GetAnchorFrm()->FindPageFrm()->GetPhyPageNum() &&
@@ -2778,16 +2730,14 @@ sal_Bool SwTabFrm::CalcFlyOffsets( SwTwips& rUpper,
const SwFrm* pThisHeaderFooterFrm = FindFooterOrHeader();
if ( pFlyHeaderFooterFrm != pThisHeaderFooterFrm &&
- // --> FME 2007-07-02 #148493# If bConsiderWrapOnObjPos is set,
+ // #148493# If bConsiderWrapOnObjPos is set,
// we want to consider the fly if it is located in the header and
// the table is located in the body:
( !bConsiderWrapOnObjPos || 0 != pThisHeaderFooterFrm || !pFlyHeaderFooterFrm->IsHeaderFrm() ) )
bConsiderFly = false;
- // <--
}
if ( bConsiderFly )
- // <--
{
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
const SwFmtHoriOrient &rHori= pFly->GetFmt()->GetHoriOrient();
@@ -2866,7 +2816,7 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
long nRightOffset = Max( 0L, nTmpRight );
SwTwips nLower = pAttrs->CalcBottomLine();
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
if ( IsCollapsingBorders() )
nLower += GetBottomLineSize();
// <-- collapsing
@@ -3040,14 +2990,13 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
OSL_FAIL( "Ungueltige orientation fuer Table." );
}
- // --> OD 2004-07-15 #i26250# - extend bottom printing area, if table
+ // #i26250# - extend bottom printing area, if table
// is last content inside a table cell.
if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS) &&
GetUpper()->IsInTab() && !GetIndNext() )
{
nLower += pAttrs->GetULSpace().GetLower();
}
- // <--
(this->*fnRect->fnSetYMargins)( nUpper, nLower );
if( (nMax - MINLAY) < (nLeftSpacing + nRightSpacing) )
(this->*fnRect->fnSetXMargins)( 0, 0 );
@@ -3157,7 +3106,7 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
if ( GetNext()->IsCntntFrm() )
GetNext()->InvalidatePage( pPage );
}
- // --> OD 2004-07-05 #i28701# - Due to the new object positioning the
+ // #i28701# - Due to the new object positioning the
// frame on the next page/column can flow backward (e.g. it was moved
// forward due to the positioning of its objects ). Thus, invalivate this
// next frame, if document compatibility option 'Consider wrapping style
@@ -3166,7 +3115,6 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
InvalidateNextPos();
}
- // <--
_InvalidateAll();
InvalidatePage( pPage );
SetComplete();
@@ -3506,7 +3454,7 @@ sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &r
if( Abs( nNewWidth - nOldWidth ) < 2 )
{
if( sal_False ==
- ( bMoveAnyway = BwdMoveNecessary( pOldPage, Frm() ) > 1 ) )
+ ( bMoveAnyway = (BwdMoveNecessary( pOldPage, Frm() ) > 1) ) )
{
SwRect aRect( pNewUpper->Prt() );
aRect.Pos() += pNewUpper->Frm().Pos();
@@ -3519,7 +3467,7 @@ sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &r
}
bMoveAnyway = BwdMoveNecessary( pNewPage, aRect) > 1;
- // --> FME 2006-01-20 #i54861# Due to changes made in PrepareMake,
+ // #i54861# Due to changes made in PrepareMake,
// the tabfrm may not have a correct position. Therefore
// it is possible that pNewUpper->Prt().Height == 0. In this
// case the above calculation of nSpace might give wrong
@@ -3529,7 +3477,6 @@ sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &r
const SwTwips nTmpSpace = (aRect.*fnRectX->fnGetHeight)();
if ( (pNewUpper->Prt().*fnRectX->fnGetHeight)() > 0 || nTmpSpace <= 0 )
nSpace = nTmpSpace;
- // <--
const ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
@@ -3546,7 +3493,7 @@ sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &r
return rReformat = sal_True;
else if ( !bLockBackMove && nSpace > 0 )
{
- // --> OD 2004-10-05 #i26945# - check, if follow flow line
+ // #i26945# - check, if follow flow line
// contains frame, which are moved forward due to its object
// positioning.
SwRowFrm* pFirstRow = GetFirstNonHeadlineRow();
@@ -3557,16 +3504,14 @@ sal_Bool SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool &r
{
return sal_False;
}
- // <--
SwTwips nTmpHeight = CalcHeightOfFirstContentLine();
- // --> FME 2005-01-17 #118840#
+ // #118840#
// For some mysterious reason, I changed the good old
// 'return nHeight <= nSpace' to 'return nTmpHeight < nSpace'.
// This obviously results in problems with table frames in
// sections. Remember: Every twip is sacred.
return nTmpHeight <= nSpace;
- // <--
}
}
return sal_False;
@@ -3639,12 +3584,11 @@ void SwTabFrm::Cut()
{
OSL_ENSURE( !pUp->IsFtnFrm(), "Tabelle in Fussnote." );
SwSectionFrm *pSct = 0;
- // --> OD 2006-01-04 #126020# - adjust check for empty section
- // --> OD 2006-02-01 #130797# - correct fix #126020#
+ // #126020# - adjust check for empty section
+ // #130797# - correct fix #126020#
if ( !pUp->Lower() && pUp->IsInSct() &&
!(pSct = pUp->FindSctFrm())->ContainsCntnt() &&
!pSct->ContainsAny( true ) )
- // <--
{
if ( pUp->GetUpper() )
{
@@ -3752,7 +3696,7 @@ SwRowFrm::SwRowFrm( const SwTableLine &rLine, SwFrm* pSib, bool bInsertContent )
SwLayoutFrm( rLine.GetFrmFmt(), pSib ),
pTabLine( &rLine ),
pFollowRow( 0 ),
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
mnTopMarginForLowers( 0 ),
mnBottomMarginForLowers( 0 ),
mnBottomLineSize( 0 ),
@@ -3824,10 +3768,9 @@ void SwRowFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
const bool bInFirstNonHeadlineRow = pTab->IsFollow() &&
this == pTab->GetFirstNonHeadlineRow();
- // --> FME 2004-10-27 #i35063#
+ // #i35063#
// Invalidation required is pRow is last row
if ( bInFirstNonHeadlineRow || !GetNext() )
- // <--
{
if ( bInFirstNonHeadlineRow )
pTab = pTab->FindMaster();
@@ -3866,13 +3809,13 @@ long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm )
((SwSectionFrm*)pFrm)->ContainsCntnt() : pFrm;
while( pTmp )
{
- // --> OD 2004-10-08 #i26945# - consider follow text frames
+ // #i26945# - consider follow text frames
const SwSortedObjs* pObjs( 0L );
bool bIsFollow( false );
if ( pTmp->IsTxtFrm() && static_cast<const SwTxtFrm*>(pTmp)->IsFollow() )
{
const SwFrm* pMaster;
- // --> FME 2005-04-01 #i46450# Master does not necessarily have
+ // #i46450# Master does not necessarily have
// to exist if this function is called from JoinFrm() ->
// Cut() -> Shrink()
const SwTxtFrm* pTmpFrm = static_cast<const SwTxtFrm*>(pTmp);
@@ -3894,20 +3837,18 @@ long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm )
pObjs = pTmp->GetDrawObjs();
}
if ( pObjs )
- // <--
{
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
- // --> OD 2004-10-08 #i26945# - if <pTmp> is follow, the
+ // #i26945# - if <pTmp> is follow, the
// anchor character frame has to be <pTmp>.
if ( bIsFollow &&
const_cast<SwAnchoredObject*>(pAnchoredObj)->FindAnchorCharFrm() != pTmp )
{
continue;
}
- // <--
- // --> OD 2004-10-04 #i26945# - consider also drawing objects
+ // #i26945# - consider also drawing objects
{
// OD 30.09.2003 #i18732# - only objects, which follow
// the text flow have to be considered.
@@ -3936,7 +3877,7 @@ long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm )
nHeight = Max( nHeight, nDistOfFlyBottomToAnchorTop + nFrmDiff -
(pFrm->Frm().*fnRect->fnGetHeight)() );
- // --> FME 2006-01-24 #i56115# The first height calculation
+ // #i56115# The first height calculation
// gives wrong results if pFrm->Prt().Y() > 0. We do
// a second calculation based on the actual rectangles of
// pFrm and pAnchoredObj, and use the maximum of the results.
@@ -3948,11 +3889,9 @@ long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm )
(pFrm->Frm().*fnRect->fnGetBottom)() );
nHeight = Max( nHeight, nDistOfFlyBottomToAnchorTop2 );
- // <--
}
}
}
- // <--
}
}
if( !pFrm->IsSctFrm() )
@@ -3970,7 +3909,7 @@ SwTwips lcl_CalcTopAndBottomMargin( const SwLayoutFrm& rCell, const SwBorderAttr
SwTwips nTopSpace = 0;
SwTwips nBottomSpace = 0;
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
if ( pTab->IsCollapsingBorders() && rCell.Lower() && !rCell.Lower()->IsRowFrm() )
{
nTopSpace = ((SwRowFrm*)rCell.GetUpper())->GetTopMarginForLowers();
@@ -3995,7 +3934,7 @@ SwTwips lcl_CalcTopAndBottomMargin( const SwLayoutFrm& rCell, const SwBorderAttr
}
-// --> OD 2004-10-04 #i26945# - add parameter <_bConsiderObjs> in order to
+// #i26945# - add parameter <_bConsiderObjs> in order to
// control, if floating screen objects have to be considered for the minimal
// cell height.
SwTwips MA_FASTCALL lcl_CalcMinCellHeight( const SwLayoutFrm *_pCell,
@@ -4014,22 +3953,20 @@ SwTwips MA_FASTCALL lcl_CalcMinCellHeight( const SwLayoutFrm *_pCell,
// and else-body
if ( pLow->IsRowFrm() )
{
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
nHeight += ::lcl_CalcMinRowHeight( static_cast<const SwRowFrm*>(pLow),
_bConsiderObjs );
- // <--
}
else
{
long nLowHeight = (pLow->Frm().*fnRect->fnGetHeight)();
nHeight += nLowHeight;
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
if ( _bConsiderObjs )
{
nFlyAdd = Max( 0L, nFlyAdd - nLowHeight );
nFlyAdd = Max( nFlyAdd, ::CalcHeightWidthFlys( pLow ) );
}
- // <--
}
pLow = pLow->GetNext();
@@ -4055,7 +3992,7 @@ SwTwips MA_FASTCALL lcl_CalcMinCellHeight( const SwLayoutFrm *_pCell,
}
// OD 2004-02-18 #106629# - correct type of 1st parameter
-// --> OD 2004-10-04 #i26945# - add parameter <_bConsiderObjs> in order to control,
+// #i26945# - add parameter <_bConsiderObjs> in order to control,
// if floating screen objects have to be considered for the minimal cell height
SwTwips MA_FASTCALL lcl_CalcMinRowHeight( const SwRowFrm* _pRow,
const sal_Bool _bConsiderObjs )
@@ -4112,7 +4049,7 @@ SwTwips MA_FASTCALL lcl_CalcMinRowHeight( const SwRowFrm* _pRow,
return nHeight;
}
-// --> collapsing borders FME 2005-05-27 #i29550#
+// #i29550#
// Calculate the maximum of (TopLineSize + TopLineDist) over all lowers:
sal_uInt16 lcl_GetTopSpace( const SwRowFrm& rRow )
@@ -4224,7 +4161,7 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
aPrt.Width ( aFrm.Width() );
aPrt.Height( aFrm.Height() );
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
// Here we calculate the top-printing area for the lower cell frames
SwTabFrm* pTabFrm = FindTabFrm();
if ( pTabFrm->IsCollapsingBorders() )
@@ -4237,7 +4174,7 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
const SwRowFrm* pPreviousRow = 0;
- // --> FME 2004-09-14 #i32456#
+ // #i32456#
// In order to calculate the top printing area for the lower cell
// frames, we have to find the 'previous' row frame and compare
// the bottom values of the 'previous' row with the 'top' values
@@ -4279,19 +4216,17 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
SwIterator<SwRowFrm,SwFmt> aIter( *pPrevTabLine->GetFrmFmt() );
for ( SwRowFrm* pRow = aIter.First(); pRow; pRow = aIter.Next() )
{
- // --> OD 2004-11-23 #115759# - do *not* take repeated
+ // #115759# - do *not* take repeated
// headlines, because during split of table it can be
// invalid and thus can't provide correct border values.
if ( pRow->GetTabLine() == pPrevTabLine &&
!pRow->IsRepeatedHeadline() )
- // <--
{
pPreviousRow = pRow;
break;
}
}
}
- // <--
sal_uInt16 nTopPrtMargin = nTopSpace;
if ( pPreviousRow )
@@ -4342,10 +4277,9 @@ void SwRowFrm::Format( const SwBorderAttrs *pAttrs )
const SwTwips nDiff = (Frm().*fnRect->fnGetHeight)() -
( HasFixSize() && !IsRowSpanLine()
? pAttrs->GetSize().Height()
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
: ::lcl_CalcMinRowHeight( this,
FindTabFrm()->IsConsiderObjsForMinCellHeight() ) );
- // <--
if ( nDiff )
{
bFixSize = sal_False;
@@ -4491,7 +4425,7 @@ void SwRowFrm::Cut()
pTab->FindMaster()->InvalidatePos();
}
- // --> OD 2010-02-17 #i103961#
+ // #i103961#
// notification for accessibility
{
SwRootFrm *pRootFrm = getRootFrm();
@@ -4512,7 +4446,6 @@ void SwRowFrm::Cut()
}
}
}
- // <--
SwLayoutFrm::Cut();
}
@@ -4621,10 +4554,9 @@ SwTwips SwRowFrm::ShrinkFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
// minimum height.
if( nMinHeight < (Frm().*fnRect->fnGetHeight)() )
{
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
OSL_ENSURE( FindTabFrm(), "<SwRowFrm::ShrinkFrm(..)> - no table frame -> crash." );
const bool bConsiderObjs( FindTabFrm()->IsConsiderObjsForMinCellHeight() );
- // <--
nMinHeight = lcl_CalcMinRowHeight( this, bConsiderObjs );
}
@@ -4821,7 +4753,7 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
for ( sal_uInt16 i = 0; i < pFrm->GetDrawObjs()->Count(); ++i )
{
SwAnchoredObject* pAnchoredObj = (*pFrm->GetDrawObjs())[i];
- // --> OD 2004-10-08 #i26945# - check, if anchored object
+ // #i26945# - check, if anchored object
// is lower of layout frame by checking, if the anchor
// frame, which contains the anchor position, is a lower
// of the layout frame.
@@ -4829,8 +4761,7 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
{
continue;
}
- // <--
- // --> OD 2005-08-08 #i52904# - distinguish between anchored
+ // #i52904# - distinguish between anchored
// objects, whose vertical position depends on its anchor
// frame and whose vertical position is independent
// from its anchor frame.
@@ -4854,13 +4785,12 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
// which are anchored to-paragraph/to-character, if
// the wrapping style influence has to be considered
// on the object positioning.
- // --> OD 2005-08-08 #i52904# - no direct move of objects,
+ // #i52904# - no direct move of objects,
// whose vertical position doesn't depend on anchor frame.
const bool bDirectMove =
WEIT_WECH != pFly->Frm().Top() &&
bVertPosDepOnAnchor &&
!pFly->ConsiderObjWrapInfluenceOnObjPos();
- // <--
if ( bDirectMove )
{
(pFly->Frm().*fnRect->fnSubTop)( -lDiff );
@@ -4870,22 +4800,19 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
// instance, which represents the Writer fly frame in
// the drawing layer
pFly->GetVirtDrawObj()->SetChanged();
- // <--
- // --> OD 2006-10-13 #i58280#
+ // #i58280#
pFly->InvalidateObjRectWithSpaces();
- // <--
}
if ( pFly->IsFlyInCntFrm() )
{
static_cast<SwFlyInCntFrm*>(pFly)->AddRefOfst( lDiff );
- // --> OD 2004-12-02 #115759# - reset current relative
+ // #115759# - reset current relative
// position to get re-positioned, if not directly moved.
if ( !bDirectMove )
{
pAnchoredObj->SetCurrRelPos( Point( 0, 0 ) );
}
- // <--
}
else if( pFly->IsAutoPos() )
{
@@ -4894,18 +4821,17 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
// <mnLastTopOfLine> has also been adjusted.
pFly->AddLastTopOfLineY( lDiff );
}
- // --> OD 2004-11-05 #i26945# - re-registration at
+ // #i26945# - re-registration at
// page frame of anchor frame, if table frame isn't
// a follow table and table frame isn't in its
// rebuild of last line.
const SwTabFrm* pTabFrm = pLay->FindTabFrm();
- // --> OD 2004-11-23 #115759#
+ // #115759#
// - save: check, if table frame is found.
if ( pTabFrm &&
!( pTabFrm->IsFollow() &&
pTabFrm->FindMaster()->IsRebuildLastLine() ) &&
pFly->IsFlyFreeFrm() )
- // <--
{
SwPageFrm* pPageFrm = pFly->GetPageFrm();
SwPageFrm* pPageOfAnchor = pFrm->FindPageFrm();
@@ -4918,28 +4844,26 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
pPageOfAnchor->AppendFlyToPage( pFly );
}
}
- // <--
// OD 2004-05-11 #i28701# - Because of the introduction
// of new positionings and alignments (e.g. aligned at
// page area, but anchored at-character), the position
// of the Writer fly frame has to be invalidated.
pFly->InvalidatePos();
- // --> OD 2004-11-04 #i26945# - follow-up of #i3317#
+ // #i26945# - follow-up of #i3317#
// No arrangement of lowers, if Writer fly frame isn't
// moved
if ( bDirectMove &&
::lcl_ArrangeLowers( pFly,
(pFly->*fnRect->fnGetPrtTop)(),
bInva ) )
- // <--
{
pFly->SetCompletePaint();
}
}
else if ( pAnchoredObj->ISA(SwAnchoredDrawObject) )
{
- // --> OD 2004-11-05 #i26945#
+ // #i26945#
const SwTabFrm* pTabFrm = pLay->FindTabFrm();
if ( pTabFrm &&
!( pTabFrm->IsFollow() &&
@@ -4959,11 +4883,11 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
pPageOfAnchor->AppendDrawObjToPage( *pAnchoredObj );
}
}
- // --> OD 2004-07-01 #i28701# - adjust last character
+ // #i28701# - adjust last character
// rectangle and last top of line.
pAnchoredObj->AddLastCharY( lDiff );
pAnchoredObj->AddLastTopOfLineY( lDiff );
- // --> OD 2005-08-08 #i52904# - re-introduce direct move
+ // #i52904# - re-introduce direct move
// of drawing objects
const bool bDirectMove =
static_cast<const SwDrawFrmFmt&>(pAnchoredObj->GetFrmFmt()).IsPosAttrSet() &&
@@ -4980,11 +4904,9 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
{
pAnchoredObj->DrawObj()->Move( Size( 0, lDiff ) );
}
- // --> OD 2006-10-13 #i58280#
+ // #i58280#
pAnchoredObj->InvalidateObjRectWithSpaces();
- // <--
}
- // <--
pAnchoredObj->InvalidateObjPos();
}
else
@@ -5006,15 +4928,14 @@ sal_Bool lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, sal_Bool bInva )
// not fit into the cell anymore:
SwTwips nDistanceToUpperPrtBottom =
(pFrm->Frm().*fnRect->fnBottomDist)( (pLay->*fnRect->fnGetPrtBottom)());
- // --> OD 2006-01-19 #i56146# - Revise fix of issue #i26945#
+ // #i56146# - Revise fix of issue #i26945#
// do *not* consider content inside fly frames, if it's an undersized paragraph.
- // --> OD 2004-10-08 #i26945# - consider content inside fly frames
+ // #i26945# - consider content inside fly frames
if ( nDistanceToUpperPrtBottom < 0 &&
( ( pFrm->IsInFly() &&
( !pFrm->IsTxtFrm() ||
!static_cast<SwTxtFrm*>(pFrm)->IsUndersized() ) ) ||
pFrm->IsInSplitTableRow() ) )
- // <--
{
pFrm->InvalidatePos();
}
@@ -5038,7 +4959,7 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
if ( Lower() )
{
SwTwips nTopSpace, nBottomSpace, nLeftSpace, nRightSpace;
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
if ( pTab->IsCollapsingBorders() && !Lower()->IsRowFrm() )
{
const SvxBoxItem& rBoxItem = pAttrs->GetBox();
@@ -5060,11 +4981,10 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
(this->*fnRect->fnSetYMargins)( nTopSpace, nBottomSpace );
}
}
- // --> OD 2004-10-04 #i26945#
+ // #i26945#
long nRemaining = GetTabBox()->getRowSpan() >= 1 ?
::lcl_CalcMinCellHeight( this, pTab->IsConsiderObjsForMinCellHeight(), pAttrs ) :
0;
- // <--
if ( !bValidSize )
{
bValidSize = sal_True;
@@ -5187,12 +5107,10 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
SwPageFrm* pPg = 0;
if ( !FindTabFrm()->IsRebuildLastLine() && text::VertOrientation::NONE != rOri.GetVertOrient() &&
- // --> OD 2008-07-16 #158225# no vertical alignment of covered cells
+ // #158225# no vertical alignment of covered cells
!IsCoveredCell() &&
- // <--
- // --> FME 2004-06-29 #116532# Do not consider vertical alignment in grid mode
+ // #116532# Do not consider vertical alignment in grid mode
!(pPg = FindPageFrm())->HasGrid() )
- // <--
{
if ( !Lower()->IsCntntFrm() && !Lower()->IsSctFrm() && !Lower()->IsTabFrm() )
{
@@ -5201,11 +5119,10 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
return;
}
sal_Bool bVertDir = sal_True;
- // --> OD 2005-03-30 #i43913# - no vertical alignment, if wrapping
+ // #i43913# - no vertical alignment, if wrapping
// style influence is considered on object positioning and
// an object is anchored inside the cell.
const bool bConsiderWrapOnObjPos( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::CONSIDER_WRAP_ON_OBJECT_POSITION) );
- // <--
//Keine Ausrichtung wenn Rahmen mit Umlauf in die Zelle ragen.
if ( pPg->GetSortedObjs() )
{
@@ -5231,17 +5148,16 @@ void SwCellFrm::Format( const SwBorderAttrs *pAttrs )
}
const SwFrm* pAnch = pAnchoredObj->GetAnchorFrm();
- // --> OD 2005-03-30 #i43913#
- // --> OD 2005-08-08 #i52904# - no vertical alignment,
+ // #i43913#
+ // #i52904# - no vertical alignment,
// if object, anchored inside cell, has temporarly
// consider its wrapping style on object positioning.
- // --> FME 2006-02-01 #i58806# - no vertical alignment
+ // #i58806# - no vertical alignment
// if object does not follow the text flow.
if ( bConsiderWrapOnObjPos ||
!IsAnLower( pAnch ) ||
pAnchoredObj->IsTmpConsiderWrapInfluence() ||
!rAnchoredObjFrmFmt.GetFollowTextFlow().GetValue() )
- // <--
{
bVertDir = sal_False;
break;
@@ -5336,7 +5252,7 @@ void SwCellFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
CheckDirChange();
}
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
if ( bAttrSetChg &&
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_BOX, sal_False, &pItem ) )
{
@@ -5379,7 +5295,7 @@ long SwCellFrm::GetLayoutRowSpan() const
return nRet;
}
-// --> OD 2010-02-17 #i103961#
+// #i103961#
void SwCellFrm::Cut()
{
// notification for accessibility
@@ -5397,7 +5313,6 @@ void SwCellFrm::Cut()
SwLayoutFrm::Cut();
}
-// <--
//
// Helper functions for repeated headlines:
@@ -5468,7 +5383,7 @@ bool SwTabFrm::IsLayoutSplitAllowed() const
return GetFmt()->GetLayoutSplit().GetValue();
}
-// --> collapsing borders FME 2005-05-27 #i29550#
+// #i29550#
sal_uInt16 SwTabFrm::GetBottomLineSize() const
{
@@ -5479,9 +5394,8 @@ sal_uInt16 SwTabFrm::GetBottomLineSize() const
const SwFrm* pTmp = GetLastLower();
- // --> FME 2005-12-07 #124755# Try to make code robust:
+ // #124755# Try to make code robust
if ( !pTmp ) return 0;
- // <--
return static_cast<const SwRowFrm*>(pTmp)->GetBottomLineSize();
}
@@ -5531,13 +5445,12 @@ SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrm& rSourceLine )
if ( pTmp )
{
SwTwips nTmpHeight = USHRT_MAX;
- // --> FME 2004-09-14 #i32456# Consider lower row frames
+ // #i32456# Consider lower row frames
if ( pTmp->IsRowFrm() )
{
const SwRowFrm* pTmpSourceRow = (SwRowFrm*)pCurrSourceCell->Lower();
nTmpHeight = lcl_CalcHeightOfFirstContentLine( *pTmpSourceRow );
}
- // <--
if ( pTmp->IsTabFrm() )
{
nTmpHeight = ((SwTabFrm*)pTmp)->CalcHeightOfFirstContentLine();
@@ -5567,19 +5480,18 @@ SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrm& rSourceLine )
pFrm = pFrm->GetNext();
}
- // --> FME, OD 2004-07-15 #i26831#, #i26520#
+ // #i26831#, #i26520#
// The additional lower space of the current last.
- // --> OD 2004-11-25 #115759# - do *not* consider the
+ // #115759# - do *not* consider the
// additional lower space for 'master' text frames
if ( pLast && pLast->IsFlowFrm() &&
( !pLast->IsTxtFrm() ||
!static_cast<const SwTxtFrm*>(pLast)->GetFollow() ) )
- // <--
{
nReal += SwFlowFrm::CastFlowFrm(pLast)->CalcAddLowerSpaceAsLastInTableCell();
}
// Don't forget the upper space and lower space,
- // --> OD 2004-11-25 #115759# - do *not* consider the upper
+ // #115759# - do *not* consider the upper
// and the lower space for follow text frames.
if ( pTmp->IsFlowFrm() &&
( !pTmp->IsTxtFrm() ||
@@ -5588,8 +5500,7 @@ SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrm& rSourceLine )
nTmpHeight += SwFlowFrm::CastFlowFrm(pTmp)->CalcUpperSpace( NULL, pLast);
nTmpHeight += SwFlowFrm::CastFlowFrm(pTmp)->CalcLowerSpace();
}
- // <--
- // --> OD 2004-11-25 #115759# - consider additional lower
+ // #115759# - consider additional lower
// space of <pTmp>, if contains only one line.
// In this case it would be the new last text frame, which
// would have no follow and thus would add this space.
@@ -5600,7 +5511,6 @@ SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrm& rSourceLine )
nTmpHeight += SwFlowFrm::CastFlowFrm(pTmp)
->CalcAddLowerSpaceAsLastInTableCell();
}
- // <--
if ( nReal > 0 )
nTmpHeight -= nReal;
}
@@ -5611,14 +5521,13 @@ SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrm& rSourceLine )
SwBorderAttrAccess aAccess( SwFrm::GetCache(), pCurrSourceCell );
const SwBorderAttrs &rAttrs = *aAccess.Get();
nTmpHeight += rAttrs.CalcTop() + rAttrs.CalcBottom();
- // --> OD 2004-07-16 #i26250#
+ // #i26250#
// Don't forget the upper space and lower space,
if ( pTmp->IsFlowFrm() )
{
nTmpHeight += SwFlowFrm::CastFlowFrm(pTmp)->CalcUpperSpace();
nTmpHeight += SwFlowFrm::CastFlowFrm(pTmp)->CalcLowerSpace();
}
- // <--
}
}
@@ -5738,12 +5647,11 @@ SwTwips SwTabFrm::CalcHeightOfFirstContentLine() const
}
}
- // --> FME 2004-11-18 #118411#
+ // #118411#
// Optimization: lcl_CalcHeightOfFirstContentLine actually can trigger
// a formatting of the row frame (via the GetFormatted()). We don't
// want this formatting if the row does not have a height.
else if ( 0 != nFirstLineHeight )
- // <--
{
const bool bOldJoinLock = IsJoinLocked();
((SwTabFrm*)this)->LockJoin();
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index daea08bdef..41c4ada96c 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -58,6 +58,7 @@
#include <crstate.hxx>
#include <frmtool.hxx>
#include <ndtxt.hxx>
+#include <dcontact.hxx>
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
@@ -65,6 +66,44 @@
#include <cfloat>
#include <swselectionlist.hxx>
+namespace {
+ bool lcl_GetCrsrOfst_Objects( const SwPageFrm* pPageFrm, bool bSearchBackground,
+ SwPosition *pPos, Point& rPoint, SwCrsrMoveState* pCMS )
+ {
+ bool bRet = false;
+ Point aPoint( rPoint );
+ SwOrderIter aIter( pPageFrm );
+ aIter.Top();
+ while ( aIter() )
+ {
+ const SwVirtFlyDrawObj* pObj =
+ static_cast<const SwVirtFlyDrawObj*>(aIter());
+ const SwAnchoredObject* pAnchoredObj = GetUserCall( aIter() )->GetAnchoredObj( aIter() );
+ const SwFmtSurround& rSurround = pAnchoredObj->GetFrmFmt().GetSurround();
+ bool bInBackground = ( rSurround.GetSurround() == SURROUND_THROUGHT );
+
+ bool bBackgroundMatches = ( bInBackground && bSearchBackground ) ||
+ ( !bInBackground && !bSearchBackground );
+
+ const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0;
+ if ( pFly && bBackgroundMatches &&
+ ( ( pCMS ? pCMS->bSetInReadOnly : false ) ||
+ !pFly->IsProtected() ) &&
+ pFly->GetCrsrOfst( pPos, aPoint, pCMS ) )
+ {
+ bRet = true;
+ break;
+ }
+
+ if ( pCMS && pCMS->bStop )
+ return false;
+ aIter.Prev();
+ }
+ return bRet;
+ }
+}
+
+
//Fuer SwFlyFrm::GetCrsrOfst
class SwCrsrOszControl
{
@@ -120,12 +159,11 @@ sal_Bool SwLayoutFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
{
pFrm->Calc();
- // --> FME 2005-05-13 #i43742# New function: SW_CONTENT_CHECK
+ // #i43742# New function
const bool bCntntCheck = pFrm->IsTxtFrm() && pCMS && pCMS->bCntntCheck;
const SwRect aPaintRect( bCntntCheck ?
pFrm->UnionFrm() :
pFrm->PaintArea() );
- // <--
if ( aPaintRect.IsInside( rPoint ) &&
( bCntntCheck || pFrm->GetCrsrOfst( pPos, rPoint, pCMS ) ) )
@@ -167,26 +205,7 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
//hineinsetzen, dadurch sollten alle Aenderungen unmoeglich sein.
if ( GetSortedObjs() )
{
- SwOrderIter aIter( this );
- aIter.Top();
- while ( aIter() )
- {
- const SwVirtFlyDrawObj* pObj =
- static_cast<const SwVirtFlyDrawObj*>(aIter());
- const SwFlyFrm* pFly = pObj ? pObj->GetFlyFrm() : 0;
- if ( pFly &&
- ( ( pCMS ? pCMS->bSetInReadOnly : sal_False ) ||
- !pFly->IsProtected() ) &&
- pFly->GetCrsrOfst( pPos, aPoint, pCMS ) )
- {
- bRet = sal_True;
- break;
- }
-
- if ( pCMS && pCMS->bStop )
- return sal_False;
- aIter.Prev();
- }
+ bRet = lcl_GetCrsrOfst_Objects( this, false, pPos, rPoint, pCMS );
}
if ( !bRet )
@@ -223,6 +242,12 @@ sal_Bool SwPageFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
}
}
+ // Check objects in the background if nothing else matched
+ if ( !bRet && GetSortedObjs() )
+ {
+ bRet = lcl_GetCrsrOfst_Objects( this, true, pPos, rPoint, pCMS );
+ }
+
if ( bRet )
rPoint = aPoint;
@@ -308,7 +333,7 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
// search for page containing rPoint. The borders around the pages are considerd
const SwPageFrm* pPage = GetPageAtPos( rPoint, 0, true );
- // --> OD 2008-12-23 #i95626#
+ // #i95626#
// special handling for <rPoint> beyond root frames area
if ( !pPage &&
rPoint.X() > Frm().Right() &&
@@ -320,7 +345,6 @@ sal_Bool SwRootFrm::GetCrsrOfst( SwPosition *pPos, Point &rPoint,
pPage = dynamic_cast<const SwPageFrm*>(pPage->GetNext());
}
}
- // <--
if ( pPage )
{
pPage->SwPageFrm::GetCrsrOfst( pPos, rPoint, pCMS );
@@ -1429,7 +1453,7 @@ void SwPageFrm::GetCntntPosition( const Point &rPt, SwPosition &rPos ) const
|*
|*************************************************************************/
-// --> OD 2005-05-25 #123110# - helper class to disable creation of an action
+// #123110# - helper class to disable creation of an action
// by a callback event - e.g., change event from a drawing object
class DisableCallbackAction
{
@@ -1450,17 +1474,15 @@ class DisableCallbackAction
mrRootFrm.SetCallbackActionEnabled( mbOldCallbackActionState );
}
};
-// <--
//!!!!! Es wird nur der vertikal naechstliegende gesucht.
//JP 11.10.2001: only in tables we try to find the right column - Bug 72294
Point SwRootFrm::GetNextPrevCntntPos( const Point& rPoint, sal_Bool bNext ) const
{
- // --> OD 2005-05-25 #123110# - disable creation of an action by a callback
+ // #123110# - disable creation of an action by a callback
// event during processing of this method. Needed because formatting is
// triggered by this method.
DisableCallbackAction aDisableCallbackAction( *this );
- // <--
//Ersten CntntFrm und seinen Nachfolger im Body-Bereich suchen
//Damit wir uns nicht tot suchen (und vor allem nicht zuviel formatieren)
//gehen wir schon mal von der richtigen Seite aus.
@@ -1735,7 +1757,7 @@ sal_Bool SwFrm::WannaRightPage() const
OSL_ENSURE( pDesc, "No pagedescriptor" );
sal_Bool bOdd;
if( nPgNum )
- bOdd = nPgNum % 2 ? sal_True : sal_False;
+ bOdd = (nPgNum % 2) ? sal_True : sal_False;
else
{
bOdd = pPage->OnRightPage();
@@ -1837,7 +1859,7 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
}
}
- // --> FME 2008-01-14 #151012# Made code robust here:
+ // #151012# Made code robust here
const SwCntntNode* pTmpStartNode = rTblCrsr.GetCntntNode();
const SwCntntNode* pTmpEndNode = rTblCrsr.GetCntntNode(sal_False);
@@ -1848,7 +1870,6 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
const SwLayoutFrm* pEnd = pTmpEndFrm ? pTmpEndFrm->GetUpper() : 0;
OSL_ENSURE( pStart && pEnd, "MakeTblCrsrs: Good to have the code robust here!" );
- // <--
/* #109590# Only change table boxes if the frames are
valid. Needed because otherwise the table cursor after moving
@@ -1977,11 +1998,10 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
ViewShell *pSh = GetCurrShell();
-// --> FME 2004-06-08 #i12836# enhanced pdf
+// #i12836# enhanced pdf
SwRegionRects aRegion( pSh && !pSh->GetViewOptions()->IsPDFExport() ?
pSh->VisArea() :
Frm() );
-// <--
if( !pStartPos->nNode.GetNode().IsCntntNode() ||
!pStartPos->nNode.GetNode().GetCntntNode()->getLayoutFrm(this) ||
( pStartPos->nNode != pEndPos->nNode &&
@@ -2459,13 +2479,12 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
const SwCntntFrm *pCntnt = pStartFrm->GetNextCntntFrm();
SwRect aPrvRect;
- // --> OD 2006-01-24 #123908# - introduce robust code:
+ // #123908# - introduce robust code
// The stacktrace issue reveals that <pCntnt> could be NULL.
// One root cause found by AMA - see #130650#
OSL_ENSURE( pCntnt,
"<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect -> please inform OD" );
while ( pCntnt && pCntnt != pEndFrm )
- // <--
{
if ( pCntnt->IsInFly() )
{
@@ -2502,10 +2521,9 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, sal_Bool bIsTblMode )
}
}
pCntnt = pCntnt->GetNextCntntFrm();
- // --> OD 2006-01-24 #123908#
+ // #123908#
OSL_ENSURE( pCntnt,
"<SwRootFrm::CalcFrmRects(..)> - no content frame. This is a serious defect -> please inform OD" );
- // <--
}
if ( aPrvRect.HasArea() )
Sub( aRegion, aPrvRect );
diff --git a/sw/source/core/layout/virtoutp.hxx b/sw/source/core/layout/virtoutp.hxx
index f7df293657..03e0ddcca2 100644
--- a/sw/source/core/layout/virtoutp.hxx
+++ b/sw/source/core/layout/virtoutp.hxx
@@ -65,7 +65,7 @@ public:
void SetOrgRect( SwRect &rRect ) { aOrgRect = rRect; }
const SwRect& GetOrgRect() const { return aOrgRect; }
- sal_Bool IsFlushable() { return 0 != pOut; }
+ sal_Bool IsFlushable() const { return 0 != pOut; }
void _Flush();
void Flush() { if( pOut ) _Flush(); }
};
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index e3de4b9120..9aafc0dc77 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -31,7 +31,6 @@
#include <hintids.hxx>
#include <hints.hxx>
-#include <tools/pstm.hxx>
#include <vcl/outdev.hxx>
#include <svl/itemiter.hxx>
#include <editeng/brshitem.hxx>
@@ -76,6 +75,7 @@
#include <editeng/frmdiritem.hxx>
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
+#include <viewopt.hxx>
using namespace ::com::sun::star;
@@ -89,9 +89,8 @@ using namespace ::com::sun::star;
SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) :
SwClient( pMod ),
- // --> OD 2006-05-10 #i65250#
+ // #i65250#
mnFrmId( SwFrm::mnLastFrmId++ ),
- // <--
mpRoot( pSib ? pSib->getRootFrm() : 0 ),
pUpper( 0 ),
pNext( 0 ),
@@ -123,8 +122,8 @@ const IDocumentDrawModelAccess* SwFrm::getIDocumentDrawModelAccess()
}
bool SwFrm::KnowsFormat( const SwFmt& rFmt ) const
-{
- return GetRegisteredIn() == &rFmt;
+{
+ return GetRegisteredIn() == &rFmt;
}
void SwFrm::RegisterToFormat( SwFmt& rFmt )
@@ -132,6 +131,25 @@ void SwFrm::RegisterToFormat( SwFmt& rFmt )
rFmt.Add( this );
}
+sal_uInt64 SwFrm::SetHeaderFooterEditMask( OutputDevice* pOut ) const
+{
+ sal_uInt64 nOldDrawMode = pOut->GetDrawMode();
+ ViewShell* pShell = getRootFrm()->GetCurrShell();
+ if ( !pShell->IsPreView() &&
+ !pShell->GetViewOptions()->IsPDFExport() &&
+ !pShell->GetViewOptions()->IsPrinting() )
+ {
+ bool bInHdrFtr = FindFooterOrHeader( ) != NULL;
+ bool bEditHdrFtr = pShell->IsHeaderFooterEdit();
+ if ( ( bInHdrFtr && !bEditHdrFtr ) || ( !bInHdrFtr && bEditHdrFtr ) )
+ pOut->SetDrawMode( DRAWMODE_GHOSTEDLINE | DRAWMODE_GHOSTEDFILL |
+ DRAWMODE_GHOSTEDTEXT | DRAWMODE_GHOSTEDBITMAP |
+ DRAWMODE_GHOSTEDGRADIENT );
+ }
+
+ return nOldDrawMode;
+}
+
void SwFrm::CheckDir( sal_uInt16 nDir, sal_Bool bVert, sal_Bool bOnlyBiDi, sal_Bool bBrowse )
{
if( FRMDIR_ENVIRONMENT == nDir || ( bVert && bOnlyBiDi ) )
@@ -233,10 +251,9 @@ void SwCellFrm::CheckDirection( sal_Bool bVert )
{
const SwFrmFmt* pFmt = GetFmt();
const SfxPoolItem* pItem;
- // --> FME 2006-03-30 #b6402837# Check if the item is set, before actually
+ // Check if the item is set, before actually
// using it. Otherwise the dynamic pool default is used, which may be set
// to LTR in case of OOo 1.0 documents.
- // <--
if( pFmt && SFX_ITEM_SET == pFmt->GetItemState( RES_FRAMEDIR, sal_True, &pItem ) )
{
const SvxFrameDirectionItem* pFrmDirItem = static_cast<const SvxFrameDirectionItem*>(pItem);
@@ -389,7 +406,7 @@ void SwFrm::InvalidatePage( const SwPageFrm *pPage ) const
if ( !pPage )
{
pPage = FindPageFrm();
- // --> OD 2004-07-02 #i28701# - for at-character and as-character
+ // #i28701# - for at-character and as-character
// anchored Writer fly frames additionally invalidate also page frame
// its 'anchor character' is on.
if ( pPage && pPage->GetUpper() && IsFlyFrm() )
@@ -397,19 +414,17 @@ void SwFrm::InvalidatePage( const SwPageFrm *pPage ) const
const SwFlyFrm* pFlyFrm = static_cast<const SwFlyFrm*>(this);
if ( pFlyFrm->IsAutoPos() || pFlyFrm->IsFlyInCntFrm() )
{
- // --> OD 2004-09-23 #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
+ // #i33751#, #i34060# - method <GetPageFrmOfAnchor()>
// is replaced by method <FindPageFrmOfAnchor()>. It's return value
// have to be checked.
SwPageFrm* pPageFrmOfAnchor =
const_cast<SwFlyFrm*>(pFlyFrm)->FindPageFrmOfAnchor();
if ( pPageFrmOfAnchor && pPageFrmOfAnchor != pPage )
- // <--
{
InvalidatePage( pPageFrmOfAnchor );
}
}
}
- // <--
}
if ( pPage && pPage->GetUpper() )
@@ -919,13 +934,12 @@ void SwCntntFrm::Cut()
if( IsInFtn() )
pFrm->Prepare( PREP_QUOVADIS, 0, sal_False );
}
- // --> OD 2004-07-15 #i26250# - invalidate printing area of previous
+ // #i26250# - invalidate printing area of previous
// table frame.
else if ( pFrm && pFrm->IsTabFrm() )
{
pFrm->InvalidatePrt();
}
- // <--
}
SwFrm *pNxt = FindNextCnt();
@@ -1002,7 +1016,7 @@ void SwCntntFrm::Cut()
pSct->InvalidatePage( pPage );
}
}
- // --> FME 2005-08-03 #i52253# The master table should take care
+ // #i52253# The master table should take care
// of removing the follow flow line.
if ( IsInTab() )
{
@@ -1014,7 +1028,6 @@ void SwCntntFrm::Cut()
pMasterTab->SetRemoveFollowFlowLinePending( sal_True );
}
}
- // <--
}
}
//Erst removen, dann Upper Shrinken.
@@ -1026,24 +1039,21 @@ void SwCntntFrm::Cut()
if ( !pUp->Lower() &&
( ( pUp->IsFtnFrm() && !pUp->IsColLocked() ) ||
( pUp->IsInSct() &&
- // --> FME 2004-06-03 #i29438#
+ // #i29438#
// We have to consider the case that the section may be "empty"
// except from a temporary empty table frame.
// This can happen due to the new cell split feature.
!pUp->IsCellFrm() &&
- // <--
- // --> OD 2006-01-04 #126020# - adjust check for empty section
- // --> OD 2006-02-01 #130797# - correct fix #126020#
+ // #126020# - adjust check for empty section
+ // #130797# - correct fix #126020#
!(pSct = pUp->FindSctFrm())->ContainsCntnt() &&
!pSct->ContainsAny( true ) ) ) )
- // <--
{
if ( pUp->GetUpper() )
{
- // --> OD 2006-09-25 #b6448963#
+ //
// prevent delete of <ColLocked> footnote frame
if ( pUp->IsFtnFrm() && !pUp->IsColLocked())
- // <--
{
if( pUp->GetNext() && !pUp->GetPrev() )
{
@@ -1056,10 +1066,9 @@ void SwCntntFrm::Cut()
}
else
{
- // --> OD 2006-09-25 #b6448963#
+ //
if ( pSct->IsColLocked() || !pSct->IsInFtn() ||
( pUp->IsFtnFrm() && pUp->IsColLocked() ) )
- // <--
{
pSct->DelEmpty( sal_False );
// Wenn ein gelockter Bereich nicht geloescht werden darf,
@@ -1785,7 +1794,7 @@ void SwFrm::ReinitializeFrmSizeAttrFlags()
pFrm = pFrm->GetNext();
}
SwCntntFrm *pCnt = ((SwLayoutFrm*)this)->ContainsCntnt();
- // --> OD 2004-12-20 #i36991# - be save.
+ // #i36991# - be save.
// E.g., a row can contain *no* content.
if ( pCnt )
{
@@ -1797,7 +1806,6 @@ void SwFrm::ReinitializeFrmSizeAttrFlags()
pCnt = pCnt->GetNextCntntFrm();
} while ( ((SwLayoutFrm*)this)->IsAnLower( pCnt ) );
}
- // <--
}
}
else if ( rFmtSize.GetHeightSizeType() == ATT_FIX_SIZE )
@@ -1887,7 +1895,7 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
GetNext()->InvalidatePos();
}
- // --> OD 2004-07-05 #i28701# - Due to the new object positioning the
+ // #i28701# - Due to the new object positioning the
// frame on the next page/column can flow backward (e.g. it was moved forward
// due to the positioning of its objects ). Thus, invalivate this next frame,
// if document compatibility option 'Consider wrapping style influence on
@@ -1896,7 +1904,6 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
{
InvalidateNextPos();
}
- // <--
}
return 0;
}
@@ -1949,7 +1956,7 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
else
nReal = nDist;
- // --> OD 2004-07-05 #i28701# - Due to the new object positioning the
+ // #i28701# - Due to the new object positioning the
// frame on the next page/column can flow backward (e.g. it was moved forward
// due to the positioning of its objects ). Thus, invalivate this next frame,
// if document compatibility option 'Consider wrapping style influence on
@@ -1965,7 +1972,6 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool bInfo )
InvalidateNextPos();
}
}
- // <--
return nReal;
}
@@ -2333,9 +2339,8 @@ SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt, SwFrm* pSib ):
bFixSize = sal_True;
}
-// --> OD 2004-06-29 #i28701#
+// #i28701#
TYPEINIT1(SwLayoutFrm,SwFrm);
-// <--
/*--------------------------------------------------
* SwLayoutFrm::InnerHeight()
* --------------------------------------------------*/
@@ -2751,10 +2756,9 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
if ( !( bVert ? bHeightChgd : bWidthChgd ) &&
! Lower()->IsColumnFrm() &&
( ( IsBodyFrm() && IsInDocBody() && ( !IsInSct() || !FindSctFrm()->IsColLocked() ) ) ||
- // --> FME 2004-07-21 #i10826# Section frames without columns should not
+ // #i10826# Section frames without columns should not
// invalidate all lowers!
IsSctFrm() ) )
- // <--
{
// Determine page frame the body frame resp. the section frame belongs to.
SwPageFrm *pPage = FindPageFrm();
@@ -2854,12 +2858,12 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
((SwCntntFrm*)pLowerFrm)->Prepare( PREP_ADJUST_FRM );
}
}
- // --> OD 2005-01-31 #i41694# - improvement by removing duplicates
+ // #i41694# - improvement by removing duplicates
if ( pLowerFrm )
{
if ( pLowerFrm->IsInSct() )
{
- // --> OD 2005-01-31 #i41694# - follow-up of issue #i10826#:
+ // #i41694# - follow-up of issue #i10826#
// No invalidation of section frame, if it's the this.
SwFrm* pSectFrm = pLowerFrm->FindSctFrm();
if( pSectFrm != this && IsAnLower( pSectFrm ) )
@@ -2867,10 +2871,8 @@ void SwLayoutFrm::ChgLowersProp( const Size& rOldSize )
pSectFrm->_InvalidateSize();
pSectFrm->InvalidatePage( pPage );
}
- // <--
}
}
- // <--
}
return;
} // end of { special case }
@@ -3144,7 +3146,7 @@ void SwLayoutFrm::Format( const SwBorderAttrs *pAttrs )
const sal_uInt16 nLower = pAttrs->CalcBottom();
sal_Bool bVert = IsVertical() && !IsPageFrm();
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
- SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
+ SwRectFn fnRect = bVert ? ( IsVertLR() ? fnRectVertL2R : fnRectVert ) : fnRectHori;
if ( !bValidPrtArea )
{
bValidPrtArea = sal_True;
@@ -3461,11 +3463,10 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
( !(Frm().*fnRect->fnGetHeight)() && pAny ) )
{
long nTop = (this->*fnRect->fnGetTopMargin)();
- // --> OD 2004-11-01 #i23129# - correction: enlarge section
+ // #i23129# - correction
// to the calculated maximum height.
(Frm().*fnRect->fnAddBottom)( nMaximum -
(Frm().*fnRect->fnGetHeight)() );
- // <--
if( nTop > nMaximum )
nTop = nMaximum;
(this->*fnRect->fnSetYMargins)( nTop, 0 );
@@ -3487,7 +3488,7 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
else
nMaximum = LONG_MAX;
- // --> OD 2004-08-25 #i3317# - reset temporarly consideration
+ // #i3317# - reset temporarly consideration
// of wrapping style influence
SwPageFrm* pPageFrm = FindPageFrm();
SwSortedObjs* pObjs = pPageFrm ? pPageFrm->GetSortedObjs() : 0L;
@@ -3504,7 +3505,6 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
}
}
}
- // <--
do
{
//Kann eine Weile dauern, deshalb hier auf Waitcrsr pruefen.
@@ -3518,11 +3518,10 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
//Breiten und Hoehen der Spalten ein (so sie denn falsch sind).
SwLayoutFrm *pCol = (SwLayoutFrm*)Lower();
- // --> FME 2004-07-19 #i27399#
+ // #i27399#
// Simply setting the column width based on the values returned by
// CalcColWidth does not work for automatic column width.
AdjustColumns( &rCol, sal_False );
- // <--
for ( sal_uInt16 i = 0; i < nNumCols; ++i )
{
@@ -3649,12 +3648,11 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
// nicht dadurch wieder unter das Minimum rutschen, wollen wir ein wenig
// Luft herauslassen.
if ( !bNoBalance &&
- // --> OD 2004-11-04 #i23129# - <nMinDiff> can be
+ // #i23129# - <nMinDiff> can be
// big, because of an object at the beginning of
// a column. Thus, decrease optimization here.
//nMaxFree >= nMinDiff &&
nMaxFree > 0 &&
- // <--
( !nAllFree ||
nMinimum < nPrtHeight - nMinDiff ) )
{
@@ -3678,17 +3676,16 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
nDiff = (Prt().*fnRect->fnGetHeight)() + nDiff + nBorder -
(Frm().*fnRect->fnGetHeight)();
(Frm().*fnRect->fnAddBottom)( nDiff );
- // --> OD 2006-08-16 #i68520#
+ // #i68520#
if ( dynamic_cast<SwFlyFrm*>(this) )
{
dynamic_cast<SwFlyFrm*>(this)->InvalidateObjRectWithSpaces();
}
- // <--
(this->*fnRect->fnSetYMargins)( nTop, nBorder - nTop );
ChgLowersProp( aOldSz );
NotifyLowerObjs();
- // --> OD 2004-08-25 #i3317# - reset temporarly consideration
+ // #i3317# - reset temporarly consideration
// of wrapping style influence
SwPageFrm* pTmpPageFrm = FindPageFrm();
SwSortedObjs* pTmpObjs = pTmpPageFrm ? pTmpPageFrm->GetSortedObjs() : 0L;
@@ -3705,7 +3702,6 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
}
}
}
- // <--
//Es muss geeignet invalidiert werden, damit
//sich die Frms huebsch ausbalancieren
//- Der jeweils erste ab der zweiten Spalte bekommt
@@ -3949,13 +3945,12 @@ void SwRootFrm::InvalidateAllObjPos()
// only to paragraph and to character anchored objects are considered.
continue;
}
- // --> OD 2004-07-07 #i28701# - special invalidation for anchored
+ // #i28701# - special invalidation for anchored
// objects, whose wrapping style influence has to be considered.
if ( pAnchoredObj->ConsiderObjWrapInfluenceOnObjPos() )
pAnchoredObj->InvalidateObjPosForConsiderWrapInfluence( true );
else
pAnchoredObj->InvalidateObjPos();
- // <--
}
}
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index b60233ab2e..041e960ae7 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -449,7 +449,6 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc
{
// #i31805# - consider value of <_bCheckBottom>
if ( !bVertL2R )
- // <--
{
if ( bCheckBottom &&
nTopOfAnch - nAdjustedRelPosY - aObjSize.Width() <
diff --git a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
index be6723d5ba..e06f7c6390 100644
--- a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
@@ -288,13 +288,12 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
if ( rAnchorFrm.IsVertical() )
rAnchorFrm.SwitchHorizontalToVertical( aAnchorPos );
- // --> OD 2005-03-09 #i44347# - keep last object rectangle at anchored object
+ // #i44347# - keep last object rectangle at anchored object
OSL_ENSURE( GetAnchoredObj().ISA(SwAnchoredDrawObject),
"<SwAsCharAnchoredObjectPosition::CalcPosition()> - wrong type of anchored object." );
SwAnchoredDrawObject& rAnchoredDrawObj =
static_cast<SwAnchoredDrawObject&>( GetAnchoredObj() );
rAnchoredDrawObj.SetLastObjRect( rAnchoredDrawObj.GetObjRect().SVRect() );
- // <--
}
else
{
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index 00da8a0a9c..e153ab46f7 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -282,7 +282,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
? rLR.GetLeft()
: rLR.GetRight() )
: rUL.GetLower();
- // <--
switch ( aVert.GetVertOrient() )
{
case text::VertOrientation::CHAR_BOTTOM:
@@ -580,7 +579,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
maOffsetToFrmAnchorPos.X() = nVertOffsetToFrmAnchorPos;
else
maOffsetToFrmAnchorPos.Y() = nVertOffsetToFrmAnchorPos;
- // <--
// #i11860# - use new method <_GetTopForObjPos>
// to get top of frame for object positioning.
const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert );
@@ -651,7 +649,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
{
pLayoutFrmToGrow->Grow( nRelPosY - nAvail );
}
- // <--
nRelPosY = 0;
}
else
@@ -754,7 +751,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
GetAnchoredObj().SetObjLeft( nTopOfAnch +
( aRelPos.X() - nRelDiff ) );
}
- // <--
}
else
{
@@ -779,7 +775,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
(pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)() );
if( nDist < 0 )
{
- // #i23512# - correction:
+ // #i23512# - correction:
// consider section frame for grow in online layout and
// consider page alignment for grow in table.
SwLayoutFrm* pLayoutFrmToGrow = 0L;
@@ -810,7 +806,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
{
pLayoutFrmToGrow->Grow( -nDist );
}
- // <--
}
if ( DoesObjFollowsTextFlow() &&
@@ -864,7 +859,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
{
GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
}
- // <--
}
else
{
@@ -917,7 +911,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
? MAKEPAGE_NOSECTION
: ( bInFtn ? MAKEPAGE_NONE : MAKEPAGE_APPEND ) ),
sal_True, &rAnchorTxtFrm );
- // correction:
+ // correction:
// If anchor is in footnote and proposed next layout environment
// isn't a footnote frame, object can't follow the text flow
if ( bInFtn && pNextLay && !pNextLay->IsFtnFrm() )
@@ -955,7 +949,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
GetAnchoredObj().SetObjLeft( nTopOfAnch +
aRelPos.X() );
}
- // <--
}
else
GetAnchoredObj().SetObjTop( nTopOfAnch +
@@ -1018,7 +1011,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
{
GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
}
- // <--
}
else
GetAnchoredObj().SetObjTop( nTopOfAnch + aRelPos.Y() );
@@ -1079,7 +1071,6 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
{
GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() );
}
- // <--
GetAnchoredObj().SetObjTop( rAnchorTxtFrm.Frm().Top() +
aRelPos.Y() );
}
diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
index 076263e4dd..090b65ea92 100644
--- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
@@ -52,7 +52,7 @@ using namespace ::com::sun::star;
SwToLayoutAnchoredObjectPosition::SwToLayoutAnchoredObjectPosition( SdrObject& _rDrawObj )
: SwAnchoredObjectPosition( _rDrawObj ),
maRelPos( Point() ),
- // --> OD 2004-06-17 #i26791#
+ // #i26791#
maOffsetToFrmAnchorPos( Point() )
{}
@@ -94,7 +94,7 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
{
eVertOrient = text::VertOrientation::TOP;
}
- // --> OD 2004-06-17 #i26791# - get vertical offset to frame anchor position.
+ // #i26791# - get vertical offset to frame anchor position.
SwTwips nVertOffsetToFrmAnchorPos( 0L );
SwTwips nRelPosY =
_GetVertRelPos( GetAnchorFrm(), GetAnchorFrm(), eVertOrient,
@@ -117,7 +117,7 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
}
// determine absolute 'vertical' position, depending on layout-direction
- // --> OD 2004-06-17 #i26791# - determine offset to 'vertical' frame
+ // #i26791# - determine offset to 'vertical' frame
// anchor position, depending on layout-direction
if( bVert )
{
@@ -209,12 +209,11 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
}
// determine absolute 'horizontal' position, depending on layout-direction
- // --> OD 2004-06-17 #i26791# - determine offset to 'horizontal' frame
+ // #i26791# - determine offset to 'horizontal' frame
// anchor position, depending on layout-direction
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
// --> OD 2009-09-04 #mongolianlayout#
if( bVert || bVertL2R )
- // <--
{
aRelPos.Y() = nRelPosX;
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 0f869da703..19f6a48007 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -169,8 +169,8 @@ public:
virtual ~SwEmbedObjectLink();
virtual void Closed();
- virtual void DataChanged( const String& rMimeType,
- const uno::Any & rValue );
+ virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
+ const String& rMimeType, const ::com::sun::star::uno::Any & rValue );
sal_Bool Connect() { return GetRealObject() != NULL; }
};
@@ -192,8 +192,8 @@ SwEmbedObjectLink::~SwEmbedObjectLink()
// -----------------------------------------------------------------------------
-void SwEmbedObjectLink::DataChanged( const String& ,
- const uno::Any & )
+::sfx2::SvBaseLink::UpdateResult SwEmbedObjectLink::DataChanged(
+ const String&, const uno::Any& )
{
if ( !pOleNode->UpdateLinkURL_Impl() )
{
@@ -222,6 +222,7 @@ void SwEmbedObjectLink::DataChanged( const String& ,
}
pOleNode->GetNewReplacement();
+ return SUCCESS;
}
// -----------------------------------------------------------------------------
@@ -288,7 +289,7 @@ SwCntntNode *SwOLENode::SplitCntntNode( const SwPosition & )
sal_Bool SwOLENode::RestorePersistentData()
{
- DBG_ASSERT( aOLEObj.GetOleRef().is(), "No object to restore!" );
+ OSL_ENSURE( aOLEObj.GetOleRef().is(), "No object to restore!" );
if ( aOLEObj.xOLERef.is() )
{
// Falls bereits eine SvPersist-Instanz existiert, nehmen wir diese
@@ -306,7 +307,7 @@ sal_Bool SwOLENode::RestorePersistentData()
if ( xChild.is() )
xChild->setParent( p->GetModel() );
- DBG_ASSERT( aOLEObj.aName.Len(), "No object name!" );
+ OSL_ENSURE( aOLEObj.aName.Len(), "No object name!" );
::rtl::OUString aObjName;
if ( !p->GetEmbeddedObjectContainer().InsertEmbeddedObject( aOLEObj.xOLERef.GetObject(), aObjName ) )
{
@@ -334,7 +335,7 @@ sal_Bool SwOLENode::SavePersistentData()
#if OSL_DEBUG_LEVEL > 0
SfxObjectShell* p = GetDoc()->GetPersist();
- DBG_ASSERT( p, "No document!" );
+ OSL_ENSURE( p, "No document!" );
if( p )
{
comphelper::EmbeddedObjectContainer& rCnt = p->GetEmbeddedObjectContainer();
@@ -622,7 +623,7 @@ void SwOLENode::CheckFileLink_Impl()
}
}
-// --> OD 2009-03-05 #i99665#
+// #i99665#
bool SwOLENode::IsChart() const
{
bool bIsChart( false );
@@ -637,7 +638,6 @@ bool SwOLENode::IsChart() const
return bIsChart;
}
-// <--
SwOLEObj::SwOLEObj( const svt::EmbeddedObjectRef& xObj ) :
pOLENd( 0 ),
@@ -680,7 +680,7 @@ SwOLEObj::~SwOLEObj()
#if OSL_DEBUG_LEVEL > 0
SfxObjectShell* p = pOLENd->GetDoc()->GetPersist();
- DBG_ASSERT( p, "No document!" );
+ OSL_ENSURE( p, "No document!" );
if( p )
{
comphelper::EmbeddedObjectContainer& rCnt = p->GetEmbeddedObjectContainer();
@@ -932,7 +932,7 @@ void SwOLELRUCache::Load()
Sequence< OUString > aNames( GetPropertyNames() );
Sequence< Any > aValues = GetProperties( aNames );
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT( aValues.getLength() == aNames.getLength(), "GetProperties failed" );
+ OSL_ENSURE( aValues.getLength() == aNames.getLength(), "GetProperties failed" );
if( aValues.getLength() == aNames.getLength() && pValues->hasValue() )
{
sal_Int32 nVal = 0;
diff --git a/sw/source/core/sw3io/sw3convert.cxx b/sw/source/core/sw3io/sw3convert.cxx
index 8d17a016d9..14d87a6a13 100644
--- a/sw/source/core/sw3io/sw3convert.cxx
+++ b/sw/source/core/sw3io/sw3convert.cxx
@@ -301,113 +301,5 @@ SW_DLLPUBLIC void sw3io_ConvertFromOldField( SwDoc& rDoc, sal_uInt16& rWhich,
}
}
}
-SW_DLLPUBLIC void sw3io_ConvertToOldField( const SwField* pFld, sal_uInt16& rWhich,
- sal_uLong& rFmt, sal_uLong nFFVersion )
-{
- const OldFormats *pOldFmt = 0L;
- sal_uLong nOldFmt = rFmt;
-
- switch( rWhich )
- {
- case RES_DOCINFOFLD:
- if( SOFFICE_FILEFORMAT_40 >= nFFVersion )
- {
- switch (pFld->GetSubType() & 0xff00)
- {
- case DI_SUB_AUTHOR: rFmt = RF_AUTHOR; break;
- case DI_SUB_TIME: rFmt = RF_TIME; break;
- case DI_SUB_DATE: rFmt = RF_DATE; break;
- }
- }
- break;
-
- case RES_DATETIMEFLD:
- if( SOFFICE_FILEFORMAT_40 >= nFFVersion )
- {
- sal_uInt16 nSubType = ((SwDateTimeField*) pFld)->GetSubType();
- switch( nSubType )
- {
- case DATEFLD: rWhich = RES_DATEFLD; break;
- case TIMEFLD: rWhich = RES_TIMEFLD; break;
- case DATEFLD|FIXEDFLD: rWhich = RES_FIXDATEFLD; break;
- case TIMEFLD|FIXEDFLD: rWhich = RES_FIXTIMEFLD; break;
- }
-
- if( nSubType & DATEFLD )
- {
- rFmt = DFF_DMY;
- pOldFmt = aOldDateFmt40;
- }
- else
- {
- rFmt = TF_SYSTEM;
- pOldFmt = aOldTimeFmt;
- }
- }
- break;
-
- case RES_DBFLD:
- case RES_TABLEFLD:
- case RES_GETEXPFLD:
- case RES_SETEXPFLD:
- case RES_USERFLD:
- if( SOFFICE_FILEFORMAT_40 >= nFFVersion )
- {
- sal_uInt16 nSubType = pFld->GetSubType();
-
- if (nSubType & nsSwExtendedSubType::SUB_INVISIBLE)
- rFmt = VVF_INVISIBLE;
- else if (nSubType & nsSwExtendedSubType::SUB_CMD)
- rFmt = VVF_CMD;
- else if( !(nsSwGetSetExpType::GSE_SEQ & nSubType) )
- {
- pOldFmt = aOldGetSetExpFmt40;
- rFmt = VVF_SYS;
- }
- }
- break;
-
- case RES_GETREFFLD:
- if( SOFFICE_FILEFORMAT_31 == nFFVersion )
- {
- switch( rFmt )
- {
- case REF_PAGE:
- case REF_CHAPTER:
- case REF_CONTENT:
- break;
-
- default:
- rFmt = REF_PAGE;
- break;
- }
- }
- break;
- }
-
- if( pOldFmt && nOldFmt )
- {
- SvNumberFormatter *pFormatter = ((SwValueField*)pFld)->GetDoc()->GetNumberFormatter();
- const SvNumberformat* pEntry = pFormatter->GetEntry( nOldFmt );
-
- if( pEntry )
- {
- sal_uInt16 i = 0;
- while( pOldFmt[i].eFormatIdx != NF_NUMERIC_START ||
- pOldFmt[i].nOldFormat )
- {
- sal_uLong nKey = pFormatter->GetFormatIndex(
- pOldFmt[i].eFormatIdx, pEntry->GetLanguage() );
-
- if( nOldFmt == nKey )
- {
- rFmt = pOldFmt[i].nOldFormat;
- break;
- }
- i++;
- }
- }
- }
-}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx
index bc8f4fc8ed..8a1db92c3d 100644
--- a/sw/source/core/swg/SwXMLTextBlocks.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks.cxx
@@ -89,7 +89,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const String& rFile )
refStg = comphelper::OStorageHelper::GetStorageFromURL( rFile, embed::ElementModes::READWRITE );
bReadOnly = sal_False;
}
- catch( const uno::Exception& )
+ catch(const uno::Exception&)
{
//couldn't open the file - maybe it's readonly
}
@@ -99,7 +99,7 @@ SwXMLTextBlocks::SwXMLTextBlocks( const String& rFile )
{
refStg = comphelper::OStorageHelper::GetStorageFromURL( rFile, embed::ElementModes::READ );
}
- catch( const uno::Exception& )
+ catch(const uno::Exception&)
{
OSL_FAIL("exception while creating AutoText storage");
}
@@ -194,7 +194,7 @@ sal_uLong SwXMLTextBlocks::Delete( sal_uInt16 n )
xTrans->commit();
return 0;
}
- catch ( uno::Exception)
+ catch (const uno::Exception&)
{
return ERR_SWG_WRITE_ERROR;
}
@@ -204,7 +204,7 @@ sal_uLong SwXMLTextBlocks::Delete( sal_uInt16 n )
sal_uLong SwXMLTextBlocks::Rename( sal_uInt16 nIdx, const String& rNewShort, const String& )
{
- DBG_ASSERT( xBlkRoot.is(), "No storage set" );
+ OSL_ENSURE( xBlkRoot.is(), "No storage set" );
if(!xBlkRoot.is())
return 0;
String aOldName (aNames[ nIdx ]->aPackageName);
@@ -230,9 +230,8 @@ sal_uLong SwXMLTextBlocks::Rename( sal_uInt16 nIdx, const String& rNewShort, con
{
xBlkRoot->renameElement ( aOldName, aPackageName );
}
- catch( const container::ElementExistException& rEx )
+ catch(const container::ElementExistException&)
{
- (void)rEx;
}
}
uno::Reference < embed::XTransactedObject > xTrans( xBlkRoot, uno::UNO_QUERY );
@@ -255,7 +254,7 @@ sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort,
String sDestShortName( GetPackageName (nIndex) );
sal_uInt16 nIdx = 0;
- DBG_ASSERT( xBlkRoot.is(), "No storage set" );
+ OSL_ENSURE( xBlkRoot.is(), "No storage set" );
if(!xBlkRoot.is())
return ERR_SWG_WRITE_ERROR;
@@ -279,7 +278,7 @@ sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort,
uno::Reference < embed::XStorage > rDestRoot = ((SwXMLTextBlocks&)rDestImp).xBlkRoot->openStorageElement( sDestShortName, embed::ElementModes::READWRITE );
rSourceRoot->copyToStorage( rDestRoot );
}
- catch ( uno::Exception& )
+ catch (const uno::Exception&)
{
nError = ERR_SWG_WRITE_ERROR;
}
@@ -298,7 +297,7 @@ sal_uLong SwXMLTextBlocks::CopyBlock( SwImpBlocks& rDestImp, String& rShort,
sal_uLong SwXMLTextBlocks::StartPutBlock( const String& rShort, const String& rPackageName )
{
- DBG_ASSERT( xBlkRoot.is(), "No storage set" );
+ OSL_ENSURE( xBlkRoot.is(), "No storage set" );
if(!xBlkRoot.is())
return 0;
GetIndex ( rShort );
@@ -311,7 +310,7 @@ sal_uLong SwXMLTextBlocks::StartPutBlock( const String& rShort, const String& rP
::rtl::OUString aMime( SotExchange::GetFormatMimeType( SOT_FORMATSTR_ID_STARWRITER_8 ) );
xRootProps->setPropertyValue( aPropName, uno::makeAny( aMime ) );
}
- catch (uno::Exception&)
+ catch (const uno::Exception&)
{
}
return 0;
@@ -372,7 +371,7 @@ sal_uLong SwXMLTextBlocks::PutBlock( SwPaM& , const String& )
xTempStorage->copyToStorage( xRoot );
bOK = bTmpOK;
}
- catch( uno::Exception& )
+ catch(const uno::Exception&)
{
}
@@ -397,7 +396,7 @@ sal_uLong SwXMLTextBlocks::PutBlock( SwPaM& , const String& )
xTmpTrans->commit();
}
}
- catch (uno::Exception&)
+ catch (const uno::Exception&)
{
}
@@ -465,7 +464,7 @@ sal_Bool SwXMLTextBlocks::PutMuchEntries( sal_Bool bOn )
bInPutMuchBlocks = sal_False;
bRet = sal_True;
}
- catch (uno::Exception&)
+ catch (const uno::Exception&)
{
}
}
@@ -484,7 +483,7 @@ sal_uLong SwXMLTextBlocks::OpenFile( sal_Bool bRdOnly )
bRdOnly ? embed::ElementModes::READ : embed::ElementModes::READWRITE );
InitBlockMode ( refStg );
}
- catch ( uno::Exception& )
+ catch (const uno::Exception&)
{
//TODO/LATER: error handling
nRet = 1;
diff --git a/sw/source/core/swg/SwXMLTextBlocks1.cxx b/sw/source/core/swg/SwXMLTextBlocks1.cxx
index 0b16cbdeaf..004b984344 100644
--- a/sw/source/core/swg/SwXMLTextBlocks1.cxx
+++ b/sw/source/core/swg/SwXMLTextBlocks1.cxx
@@ -207,7 +207,7 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
OUString sStreamName(RTL_CONSTASCII_USTRINGPARAM("atevent.xml"));
uno::Reference < io::XStream > xDocStream = xRoot->openStreamElement(
sStreamName, embed::ElementModes::READ );
- DBG_ASSERT(xDocStream.is(), "Can't create stream");
+ OSL_ENSURE(xDocStream.is(), "Can't create stream");
if ( xDocStream.is() )
{
uno::Reference<io::XInputStream> xInputStream = xDocStream->getInputStream();
@@ -229,7 +229,7 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
uno::Reference< xml::sax::XParser > xParser(
xServiceFactory->createInstance(sParserService),
UNO_QUERY );
- DBG_ASSERT( xParser.is(), "Can't create parser" );
+ OSL_ENSURE( xParser.is(), "Can't create parser" );
if( xParser.is() )
{
// create descriptor and reference to it. Either
@@ -249,7 +249,7 @@ sal_uLong SwXMLTextBlocks::GetMacroTable( sal_uInt16 nIdx,
xServiceFactory->createInstanceWithArguments(
sFilterComponent, aFilterArguments),
UNO_QUERY );
- DBG_ASSERT( xFilter.is(),
+ OSL_ENSURE( xFilter.is(),
"can't instantiate atevents filter");
if ( xFilter.is() )
{
@@ -416,7 +416,7 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const String& rShort, const String& ,
uno::Reference < XInterface > xWriter (xServiceFactory->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer"))));
- DBG_ASSERT(xWriter.is(),"com.sun.star.xml.sax.Writer service missing");
+ OSL_ENSURE(xWriter.is(),"com.sun.star.xml.sax.Writer service missing");
sal_uLong nRes = 0;
try
@@ -548,7 +548,7 @@ void SwXMLTextBlocks::WriteInfo( void )
{
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory();
- DBG_ASSERT( xServiceFactory.is(),
+ OSL_ENSURE( xServiceFactory.is(),
"XMLReader::Read: got no service manager" );
if( !xServiceFactory.is() )
{
@@ -557,7 +557,7 @@ void SwXMLTextBlocks::WriteInfo( void )
uno::Reference < XInterface > xWriter (xServiceFactory->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer"))));
- DBG_ASSERT(xWriter.is(),"com.sun.star.xml.sax.Writer service missing");
+ OSL_ENSURE(xWriter.is(),"com.sun.star.xml.sax.Writer service missing");
OUString sDocName( RTL_CONSTASCII_USTRINGPARAM( XMLN_BLOCKLIST ) );
/*
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index 9c950f9893..ce1a173973 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -73,7 +73,7 @@ public:
std::vector<const SwSelBoxes*> aBoxes;
long mnMergeWidth;
SwBoxSelection() : mnMergeWidth(0) {}
- bool isEmpty() const { return aBoxes.size() == 0; }
+ bool isEmpty() const { return aBoxes.empty(); }
void insertBoxes( const SwSelBoxes* pNew ){ aBoxes.insert( aBoxes.end(), pNew ); }
};
@@ -1231,7 +1231,7 @@ void lcl_SophisticatedFillLineIndices( SwLineOffsetArray &rArr,
// in the resulting array the index has to be _on_ the line
// nSum is to evaluate the wished value
sal_uInt16 nSum = 1;
- while( aBoxes.size() )
+ while( !aBoxes.empty() )
{
// I. step:
// Looking for the "smallest" line end with the smallest row span
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 854678a737..812c272425 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -460,6 +460,7 @@ void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
const bool bRefreshHidden )
{
const long nWish = pTabFmt->GetFrmSize().GetWidth();
+ OSL_ENSURE(nWish, "weird <= 0 width frmfrm");
const long nAct = rToFill.GetRight() - rToFill.GetLeft(); // +1 why?
//Der Wert fuer die linke Kante der Box errechnet sich aus den
@@ -471,13 +472,18 @@ void lcl_SortedTabColInsert( SwTabCols &rToFill, const SwTableBox *pBox,
const SwTableBox *pCur = pBox;
const SwTableLine *pLine = pBox->GetUpper();
while ( pLine )
- { const SwTableBoxes &rBoxes = pLine->GetTabBoxes();
+ {
+ const SwTableBoxes &rBoxes = pLine->GetTabBoxes();
for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
{
SwTwips nWidth = rBoxes[i]->GetFrmFmt()->GetFrmSize().GetWidth();
nSum = (sal_uInt16)(nSum + nWidth);
sal_uInt64 nTmp = nSum;
nTmp *= nAct;
+
+ if (nWish == 0) //fdo#33012 0 width frmfmt
+ continue;
+
nTmp /= nWish;
if (rBoxes[i] != pCur)
{
@@ -1131,12 +1137,12 @@ static void lcl_AdjustWidthsInLine( SwTableLine* pLine, ChangeList& rOldNew,
static void lcl_CalcNewWidths( std::list<sal_uInt16> &rSpanPos, ChangeList& rChanges,
SwTableLine* pLine, long nWish, long nWidth, bool bTop )
{
- if( !rChanges.size() )
+ if( rChanges.empty() )
{
rSpanPos.clear();
return;
}
- if( !rSpanPos.size() )
+ if( rSpanPos.empty() )
{
rChanges.clear();
return;
@@ -1332,14 +1338,14 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
}
lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[nCurr],
rParm.nOldWish, nOldWidth, true );
- bool bGoOn = aRowSpanPos.size() > 0;
+ bool bGoOn = !aRowSpanPos.empty();
sal_uInt16 j = nCurr;
while( bGoOn )
{
lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[--j],
rParm.nOldWish, nOldWidth, true );
lcl_AdjustWidthsInLine( rLines[j], aCopy, rParm, 0 );
- bGoOn = aRowSpanPos.size() > 0 && j > 0;
+ bGoOn = !aRowSpanPos.empty() && j > 0;
};
aRowSpanPos.clear();
}
@@ -1356,17 +1362,17 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
}
lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[nCurr],
rParm.nOldWish, nOldWidth, false );
- bool bGoOn = aRowSpanPos.size() > 0;
+ bool bGoOn = !aRowSpanPos.empty();
sal_uInt16 j = nCurr;
while( bGoOn )
{
lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[++j],
rParm.nOldWish, nOldWidth, false );
lcl_AdjustWidthsInLine( rLines[j], aCopy, rParm, 0 );
- bGoOn = aRowSpanPos.size() > 0 && j+1 < rLines.Count();
+ bGoOn = !aRowSpanPos.empty() && j+1 < rLines.Count();
};
}
- ::lcl_AdjustWidthsInLine( rLines[nCurr], aOldNew, rParm, 1 );
+ ::lcl_AdjustWidthsInLine( rLines[nCurr], aOldNew, rParm, COLFUZZY );
}
else for( sal_uInt16 i = 0; i < rLines.Count(); ++i )
::lcl_AdjustWidthsInLine( rLines[i], aOldNew, rParm, COLFUZZY );
@@ -1394,7 +1400,7 @@ sal_Bool IsValidRowName( const String& rStr )
return bIsValid;
}
-// --> OD 2007-08-03 #i80314#
+// #i80314#
// add 3rd parameter and its handling
sal_uInt16 SwTable::_GetBoxNum( String& rStr, sal_Bool bFirstPart,
const bool bPerformValidCheck )
@@ -1442,9 +1448,8 @@ sal_uInt16 SwTable::_GetBoxNum( String& rStr, sal_Bool bFirstPart,
}
return nRet;
}
-// <--
-// --> OD 2007-08-03 #i80314#
+// #i80314#
// add 2nd parameter and its handling
const SwTableBox* SwTable::GetTblBox( const String& rName,
const bool bPerformValidCheck ) const
@@ -1524,10 +1529,9 @@ SwTableBox* SwTable::GetTblBox( sal_uLong nSttIdx )
if ( pCNd || pTblNd )
{
SwModify* pModify = pCNd;
- // --> FME 2007-3-26 #144862# Better handling of table in table:
+ // #144862# Better handling of table in table
if ( pTblNd && pTblNd->GetTable().GetFrmFmt() )
pModify = pTblNd->GetTable().GetFrmFmt();
- // <--
SwFrm* pFrm = SwIterator<SwFrm,SwModify>::FirstElement( *pModify );
while ( pFrm && !pFrm->IsCellFrm() )
@@ -1637,7 +1641,7 @@ void SwTableLine::ChgFrmFmt( SwTableLineFmt *pNewFmt )
pRow->SetCompletePaint();
pRow->ReinitializeFrmSizeAttrFlags();
- // --> FME 2004-10-27 #i35063#
+ // #i35063#
// consider 'split row allowed' attribute
SwTabFrm* pTab = pRow->FindTabFrm();
bool bInFollowFlowRow = false;
@@ -1654,7 +1658,6 @@ void SwTableLine::ChgFrmFmt( SwTableLineFmt *pNewFmt )
pTab->SetRemoveFollowFlowLinePending( sal_True );
pTab->InvalidatePos();
}
- // <--
}
}
@@ -1863,7 +1866,7 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
pCell->SetDerivedVert( sal_False );
pCell->CheckDirChange();
- // --> FME 2005-04-15 #i47489#
+ // #i47489#
// make sure that the row will be formatted, in order
// to have the correct Get(Top|Bottom)MarginForLowers values
// set at the row.
@@ -1874,7 +1877,6 @@ void SwTableBox::ChgFrmFmt( SwTableBoxFmt* pNewFmt )
pRow->_InvalidateSize();
pRow->_InvalidatePrt();
}
- // <--
}
}
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index 7518da3bfa..a7bc5063e4 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1710,10 +1710,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
if ( !bIntern || -1 != nDestId )
{
- // --> FME 2005-05-09 #i44368# Links in Header/Footer
+ // #i44368# Links in Header/Footer
const SwPosition aPos( *pTNd );
const bool bHeaderFooter = pDoc->IsInHeaderFooter( aPos.nNode );
- // <--
// Create links for all selected rectangles:
const sal_uInt16 nNumOfRects = aTmp.Count();
@@ -1741,10 +1740,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
else
pPDFExtOutDevData->SetLinkURL( nLinkId, aURL );
- // --> FME 2005-05-09 #i44368# Links in Header/Footer
+ // #i44368# Links in Header/Footer
if ( bHeaderFooter )
MakeHeaderFooterLinks( *pPDFExtOutDevData, *pTNd, rLinkRect, nDestId, aURL, bIntern );
- // <--
}
}
}
@@ -1807,7 +1805,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
else
pPDFExtOutDevData->SetLinkURL( nLinkId, aURL );
- // --> FME 2005-05-09 #i44368# Links in Header/Footer
+ // #i44368# Links in Header/Footer
const SwFmtAnchor &rAnch = pFrmFmt->GetAnchor();
if (FLY_AT_PAGE != rAnch.GetAnchorId())
{
@@ -1819,7 +1817,6 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
MakeHeaderFooterLinks( *pPDFExtOutDevData, *pTNd, aLinkRect, nDestId, aURL, bIntern );
}
}
- // <--
}
}
}
@@ -1871,10 +1868,9 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Destination Export
const sal_Int32 nDestId = pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum );
- // --> FME 2005-05-09 #i44368# Links in Header/Footer
+ // #i44368# Links in Header/Footer
const SwPosition aPos( *pTNd );
const bool bHeaderFooter = pDoc->IsInHeaderFooter( aPos.nNode );
- // <--
// Create links for all selected rectangles:
const sal_uInt16 nNumOfRects = aTmp.Count();
@@ -1899,13 +1895,12 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// Connect Link and Destination:
pPDFExtOutDevData->SetLinkDest( nLinkId, nDestId );
- // --> FME 2005-05-09 #i44368# Links in Header/Footer
+ // #i44368# Links in Header/Footer
if ( bHeaderFooter )
{
const String aDummy;
MakeHeaderFooterLinks( *pPDFExtOutDevData, *pTNd, rLinkRect, nDestId, aDummy, true );
}
- // <--
}
}
}
@@ -2001,9 +1996,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
OSL_ENSURE( 0 != pTNd, "Enhanced pdf export - text node is missing" );
if ( pTNd->IsHidden() ||
- // --> FME 2005-01-10 #i40292# Skip empty outlines:
+ // #i40292# Skip empty outlines:
0 == pTNd->GetTxt().Len() )
- // <--
continue;
// Get parent id from stack:
@@ -2045,7 +2039,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
if( pPDFExtOutDevData->GetIsExportNamedDestinations() )
{
- //---> i56629 the iteration to convert the OOo bookmark (#bookmark)
+ // #i56629# the iteration to convert the OOo bookmark (#bookmark)
// into PDF named destination, see section 8.2.1 in PDF 1.4 spec
// We need:
// 1. a name for the destination, formed from the standard OOo bookmark name
@@ -2102,12 +2096,18 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
if ( -1 != nDestPageNum )
{
- // Destination Export
- const sal_Int32 nDestId =
- pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum );
+ if ( aIBeg->nLinkId != -1 )
+ {
+ // Destination Export
+ const sal_Int32 nDestId = pPDFExtOutDevData->CreateDest( rDestRect.SVRect(), nDestPageNum );
- // Connect Link and Destination:
- pPDFExtOutDevData->SetLinkDest( aIBeg->nLinkId, nDestId );
+ // Connect Link and Destination:
+ pPDFExtOutDevData->SetLinkDest( aIBeg->nLinkId, nDestId );
+ }
+ else
+ {
+ pPDFExtOutDevData->DescribeRegisteredDest( aIBeg->nDestId, rDestRect.SVRect(), nDestPageNum );
+ }
}
}
else
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index 8ae39320d5..348819974d 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -229,7 +229,7 @@ bool lcl_ChgHyperLinkColor( const SwTxtAttr& rAttr,
RES_CHRATR_COLOR != rItem.Which() )
return false;
- // --> FME 2004-09-13 #i15455#
+ // #i15455#
// 1. case:
// We do not want to show visited links:
// (printing, pdf export, page preview)
@@ -257,7 +257,6 @@ bool lcl_ChgHyperLinkColor( const SwTxtAttr& rAttr,
return false;
}
- // <--
//
// 2. case:
diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx
index 8b66234be7..f120e386d9 100644
--- a/sw/source/core/text/blink.cxx
+++ b/sw/source/core/text/blink.cxx
@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-#include <tools/debug.hxx>
#include "viewsh.hxx"
#include "rootfrm.hxx" // GetOleShell()
#include "txtfrm.hxx" // FindRootFrm()
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 80c8c76e9a..9a95b72231 100644..100755
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -486,12 +486,11 @@ void SwTxtFrm::AdjustFrm( const SwTwips nChgHght, sal_Bool bHasToFit )
//In Tabellenzellen kann ich mir evtl. noch ein wenig dazuholen, weil
//durch eine vertikale Ausrichtung auch oben noch Raum sein kann.
- // --> OD 2004-11-25 #115759# - assure, that first lower in upper
+ // #115759# - assure, that first lower in upper
// is the current one or is valid.
if ( IsInTab() &&
( GetUpper()->Lower() == this ||
GetUpper()->Lower()->IsValid() ) )
- // <--
{
long nAdd = (*fnRect->fnYDiff)( (GetUpper()->Lower()->Frm().*fnRect->fnGetTop)(),
(GetUpper()->*fnRect->fnGetPrtTop)() );
@@ -667,7 +666,7 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
pFoll->MoveFlyInCnt( this, nStart, STRING_LEN );
pFoll->SetFtn( sal_False );
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for current next paragraph will change
// and relation CONTENT_FLOWS_TO for current previous paragraph, which
@@ -682,7 +681,6 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
this );
}
}
- // <--
pFoll->Cut();
delete pFoll;
pFollow = pNxt;
@@ -707,7 +705,7 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
SetFollow( pNew );
pNew->Paste( GetUpper(), GetNext() );
- // --> OD 2005-12-01 #i27138#
+ // #i27138#
// notify accessibility paragraphs objects about changed CONTENT_FLOWS_FROM/_TO relation.
// Relation CONTENT_FLOWS_FROM for current next paragraph will change
// and relation CONTENT_FLOWS_TO for current previous paragraph, which
@@ -722,7 +720,6 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
this );
}
}
- // <--
// Wenn durch unsere Aktionen Fussnoten in pNew landen,
// so muessen sie umgemeldet werden.
@@ -1025,8 +1022,21 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
!rFrmBreak.IsInside( rLine ) )
: rFrmBreak.IsBreakNow( rLine ) ) ) )
? 1 : 0;
+ // --> OD #i84870#
+ // no split of text frame, which only contains a as-character anchored object
+ const bool bOnlyContainsAsCharAnchoredObj =
+ !IsFollow() && nStrLen == 1 &&
+ GetDrawObjs() && GetDrawObjs()->Count() == 1 &&
+ (*GetDrawObjs())[0]->GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AS_CHAR;
+ if ( nNew && bOnlyContainsAsCharAnchoredObj )
+ {
+ nNew = 0;
+ }
+ // <--
if ( nNew )
+ {
SplitFrm( nEnd );
+ }
const SwFrm *pBodyFrm = (const SwFrm*)(FindBodyFrm());
@@ -1081,8 +1091,7 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
// the numbering and must stay.
if ( GetFollow()->GetOfst() != nEnd ||
GetFollow()->IsFieldFollow() ||
- ( nStrLen == 0 && GetTxtNode()->GetNumRule())
- )
+ ( nStrLen == 0 && GetTxtNode()->GetNumRule() ) )
{
nNew |= 3;
}
@@ -1093,8 +1102,11 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
{
// OD 21.03.2003 #108121# - Only split frame, if the frame contains
// content or contains no content, but has a numbering.
- if ( nStrLen > 0 ||
- ( nStrLen == 0 && GetTxtNode()->GetNumRule())
+ // OD #i84870# - no split, if text frame only contains one
+ // as-character anchored object.
+ if ( !bOnlyContainsAsCharAnchoredObj &&
+ ( nStrLen > 0 ||
+ ( nStrLen == 0 && GetTxtNode()->GetNumRule() ) )
)
{
SplitFrm( nEnd );
@@ -1115,7 +1127,15 @@ void SwTxtFrm::FormatAdjust( SwTxtFormatter &rLine,
const SwTwips nDocPrtTop = Frm().Top() + Prt().Top();
const SwTwips nOldHeight = Prt().SSize().Height();
- const SwTwips nChg = rLine.CalcBottomLine() - nDocPrtTop - nOldHeight;
+ SwTwips nChg = rLine.CalcBottomLine() - nDocPrtTop - nOldHeight;
+ // --> OD #i84870# - no shrink of text frame, if it only contains one
+ // as-character anchored object.
+ if ( nChg < 0 &&
+ bOnlyContainsAsCharAnchoredObj )
+ {
+ nChg = 0;
+ }
+ // <--
// Vertical Formatting:
// The (rotated) repaint rectangle's x coordinate referes to the frame.
@@ -1337,19 +1357,17 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
// AMA: Leider doch, Textgroessenaenderungen + FlyFrames, die Rueckwirkung
// kann im Extremfall mehrere Zeilen (Frames!!!) betreffen!
- // --> FME 2005-04-18 #i46560#
+ // #i46560#
// FME: Yes, consider this case: (word ) has to go to the next line
// because ) is a forbidden character at the beginning of a line although
// (word would still fit on the previous line. Adding text right in front
// of ) would not trigger a reformatting of the previous line. Adding 1
// to the result of FindBrk() does not solve the problem in all cases,
// nevertheless it should be sufficient.
- // <--
sal_Bool bPrev = rLine.GetPrev() &&
( FindBrk( rString, rLine.GetStart(), rReformat.Start() + 1 )
- // --> FME 2005-04-18 #i46560#
+ // #i46560#
+ 1
- // <--
>= rReformat.Start() ||
rLine.GetCurr()->IsRest() );
if( bPrev )
@@ -1445,10 +1463,11 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
if( IsFollow() && IsFieldFollow() && rLine.GetStart() == GetOfst() )
{
- const SwLineLayout* pLine;
+ SwTxtFrm *pMaster = FindMaster();
+ OSL_ENSURE( pMaster, "SwTxtFrm::Format: homeless follow" );
+ const SwLineLayout* pLine=NULL;
+ if (pMaster)
{
- SwTxtFrm *pMaster = FindMaster();
- OSL_ENSURE( pMaster, "SwTxtFrm::Format: homeless follow" );
if( !pMaster->HasPara() )
pMaster->GetFormatted();
SwTxtSizeInfo aInf( pMaster );
@@ -1456,8 +1475,8 @@ void SwTxtFrm::_Format( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf,
aMasterLine.Bottom();
pLine = aMasterLine.GetCurr();
}
- SwLinePortion* pRest =
- rLine.MakeRestPortion( pLine, GetOfst() );
+ SwLinePortion* pRest = pLine ?
+ rLine.MakeRestPortion(pLine, GetOfst()) : NULL;
if( pRest )
rInf.SetRest( pRest );
else
@@ -1919,9 +1938,8 @@ void SwTxtFrm::Format( const SwBorderAttrs * )
{
SwFrm* pPre = GetPrev();
if( pPre &&
- // --> FME 2004-07-22 #i10826# It's the first, it cannot keep!
+ // #i10826# It's the first, it cannot keep!
pPre->GetIndPrev() &&
- // <--
pPre->GetAttrSet()->GetKeep().GetValue() )
{
pPre->InvalidatePos();
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 724d21e4c6..42ef50469e 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -58,14 +58,13 @@
#include <tabfrm.hxx> // SwTabFrm (Redlining)
#include <SwGrammarMarkUp.hxx>
-// --> FME 2004-06-08 #i12836# enhanced pdf export
+// #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
-// <--
#include <IDocumentStylePoolAccess.hxx>
#include <IDocumentLineNumberAccess.hxx>
-// --> OD 2006-06-27 #b6440955#
+//
// variable moved to class <numfunc:GetDefBulletConfig>
//extern const sal_Char sBulletFntName[];
namespace numfunc
@@ -73,7 +72,6 @@ namespace numfunc
extern const String& GetDefBulletFontname();
extern bool IsDefBulletFontUserDefined();
}
-// <--
#define REDLINE_DISTANCE 567/4
@@ -332,9 +330,8 @@ void SwTxtFrm::PaintExtraData( const SwRect &rRect ) const
SwLayoutModeModifier aLayoutModeModifier( *pSh->GetOut() );
aLayoutModeModifier.Modify( sal_False );
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() );
- // <--
SwExtraPainter aExtra( this, pSh, rLineInf, rRect, eHor, bLineNum );
@@ -570,6 +567,7 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
// Don't show the paragraph mark for collapsed paragraphs, when they are hidden
if ( EmptyHeight( ) > 1 )
{
+ sal_uInt64 nOldDrawMode = SetHeaderFooterEditMask( pSh->GetOut() );
const XubString aTmp( CH_PAR );
SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), 0, aTmp, 0, 1 );
aDrawInf.SetLeft( rRect.Left() );
@@ -585,6 +583,7 @@ sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
aDrawInf.SetSnapToGrid( sal_False );
pFnt->_DrawText( aDrawInf );
+ pSh->GetOut()->SetDrawMode( nOldDrawMode );
}
delete pClip;
}
@@ -605,7 +604,7 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
ResetRepaint();
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
ViewShell *pSh = getRootFrm()->GetCurrShell();
Num_Info aNumInfo( *this );
@@ -613,7 +612,6 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
Frm_Info aFrmInfo( *this );
SwTaggedPDFHelper aTaggedPDFHelperParagraph( 0, &aFrmInfo, 0, *pSh->GetOut() );
- // <--
if( !IsEmpty() || !PaintEmpty( rRect, sal_True ) )
{
@@ -631,10 +629,9 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
{
OSL_ENSURE( GetValidPosFlag(), "+SwTxtFrm::Paint: no Calc()" );
- // --> FME 2004-10-29 #i29062# pass info that we are currently
+ // #i29062# pass info that we are currently
// painting.
((SwTxtFrm*)this)->GetFormatted( true );
- // <--
if( IsEmpty() )
{
PaintEmpty( rRect, sal_False );
@@ -702,6 +699,8 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
OutputDevice* pOut = aInf.GetOut();
const sal_Bool bOnWin = pSh->GetWin() != 0;
+ sal_uInt64 nOldDrawMode = SetHeaderFooterEditMask( pOut );
+
SwSaveClip aClip( bOnWin || IsUndersized() ? pOut : 0 );
// Ausgabeschleife: Fuer jede Zeile ... (die noch zu sehen ist) ...
@@ -733,6 +732,8 @@ void SwTxtFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
if( rRepaint.HasArea() )
rRepaint.Clear();
+ pOut->SetDrawMode( nOldDrawMode );
+
UNDO_SWAP( this )
(SwRect&)rRect = aOldRect;
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index cd489f3539..7ebeafc66b 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <ctype.h>
#include <editeng/unolingu.hxx>
#include <tools/shl.hxx> // needed for SW_MOD() macro
@@ -45,6 +44,7 @@
#include <com/sun/star/i18n/WordType.hpp>
#include <unotools/charclass.hxx>
#include <porfld.hxx>
+#include <paratr.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -68,7 +68,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
{
nCutPos = rInf.GetIdx();
- // Leere Strings sind immer 0
+ // Empty strings are always 0
if( !rInf.GetLen() || !rInf.GetTxt().Len() )
return sal_False;
@@ -121,9 +121,8 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
nLineWidth -= nItalic;
- // --> FME 2005-05-13 #i46524# LineBreak bug with italics
+ // #i46524# LineBreak bug with italics
if ( nLineWidth < 0 ) nLineWidth = 0;
- // <--
}
// first check if everything fits to line
@@ -141,10 +140,9 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
nCutPos = rInf.GetIdx() + nMaxLen;
if( nItalic &&
( nCutPos >= rInf.GetTxt().Len() ||
- // --> FME 2005-05-13 #i48035# Needed for CalcFitToContent
+ // #i48035# Needed for CalcFitToContent
// if first line ends with a manual line break
rInf.GetTxt().GetChar( nCutPos ) == CH_BREAK ) )
- // <--
nBreakWidth = nBreakWidth + nItalic;
// save maximum width for later use
@@ -191,8 +189,8 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
nBreakWidth = nMinSize;
- // Der folgende Vergleich sollte eigenlich immer sal_True ergeben, sonst
- // hat es wohl bei GetTxtBreak einen Pixel-Rundungsfehler gegeben...
+ // The following comparison should always give sal_True, otherwise
+ // a pixel rounding error in GetTxtBreak will appear
if ( nBreakWidth <= nLineWidth )
{
if( nItalic && ( nBreakPos + 1 ) >= rInf.GetTxt().Len() )
@@ -223,12 +221,23 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
nBreakPos = nCutPos;
xub_StrLen nX = nBreakPos;
- // we step back until a non blank character has been found
- // or there is only one more character left
- while( nX && nBreakPos > rInf.GetLineStart() + 1 &&
- ( CH_BLANK == ( cCutChar = rInf.GetChar( --nX ) ) ||
- CH_FULL_BLANK == cCutChar ) )
- --nBreakPos;
+ const SvxAdjust& rAdjust = rInf.GetTxtFrm()->GetTxtNode()->GetSwAttrSet().GetAdjust().GetAdjust();
+ if ( rAdjust == SVX_ADJUST_LEFT )
+ {
+ // we step back until a non blank character has been found
+ // or there is only one more character left
+ while( nX && nBreakPos > rInf.GetTxt().Len() &&
+ ( CH_BLANK == ( cCutChar = rInf.GetChar( --nX ) ) ||
+ CH_FULL_BLANK == cCutChar ) )
+ --nBreakPos;
+ }
+ else
+ {
+ while( nX && nBreakPos > rInf.GetLineStart() + 1 &&
+ ( CH_BLANK == ( cCutChar = rInf.GetChar( --nX ) ) ||
+ CH_FULL_BLANK == cCutChar ) )
+ --nBreakPos;
+ }
if( nBreakPos > rInf.GetIdx() )
nPorLen = nBreakPos - rInf.GetIdx();
@@ -432,16 +441,20 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
CHAR_SOFTHYPHEN == rInf.GetTxt().GetChar( nBreakPos - 1 ) )
nBreakPos = rInf.GetIdx() - 1;
- // Delete any blanks at the end of a line, but be careful:
- // If a field has been expanded, we do not want to delete any
- // blanks inside the field portion. This would cause an unwanted
- // underflow
- xub_StrLen nX = nBreakPos;
- while( nX > rInf.GetLineStart() &&
- ( CH_TXTATR_BREAKWORD != cFldChr || nX > rInf.GetIdx() ) &&
- ( CH_BLANK == rInf.GetChar( --nX ) ||
- CH_FULL_BLANK == rInf.GetChar( nX ) ) )
- nBreakPos = nX;
+ const SvxAdjust& rAdjust = rInf.GetTxtFrm()->GetTxtNode()->GetSwAttrSet().GetAdjust().GetAdjust();
+ if( rAdjust != SVX_ADJUST_LEFT )
+ {
+ // Delete any blanks at the end of a line, but be careful:
+ // If a field has been expanded, we do not want to delete any
+ // blanks inside the field portion. This would cause an unwanted
+ // underflow
+ xub_StrLen nX = nBreakPos;
+ while( nX > rInf.GetLineStart() &&
+ ( CH_TXTATR_BREAKWORD != cFldChr || nX > rInf.GetIdx() ) &&
+ ( CH_BLANK == rInf.GetChar( --nX ) ||
+ CH_FULL_BLANK == rInf.GetChar( nX ) ) )
+ nBreakPos = nX;
+ }
if( nBreakPos > rInf.GetIdx() )
nPorLen = nBreakPos - rInf.GetIdx();
}
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index ee9f9b9cce..e04d713bcc 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -73,13 +73,12 @@
#include <pam.hxx>
#include <SwGrammarMarkUp.hxx>
#include <cstdio>
-// --> FME 2004-06-08 #i12836# enhanced pdf export
+// #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
-// <--
#include <unomid.h>
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
@@ -100,7 +99,7 @@ using namespace ::com::sun::star::beans;
#define DRAW_SPECIAL_OPTIONS_CENTER 1
#define DRAW_SPECIAL_OPTIONS_ROTATE 2
-// --> OD 2006-06-27 #b6440955#
+//
// variable moved to class <numfunc:GetDefBulletConfig>
//extern const sal_Char sBulletFntName[];
namespace numfunc
@@ -108,7 +107,6 @@ namespace numfunc
extern const String& GetDefBulletFontname();
extern bool IsDefBulletFontUserDefined();
}
-// <--
#if OSL_DEBUG_LEVEL > 1
// Test2: WYSIWYG++
@@ -692,12 +690,11 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
if ( nSpaceAdd )
{
xub_StrLen nCharCnt;
- // --> FME 2005-04-04 #i41860# Thai justified alignemt needs some
+ // #i41860# Thai justified alignemt needs some
// additional information:
aDrawInf.SetNumberOfBlanks( rPor.InTxtGrp() ?
static_cast<const SwTxtPortion&>(rPor).GetSpaceCnt( *this, nCharCnt ) :
0 );
- // <--
}
aDrawInf.SetSpace( nSpaceAdd );
@@ -1195,7 +1192,7 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
bool bIsStartMark=(1==GetLen() && CH_TXT_ATR_FIELDSTART==GetTxt().GetChar(GetIdx()));
if(pFieldmark) {
OSL_TRACE("Found Fieldmark");
-#if DEBUG
+#if OSL_DEBUG_LEVEL > 1
rtl::OUString str = pFieldmark->ToString( );
fprintf( stderr, "%s\n", rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr( ) );
#endif
@@ -1225,9 +1222,8 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
{
OutputDevice* pTmpOut = (OutputDevice*)GetOut();
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pTmpOut );
- // <--
pTmpOut->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
@@ -1347,7 +1343,7 @@ static void lcl_InitHyphValues( PropertyValues &rVals,
const PropertyValues & SwTxtFormatInfo::GetHyphValues() const
{
- DBG_ASSERT( 2 == aHyphVals.getLength(),
+ OSL_ENSURE( 2 == aHyphVals.getLength(),
"hyphenation values not yet initialized" );
return aHyphVals;
}
@@ -1469,7 +1465,8 @@ void SwTxtFormatInfo::Init()
if ( GetTxtFrm()->IsFollow() )
{
const SwTxtFrm* pMaster = GetTxtFrm()->FindMaster();
- const SwLinePortion* pTmpPara = pMaster->GetPara();
+ OSL_ENSURE(pMaster, "pTxtFrm without Master");
+ const SwLinePortion* pTmpPara = pMaster ? pMaster->GetPara() : NULL;
// there is a master for this follow and the master does not have
// any contents (especially it does not have a number portion)
@@ -1598,9 +1595,8 @@ xub_StrLen SwTxtFormatInfo::ScanPortionEnd( const xub_StrLen nStart,
//
const xub_Unicode cTabDec = GetLastTab() ? (sal_Unicode)GetTabDecimal() : 0;
const xub_Unicode cThousandSep = ',' == cTabDec ? '.' : ',';
- // --> FME 2006-01-23 #i45951# German (Switzerland) uses ' as thousand separator:
+ // #i45951# German (Switzerland) uses ' as thousand separator
const xub_Unicode cThousandSep2 = ',' == cTabDec ? '.' : '\'';
- // <--
bool bNumFound = false;
const bool bTabCompat = GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT);
@@ -1669,7 +1665,7 @@ xub_StrLen SwTxtFormatInfo::ScanPortionEnd( const xub_StrLen nStart,
}
}
- // --> FME 2006-01-13 #130210# Check if character *behind* the portion has
+ // #130210# Check if character *behind* the portion has
// to become the hook:
if ( i == nEnd && i < GetTxt().Len() && bNumFound )
{
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index ecb2355f88..5fb19038aa 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -178,7 +178,7 @@ protected:
SwTxtPortionTable aMaxWidth;
// for each line, an array of compression values is calculated
// this array is passed over to the info structure
- SvUShorts* pKanaComp;
+ std::deque<sal_uInt16>* pKanaComp;
ViewShell *pVsh;
@@ -365,10 +365,10 @@ public:
inline void ResetKanaIdx(){ nKanaIdx = 0; }
inline void SetKanaIdx( MSHORT nNew ) { nKanaIdx = nNew; }
inline void IncKanaIdx() { ++nKanaIdx; }
- inline void SetKanaComp( SvUShorts *pNew ){ pKanaComp = pNew; }
- inline SvUShorts* GetpKanaComp() const { return pKanaComp; }
+ inline void SetKanaComp( std::deque<sal_uInt16> *pNew ){ pKanaComp = pNew; }
+ inline std::deque<sal_uInt16>* GetpKanaComp() const { return pKanaComp; }
inline sal_uInt16 GetKanaComp() const
- { return ( pKanaComp && nKanaIdx < pKanaComp->Count() )
+ { return ( pKanaComp && nKanaIdx < pKanaComp->size() )
? (*pKanaComp)[nKanaIdx] : 0; }
#if OSL_DEBUG_LEVEL > 1
@@ -532,11 +532,10 @@ class SwTxtFormatInfo : public SwTxtPaintInfo
xub_StrLen nHyphWrdLen; // gefundene Wort-Laenge
xub_StrLen nLineStart; // aktueller Zeilenbeginn im rTxt
xub_StrLen nUnderScorePos; // enlarge repaint if underscore has been found
- // --> FME 2004-11-25 #i34348# Changed type from sal_uInt16 to SwTwips
+ // #i34348# Changed type from sal_uInt16 to SwTwips
SwTwips nLeft; // linker Rand
SwTwips nRight; // rechter Rand
SwTwips nFirst; // EZE
- // <--
KSHORT nRealWidth; // "echte" Zeilenbreite
KSHORT nWidth; // "virtuelle" Zeilenbreite
KSHORT nLineHeight; // endgueltige Hoehe nach CalcLine
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 83cfd36ef5..59b6cae3d1 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -304,10 +304,9 @@ void SwTxtAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
if (!bSkipKashida)
CalcRightMargin( pCurrent, nReal );
- // --> FME 2005-06-08 #i49277#
+ // #i49277#
const sal_Bool bDoNotJustifyLinesWithManualBreak =
GetTxtFrm()->GetNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK);
- // <--
SwLinePortion *pPos = pCurrent->GetPortion();
@@ -424,7 +423,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
OSL_ENSURE( pCurrent->Height(), "SwTxtAdjuster::CalcBlockAdjust: missing CalcLine()" );
OSL_ENSURE( !pCurrent->GetpKanaComp(), "pKanaComp already exists!!" );
- SvUShorts *pNewKana = new SvUShorts;
+ std::deque<sal_uInt16> *pNewKana = new std::deque<sal_uInt16>();
pCurrent->SetKanaComp( pNewKana );
const sal_uInt16 nNull = 0;
@@ -462,8 +461,8 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
}
else if( pPos->InGlueGrp() && pPos->InFixMargGrp() )
{
- if ( nKanaIdx == pCurrent->GetKanaComp().Count() )
- pCurrent->GetKanaComp().Insert( nNull, nKanaIdx );
+ if ( nKanaIdx == pCurrent->GetKanaComp().size() )
+ pCurrent->GetKanaComp().push_back( nNull );
sal_uInt16 nRest;
@@ -550,8 +549,7 @@ SwTwips SwTxtAdjuster::CalcKanaAdj( SwLineLayout* pCurrent )
// set fix width to width
((SwTabPortion*)pPos)->SetFixWidth( pPos->Width() );
- const SvUShorts& rKanaComp = pCurrent->GetKanaComp();
- if ( ++nKanaIdx < rKanaComp.Count() )
+ if ( ++nKanaIdx < pCurrent->GetKanaComp().size() )
nCompress = ( pCurrent->GetKanaComp() )[ nKanaIdx ];
nKanaDiffSum = 0;
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 60a129248c..3c4bebd7ac 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -56,9 +56,8 @@
#include "pordrop.hxx"
#include "crstate.hxx" // SwCrsrMoveState
#include <pormulti.hxx> // SwMultiPortion
-// --> OD 2010-05-05 #i111284#
+// #i111284#
#include <numrule.hxx>
-// <--
// Nicht reentrant !!!
// wird in GetCharRect gesetzt und im UnitUp/Down ausgewertet.
@@ -145,7 +144,7 @@ void lcl_GetCharRectInsideField( SwTxtSizeInfo& rInf, SwRect& rOrig,
}
}
-// --> OD 2010-05-05 #i111284#
+// #i111284#
namespace {
bool AreListLevelIndentsApplicableAndLabelAlignmentActive( const SwTxtNode& rTxtNode )
{
@@ -164,7 +163,6 @@ namespace {
return bRet;
}
} // end of anonymous namespace
-// <--
/*************************************************************************
* SwTxtMargin::CtorInitTxtMargin()
@@ -178,11 +176,10 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
const SwTxtNode *pNode = pFrm->GetTxtNode();
const SvxLRSpaceItem &rSpace = pFrm->GetTxtNode()->GetSwAttrSet().GetLRSpace();
- // --> OD 2009-09-08 #i95907#, #b6879723#
- // --> OD 2010-05-05 #i111284#
+ // #i95907#
+ // #i111284#
const bool bListLevelIndentsApplicableAndLabelAlignmentActive(
AreListLevelIndentsApplicableAndLabelAlignmentActive( *(pFrm->GetTxtNode()) ) );
- // <--
//
// Carefully adjust the text formatting ranges.
@@ -204,37 +201,31 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
pFrm->Prt().Left() +
nLMWithNum -
pNode->GetLeftMarginWithNum( sal_False ) -
- // --> OD 2009-09-08 #i95907#, #b6879723#
- // --> OD 2010-05-05 #i111284#
+ // #i95907#
+ // #i111284#
// rSpace.GetLeft() +
// rSpace.GetTxtLeft();
( bListLevelIndentsApplicableAndLabelAlignmentActive
? 0
: ( rSpace.GetLeft() - rSpace.GetTxtLeft() ) );
- // <--
}
else
{
- // --> OD 2009-09-08 #i95907#, #b6879723#
- // --> OD 2010-05-05 #i111284#
-// if ( !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ // #i95907#
+ // #i111284#
if ( bListLevelIndentsApplicableAndLabelAlignmentActive ||
!pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
- // <--
{
// this calculation is identical this the calculation for R2L layout - see above
nLeft = pFrm->Frm().Left() +
pFrm->Prt().Left() +
nLMWithNum -
pNode->GetLeftMarginWithNum( sal_False ) -
- // --> OD 2009-09-08 #i95907#, #b6879723#
- // --> OD 2010-05-05 #i111284#
-// rSpace.GetLeft() +
-// rSpace.GetTxtLeft();
+ // #i95907#
+ // #i111284#
( bListLevelIndentsApplicableAndLabelAlignmentActive
? 0
: ( rSpace.GetLeft() - rSpace.GetTxtLeft() ) );
- // <--
}
else
{
@@ -247,12 +238,11 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
nRight = pFrm->Frm().Left() + pFrm->Prt().Left() + pFrm->Prt().Width();
if( nLeft >= nRight &&
- // --> FME 2005-08-10 #i53066# Omit adjustment of nLeft for numbered
+ // #i53066# Omit adjustment of nLeft for numbered
// paras inside cells inside new documents:
( pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) ||
!pFrm->IsInTab() ||
!nLMWithNum ) )
- // <--
{
nLeft = pFrm->Prt().Left() + pFrm->Frm().Left();
if( nLeft >= nRight ) // z.B. bei grossen Absatzeinzuegen in schmalen Tabellenspalten
@@ -318,14 +308,11 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
else
nFirstLineOfs = nFLOfst;
- // --> OD 2009-09-08 #i95907#, #b6879723#
- // --> OD 2010-05-05 #i111284#
-// if ( pFrm->IsRightToLeft() ||
-// !pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
+ // #i95907#
+ // #i111284#
if ( pFrm->IsRightToLeft() ||
bListLevelIndentsApplicableAndLabelAlignmentActive ||
!pNode->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) )
- // <--
{
nFirst = nLeft + nFirstLineOfs;
}
@@ -361,9 +348,8 @@ void SwTxtMargin::CtorInitTxtMargin( SwTxtFrm *pNewFrm, SwTxtSizeInfo *pNewInf )
bLastBlock = rAdjust.GetLastBlock() == SVX_ADJUST_BLOCK;
bLastCenter = rAdjust.GetLastBlock() == SVX_ADJUST_CENTER;
- // --> OD 2008-07-01 #i91133#
+ // #i91133#
mnTabLeft = pNode->GetLeftMarginForTabCalculation();
- // <--
#if OSL_DEBUG_LEVEL > 1
static sal_Bool bOne = sal_False;
@@ -551,9 +537,9 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
SwLinePortion *pPor = pCurr->GetFirstPortion();
SwBidiPortion* pLastBidiPor = 0;
SwTwips nLastBidiPorWidth = 0;
- SvUShorts* pKanaComp = pCurr->GetpKanaComp();
+ std::deque<sal_uInt16>* pKanaComp = pCurr->GetpKanaComp();
MSHORT nSpaceIdx = 0;
- MSHORT nKanaIdx = 0;
+ size_t nKanaIdx = 0;
long nSpaceAdd = pCurr->IsSpaceAdd() ? pCurr->GetLLSpaceAdd( 0 ) : 0;
sal_Bool bNoTxt = sal_True;
@@ -587,7 +573,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nSpaceAdd = 0;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
++nKanaIdx;
}
if( pPor->InFixMargGrp() )
@@ -605,7 +591,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nSpaceAdd = 0;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
++nKanaIdx;
}
}
@@ -662,7 +648,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
}
if ( pKanaComp &&
- ( nKanaIdx + 1 ) < pKanaComp->Count()
+ ( nKanaIdx + 1 ) < pKanaComp->size()
)
++nKanaIdx;
}
@@ -682,7 +668,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nSpaceAdd = 0;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
++nKanaIdx;
}
@@ -1002,7 +988,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nSpaceAdd = 0;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
++nKanaIdx;
}
if ( !pPor->IsFlyPortion() || ( pPor->GetPortion() &&
@@ -1020,7 +1006,7 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
nSpaceAdd = 0;
}
- if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->Count() )
+ if( pKanaComp && ( nKanaIdx + 1 ) < pKanaComp->size() )
++nKanaIdx;
}
if( !pPor->IsFlyPortion() )
@@ -1312,10 +1298,10 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
sal_Bool bHolePortion = sal_False;
sal_Bool bLastHyph = sal_False;
- SvUShorts *pKanaComp = pCurr->GetpKanaComp();
+ std::deque<sal_uInt16> *pKanaComp = pCurr->GetpKanaComp();
xub_StrLen nOldIdx = GetInfo().GetIdx();
MSHORT nSpaceIdx = 0;
- MSHORT nKanaIdx = 0;
+ size_t nKanaIdx = 0;
long nSpaceAdd = pCurr->IsSpaceAdd() ? pCurr->GetLLSpaceAdd( 0 ) : 0;
short nKanaComp = pKanaComp ? (*pKanaComp)[0] : 0;
@@ -1344,7 +1330,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
if( pKanaComp )
{
- if ( nKanaIdx + 1 < pKanaComp->Count() )
+ if ( nKanaIdx + 1 < pKanaComp->size() )
nKanaComp = (*pKanaComp)[++nKanaIdx];
else
nKanaComp = 0;
@@ -1389,7 +1375,7 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
if ( pKanaComp )
{
- if( nKanaIdx + 1 < pKanaComp->Count() )
+ if( nKanaIdx + 1 < pKanaComp->size() )
nKanaComp = (*pKanaComp)[++nKanaIdx];
else
nKanaComp = 0;
@@ -1634,12 +1620,11 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
if ( nSpaceAdd )
{
xub_StrLen nCharCnt;
- // --> FME 2005-04-04 #i41860# Thai justified alignemt needs some
+ // #i41860# Thai justified alignemt needs some
// additional information:
aDrawInf.SetNumberOfBlanks( pPor->InTxtGrp() ?
static_cast<const SwTxtPortion*>(pPor)->GetSpaceCnt( aSizeInf, nCharCnt ) :
0 );
- // <--
}
if ( pPor->InFldGrp() && pCMS && pCMS->pSpecialPos )
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 78dd1f13da..1fe771e8f3 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -346,9 +346,8 @@ void SwTxtFormatter::InsertPortion( SwTxtFormatInfo &rInf,
pPor = pCurr->GetPortion();
}
- // --> OD 2010-07-07 #i112181#
+ // #i112181#
rInf.SetOtherThanFtnInside( rInf.IsOtherThanFtnInside() || !pPor->IsFtnPortion() );
- // <--
}
else
{
@@ -775,7 +774,7 @@ void SwTxtFormatter::CalcAscent( SwTxtFormatInfo &rInf, SwLinePortion *pPor )
((SwFldPortion*)pPor)->Height( pFldFnt->GetHeight( rInf.GetVsh(), *rInf.GetOut() ) );
((SwFldPortion*)pPor)->SetAscent( pFldFnt->GetAscent( rInf.GetVsh(), *rInf.GetOut() ) );
}
- // --> OD 2008-06-05 #i89179#
+ // #i89179#
// tab portion representing the list tab of a list label gets the
// same height and ascent as the corresponding number portion
else if ( pPor->InTabGrp() && pPor->GetLen() == 0 &&
@@ -786,7 +785,6 @@ void SwTxtFormatter::CalcAscent( SwTxtFormatInfo &rInf, SwLinePortion *pPor )
pPor->Height( pLast->Height() );
pPor->SetAscent( pLast->GetAscent() );
}
- // <--
else
{
const SwLinePortion *pLast = rInf.GetLast();
@@ -1236,10 +1234,9 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
if( !pPor )
{
if( ( !pMulti || pMulti->IsBidi() ) &&
- // --> FME 2005-02-14 #i42734#
+ // #i42734#
// No multi portion if there is a hook character waiting:
( !rInf.GetRest() || '\0' == rInf.GetHookChar() ) )
- // <--
{
// We open a multiportion part, if we enter a multi-line part
// of the paragraph.
@@ -1346,7 +1343,7 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
SwTabPortion* pLastTabPortion = rInf.GetLastTab();
if ( pLastTabPortion && cChar == rInf.GetTabDecimal() )
{
- // --> FME 2005-12-19 #127428# Abandon dec. tab position if line is full:
+ // #127428# Abandon dec. tab position if line is full
// We have a decimal tab portion in the line and the next character has to be
// aligned at the tab stop position. We store the width from the beginning of
// the tab stop portion up to the portion containint the decimal separator:
@@ -1358,7 +1355,6 @@ SwLinePortion *SwTxtFormatter::NewPortion( SwTxtFormatInfo &rInf )
static_cast<SwTabDecimalPortion*>(pLastTabPortion)->SetWidthOfPortionsUpToDecimalPosition( nWidthOfPortionsUpToDecimalPosition );
rInf.SetTabDecimal( 0 );
}
- // <--
else
rInf.SetFull( rInf.GetLastTab()->Format( rInf ) );
}
@@ -1852,11 +1848,10 @@ void SwTxtFormatter::FeedInf( SwTxtFormatInfo &rInf ) const
rInf.SetIdx( nStart );
// Handle overflows:
- // --> FME 2004-11-25 #i34348# Changed type from sal_uInt16 to SwTwips
+ // #i34348# Changed type from sal_uInt16 to SwTwips
SwTwips nTmpLeft = Left();
SwTwips nTmpRight = Right();
SwTwips nTmpFirst = FirstLeft();
- // <--
if ( nTmpLeft > USHRT_MAX ||
nTmpRight > USHRT_MAX ||
@@ -2052,7 +2047,7 @@ namespace {
#ifndef QUARTZ
#ifndef ENABLE_GRAPHITE
- // --> FME 2004-09-27 #i28795#, #i34607#, #i38388#
+ // #i28795#, #i34607#, #i38388#
// step back six(!) more characters for complex scripts
// this is required e.g., for Khmer (thank you, Javier!)
const SwScriptInfo& rSI = txtFmtInfo.GetParaPortion()->GetScriptInfo();
@@ -2075,7 +2070,6 @@ namespace {
else
nReformat = txtFmtInfo.GetLineStart();
}
- // <--
// Weird situation: Our line used to end with a hole portion
// and we delete some characters at the end of our line. We have
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 8e677354c4..8310947d23 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -50,9 +50,8 @@
#include <pagedesc.hxx> // SwPageDesc
#include <tgrditem.hxx>
-// --> FME 2004-06-08 #i12836# enhanced pdf export
+// #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
-// <--
#include "flyfrms.hxx"
@@ -398,10 +397,9 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
}
{
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
Por_Info aPorInfo( *pPor, *this );
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, &aPorInfo, *pOut );
- // <--
if( pPor->IsMultiPortion() )
PaintMultiPortion( rPaint, (SwMultiPortion&)*pPor );
@@ -426,11 +424,10 @@ void SwTxtPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
pArrow = (SwArrowPortion*)pPor;
pPor = bDrawInWindow || GetInfo().X() <= nMaxRight ||
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
( GetInfo().GetVsh() &&
GetInfo().GetVsh()->GetViewOptions()->IsPDFExport() &&
pNext && pNext->IsHolePortion() ) ?
- // <--
pNext :
0;
}
diff --git a/sw/source/core/text/itrtxt.hxx b/sw/source/core/text/itrtxt.hxx
index 84c027ef72..1aa55ec49f 100644
--- a/sw/source/core/text/itrtxt.hxx
+++ b/sw/source/core/text/itrtxt.hxx
@@ -149,9 +149,8 @@ private:
KSHORT nDropDescent;
MSHORT nDropLines;
MSHORT nAdjust;
- // --> OD 2008-06-30 #i91133#
+ // #i91133#
SwTwips mnTabLeft;
- // <--
protected:
// fuer FormatQuoVadis
@@ -181,12 +180,11 @@ public:
inline SwTwips GetLeftMin() const { return nFirst < nLeft ? nFirst : nLeft; }
inline sal_Bool HasNegFirst() const { return nFirst < nLeft; }
- // --> OD 2008-06-30 #i91133#
+ // #i91133#
inline SwTwips GetTabLeft() const
{
return mnTabLeft;
}
- // <--
// DropCaps
inline MSHORT GetDropLines() const { return nDropLines; }
inline void SetDropLines( const MSHORT nNew ) { nDropLines = nNew; }
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 96f62a8ac1..34e8e48df3 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -72,10 +72,9 @@ SwFldPortion *SwFldPortion::Clone( const XubString &rExpand ) const
{
pNewFnt = new SwFont( *pFnt );
}
- // --> OD 2009-11-25 #i107143#
+ // #i107143#
// pass placeholder property to created <SwFldPortion> instance.
SwFldPortion* pClone = new SwFldPortion( rExpand, pNewFnt, bPlaceHolder );
- // <--
pClone->SetNextOffset( nNextOffset );
pClone->m_bNoLength = this->m_bNoLength;
return pClone;
@@ -243,12 +242,10 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf )
// #i16354# Change script type for RTL text to CTL.
const SwScriptInfo& rSI = rInf.GetParaPortion()->GetScriptInfo();
- // --> OD 2009-01-29 #i98418#
-// const sal_uInt8 nFldDir = IsNumberPortion() ?
+ // #i98418#
const sal_uInt8 nFldDir = ( IsNumberPortion() || IsFtnNumPortion() ) ?
rSI.GetDefaultDir() :
rSI.DirType( IsFollow() ? rInf.GetIdx() - 1 : rInf.GetIdx() );
- // <--
if ( UBIDI_RTL == nFldDir )
{
UErrorCode nError = U_ZERO_ERROR;
@@ -283,11 +280,10 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf )
nTmp = SW_CTL;
}
- // --> OD 2009-01-29 #i98418#
+ // #i98418#
// keep determined script type for footnote portions as preferred script type.
// For footnote portions a font can not be created directly - see footnote
// portion format method.
-// if( !IsFtnPortion() && nTmp != nActual )
if ( IsFtnPortion() )
{
dynamic_cast<SwFtnPortion*>(this)->SetPreferredScriptType( nTmp );
@@ -298,7 +294,6 @@ void SwFldPortion::CheckScript( const SwTxtSizeInfo &rInf )
pFnt = new SwFont( *rInf.GetFont() );
pFnt->SetActual( nTmp );
}
- // <--
}
}
@@ -398,20 +393,16 @@ sal_Bool SwFldPortion::Format( SwTxtFormatInfo &rInf )
case CHAR_HARDHYPHEN: // non-breaking hyphen
case CHAR_SOFTHYPHEN:
case CHAR_HARDBLANK:
- // --> FME 2006-01-11 #i59759# Erase additional control
+ // #i59759# Erase additional control
// characters from field string, otherwise we get stuck in
// a loop.
case CHAR_ZWSP :
case CHAR_ZWNBSP :
- // case CHAR_RLM :
- // case CHAR_LRM :
- // <--
- // --> OD 2010-06-03 #i111750#
+ // #i111750#
// - Erasing further control characters from field string in
// to avoid loop.
case CH_TXTATR_BREAKWORD:
case CH_TXTATR_INWORD:
- // <--
{
aNew.Erase( 0, 1 );
++nNextOfst;
@@ -597,9 +588,8 @@ sal_Bool SwNumberPortion::Format( SwTxtFormatInfo &rInf )
if ( !mbLabelAlignmentPosAndSpaceModeActive )
{
if ( !rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING) &&
- // --> FME 2004-08-13 #i32902#
+ // #i32902#
!IsFtnNumPortion() )
- // <--
{
nDiff = rInf.Left()
+ rInf.GetTxtFrm()->GetTxtNode()->
@@ -768,13 +758,12 @@ void SwNumberPortion::Paint( const SwTxtPaintInfo &rInf ) const
static sal_Char const sDoubleSpace[] = " ";
aInf.X( aInf.X() + nSpaceOffs );
- // --> FME 2005-08-12 #i53199# Adjust position of underline:
+ // #i53199# Adjust position of underline:
if ( rInf.GetUnderFnt() )
{
const Point aNewPos( aInf.GetPos().X(), rInf.GetUnderFnt()->GetPos().Y() );
rInf.GetUnderFnt()->SetPos( aNewPos );
}
- // <--
pThis->Width( nOldWidth - nSpaceOffs + 12 );
{
@@ -877,7 +866,6 @@ sal_Bool SwGrfNumPortion::Format( SwTxtFormatInfo &rInf )
SetLen( 0 );
}
Width( nFixWidth + nFollowedByWidth );
- // <--
const sal_Bool bFull = rInf.Width() < rInf.X() + Width();
const sal_Bool bFly = rInf.GetFly() ||
( rInf.GetLast() && rInf.GetLast()->IsFlyPortion() );
@@ -901,7 +889,6 @@ sal_Bool SwGrfNumPortion::Format( SwTxtFormatInfo &rInf )
long nDiff = mbLabelAlignmentPosAndSpaceModeActive
? 0
: rInf.Left() - rInf.First() + rInf.ForcedLeftMargin();
- // <--
// Ein Vorschlag von Juergen und Volkmar:
// Der Textteil hinter der Numerierung sollte immer
// mindestens beim linken Rand beginnen.
@@ -1004,9 +991,8 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const
else if ( pViewShell &&
!pViewShell->GetAccessibilityOptions()->IsStopAnimatedGraphics() &&
!pViewShell->IsPreView() &&
- // --> FME 2004-06-21 #i9684# Stop animation during printing/pdf export.
+ // #i9684# Stop animation during printing/pdf export.
pViewShell->GetWin() )
- // <--
{
( (Graphic*) pBrush->GetGraphic() )->StartAnimation(
(OutputDevice*)rInf.GetOut(), aPos, aSize, nId );
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index a4948fd6d9..e3ec9087c8 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -73,9 +73,8 @@ public:
void TakeNextOffset( const SwFldPortion* pFld );
void CheckScript( const SwTxtSizeInfo &rInf );
inline sal_Bool HasFont() const { return 0 != pFnt; }
- // --> OD 2008-06-05 #i89179# - made public
+ // #i89179# - made public
inline const SwFont *GetFont() const { return pFnt; }
- // <--
inline const XubString &GetExp() const { return aExpand; }
virtual sal_Bool GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const;
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 3ec3ca0385..4c545c8f18 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -172,7 +172,7 @@ void SwTxtFrm::MoveFlyInCnt( SwTxtFrm *pNew, xub_StrLen nStart, xub_StrLen nEnd
for ( sal_uInt32 i = 0; GetDrawObjs() && i < pObjs->Count(); ++i )
{
// OD 2004-03-29 #i26791#
- // --> OD 2004-07-06 #i28701# - consider changed type of
+ // #i28701# - consider changed type of
// <SwSortedList> entries
SwAnchoredObject* pAnchoredObj = (*pObjs)[i];
const SwFmtAnchor& rAnch = pAnchoredObj->GetFrmFmt().GetAnchor();
@@ -195,7 +195,6 @@ void SwTxtFrm::MoveFlyInCnt( SwTxtFrm *pNew, xub_StrLen nStart, xub_StrLen nEnd
--i;
}
}
- // <--
}
}
}
@@ -326,10 +325,9 @@ SwFlyCntPortion::SwFlyCntPortion( const SwTxtFrm& rFrm,
{
// OD 2004-04-01 #i26791# - no direct positioning needed any more
pDrawContact->ConnectToLayout();
- // --> OD 2005-01-14 #i40333# - follow-up of #i35635#
+ // #i40333# - follow-up of #i35635#
// move object to visible layer
pDrawContact->MoveObjToVisibleLayer( pDrawContact->GetMaster() );
- // <--
}
nLineLength = 1;
nFlags |= AS_CHAR_ULSPACE | AS_CHAR_INIT;
@@ -369,7 +367,7 @@ void SwFlyCntPortion::SetBase( const SwTxtFrm& rFrm, const Point &rBase,
OSL_FAIL( "SwFlyCntPortion::SetBase(..) - No drawing object found by <GetDrawContact()->GetDrawObjectByAnchorFrm( rFrm )>" );
pSdrObj = GetDrawContact()->GetMaster();
}
- // --> OD 2007-11-29 #i65798#
+ // #i65798#
// call <SwAnchoredDrawObject::MakeObjPos()> to assure that flag at
// the <DrawFrmFmt> and at the <SwAnchoredDrawObject> instance are
// correctly set.
@@ -377,7 +375,6 @@ void SwFlyCntPortion::SetBase( const SwTxtFrm& rFrm, const Point &rBase,
{
GetDrawContact()->GetAnchoredObj( pSdrObj )->MakeObjPos();
}
- // <--
}
else
{
diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx
index 9f3434b598..ec4957a873 100644
--- a/sw/source/core/text/porftn.hxx
+++ b/sw/source/core/text/porftn.hxx
@@ -42,10 +42,9 @@ class SwFtnPortion : public SwFldPortion
SwTxtFrm *pFrm; // um im Dtor RemoveFtn rufen zu koennen.
SwTxtFtn *pFtn;
KSHORT nOrigHeight;
- // --> OD 2009-01-29 #i98418#
+ // #i98418#
bool mbPreferredScriptTypeSet;
sal_uInt8 mnPreferredScriptType;
- // <--
public:
SwFtnPortion( const XubString &rExpand, SwTxtFrm *pFrm, SwTxtFtn *pFtn,
KSHORT nOrig = KSHRT_MAX );
@@ -56,9 +55,8 @@ public:
virtual SwPosSize GetTxtSize( const SwTxtSizeInfo &rInfo ) const;
virtual sal_Bool Format( SwTxtFormatInfo &rInf );
- // --> OD 2009-01-29 #i98418#
+ // #i98418#
void SetPreferredScriptType( sal_uInt8 nPreferredScriptType );
- // <--
const SwTxtFtn* GetTxtFtn() const { return pFtn; };
OUTPUT_OPERATOR
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 1e4858e954..285580cc5d 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -339,8 +339,8 @@ SwMarginPortion *SwLineLayout::CalcLeftMargin()
// Die FlyPortion wird ausgesogen ...
pLeft->Join( (SwGluePortion*)pPos );
pPos = pLeft->GetPortion();
- if( GetpKanaComp() )
- GetKanaComp().Remove( 0, 1 );
+ if( GetpKanaComp() && !GetKanaComp().empty() )
+ GetKanaComp().pop_front();
}
else
pPos = 0;
@@ -415,13 +415,12 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
nFlyDescent = 0;
}
- // --> FME 2006-03-01 #i3952#
+ // #i3952#
const bool bIgnoreBlanksAndTabsForLineHeightCalculation =
rInf.GetTxtFrm()->GetNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION);
bool bHasBlankPortion = false;
bool bHasOnlyBlankPortions = true;
- // <--
if( pPortion )
{
@@ -469,7 +468,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
nLineLength = nLineLength + pPos->GetLen();
AddPrtWidth( pPos->Width() );
- // --> FME 2006-03-01 #i3952#
+ // #i3952#
if ( bIgnoreBlanksAndTabsForLineHeightCalculation )
{
if ( pPos->InTabGrp() || pPos->IsHolePortion() ||
@@ -482,7 +481,6 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
continue;
}
}
- // <--
bHasOnlyBlankPortions = false;
@@ -623,16 +621,15 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
{
SetCntnt( !bTmpDummy );
- // --> FME 2006-03-01 #i3952#
+ // #i3952#
if ( bIgnoreBlanksAndTabsForLineHeightCalculation &&
lcl_HasOnlyBlanks( rInf.GetTxt(), rInf.GetLineStart(), rInf.GetLineStart() + GetLen() ) )
{
bHasBlankPortion = true;
}
- // <--
}
- // --> FME 2006-03-01 #i3952#
+ // #i3952#
if ( bHasBlankPortion && bHasOnlyBlankPortions )
{
sal_uInt16 nTmpAscent = GetAscent();
@@ -641,7 +638,6 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
SetAscent( nTmpAscent );
Height( nTmpHeight );
}
- // <--
// Robust:
if( nLineWidth < Width() )
@@ -652,7 +648,7 @@ void SwLineLayout::CalcLine( SwTxtFormatter &rLine, SwTxtFormatInfo &rInf )
rLine.GetRedln()->CheckLine( rLine.GetStart(), rLine.GetEnd() ) );
}
-// --> OD 2005-05-20 #i47162# - add optional parameter <_bNoFlyCntPorAndLinePor>
+// #i47162# - add optional parameter <_bNoFlyCntPorAndLinePor>
// to control, if the fly content portions and line portion are considered.
void SwLineLayout::MaxAscentDescent( SwTwips& _orAscent,
SwTwips& _orDescent,
@@ -988,7 +984,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
if ( nChg > rTxt.Len() )
nChg = rTxt.Len();
- // --> FME 2008-09-17 #i28203#
+ // #i28203#
// for 'complex' portions, we make sure that a portion does not contain more
// than one script:
if( i18n::ScriptType::COMPLEX == nScript && pBreakIt->GetScriptTypeDetector().is() )
@@ -1006,7 +1002,6 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
}
nChg = Min( nChg, nNextCTLScriptStart );
}
- // <--
// special case for dotted circle since it can be used with complex
// before a mark, so we want it associated with the mark's script
diff --git a/sw/source/core/text/porlay.hxx b/sw/source/core/text/porlay.hxx
index 7aa26e2150..1007c2cd7d 100644
--- a/sw/source/core/text/porlay.hxx
+++ b/sw/source/core/text/porlay.hxx
@@ -37,6 +37,7 @@
#include "swfont.hxx"
#include <vector>
+#include <deque>
class SwMarginPortion;
class SwDropPortion;
@@ -101,7 +102,7 @@ class SwLineLayout : public SwTxtPortion
private:
SwLineLayout *pNext; // Die naechste Zeile.
std::vector<long>* pLLSpaceAdd; // Used for justified alignment.
- SvUShorts* pKanaComp; // Used for Kana compression.
+ std::deque<sal_uInt16>* pKanaComp; // Used for Kana compression.
KSHORT nRealHeight; // Die aus Zeilenabstand/Register resultierende Hoehe.
sal_Bool bFormatAdj : 1;
sal_Bool bDummy : 1;
@@ -210,10 +211,10 @@ public:
//
// STUFF FOR KANA COMPRESSION
//
- inline void SetKanaComp( SvUShorts* pNew ){ pKanaComp = pNew; }
+ inline void SetKanaComp( std::deque<sal_uInt16>* pNew ){ pKanaComp = pNew; }
inline void FinishKanaComp() { delete pKanaComp; pKanaComp = NULL; }
- inline SvUShorts* GetpKanaComp() const { return pKanaComp; }
- inline SvUShorts& GetKanaComp() { return *pKanaComp; }
+ inline std::deque<sal_uInt16>* GetpKanaComp() const { return pKanaComp; }
+ inline std::deque<sal_uInt16>& GetKanaComp() { return *pKanaComp; }
/** determine ascent and descent for positioning of as-character anchored
object
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 8d9693fdb9..6a45c56ba0 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -200,9 +200,6 @@ public:
// Accessibility: pass information about this portion to the PortionHandler
virtual void HandlePortion( SwPortionHandler& rPH ) const;
-#if OSL_DEBUG_LEVEL > 1
- void dumpPortionAsXml(sal_uInt16 ofs, String& aText, xmlTextWriter* writer);
-#endif
OUTPUT_OPERATOR
};
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 1a33d0286a..336a57d7d3 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -565,11 +565,10 @@ sal_Bool SwDoubleLinePortion::ChgSpaceAdd( SwLineLayout* pCurr,
if( nMultiSpace < KSHRT_MAX * SPACING_PRECISION_FACTOR )
{
// pCurr->SetLLSpaceAdd( nMultiSpace, 0 );
- // --> FME 2006-07-11 #i65711# SetLLSpaceAdd replaces the first value,
+ // #i65711# SetLLSpaceAdd replaces the first value,
// instead we want to insert a new first value:
std::vector<long>* pVec = pCurr->GetpLLSpaceAdd();
pVec->insert( pVec->begin(), nMultiSpace );
- // <--
bRet = sal_True;
}
}
@@ -948,15 +947,18 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
else
pRotItem = NULL;
const SvxTwoLinesItem* p2Lines = NULL;
+ const SwTxtNode *pLclTxtNode = pFrm->GetTxtNode();
+ if( !pLclTxtNode )
+ return NULL;
const SfxPoolItem* pItem;
- if( SFX_ITEM_SET == pFrm->GetTxtNode()->GetSwAttrSet().
+ if( SFX_ITEM_SET == pLclTxtNode->GetSwAttrSet().
GetItemState( RES_CHRATR_TWO_LINES, sal_True, &pItem ) &&
((SvxTwoLinesItem*)pItem)->GetValue() )
p2Lines = (SvxTwoLinesItem*)pItem;
else
pItem = NULL;
- const SwpHints *pHints = pFrm->GetTxtNode()->GetpSwpHints();
+ const SwpHints *pHints = pLclTxtNode->GetpSwpHints();
if( !pHints && !p2Lines && !pRotate )
return NULL;
const SwTxtAttr *pRuby = NULL;
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 375aa2e638..4988817e8b 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -177,12 +177,11 @@ void SwKernPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
static sal_Char const sDoubleSpace[] = " ";
XubString aTxtDouble( sDoubleSpace, RTL_TEXTENCODING_MS_1252 );
- // --> FME 2006-07-12 #b6439097#
+ //
SwRect aClipRect;
rInf.CalcRect( *this, &aClipRect, 0 );
SwSaveClip aClip( (OutputDevice*)rInf.GetOut() );
aClip.ChgClip( aClipRect, 0 );
- // <--
rInf.DrawText( aTxtDouble, *this, 0, 2, sal_True );
}
}
@@ -368,11 +367,10 @@ sal_Bool SwTxtFrm::FormatEmpty()
aTxtFly.IsOn() && aTxtFly.IsAnyObj( aRect ) )
return sal_False;
- // --> OD 2004-11-17 #i35635# - call method <HideAndShowObjects()>
+ // #i35635# - call method <HideAndShowObjects()>
// to assure that objects anchored at the empty paragraph are
// correctly visible resp. invisible.
HideAndShowObjects();
- // <--
return sal_True;
}
}
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 01ce44937f..09b5785fb1 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -394,9 +394,8 @@ sal_Bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf )
// (work around different definition of tab stop character - breaking or
// non breaking character - in compatibility mode)
else if ( ( IsFtnPortion() && rInf.IsFakeLineStart() &&
- // --> OD 2010-01-29 #b6921213#
+ //
rInf.IsOtherThanFtnInside() ) ||
- // <--
( rInf.GetLast() &&
rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) &&
rInf.GetLast()->InTabGrp() &&
@@ -736,13 +735,12 @@ SwLinePortion *SwHolePortion::Compress() { return this; }
void SwHolePortion::Paint( const SwTxtPaintInfo &rInf ) const
{
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
if( rInf.GetVsh() && rInf.GetVsh()->GetViewOptions()->IsPDFExport() )
{
const XubString aTxt( ' ' );
rInf.DrawText( aTxt, *this, 0, 1, false );
}
- // <--
}
/*************************************************************************
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index 5fe9a939b5..43ed29d7fc 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -67,10 +67,6 @@ public:
// Accessibility: pass information about this portion to the PortionHandler
virtual void HandlePortion( SwPortionHandler& rPH ) const;
-#if OSL_DEBUG_LEVEL > 1
- void dumpPortionAsXml(sal_uInt16 ofs, String& aText, xmlTextWriter* writer);
-#endif
-
OUTPUT_OPERATOR
DECL_FIXEDMEMPOOL_NEWDEL(SwTxtPortion)
};
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index ffdd20f9b2..03f1ba7d9f 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -149,7 +149,7 @@ void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, S
MSHORT nRedlPos = pIDRA->GetRedlinePos( rTxtNode, USHRT_MAX );
if( pExtInp || MSHRT_MAX != nRedlPos )
{
- const SvUShorts* pArr = 0;
+ const std::vector<sal_uInt16> *pArr = 0;
xub_StrLen nInputStt = 0;
if( pExtInp )
{
@@ -185,8 +185,9 @@ void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, S
*************************************************************************/
SwRedlineItr::SwRedlineItr( const SwTxtNode& rTxtNd, SwFont& rFnt,
- SwAttrHandler& rAH, MSHORT nRed, sal_Bool bShw, const SvUShorts *pArr,
- xub_StrLen nExtStart )
+ SwAttrHandler& rAH, MSHORT nRed, sal_Bool bShw,
+ const std::vector<sal_uInt16> *pArr,
+ xub_StrLen nExtStart )
: rDoc( *rTxtNd.GetDoc() ), rNd( rTxtNd ), rAttrHandler( rAH ), pSet( 0 ),
nNdIdx( rTxtNd.GetIndex() ), nFirst( nRed ),
nAct( MSHRT_MAX ), bOn( sal_False ), bShow( bShw )
@@ -492,7 +493,7 @@ xub_StrLen SwExtend::Next( xub_StrLen nNext )
{
MSHORT nIdx = nPos - nStart;
MSHORT nAttr = rArr[ nIdx ];
- while( ++nIdx < rArr.Count() && nAttr == rArr[ nIdx ] )
+ while( ++nIdx < rArr.size() && nAttr == rArr[ nIdx ] )
; //nothing
nIdx = nIdx + nStart;
if( nNext > nIdx )
diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx
index 762aeab152..c85c36a822 100644
--- a/sw/source/core/text/redlnitr.hxx
+++ b/sw/source/core/text/redlnitr.hxx
@@ -33,10 +33,7 @@
#include <IDocumentRedlineAccess.hxx>
#include "swfont.hxx"
-#ifndef _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
-#endif
+#include <vector>
class SwTxtNode;
class SwDoc;
@@ -46,7 +43,7 @@ class SwAttrHandler;
class SwExtend
{
SwFont *pFnt;
- const SvUShorts &rArr; // XAMA: Array of xub_StrLen
+ const std::vector<sal_uInt16> &rArr; // XAMA: Array of xub_StrLen
xub_StrLen nStart;
xub_StrLen nPos;
xub_StrLen nEnd;
@@ -54,8 +51,8 @@ class SwExtend
sal_Bool Inside() const { return ( nPos >= nStart && nPos < nEnd ); }
void ActualizeFont( SwFont &rFnt, xub_StrLen nAttr );
public:
- SwExtend( const SvUShorts &rA, xub_StrLen nSt ) : pFnt(0), rArr( rA ),
- nStart( nSt ), nPos( STRING_LEN ), nEnd( nStart + rA.Count() ) {}
+ SwExtend( const std::vector<sal_uInt16> &rA, xub_StrLen nSt ) : pFnt(0), rArr( rA ),
+ nStart( nSt ), nPos( STRING_LEN ), nEnd( nStart + rA.size() ) {}
~SwExtend() { delete pFnt; }
sal_Bool IsOn() const { return pFnt != 0; }
void Reset() { if( pFnt ) { delete pFnt; pFnt = NULL; } nPos = STRING_LEN; }
@@ -94,7 +91,7 @@ class SwRedlineItr
{ if( pExt ) return pExt->Next( nNext ); return nNext; }
public:
SwRedlineItr( const SwTxtNode& rTxtNd, SwFont& rFnt, SwAttrHandler& rAH,
- xub_StrLen nRedlPos, sal_Bool bShw, const SvUShorts *pArr = 0,
+ xub_StrLen nRedlPos, sal_Bool bShw, const std::vector<sal_uInt16> *pArr = 0,
xub_StrLen nStart = STRING_LEN );
~SwRedlineItr();
inline sal_Bool IsOn() const { return bOn || ( pExt && pExt->IsOn() ); }
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index f9a9a92c7c..ed0e30ac9b 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -468,7 +468,7 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
//
pNumFnt = new SwFont( &rInf.GetCharAttr(), pIDSA );
- // --> FME 2005-08-11 #i53199#
+ // #i53199#
if ( !pIDSA->get(IDocumentSettingAccess::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT) )
{
// i18463:
@@ -513,7 +513,6 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
pNumFnt,
bLeft, bCenter, nMinDist,
bLabelAlignmentPosAndSpaceModeActive );
- // <--
}
else
{
@@ -535,7 +534,7 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
//
pNumFnt = new SwFont( &rInf.GetCharAttr(), pIDSA );
- // --> FME 2005-08-11 #i53199#
+ // #i53199#
if ( !pIDSA->get(IDocumentSettingAccess::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT) )
{
// i18463:
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 78f70216e9..a90086733a 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -58,9 +58,8 @@
#include <editeng/txtrange.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
-// --> OD 2004-06-16 #i28701#
+// #i28701#
#include <editeng/lspcitem.hxx>
-// <--
#include <txtflcnt.hxx>
#include <fmtsrnd.hxx>
#include <fmtanchr.hxx>
@@ -773,19 +772,16 @@ void SwTxtFly::CtorInitTxtFly( const SwTxtFrm *pFrm )
{
mbIgnoreCurrentFrame = sal_False;
mbIgnoreContour = sal_False;
- // --> OD 2004-12-17 #118809#
+ // #118809#
mbIgnoreObjsInHeaderFooter = sal_False;
- // <--
pPage = pFrm->FindPageFrm();
const SwFlyFrm* pTmp = pFrm->FindFlyFrm();
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
mpCurrAnchoredObj = pTmp;
- // <--
pCurrFrm = pFrm;
pMaster = pCurrFrm->IsFollow() ? NULL : pCurrFrm;
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
mpAnchoredObjList = NULL;
- // <--
// Wenn wir nicht von einem Frame ueberlappt werden, oder wenn
// es gar keine FlyCollection gibt, dann schaltet wir uns fuer immer ab.
// Aber es koennte sein, dass waehrend der Formatierung eine Zeile
@@ -883,9 +879,8 @@ sal_Bool SwTxtFly::IsAnyObj( const SwRect &rRect ) const
if( pObj->GetObjRect().Left() > aRect.Right() )
continue;
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
if( mpCurrAnchoredObj != pObj && aBound.IsOver( aRect ) )
- // <--
return sal_True;
}
}
@@ -895,7 +890,7 @@ sal_Bool SwTxtFly::IsAnyObj( const SwRect &rRect ) const
const SwCntntFrm* SwTxtFly::_GetMaster()
{
pMaster = pCurrFrm;
- while( pMaster->IsFollow() )
+ while( pMaster && pMaster->IsFollow() )
pMaster = (SwCntntFrm*)pMaster->FindMaster();
return pMaster;
}
@@ -944,30 +939,26 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo &rInf )
SwRegionRects aRegion( aRect );
sal_Bool bOpaque = sal_False;
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const sal_uInt32 nCurrOrd = mpCurrAnchoredObj
? mpCurrAnchoredObj->GetDrawObj()->GetOrdNum()
: SAL_MAX_UINT32;
- // <--
OSL_ENSURE( !bTopRule, "DrawTextOpaque: Wrong TopRule" );
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
if ( bOn && nCount > 0 )
- // <--
{
MSHORT nHellId = pPage->getRootFrm()->GetCurrShell()->getIDocumentDrawModelAccess()->GetHellId();
for( MSHORT i = 0; i < nCount; ++i )
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwAnchoredObject* pTmpAnchoredObj = (*mpAnchoredObjList)[i];
if( dynamic_cast<const SwFlyFrm*>(pTmpAnchoredObj) &&
mpCurrAnchoredObj != pTmpAnchoredObj )
- // <--
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwFlyFrm* pFly = dynamic_cast<const SwFlyFrm*>(pTmpAnchoredObj);
- // <--
if( aRegion.GetOrigin().IsOver( pFly->Frm() ) )
{
const SwFrmFmt *pFmt = pFly->GetFmt();
@@ -980,17 +971,15 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo &rInf )
|| pFly->IsShadowTransparent() ) &&
SURROUND_THROUGHT == rSur.GetSurround() &&
( !rSur.IsAnchorOnly() ||
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
GetMaster() == pFly->GetAnchorFrm() ||
- // <--
((FLY_AT_PARA != rAnchor.GetAnchorId()) &&
(FLY_AT_CHAR != rAnchor.GetAnchorId())
)
) &&
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
pTmpAnchoredObj->GetDrawObj()->GetLayer() != nHellId &&
nCurrOrd < pTmpAnchoredObj->GetDrawObj()->GetOrdNum()
- // <--
)
{
//Ausser der Inhalt ist Transparent
@@ -1056,49 +1045,42 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
{
SwRegionRects aRegion( rRect );
OSL_ENSURE( !bTopRule, "DrawFlyRect: Wrong TopRule" );
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
if ( bOn && nCount > 0 )
- // <--
{
MSHORT nHellId = pPage->getRootFrm()->GetCurrShell()->getIDocumentDrawModelAccess()->GetHellId();
for( MSHORT i = 0; i < nCount; ++i )
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwAnchoredObject* pAnchoredObjTmp = (*mpAnchoredObjList)[i];
if( mpCurrAnchoredObj != pAnchoredObjTmp &&
dynamic_cast<const SwFlyFrm*>(pAnchoredObjTmp) )
- // <--
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwFmtSurround& rSur = pAnchoredObjTmp->GetFrmFmt().GetSurround();
- // <--
// OD 24.01.2003 #106593# - correct clipping of fly frame area.
// Consider that fly frame background/shadow can be transparent
// and <SwAlignRect(..)> fly frame area
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwFlyFrm* pFly = dynamic_cast<const SwFlyFrm*>(pAnchoredObjTmp);
- // <--
- // --> OD 2005-06-08 #i47804# - consider transparent graphics
+ // #i47804# - consider transparent graphics
// and OLE objects.
bool bClipFlyArea =
( ( SURROUND_THROUGHT == rSur.GetSurround() )
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
? (pAnchoredObjTmp->GetDrawObj()->GetLayer() != nHellId)
- // <--
: !rSur.IsContour() ) &&
!pFly->IsBackgroundTransparent() &&
!pFly->IsShadowTransparent() &&
( !pFly->Lower() ||
!pFly->Lower()->IsNoTxtFrm() ||
!static_cast<const SwNoTxtFrm*>(pFly->Lower())->IsTransparent() );
- // <--
if ( bClipFlyArea )
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
SwRect aFly( pAnchoredObjTmp->GetObjRect() );
- // <--
// OD 24.01.2003 #106593#
::SwAlignRect( aFly, pPage->getRootFrm()->GetCurrShell() );
if( aFly.Width() > 0 && aFly.Height() > 0 )
@@ -1122,21 +1104,18 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
}
}
-// --> OD 2004-10-06 #i26945# - change first parameter:
+// #i26945# - change first parameter
// Now it's the <SwAnchoredObject> instance of the floating screen object
sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
const sal_Bool bInFtn,
const sal_Bool bInFooterOrHeader )
-// <--
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
// <mpCurrAnchoredObj> is set, if <pCurrFrm> is inside a fly frame
if( _pAnchoredObj != mpCurrAnchoredObj )
- // <--
{
- // --> OD 2004-10-06 #i26945#
+ // #i26945#
const SdrObject* pNew = _pAnchoredObj->GetDrawObj();
- // <--
// #102344# Ignore connectors which have one or more connections
if(pNew && pNew->ISA(SdrEdgeObj))
{
@@ -1149,10 +1128,9 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
if( ( bInFtn || bInFooterOrHeader ) && bTopRule )
{
- // --> OD 2004-10-06 #i26945#
+ // #i26945#
const SwFrmFmt& rFrmFmt = _pAnchoredObj->GetFrmFmt();
const SwFmtAnchor& rNewA = rFrmFmt.GetAnchor();
- // <--
if (FLY_AT_PAGE == rNewA.GetAnchorId())
{
if ( bInFtn )
@@ -1169,7 +1147,7 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
}
}
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
// bEvade: consider pNew, if we are not inside a fly
// consider pNew, if pNew is lower of <mpCurrAnchoredObj>
sal_Bool bEvade = !mpCurrAnchoredObj ||
@@ -1188,17 +1166,14 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
else
{
// innerhalb von verketteten Flys wird nur Lowern ausgewichen
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwFmtChain &rChain = mpCurrAnchoredObj->GetFrmFmt().GetChain();
- // <--
if ( !rChain.GetPrev() && !rChain.GetNext() )
{
- // --> OD 2004-10-06 #i26945#
+ // #i26945#
const SwFmtAnchor& rNewA = _pAnchoredObj->GetFrmFmt().GetAnchor();
- // <--
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwFmtAnchor& rCurrA = mpCurrAnchoredObj->GetFrmFmt().GetAnchor();
- // <--
// If <mpCurrAnchoredObj> is anchored as character, its content
// does not wrap around pNew
@@ -1224,7 +1199,7 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
bEvade = sal_True; // Nicht seitengeb. weichen Rahmengeb. aus
else if( FLY_AT_FLY == rCurrA.GetAnchorId() )
return sal_False; // Rahmengebundene weichen abs.geb. nicht aus
- // --> OD 2006-01-30 #i57062#
+ // #i57062#
// In order to avoid loop situation, it's decided to adjust
// the wrapping behaviour of content of at-paragraph/at-character
// anchored objects to one in the page header/footer and
@@ -1239,31 +1214,27 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
// rCurrA.GetCntntAnchor()->nNode.GetIndex();
else
return sal_False;
- // <--
}
}
// aber: es wird niemals einem hierarchisch untergeordnetem
// ausgewichen und ausserdem braucht nur bei Ueberlappung
// ausgewichen werden.
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
bEvade &= ( mpCurrAnchoredObj->GetDrawObj()->GetOrdNum() < pNew->GetOrdNum() );
- // <--
if( bEvade )
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
SwRect aTmp( _pAnchoredObj->GetObjRectWithSpaces() );
if ( !aTmp.IsOver( mpCurrAnchoredObj->GetObjRectWithSpaces() ) )
bEvade = sal_False;
- // <--
}
}
if ( bEvade )
{
- // --> OD 2004-10-06 #i26945#
+ // #i26945#
const SwFmtAnchor& rNewA = _pAnchoredObj->GetFrmFmt().GetAnchor();
- // <--
OSL_ENSURE( FLY_AS_CHAR != rNewA.GetAnchorId(),
"Don't call GetTop with a FlyInCntFrm" );
if (FLY_AT_PAGE == rNewA.GetAnchorId())
@@ -1274,20 +1245,18 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
// Wenn wir aber gerade den Text des FlyCnt formatieren, dann
// muss er natuerlich dem absatzgebundenen Frm ausweichen!
// pCurrFrm ist der Anker von pNew?
- // --> OD 2004-10-06 #i26945#
+ // #i26945#
const SwFrm* pTmp = _pAnchoredObj->GetAnchorFrm();
- // <--
if( pTmp == pCurrFrm )
return sal_True;
if( pTmp->IsTxtFrm() && ( pTmp->IsInFly() || pTmp->IsInFtn() ) )
{
- // --> OD 2004-10-06 #i26945#
+ // #i26945#
Point aPos = _pAnchoredObj->GetObjRect().Pos();
- // <--
pTmp = GetVirtualUpper( pTmp, aPos );
}
- // --> OD 2004-10-06 #i26945#
- // --> OD 2004-11-29 #115759#
+ // #i26945#
+ // #115759#
// If <pTmp> is a text frame inside a table, take the upper
// of the anchor frame, which contains the anchor position.
else if ( pTmp->IsTxtFrm() && pTmp->IsInTab() )
@@ -1295,14 +1264,13 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
pTmp = const_cast<SwAnchoredObject*>(_pAnchoredObj)
->GetAnchorFrmContainingAnchPos()->GetUpper();
}
- // <--
- // --> OD 2004-05-13 #i28701# - consider all objects in same context,
+ // #i28701# - consider all objects in same context,
// if wrapping style is considered on object positioning.
// Thus, text will wrap around negative positioned objects.
- // --> OD 2004-08-25 #i3317# - remove condition on checking,
+ // #i3317# - remove condition on checking,
// if wrappings style is considered on object postioning.
// Thus, text is wrapping around negative positioned objects.
- // --> OD 2004-10-20 #i35640# - no consideration of negative
+ // #i35640# - no consideration of negative
// positioned objects, if wrapping style isn't considered on
// object position and former text wrapping is applied.
// This condition is typically for documents imported from the
@@ -1314,17 +1282,15 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
{
return sal_True;
}
- // <--
const SwFrm* pHeader = 0;
if ( pCurrFrm->GetNext() != pTmp &&
( IsFrmInSameKontext( pTmp, pCurrFrm ) ||
- // --> #i13832#, #i24135# wrap around objects in page header
+ // #i13832#, #i24135# wrap around objects in page header
( !pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) &&
0 != ( pHeader = pTmp->FindFooterOrHeader() ) &&
!pHeader->IsFooterFrm() &&
pCurrFrm->IsInDocBody() ) ) )
- // <--
{
if( pHeader || FLY_AT_FLY == rNewA.GetAnchorId() )
return sal_True;
@@ -1347,7 +1313,7 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
}
return sal_False;
}
-// --> OD 2006-08-15 #i68520#
+// #i68520#
struct AnchoredObjOrder
{
sal_Bool mbR2L;
@@ -1403,39 +1369,30 @@ struct AnchoredObjOrder
}
};
-// --> OD 2006-08-15 #i68520#
+// #i68520#
SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
{
OSL_ENSURE( pCurrFrm, "InitFlyList: No Frame, no FlyList" );
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
OSL_ENSURE( !mpAnchoredObjList, "InitFlyList: FlyList already initialized" );
- // <--
SWAP_IF_SWAPPED( pCurrFrm )
const SwSortedObjs *pSorted = pPage->GetSortedObjs();
const sal_uInt32 nCount = pSorted ? pSorted->Count() : 0;
- // --> #108724# Page header/footer content doesn't have to wrap around
- // floating screen objects
- const bool bFooterHeader = 0 != pCurrFrm->FindFooterOrHeader();
- const IDocumentSettingAccess* pIDSA = pCurrFrm->GetTxtNode()->getIDocumentSettingAccess();
- // --> OD 2005-01-12 #i40155# - check, if frame is marked not to wrap
- const sal_Bool bWrapAllowed = ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) ||
- ( !pCurrFrm->IsInFtn() && !bFooterHeader ) ) &&
- !SwLayouter::FrmNotToWrap( *pCurrFrm->GetTxtNode()->getIDocumentLayoutAccess(), *pCurrFrm );
- // <--
+ const sal_Bool bWrapAllowed = !SwLayouter::FrmNotToWrap( *pCurrFrm->GetTxtNode()->getIDocumentLayoutAccess(), *pCurrFrm );
bOn = sal_False;
if( nCount && bWrapAllowed )
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
mpAnchoredObjList = new SwAnchoredObjList();
- // <--
- // --> OD 2004-06-18 #i28701# - consider complete frame area for new
+ // #i28701# - consider complete frame area for new
// text wrapping
SwRect aRect;
+ const IDocumentSettingAccess* pIDSA = pCurrFrm->GetTxtNode()->getIDocumentSettingAccess();
if ( pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) )
{
aRect = pCurrFrm->Prt();
@@ -1451,38 +1408,20 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
const long nRight = (aRect.*fnRect->fnGetRight)() - 1;
const long nLeft = (aRect.*fnRect->fnGetLeft)() + 1;
const sal_Bool bR2L = pCurrFrm->IsRightToLeft();
+ const bool bFooterHeader = ( pCurrFrm->FindFooterOrHeader() != NULL );
const IDocumentDrawModelAccess* pIDDMA = pCurrFrm->GetTxtNode()->getIDocumentDrawModelAccess();
for( sal_uInt32 i = 0; i < nCount; i++ )
{
- // --> OD 2006-08-15 #i68520#
-// SwAnchoredObject* pAnchoredObj = (*pSorted)[ i ];
-// const SwRect aBound( pAnchoredObj->GetObjRectWithSpaces() );
-
-// // OD 2004-01-15 #110582# - do not consider hidden objects
-// // OD 2004-05-13 #i28701# - check, if object has to be considered
-// // for text wrap.
-// if ( !pDoc->IsVisibleLayerId( pAnchoredObj->GetDrawObj()->GetLayer() ) ||
-// !pAnchoredObj->ConsiderForTextWrap() ||
-// nRight < (aBound.*fnRect->fnGetLeft)() ||
-// (*fnRect->fnYDiff)( (aRect.*fnRect->fnGetTop)(),
-// (aBound.*fnRect->fnGetBottom)() ) > 0 ||
-// nLeft > (aBound.*fnRect->fnGetRight)() ||
-// // --> OD 2004-12-17 #118809# - If requested, do not consider
-// // objects in page header|footer for text frames not in page
-// // header|footer. This is requested for the calculation of
-// // the base offset for objects <SwTxtFrm::CalcBaseOfstForFly()>
-// ( mbIgnoreObjsInHeaderFooter && !bFooterHeader &&
-// pAnchoredObj->GetAnchorFrm()->FindFooterOrHeader() ) ||
-// // <--
-// // --> FME 2004-07-14 #i20505# Do not consider oversized objects
-// (aBound.*fnRect->fnGetHeight)() >
-// 2 * (pPage->Frm().*fnRect->fnGetHeight)() )
-// // <--
-// {
-// continue;
-// }
+ // #i68520#
+ // do not consider hidden objects
+ // check, if object has to be considered for text wrap
+ // #118809# - If requested, do not consider
+ // objects in page header|footer for text frames not in page
+ // header|footer. This is requested for the calculation of
+ // the base offset for objects <SwTxtFrm::CalcBaseOfstForFly()>
+ // #i20505# Do not consider oversized objects
SwAnchoredObject* pAnchoredObj = (*pSorted)[ i ];
if ( !pIDDMA->IsVisibleLayerId( pAnchoredObj->GetDrawObj()->GetLayer() ) ||
!pAnchoredObj->ConsiderForTextWrap() ||
@@ -1502,20 +1441,18 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
{
continue;
}
- // <--
- // --> OD 2004-10-06 #i26945# - pass <pAnchoredObj> to method
+ // #i26945# - pass <pAnchoredObj> to method
// <GetTop(..)> instead of only the <SdrObject> instance of the
// anchored object
if ( GetTop( pAnchoredObj, pCurrFrm->IsInFtn(), bFooterHeader ) )
- // <--
{
// OD 11.03.2003 #107862# - adjust insert position:
// overlapping objects should be sorted from left to right and
// inside left to right sorting from top to bottom.
// If objects on the same position are found, they are sorted
// on its width.
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
// sal_uInt16 nPos = pFlyList->Count();
// while ( nPos )
// {
@@ -1570,13 +1507,11 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
mpAnchoredObjList->insert( aInsPosIter, pAnchoredObj );
}
- // <--
const SwFmtSurround &rFlyFmt = pAnchoredObj->GetFrmFmt().GetSurround();
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
if ( rFlyFmt.IsAnchorOnly() &&
pAnchoredObj->GetAnchorFrm() == GetMaster() )
- // <--
{
const SwFmtVertOrient &rTmpFmt =
pAnchoredObj->GetFrmFmt().GetVertOrient();
@@ -1598,23 +1533,22 @@ SwAnchoredObjList* SwTxtFly::InitAnchoredObjList()
}
else
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
mpAnchoredObjList = new SwAnchoredObjList();
- // <--
}
UNDO_SWAP( pCurrFrm )
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
return mpAnchoredObjList;
- // <--
}
-// <--
SwTwips SwTxtFly::CalcMinBottom() const
{
SwTwips nRet = 0;
- const SwSortedObjs *pDrawObj = GetMaster()->GetDrawObjs();
+ const SwCntntFrm *pLclMaster = GetMaster();
+ OSL_ENSURE(pLclMaster, "SwTxtFly without master");
+ const SwSortedObjs *pDrawObj = pLclMaster ? pLclMaster->GetDrawObjs() : NULL;
const sal_uInt32 nCount = pDrawObj ? pDrawObj->Count() : 0;
if( nCount )
{
@@ -1708,7 +1642,7 @@ void ClrContourCache()
* lappung von BoundRect (inkl. Abstand!) und Zeile,
* bei Konturumfluss wird das Polypolygon des Objekts abgeklappert
*************************************************************************/
-// --> OD 2006-08-15 #i68520#
+// #i68520#
const SwRect SwContourCache::CalcBoundRect( const SwAnchoredObject* pAnchoredObj,
const SwRect &rLine,
const SwTxtFrm* pFrm,
@@ -1741,7 +1675,6 @@ const SwRect SwContourCache::CalcBoundRect( const SwAnchoredObject* pAnchoredObj
return aRet;
}
-// <--
const SwRect SwContourCache::ContourRect( const SwFmt* pFmt,
const SdrObject* pObj, const SwTxtFrm* pFrm, const SwRect &rLine,
@@ -1843,7 +1776,7 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt,
MSHORT nIdx = 0;
while( nIdx < nCount && (*pTmp)[ nIdx ] < nXPos )
++nIdx;
- sal_Bool bOdd = nIdx % 2 ? sal_True : sal_False;
+ sal_Bool bOdd = (nIdx % 2) ? sal_True : sal_False;
sal_Bool bSet = sal_True;
if( bOdd )
--nIdx; // innerhalb eines Intervalls
@@ -1957,31 +1890,27 @@ sal_Bool SwTxtFly::ForEach( const SwRect &rRect, SwRect* pRect, sal_Bool bAvoid
SWAP_IF_SWAPPED( pCurrFrm )
sal_Bool bRet = sal_False;
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
SwAnchoredObjList::size_type nCount( bOn ? GetAnchoredObjList()->size() : 0 );
if ( bOn && nCount > 0 )
- // <--
{
for( SwAnchoredObjList::size_type i = 0; i < nCount; ++i )
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwAnchoredObject* pAnchoredObj = (*mpAnchoredObjList)[i];
SwRect aRect( pAnchoredObj->GetObjRectWithSpaces() );
- // <--
// Optimierung
SWRECTFN( pCurrFrm )
if( (aRect.*fnRect->fnGetLeft)() > (rRect.*fnRect->fnGetRight)() )
break;
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
if ( mpCurrAnchoredObj != pAnchoredObj && aRect.IsOver( rRect ) )
- // <--
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwFmt* pFmt( &(pAnchoredObj->GetFrmFmt()) );
const SwFmtSurround &rSur = pFmt->GetSurround();
- // <--
if( bAvoid )
{
// Wenn der Text drunter durchlaeuft, bleibt die
@@ -1990,33 +1919,30 @@ sal_Bool SwTxtFly::ForEach( const SwRect &rRect, SwRect* pRect, sal_Bool bAvoid
const SwFmtAnchor& rAnchor = pFmt->GetAnchor();
if( ( SURROUND_THROUGHT == rSur.GetSurround() &&
( !rSur.IsAnchorOnly() ||
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
GetMaster() == pAnchoredObj->GetAnchorFrm() ||
- // <--
((FLY_AT_PARA != rAnchor.GetAnchorId()) &&
(FLY_AT_CHAR != rAnchor.GetAnchorId())) ) )
|| aRect.Top() == WEIT_WECH )
continue;
}
- // --> OD 2006-01-20 #i58642#
+ // #i58642#
// Compare <GetMaster()> instead of <pCurrFrm> with the anchor
// frame of the anchored object, because a follow frame have
// to ignore the anchored objects of its master frame.
// Note: Anchored objects are always registered at the master
// frame, exception are as-character anchored objects,
// but these aren't handled here.
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
if ( mbIgnoreCurrentFrame &&
GetMaster() == pAnchoredObj->GetAnchorFrm() )
continue;
- // <--
if( pRect )
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
SwRect aFly = AnchoredObjToRect( pAnchoredObj, rRect );
- // <--
if( aFly.IsEmpty() || !aFly.IsOver( rRect ) )
continue;
if( !bRet || (
@@ -2050,7 +1976,7 @@ sal_Bool SwTxtFly::ForEach( const SwRect &rRect, SwRect* pRect, sal_Bool bAvoid
* liefert die Position im sorted Array zurueck
*************************************************************************/
-// --> OD 2006-08-15 #i68520#
+// #i68520#
SwAnchoredObjList::size_type SwTxtFly::GetPos( const SwAnchoredObject* pAnchoredObj ) const
{
SwAnchoredObjList::size_type nCount = GetAnchoredObjList()->size();
@@ -2059,7 +1985,6 @@ SwAnchoredObjList::size_type SwTxtFly::GetPos( const SwAnchoredObject* pAnchored
++nRet;
return nRet;
}
-// <--
/*************************************************************************
* SwTxtFly::CalcRightMargin()
@@ -2069,7 +1994,7 @@ SwAnchoredObjList::size_type SwTxtFly::GetPos( const SwAnchoredObject* pAnchored
* Der rechte Rand ist der rechte Rand oder
* er wird durch das naechste Object, welches in die Zeile ragt, bestimmt.
*************************************************************************/
-// --> OD 2006-08-15 #i68520#
+// #i68520#
void SwTxtFly::CalcRightMargin( SwRect &rFly,
SwAnchoredObjList::size_type nFlyPos,
const SwRect &rLine ) const
@@ -2078,9 +2003,8 @@ void SwTxtFly::CalcRightMargin( SwRect &rFly,
OSL_ENSURE( ! pCurrFrm->IsVertical() || ! pCurrFrm->IsSwapped(),
"SwTxtFly::CalcRightMargin with swapped frame" );
SWRECTFN( pCurrFrm )
- // --> OD 2004-12-14 #118796# - correct determination of right of printing area
+ // #118796# - correct determination of right of printing area
SwTwips nRight = (pCurrFrm->*fnRect->fnGetPrtRight)();
- // <--
SwTwips nFlyRight = (rFly.*fnRect->fnGetRight)();
SwRect aLine( rLine );
(aLine.*fnRect->fnSetRight)( nRight );
@@ -2092,32 +2016,28 @@ void SwTxtFly::CalcRightMargin( SwRect &rFly,
// unsichtbar, das heisst, dass sie bei der Berechnung der Raender
// anderer Flys ebenfalls nicht auffallen.
// 3301: pNext->Frm().IsOver( rLine ) ist noetig
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
SwSurround eSurroundForTextWrap;
- // <--
sal_Bool bStop = sal_False;
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
SwAnchoredObjList::size_type nPos = 0;
- // <--
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
while( nPos < mpAnchoredObjList->size() && !bStop )
- // <--
{
if( nPos == nFlyPos )
{
++nPos;
continue;
}
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwAnchoredObject* pNext = (*mpAnchoredObjList)[ nPos++ ];
if ( pNext == mpCurrAnchoredObj )
continue;
eSurroundForTextWrap = _GetSurroundForTextWrap( pNext );
if( SURROUND_THROUGHT == eSurroundForTextWrap )
continue;
- // <--
const SwRect aTmp( SwContourCache::CalcBoundRect
( pNext, aLine, pCurrFrm, nFlyRight, sal_True ) );
@@ -2164,7 +2084,6 @@ void SwTxtFly::CalcRightMargin( SwRect &rFly,
}
(rFly.*fnRect->fnSetRight)( nRight );
}
-// <--
/*************************************************************************
* SwTxtFly::CalcLeftMargin()
@@ -2174,7 +2093,7 @@ void SwTxtFly::CalcRightMargin( SwRect &rFly,
* Der linke Rand ist der linke Rand der aktuellen PrintArea oder
* er wird durch den vorigen FlyFrm, der in die Zeile ragt, bestimmt.
*************************************************************************/
-// --> OD 2006-08-15 #i68520#
+// #i68520#
void SwTxtFly::CalcLeftMargin( SwRect &rFly,
SwAnchoredObjList::size_type nFlyPos,
const SwRect &rLine ) const
@@ -2182,9 +2101,8 @@ void SwTxtFly::CalcLeftMargin( SwRect &rFly,
OSL_ENSURE( ! pCurrFrm->IsVertical() || ! pCurrFrm->IsSwapped(),
"SwTxtFly::CalcLeftMargin with swapped frame" );
SWRECTFN( pCurrFrm )
- // --> OD 2004-12-14 #118796# - correct determination of left of printing area
+ // #118796# - correct determination of left of printing area
SwTwips nLeft = (pCurrFrm->*fnRect->fnGetPrtLeft)();
- // <--
const SwTwips nFlyLeft = (rFly.*fnRect->fnGetLeft)();
if( nLeft > nFlyLeft )
@@ -2200,15 +2118,13 @@ void SwTxtFly::CalcLeftMargin( SwRect &rFly,
// anderer Flys ebenfalls nicht auffallen.
// 3301: pNext->Frm().IsOver( rLine ) ist noetig
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
SwAnchoredObjList::size_type nMyPos = nFlyPos;
while( ++nFlyPos < mpAnchoredObjList->size() )
- // <--
{
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwAnchoredObject* pNext = (*mpAnchoredObjList)[ nFlyPos ];
const SwRect aTmp( pNext->GetObjRectWithSpaces() );
- // <--
if( (aTmp.*fnRect->fnGetLeft)() >= nFlyLeft )
break;
}
@@ -2217,33 +2133,30 @@ void SwTxtFly::CalcLeftMargin( SwRect &rFly,
{
if( --nFlyPos == nMyPos )
continue;
- // --> OD 2006-08-15 #i68520#
+ // #i68520#
const SwAnchoredObject* pNext = (*mpAnchoredObjList)[ nFlyPos ];
if( pNext == mpCurrAnchoredObj )
continue;
SwSurround eSurroundForTextWrap = _GetSurroundForTextWrap( pNext );
if( SURROUND_THROUGHT == eSurroundForTextWrap )
continue;
- // <--
const SwRect aTmp( SwContourCache::CalcBoundRect
( pNext, aLine, pCurrFrm, nFlyLeft, sal_False ) );
if( (aTmp.*fnRect->fnGetLeft)() < nFlyLeft && aTmp.IsOver( aLine ) )
{
- // --> OD 2004-12-14 #118796# - no '+1', because <..fnGetRight>
+ // #118796# - no '+1', because <..fnGetRight>
// returns the correct value.
SwTwips nTmpRight = (aTmp.*fnRect->fnGetRight)();
if ( nLeft <= nTmpRight )
nLeft = nTmpRight;
- // <--
break;
}
}
(rFly.*fnRect->fnSetLeft)( nLeft );
}
-// <--
/*************************************************************************
* SwTxtFly::FlyToRect()
@@ -2254,7 +2167,7 @@ void SwTxtFly::CalcLeftMargin( SwRect &rFly,
* unter Beruecksichtigung der eingestellten Attribute fuer den Abstand
* zum Text zurueck.
*************************************************************************/
-// --> OD 2006-08-15 #i68520#
+// #i68520#
SwRect SwTxtFly::AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj,
const SwRect &rLine ) const
{
@@ -2309,7 +2222,7 @@ SwRect SwTxtFly::AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj,
return aFly;
}
-// --> OD 2006-08-15 #i68520#
+// #i68520#
// new method <_GetSurroundForTextWrap(..)> replaces methods
// <CalcSmart(..)> and <GetOrder(..)>
/*************************************************************************
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index d90794b72b..fd4a3143f0 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -505,7 +505,7 @@ void SwTxtFrm::HideFootnotes( xub_StrLen nStart, xub_StrLen nEnd )
}
}
-// --> OD 2005-03-30 #120729# - hotfix: WW8 documents contain at its end hidden,
+// #120729# - hotfix
// as-character anchored graphics, which are used for a graphic bullet list.
// As long as these graphic bullet list aren't imported, do not hide a
// at-character anchored object, if
@@ -562,7 +562,6 @@ bool lcl_HideObj( const SwTxtFrm& _rFrm,
return bRet;
}
-// <--
/*************************************************************************
* SwTxtFrm::HideAndShowObjects()
*************************************************************************/
@@ -589,7 +588,7 @@ void SwTxtFrm::HideAndShowObjects()
{
SdrObject* pObj = (*GetDrawObjs())[i]->DrawObj();
SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
- // --> OD 2005-03-30 #120729# - hotfix: do not hide object
+ // #120729# - hotfix
// under certain conditions
const RndStdIds eAnchorType( pContact->GetAnchorId() );
const xub_StrLen nObjAnchorPos = pContact->GetCntntAnchorIndex().GetIndex();
@@ -599,7 +598,6 @@ void SwTxtFrm::HideAndShowObjects()
{
pContact->MoveObjToInvisibleLayer( pObj );
}
- // <--
}
}
else
@@ -618,9 +616,8 @@ void SwTxtFrm::HideAndShowObjects()
{
SdrObject* pObj = (*GetDrawObjs())[i]->DrawObj();
SwContact* pContact = static_cast<SwContact*>(pObj->GetUserCall());
- // --> OD 2005-03-30 #120729# - determine anchor type only once
+ // #120729# - determine anchor type only once
const RndStdIds eAnchorType( pContact->GetAnchorId() );
- // <--
if (eAnchorType == FLY_AT_PARA)
{
@@ -633,11 +630,10 @@ void SwTxtFrm::HideAndShowObjects()
xub_StrLen nHiddenEnd;
xub_StrLen nObjAnchorPos = pContact->GetCntntAnchorIndex().GetIndex();
SwScriptInfo::GetBoundsOfHiddenRange( rNode, nObjAnchorPos, nHiddenStart, nHiddenEnd, 0 );
- // --> OD 2005-03-30 #120729# - hotfix: do not hide object
+ // #120729# - hotfix
// under certain conditions
if ( nHiddenStart != STRING_LEN && bShouldBeHidden &&
lcl_HideObj( *this, eAnchorType, nObjAnchorPos, (*GetDrawObjs())[i] ) )
- // <--
pContact->MoveObjToInvisibleLayer( pObj );
else
pContact->MoveObjToVisibleLayer( pObj );
@@ -650,9 +646,12 @@ void SwTxtFrm::HideAndShowObjects()
}
}
- if ( IsFollow() )
+ if (IsFollow())
{
- FindMaster()->HideAndShowObjects();
+ SwTxtFrm *pMaster = FindMaster();
+ OSL_ENSURE(pMaster, "SwTxtFrm without master");
+ if (pMaster)
+ pMaster->HideAndShowObjects();
}
}
@@ -669,7 +668,7 @@ xub_StrLen SwTxtFrm::FindBrk( const XubString &rTxt,
const xub_StrLen nStart,
const xub_StrLen nEnd ) const
{
- // --> OD 2009-12-28 #i104291# - applying patch to avoid overflow.
+ // #i104291# - applying patch to avoid overflow.
unsigned long nFound = nStart;
const xub_StrLen nEndLine = Min( nEnd, rTxt.Len() );
@@ -693,7 +692,6 @@ xub_StrLen SwTxtFrm::FindBrk( const XubString &rTxt,
return nFound <= STRING_LEN
? static_cast<xub_StrLen>(nFound)
: STRING_LEN;
- // <--
}
/*************************************************************************
@@ -1065,13 +1063,12 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
}
}
- // --> OD 2010-02-16 #i104008#
+ // #i104008#
ViewShell* pViewSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
if ( pViewSh )
{
pViewSh->InvalidateAccessibleParaAttrs( *this );
}
- // <--
}
break;
case RES_OBJECTDYING:
@@ -1322,13 +1319,12 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
SwCntntFrm::Modify( pOld, pNew );
}
- // --> OD 2009-01-06 #i88069#
+ // #i88069#
ViewShell* pViewSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
if ( pViewSh )
{
pViewSh->InvalidateAccessibleParaAttrs( *this );
}
- // <--
}
break;
@@ -1559,10 +1555,9 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
if ( pGrid && GetTxtNode()->GetSwAttrSet().GetParaGrid().GetValue() )
break;
- // --> OD 2004-07-16 #i28701# - consider anchored objects
+ // #i28701# - consider anchored objects
if ( GetDrawObjs() )
break;
- // <--
return;
}
@@ -1743,7 +1738,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
for ( MSHORT i = 0; i < nCnt; ++i )
{
SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i];
- // --> OD 2004-07-16 #i28701# - consider all
+ // #i28701# - consider all
// to-character anchored objects
if ( pAnchoredObj->GetFrmFmt().GetAnchor().GetAnchorId()
== FLY_AT_CHAR )
@@ -2162,12 +2157,11 @@ SwTxtFrm* SwTxtFrm::GetFormatted( bool bForceQuickFormat )
SwTwips SwTxtFrm::CalcFitToContent()
{
- // --> FME 2004-07-16 #i31490#
+ // #i31490#
// If we are currently locked, we better return with a
// fairly reasonable value:
if ( IsLocked() )
return Prt().Width();
- // <--
SwParaPortion* pOldPara = GetPara();
SwParaPortion *pDummy = new SwParaPortion();
@@ -2184,28 +2178,26 @@ SwTwips SwTxtFrm::CalcFitToContent()
Frm().Width( nPageWidth );
Prt().Width( nPageWidth );
- // --> FME 2004-07-19 #i25422# objects anchored as character in RTL
+ // #i25422# objects anchored as character in RTL
if ( IsRightToLeft() )
Frm().Pos().X() += nOldFrmWidth - nPageWidth;
- // --> FME 2004-07-16 #i31490#
+ // #i31490#
SwTxtFrmLocker aLock( this );
- // <--
SwTxtFormatInfo aInf( this, sal_False, sal_True, sal_True );
aInf.SetIgnoreFly( sal_True );
SwTxtFormatter aLine( this, &aInf );
SwHookOut aHook( aInf );
- // --> OD 2005-09-06 #i54031# - assure mininum of MINLAY twips.
+ // #i54031# - assure mininum of MINLAY twips.
const SwTwips nMax = Max( (SwTwips)MINLAY,
aLine._CalcFitToContent() + 1 );
- // <--
Frm().Width( nOldFrmWidth );
Prt().Width( nOldPrtWidth );
- // --> FME 2004-07-19 #i25422# objects anchored as character in RTL
+ // #i25422# objects anchored as character in RTL
if ( IsRightToLeft() )
Frm().Pos() = aOldFrmPos;
@@ -2302,14 +2294,13 @@ void SwTxtFrm::CalcAdditionalFirstLineOffset()
*/
void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
{
- // --> OD 2006-11-13 #i71281#
+ // #i71281#
// invalidate printing area, if height of last line changes
const SwTwips mnOldHeightOfLastLine( mnHeightOfLastLine );
- // <--
// determine output device
ViewShell* pVsh = getRootFrm()->GetCurrShell();
OSL_ENSURE( pVsh, "<SwTxtFrm::_GetHeightOfLastLineForPropLineSpacing()> - no ViewShell" );
- // --> OD 2007-07-02 #i78921# - make code robust, according to provided patch
+ // #i78921# - make code robust, according to provided patch
// There could be no <ViewShell> instance in the case of loading a binary
// StarOffice file format containing an embedded Writer document.
if ( !pVsh )
@@ -2324,12 +2315,11 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true );
}
OSL_ENSURE( pOut, "<SwTxtFrm::_GetHeightOfLastLineForPropLineSpacing()> - no OutputDevice" );
- // --> OD 2007-07-02 #i78921# - make code robust, according to provided patch
+ // #i78921# - make code robust, according to provided patch
if ( !pOut )
{
return;
}
- // <--
// determine height of last line
@@ -2366,7 +2356,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
else
{
// new determination of last line height - take actually height of last line
- // --> OD 2008-05-06 #i89000#
+ // #i89000#
// assure same results, if paragraph is undersized
if ( IsUndersized() )
{
@@ -2397,20 +2387,19 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
if ( pLineLayout )
{
SwTwips nAscent, nDescent, nDummy1, nDummy2;
- // --> OD 2005-05-20 #i47162# - suppress consideration of
+ // #i47162# - suppress consideration of
// fly content portions and the line portion.
pLineLayout->MaxAscentDescent( nAscent, nDescent,
nDummy1, nDummy2,
0, true );
- // <--
- // --> OD 2006-11-22 #i71281#
+ // #i71281#
// Suppress wrong invalidation of printing area, if method is
// called recursive.
// Thus, member <mnHeightOfLastLine> is only set directly, if
// no recursive call is needed.
// mnHeightOfLastLine = nAscent + nDescent;
const SwTwips nNewHeightOfLastLine = nAscent + nDescent;
- // --> OD 2005-05-20 #i47162# - if last line only contains
+ // #i47162# - if last line only contains
// fly content portions, <mnHeightOfLastLine> is zero.
// In this case determine height of last line by the font
if ( nNewHeightOfLastLine == 0 )
@@ -2421,20 +2410,16 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
{
mnHeightOfLastLine = nNewHeightOfLastLine;
}
- // <--
- // <--
}
}
}
- // <--
}
- // --> OD 2006-11-13 #i71281#
+ // #i71281#
// invalidate printing area, if height of last line changes
if ( mnHeightOfLastLine != mnOldHeightOfLastLine )
{
InvalidatePrt();
}
- // <--
}
/*************************************************************************
@@ -2622,11 +2607,10 @@ void SwTxtFrm::RecalcAllLines()
(pPrv->IsInTab() || pPrv->IsInDocBody() != IsInDocBody()) )
pPrv = pPrv->GetPrevCntntFrm();
- // --> FME 2007-06-22 #i78254# Restart line numbering at page change:
+ // #i78254# Restart line numbering at page change
// First body content may be in table!
if ( bRestart && pPrv && pPrv->FindPageFrm() != FindPageFrm() )
pPrv = 0;
- // <--
nNewNum = pPrv ? ((SwTxtFrm*)pPrv)->GetAllLines() : 0;
}
@@ -2779,10 +2763,9 @@ void SwTxtFrm::CalcBaseOfstForFly()
SwTxtFly aTxtFly( this );
aTxtFly.SetIgnoreCurrentFrame( sal_True );
aTxtFly.SetIgnoreContour( sal_True );
- // --> OD 2004-12-17 #118809# - ignore objects in page header|footer for
+ // #118809# - ignore objects in page header|footer for
// text frames not in page header|footer
aTxtFly.SetIgnoreObjsInHeaderFooter( sal_True );
- // <--
SwTwips nRet1 = lcl_CalcFlyBasePos( *this, aFlyRect, aTxtFly );
aTxtFly.SetIgnoreCurrentFrame( sal_False );
SwTwips nRet2 = lcl_CalcFlyBasePos( *this, aFlyRect, aTxtFly );
@@ -2810,4 +2793,4 @@ void SwTxtFrm::repaintTextFrames( const SwTxtNode& rNode )
}
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 8f36293363..cf36dc55e8 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -1022,7 +1022,7 @@ SwNumberPortion *SwTxtFormatter::NewFtnNumPortion( SwTxtFormatInfo &rInf ) const
const IDocumentSettingAccess* pIDSA = pFrm->GetTxtNode()->getIDocumentSettingAccess();
SwFont *pNumFnt = new SwFont( pParSet, pIDSA );
- // --> FME 2005-02-17 #i37142#
+ // #i37142#
// Underline style of paragraph font should not be considered
// Overline style of paragraph font should not be considered
// Weight style of paragraph font should not be considered
@@ -1036,7 +1036,6 @@ SwNumberPortion *SwTxtFormatter::NewFtnNumPortion( SwTxtFormatInfo &rInf ) const
pNumFnt->SetWeight( WEIGHT_NORMAL, SW_LATIN );
pNumFnt->SetWeight( WEIGHT_NORMAL, SW_CJK );
pNumFnt->SetWeight( WEIGHT_NORMAL, SW_CTL );
- // <--
pNumFnt->SetDiffFnt(&rSet, pIDSA );
pNumFnt->SetVertical( pNumFnt->GetOrientation(), pFrm->IsVertical() );
@@ -1354,7 +1353,7 @@ SwFtnSave::SwFtnSave( const SwTxtSizeInfo &rInf,
SwFmtFtn& rFtn = (SwFmtFtn&)pTxtFtn->GetFtn();
const SwDoc *pDoc = rInf.GetTxtFrm()->GetNode()->GetDoc();
- // --> OD 2009-01-29 #i98418#
+ // #i98418#
if ( bApplyGivenScriptType )
{
pFnt->SetActual( nGivenScriptType );
@@ -1365,7 +1364,6 @@ SwFtnSave::SwFtnSave( const SwTxtSizeInfo &rInf,
String aTmpStr( rFtn.GetViewNumStr( *pDoc ) );
pFnt->SetActual( SwScriptInfo::WhichFont( 0, &aTmpStr, 0 ) );
}
- // <--
const SwEndNoteInfo* pInfo;
if( rFtn.IsEndNote() )
@@ -1427,10 +1425,9 @@ SwFtnPortion::SwFtnPortion( const XubString &rExpand, SwTxtFrm *pFrame,
, pFrm(pFrame)
, pFtn(pFootn)
, nOrigHeight( nReal )
- // --> OD 2009-01-29 #i98418#
+ // #i98418#
, mbPreferredScriptTypeSet( false )
, mnPreferredScriptType( SW_LATIN )
- // <--
{
SetLen(1);
SetWhichPor( POR_FTN );
@@ -1452,10 +1449,9 @@ sal_Bool SwFtnPortion::GetExpTxt( const SwTxtSizeInfo &, XubString &rTxt ) const
sal_Bool SwFtnPortion::Format( SwTxtFormatInfo &rInf )
{
- // --> OD 2009-01-29 #i98418#
+ // #i98418#
// SwFtnSave aFtnSave( rInf, pFtn );
SwFtnSave aFtnSave( rInf, pFtn, mbPreferredScriptTypeSet, mnPreferredScriptType );
- // <--
// the idx is manipulated in SwExpandPortion::Format
// this flag indicates, that a footnote is allowed to trigger
// an underflow during SwTxtGuess::Guess
@@ -1476,10 +1472,9 @@ sal_Bool SwFtnPortion::Format( SwTxtFormatInfo &rInf )
void SwFtnPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
- // --> OD 2009-01-29 #i98418#
+ // #i98418#
// SwFtnSave aFtnSave( rInf, pFtn );
SwFtnSave aFtnSave( rInf, pFtn, mbPreferredScriptTypeSet, mnPreferredScriptType );
- // <--
rInf.DrawViewOpt( *this, POR_FTN );
SwExpandPortion::Paint( rInf );
}
@@ -1490,20 +1485,18 @@ void SwFtnPortion::Paint( const SwTxtPaintInfo &rInf ) const
SwPosSize SwFtnPortion::GetTxtSize( const SwTxtSizeInfo &rInfo ) const
{
- // --> OD 2009-01-29 #i98418#
+ // #i98418#
// SwFtnSave aFtnSave( rInfo, pFtn );
SwFtnSave aFtnSave( rInfo, pFtn, mbPreferredScriptTypeSet, mnPreferredScriptType );
- // <--
return SwExpandPortion::GetTxtSize( rInfo );
}
-// --> OD 2009-01-29 #i98418#
+// #i98418#
void SwFtnPortion::SetPreferredScriptType( sal_uInt8 nPreferredScriptType )
{
mbPreferredScriptTypeSet = true;
mnPreferredScriptType = nPreferredScriptType;
}
-// <--
/*************************************************************************
* class SwQuoVadisPortion
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 958306710a..b41f1bcfc0 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -386,13 +386,12 @@ sal_Bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess )
sal_Bool SwHyphPortion::GetExpTxt( const SwTxtSizeInfo &rInf, XubString &rTxt ) const
{
- // --> FME 2004-06-24 #i16816# tagged pdf support
+ // #i16816# tagged pdf support
const sal_Unicode cChar = rInf.GetVsh() &&
rInf.GetVsh()->GetViewOptions()->IsPDFExport() &&
SwTaggedPDFHelper::IsExportTaggedPDF( *rInf.GetOut() ) ?
0xad :
'-';
- // <--
rTxt = cChar;
return sal_True;
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index 5b77142fab..5c8066cc9c 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -42,9 +42,8 @@
#include "itrform2.hxx"
#include "txtfrm.hxx"
#include <numrule.hxx>
-// --> OD 2008-06-05 #i89179#
+// #i89179#
#include <porfld.hxx>
-// <--
/*************************************************************************
@@ -100,7 +99,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
// #i24363# tab stops relative to indent
// nTabLeft: The absolute value, the tab stops are relative to: Tabs origin.
//
- // --> OD 2008-07-01 #i91133#
+ // #i91133#
const bool bTabsRelativeToIndent =
pFrm->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TABS_RELATIVE_TO_INDENT);
const SwTwips nTabLeft = bRTL
@@ -108,7 +107,6 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
( bTabsRelativeToIndent ? GetTabLeft() : 0 )
: pFrm->Frm().Left() +
( bTabsRelativeToIndent ? GetTabLeft() : 0 );
- // <--
//
// nLinePos: The absolute position, where we started the line formatting.
@@ -204,7 +202,6 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
nNextPos = nCount < 0 || (!nCount && nSearchPos <= 0)? nCount * nDefTabDist :( nCount + 1 ) * nDefTabDist ;
// --> FME 2004-09-21 #117919 Minimum tab stop width is 1 or 51 twips:
const SwTwips nMinimumTabWidth = pFrm->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) ? 0 : 50;
- // <--
if( ( bRTL && nTabLeft - nNextPos >= nCurrentAbsPos - nMinimumTabWidth ) ||
( !bRTL && nNextPos + nTabLeft <= nCurrentAbsPos + nMinimumTabWidth ) )
{
@@ -288,9 +285,8 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
if ( bAuto )
{
if ( SVX_TAB_ADJUST_DECIMAL == eAdj &&
- // --> FME 2005-12-19 #127428#
+ // #127428#
1 == aLineInf.NumberOfTabStops() )
- // <--
pTabPor = new SwAutoTabDecimalPortion( nNewTabPos, cDec, cFill );
}
else
@@ -394,13 +390,12 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf )
const bool bTabCompat = rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT);
// Die Mindestbreite eines Tabs ist immer mindestens ein Blank
- // --> FME 2004-11-25 #i37686# In compatibility mode, the minimum width
+ // #i37686# In compatibility mode, the minimum width
// should be 1, even for non-left tab stops.
sal_uInt16 nMinimumTabWidth = 1;
- // <--
if ( !bTabCompat )
{
- // --> OD 2008-06-05 #i89179#
+ // #i89179#
// tab portion representing the list tab of a list label gets the
// same font as the corresponding number portion
std::auto_ptr< SwFontSave > pSave( 0 );
@@ -412,7 +407,6 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf )
static_cast<SwNumberPortion*>(rInf.GetLast())->GetFont();
pSave.reset( new SwFontSave( rInf, const_cast<SwFont*>(pNumberPortionFont) ) );
}
- // <--
XubString aTmp( ' ' );
SwTxtSizeInfo aInf( rInf, aTmp );
nMinimumTabWidth = aInf.GetTxtSize().Width();
@@ -467,10 +461,9 @@ sal_Bool SwTabPortion::PreFormat( SwTxtFormatInfo &rInf )
// Wir muessen aufpassen, dass wir nicht endlos schleifen,
// wenn die Breite kleiner ist, als ein Blank ...
if( rInf.GetIdx() == rInf.GetLineStart() &&
- // --> FME 2005-01-19 #119175# TabStop should be forced to current
+ // #119175# TabStop should be forced to current
// line if there is a fly reducing the line width:
!rInf.GetFly() )
- // <--
{
PrtWidth( static_cast<sal_uInt16>(rInf.Width() - rInf.X()) );
SetFixWidth( PrtWidth() );
@@ -516,7 +509,7 @@ sal_Bool SwTabPortion::PostFormat( SwTxtFormatInfo &rInf )
OSL_ENSURE( POR_TABLEFT != nWhich, "SwTabPortion::PostFormat: already formatted" );
const bool bTabCompat = rInf.GetTxtFrm()->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT);
- // --> FME 2005-12-19 #127428# Abandon dec. tab position if line is full:
+ // #127428# Abandon dec. tab position if line is full
if ( bTabCompat && POR_TABDECIMAL == nWhich )
{
KSHORT nPrePorWidth = static_cast<const SwTabDecimalPortion*>(this)->GetWidthOfPortionsUpToDecimalPosition();
@@ -532,7 +525,6 @@ sal_Bool SwTabPortion::PostFormat( SwTxtFormatInfo &rInf )
nPorWidth = nPrePorWidth - 1;
}
}
- // <--
if( POR_TABCENTER == nWhich )
{
@@ -589,7 +581,7 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const
}
#endif
- // --> OD 2008-06-05 #i89179#
+ // #i89179#
// tab portion representing the list tab of a list label gets the
// same font as the corresponding number portion
std::auto_ptr< SwFontSave > pSave( 0 );
@@ -606,7 +598,6 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const
pSave.reset( new SwFontSave( rInf, const_cast<SwFont*>(pNumberPortionFont) ) );
}
}
- // <--
rInf.DrawBackBrush( *this );
// do we have to repaint a post it portion?
diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx
index 3ec65d18b8..606d0fe72f 100644..100755
--- a/sw/source/core/text/widorp.cxx
+++ b/sw/source/core/text/widorp.cxx
@@ -150,10 +150,23 @@ sal_Bool SwTxtFrmBreak::IsInside( SwTxtMargin &rLine ) const
// Der Frm besitzt eine Hoehe, mit der er auf die Seite passt.
SwTwips nHeight =
(*fnRect->fnYDiff)( (pFrm->GetUpper()->*fnRect->fnGetPrtBottom)(), nOrigin );
-
// Wenn sich alles innerhalb des bestehenden Frames abspielt,
// ist das Ergebnis sal_True;
bFit = nHeight >= nLineHeight;
+
+ // --> OD #i103292#
+ if ( !bFit )
+ {
+ if ( rLine.GetNext() &&
+ pFrm->IsInTab() && !pFrm->GetFollow() && !pFrm->GetIndNext() )
+ {
+ // add additional space taken as lower space as last content in a table
+ // for all text lines except the last one.
+ nHeight += pFrm->CalcAddLowerSpaceAsLastInTableCell();
+ bFit = nHeight >= nLineHeight;
+ }
+ }
+ // <--
if( !bFit )
{
// Die LineHeight sprengt die aktuelle Frm-Hoehe.
@@ -491,7 +504,7 @@ sal_Bool WidowsAndOrphans::FindWidows( SwTxtFrm *pFrame, SwTxtMargin &rLine )
MSHORT nNeed = 1; // frueher: nWidLines - rLine.GetLineNr();
// Special case: Master cannot give lines to follow
- // --> FME 2008-09-16 #i91421#
+ // #i91421#
if ( !pMaster->GetIndPrev() )
{
sal_uLong nLines = pMaster->GetThisLines();
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index dd509323f0..1599fec1b7 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -31,7 +31,6 @@
#include <tools/string.hxx>
-#include <tools/debug.hxx>
#include "swtypes.hxx"
#include "txttypes.hxx"
@@ -467,7 +466,7 @@ void SwWrongList::JoinList( SwWrongList* pNext, xub_StrLen nInsertPos )
{
if (pNext)
{
- DBG_ASSERT( GetWrongListType() == pNext->GetWrongListType(), "type mismatch with next list" );
+ OSL_ENSURE( GetWrongListType() == pNext->GetWrongListType(), "type mismatch with next list" );
}
if( pNext )
{
@@ -503,7 +502,7 @@ void SwWrongList::InsertSubList( xub_StrLen nNewPos, xub_StrLen nNewLen, sal_uIn
{
if (pSubList)
{
- DBG_ASSERT( GetWrongListType() == pSubList->GetWrongListType(), "type mismatch with sub list" );
+ OSL_ENSURE( GetWrongListType() == pSubList->GetWrongListType(), "type mismatch with sub list" );
}
std::vector<SwWrongArea>::iterator i = maList.begin();
if ( nWhere >= maList.size() )
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 3209fbadac..f91fbbc9f0 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -29,10 +29,14 @@
#include "precompiled_sw.hxx"
#include "frame.hxx"
+#include "sectfrm.hxx"
+#include "tabfrm.hxx"
#include "txtfrm.hxx"
#include "porlin.hxx"
#include "porlay.hxx"
#include "portxt.hxx"
+#include "sortedobjs.hxx"
+#include <anchoredobject.hxx>
#include <libxml/xmlwriter.h>
#include <SwPortionHandler.hxx>
@@ -41,6 +45,77 @@ class XmlPortionDumper:public SwPortionHandler
private:
xmlTextWriterPtr writer;
sal_uInt16 ofs;
+
+ const char* getTypeName( sal_uInt16 nType )
+ {
+ switch ( nType )
+ {
+ case POR_LIN: return "POR_LIN";
+ case POR_FLYCNT: return "POR_FLYCNT";
+
+ case POR_HOLE: return "POR_HOLE";
+ case POR_TMPEND: return "POR_TMPEND";
+ case POR_BRK: return "POR_BRK";
+ case POR_KERN: return "POR_KERN";
+ case POR_ARROW: return "POR_ARROW";
+ case POR_MULTI: return "POR_MULTI";
+ case POR_HIDDEN_TXT: return "POR_HIDDEN_TXT";
+ case POR_CONTROLCHAR: return "POR_CONTROLCHAR";
+
+ case POR_TXT: return "POR_TXT";
+ case POR_LAY: return "POR_LAY";
+ case POR_PARA: return "POR_PARA";
+ case POR_URL: return "POR_URL";
+ case POR_HNG: return "POR_HNG";
+
+ case POR_DROP: return "POR_DROP";
+ case POR_TOX: return "POR_TOX";
+ case POR_ISOTOX: return "POR_ISOTOX";
+ case POR_REF: return "POR_REF";
+ case POR_ISOREF: return "POR_ISOREF";
+ case POR_META: return "POR_META";
+
+ case POR_EXP: return "POR_EXP";
+ case POR_BLANK: return "POR_BLANK";
+ case POR_POSTITS: return "POR_POSTITS";
+
+ case POR_HYPH: return "POR_HYPH";
+ case POR_HYPHSTR: return "POR_HYPHSTR";
+ case POR_SOFTHYPH: return "POR_SOFTHYPH";
+ case POR_SOFTHYPHSTR: return "POR_SOFTHYPHSTR";
+ case POR_SOFTHYPH_COMP: return "POR_SOFTHYPH_COMP";
+
+ case POR_FLD: return "POR_FLD";
+ case POR_HIDDEN: return "POR_HIDDEN";
+ case POR_QUOVADIS: return "POR_QUOVADIS";
+ case POR_ERGOSUM: return "POR_ERGOSUM";
+ case POR_COMBINED: return "POR_COMBINED";
+ case POR_FTN: return "POR_FTN";
+
+ case POR_FTNNUM: return "POR_FTNNUM";
+ case POR_NUMBER: return "POR_NUMBER";
+ case POR_BULLET: return "POR_BULLET";
+ case POR_GRFNUM: return "POR_GRFNUM";
+
+ case POR_GLUE: return "POR_GLUE";
+
+ case POR_MARGIN: return "POR_MARGIN";
+
+ case POR_FIX: return "POR_FIX";
+ case POR_FLY: return "POR_FLY";
+
+ case POR_TAB: return "POR_TAB";
+
+ case POR_TABRIGHT: return "POR_TABRIGHT";
+ case POR_TABCENTER: return "POR_TABCENTER";
+ case POR_TABDECIMAL: return "POR_TABDECIMAL";
+
+ case POR_TABLEFT: return "POR_TABLEFT";
+ default:
+ return "Unknown";
+ }
+ }
+
public:
XmlPortionDumper( xmlTextWriterPtr some_writer ):writer( some_writer ), ofs( 0 )
@@ -67,7 +142,7 @@ class XmlPortionDumper:public SwPortionHandler
"%i", ( int ) nLength );
xmlTextWriterWriteFormatAttribute( writer,
BAD_CAST( "nType" ),
- "%i", ( int ) nType );
+ "%s", getTypeName( nType ) );
xmlTextWriterEndElement( writer );
}
@@ -89,7 +164,7 @@ class XmlPortionDumper:public SwPortionHandler
"%i", ( int ) nLength );
xmlTextWriterWriteFormatAttribute( writer,
BAD_CAST( "nType" ),
- "%i", ( int ) nType );
+ "%s", getTypeName( nType ) );
rtl::OUString sText( rText );
rtl::OString sText8 =::rtl::OUStringToOString( sText,
RTL_TEXTENCODING_UTF8 );
@@ -128,82 +203,28 @@ class XmlPortionDumper:public SwPortionHandler
};
-#if OSL_DEBUG_LEVEL > 1
-
-void SwTxtPortion::dumpPortionAsXml( xub_StrLen ofs, XubString & /*aText */,
- xmlTextWriterPtr writer )
+namespace
{
- xmlTextWriterStartElement( writer, BAD_CAST( "SwTxtPortion" ) );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ofs" ), "%i", ofs );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "len" ), "%i",
- ( int ) this->GetLen( ) );
-
- xmlTextWriterEndElement( writer );
-}
-
-void SwLinePortion::dumpPortionAsXml( xub_StrLen ofs, XubString & /*aText */,
- xmlTextWriterPtr writer )
-{
- xmlTextWriterStartElement( writer, BAD_CAST( "SwLinePortion" ) );
- xmlTextWriterWriteFormatAttribute( writer,
- BAD_CAST( "nWhichPor" ),
- "%04X",
- ( int ) this->GetWhichPor( ) );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ofs" ), "%i", ofs );
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "len" ), "%i",
- ( int ) this->GetLen( ) );
- xmlTextWriterEndElement( writer );
-}
-
-void SwLineLayout::dumpLineAsXml( xmlTextWriterPtr writer,
- xub_StrLen & ofs, XubString & aText )
-{ // not used any longer...
- xmlTextWriterStartElement( writer, BAD_CAST( "SwLineLayout" ) );
- SwLinePortion *portion = this;
- while ( portion != NULL )
+ xmlTextWriterPtr lcl_createDefaultWriter()
{
- portion->dumpPortionAsXml( ofs, aText, writer );
- ofs += portion->GetLen( );
- portion = portion->GetPortion( );
+ xmlTextWriterPtr writer = xmlNewTextWriterFilename( "layout.xml", 0 );
+ xmlTextWriterStartDocument( writer, NULL, NULL, NULL );
+ return writer;
}
- xmlTextWriterEndElement( writer );
-}
-
-
-void SwParaPortion::dumpAsXml( xmlTextWriterPtr writer, SwTxtFrm * pTxtFrm )
-{
- xmlTextWriterStartElement( writer, BAD_CAST( "SwParaPortion" ) );
- SwParaPortion *pPara = this;
- if ( pPara && pTxtFrm )
+ void lcl_freeWriter( xmlTextWriterPtr writer )
{
- xub_StrLen ofs = 0;
- XubString & aText = ( String & ) pTxtFrm->GetTxt( );
- if ( pTxtFrm->IsFollow( ) )
- ofs += pTxtFrm->GetOfst( );
-
- SwLineLayout *pLine = pPara;
- while ( pLine )
- {
- xmlTextWriterStartElement( writer, BAD_CAST( "line" ) );
- SwLinePortion *pPor = pLine->GetFirstPortion( );
- while ( pPor )
- {
- pPor->dumpPortionAsXml( ofs, aText, writer );
- ofs += pPor->GetLen( );
- pPor = pPor->GetPortion( );
- }
-
- xmlTextWriterEndElement( writer ); // line
- pLine = pLine->GetNext( );
- }
+ xmlTextWriterEndDocument( writer );
+ xmlFreeTextWriter( writer );
}
- xmlTextWriterEndElement( writer );
}
-
void SwFrm::dumpAsXml( xmlTextWriterPtr writer )
{
+ bool bCreateWriter = ( NULL == writer );
+ if ( bCreateWriter )
+ writer = lcl_createDefaultWriter();
+
const char *name = NULL;
switch ( GetType( ) )
@@ -264,6 +285,22 @@ void SwFrm::dumpAsXml( xmlTextWriterPtr writer )
dumpAsXmlAttributes( writer );
+ // Dump Anchored objects if any
+ SwSortedObjs* pAnchored = GetDrawObjs();
+ if ( pAnchored && pAnchored->Count( ) > 0 )
+ {
+ xmlTextWriterStartElement( writer, BAD_CAST( "anchored" ) );
+
+ for ( sal_uInt32 i = 0, len = pAnchored->Count(); i < len; i++ )
+ {
+ SwAnchoredObject* pObject = (*pAnchored)[i];
+ pObject->dumpAsXml( writer );
+ }
+
+ xmlTextWriterEndElement( writer );
+ }
+
+ // Dump the children
if ( IsTxtFrm( ) )
{
SwTxtFrm *pTxtFrm = ( SwTxtFrm * ) this;
@@ -286,6 +323,9 @@ void SwFrm::dumpAsXml( xmlTextWriterPtr writer )
}
xmlTextWriterEndElement( writer );
}
+
+ if ( bCreateWriter )
+ lcl_freeWriter( writer );
}
void SwFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
@@ -306,13 +346,49 @@ void SwFrm::dumpChildrenAsXml( xmlTextWriterPtr writer )
}
}
+void SwAnchoredObject::dumpAsXml( xmlTextWriterPtr writer )
+{
+ bool bCreateWriter = ( NULL == writer );
+ if ( bCreateWriter )
+ writer = lcl_createDefaultWriter();
+
+ xmlTextWriterStartElement( writer, BAD_CAST( getElementName() ) );
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "ptr" ), "%p", this );
+ xmlTextWriterEndElement( writer );
+
+
+ if ( bCreateWriter )
+ lcl_freeWriter( writer );
+}
+
void SwTxtFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
{
SwFrm::dumpAsXmlAttributes( writer );
if ( HasFollow() )
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
+
+ if ( pPrecede != NULL )
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwTxtFrm*)pPrecede );
+}
+
+void SwSectionFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
+{
+ SwFrm::dumpAsXmlAttributes( writer );
+ if ( HasFollow() )
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
+
+ if ( pPrecede != NULL )
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwSectionFrm*)pPrecede );
}
-#endif
+void SwTabFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
+{
+ SwFrm::dumpAsXmlAttributes( writer );
+ if ( HasFollow() )
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
+
+ if ( pPrecede != NULL )
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwTabFrm*)pPrecede );
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx
index 5c2b463e8f..71dfaddf35 100644
--- a/sw/source/core/tox/tox.cxx
+++ b/sw/source/core/tox/tox.cxx
@@ -335,10 +335,9 @@ SwForm::SwForm( TOXTypes eTyp ) // #i21237#
SwFormToken aToken(TOKEN_TAB_STOP);
aToken.nTabStopPosition = 0;
- // --> FME 2004-12-10 #i36870# right aligned tab for all
+ // #i36870# right aligned tab for all
aToken.cTabFillChar = '.';
aToken.eTabAlign = SVX_TAB_ADJUST_END;
- // <--
aTokens.push_back(aToken);
aTokens.push_back(SwFormToken(TOKEN_PAGE_NUMS));
@@ -463,7 +462,7 @@ void SwForm::AdjustTabStops(SwDoc& rDoc, sal_Bool bInsertNewTapStops) // #i21237
{
const SvxTabStop& rTab = (*pTabStops)[nTab];
- // --> FME 2004-12-16 #i29178#
+ // #i29178#
// For Word import, we do not want to replace exising tokens,
// we insert new tabstop tokens without a tabstop character:
if ( bInsertNewTapStops )
@@ -479,7 +478,6 @@ void SwForm::AdjustTabStops(SwDoc& rDoc, sal_Bool bInsertNewTapStops) // #i21237
aCurrentPattern.push_back(aToken);
}
}
- // <--
else
{
aIt = find_if(aIt, aCurrentPattern.end(),
@@ -500,7 +498,6 @@ void SwForm::AdjustTabStops(SwDoc& rDoc, sal_Bool bInsertNewTapStops) // #i21237
break; // no more tokens to replace
}
}
- // <--
if(bChanged)
SetPattern(nLevel, aCurrentPattern); // #i21237#
diff --git a/sw/source/core/tox/toxhlp.cxx b/sw/source/core/tox/toxhlp.cxx
index 6192fe8377..6af7312d05 100644
--- a/sw/source/core/tox/toxhlp.cxx
+++ b/sw/source/core/tox/toxhlp.cxx
@@ -34,7 +34,6 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/i18n/XExtendedIndexEntrySupplier.hpp>
#include <tools/string.hxx>
-#include <tools/debug.hxx>
#include <toxwrap.hxx>
using namespace ::com::sun::star;
@@ -66,7 +65,7 @@ IndexEntrySupplierWrapper::IndexEntrySupplierWrapper()
#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "IndexEntrySupplierWrapper: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ OSL_FAIL( aMsg.GetBuffer() );
#endif
}
}
@@ -92,7 +91,7 @@ String IndexEntrySupplierWrapper::GetIndexKey( const String& rTxt,
#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "getIndexKey: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ OSL_FAIL( aMsg.GetBuffer() );
#endif
}
return sRet;
@@ -113,7 +112,7 @@ String IndexEntrySupplierWrapper::GetFollowingText( sal_Bool bMorePages ) const
#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "getIndexFollowPageWord: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ OSL_FAIL( aMsg.GetBuffer() );
#endif
}
return sRet;
@@ -136,7 +135,7 @@ IndexEntrySupplierWrapper::GetAlgorithmList( const STAR_NMSPC::lang::Locale& rLc
#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "getAlgorithmList: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ OSL_FAIL( aMsg.GetBuffer() );
#endif
}
return sRet;
@@ -159,7 +158,7 @@ sal_Bool IndexEntrySupplierWrapper::LoadAlgorithm(
#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "loadAlgorithm: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ OSL_FAIL( aMsg.GetBuffer() );
#endif
}
return bRet;
@@ -185,7 +184,7 @@ sal_Int16 IndexEntrySupplierWrapper::CompareIndexEntry(
#if OSL_DEBUG_LEVEL > 1
ByteString aMsg( "compareIndexEntry: Exception caught\n" );
aMsg += ByteString( String( e.Message ), RTL_TEXTENCODING_UTF8 );
- DBG_ERRORFILE( aMsg.GetBuffer() );
+ OSL_FAIL( aMsg.GetBuffer() );
#endif
}
return nRet;
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index 30eb065bb2..f6faaaa0c9 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -207,10 +207,9 @@ void SwFmtFld::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
// GetReferenz-Felder aktualisieren
if( RES_GETREFFLD == GetFld()->GetTyp()->Which() )
{
- // --> OD 2007-09-06 #i81002#
+ // #i81002#
// ((SwGetRefField*)GetFld())->UpdateField();
dynamic_cast<SwGetRefField*>(GetFld())->UpdateField( pTxtAttr );
- // <--
}
break;
case RES_DOCPOS_UPDATE:
@@ -328,11 +327,10 @@ void SwTxtFld::Expand() const
const sal_uInt16 nWhich = pFld->GetTyp()->Which();
if( RES_CHAPTERFLD != nWhich && RES_PAGENUMBERFLD != nWhich &&
RES_REFPAGEGETFLD != nWhich &&
- // --> FME 2005-05-23 #122919# Page count fields to not use aExpand
+ // #122919# Page count fields to not use aExpand
// during formatting, therefore an invalidation of the text frame
// has to be triggered even if aNewExpand == aExpand:
( RES_DOCSTATFLD != nWhich || DS_PAGE != static_cast<const SwDocStatField*>(pFld)->GetSubType() ) &&
- // <--
( RES_GETEXPFLD != nWhich || ((SwGetExpField*)pFld)->IsInBodyTxt() ) )
{
// BP: das muesste man noch optimieren!
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index 88c61f7d85..c4c6ddcd3c 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -273,11 +273,10 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
// 7922: Wir muessen dafuer sorgen, dass der Inhalt des FlyInCnt
// nach seiner Konstruktion stramm durchformatiert wird.
- // --> OD 2004-11-09 #i26945# - Use new object formatter to format Writer
+ // #i26945# - Use new object formatter to format Writer
// fly frame and its content.
SwObjectFormatter::FormatObj( *pFly, const_cast<SwFrm*>(pCurrFrm),
pCurrFrm->FindPageFrm() );
- // <--
return pFly;
}
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 4f29d72923..e89c671744 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -32,7 +32,6 @@
#define _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTSSORT
#include <svl/svstdarr.hxx>
#include <doc.hxx>
#include <cntfrm.hxx> // OSL_ENSURE(in ~SwTxtFtn()
@@ -50,6 +49,87 @@
#include <section.hxx>
#include <switerator.hxx>
+namespace {
+ /// Get a sorted list of the used footnote reference numbers.
+ /// @param[in] rDoc The active document.
+ /// @param[in] pExclude A footnote whose reference number should be excluded from the set.
+ /// @param[out] rInvalid A returned list of all items that had an invalid reference number.
+ /// @returns The set of used reference numbers.
+ static std::set<sal_uInt16> lcl_GetUsedFtnRefNumbers(SwDoc &rDoc,
+ SwTxtFtn *pExclude,
+ std::vector<SwTxtFtn*> &rInvalid)
+ {
+ int n;
+ std::set<sal_uInt16> aArr;
+ SwFtnIdxs& ftnIdxs = rDoc.GetFtnIdxs();
+ SwTxtFtn* pTxtFtn;
+
+ rInvalid.clear();
+
+ for( n = 0; n < ftnIdxs.Count(); ++n )
+ {
+ pTxtFtn = ftnIdxs[ n ];
+ if ( pTxtFtn != pExclude )
+ {
+ if ( USHRT_MAX == pTxtFtn->GetSeqRefNo() )
+ {
+ rInvalid.push_back(pTxtFtn);
+ }
+ else
+ {
+ aArr.insert( pTxtFtn->GetSeqRefNo() );
+ }
+ }
+ }
+ return aArr;
+ }
+
+ /// Check whether a requested reference number is available.
+ /// @param[in] rUsedNums Set of used reference numbers.
+ /// @param[in] requested The requested reference number.
+ /// @returns true if the number is available, false if not.
+ static bool lcl_IsRefNumAvailable(std::set<sal_uInt16> &rUsedNums,
+ sal_uInt16 requested)
+ {
+ if ( USHRT_MAX == requested )
+ return false; // Invalid sequence number.
+ if ( rUsedNums.count(requested) )
+ return false; // Number already used.
+ return true;
+ }
+
+ /// Get the first few unused sequential reference numbers.
+ /// @param[in] rUsedNums The set of used sequential reference numbers.
+ /// @param[in] numRequired The number of reference number required.
+ /// @returns The lowest unused sequential reference numbers.
+ static std::vector<sal_uInt16> lcl_GetUnusedSeqRefNums(std::set<sal_uInt16> &rUsedNums,
+ size_t numRequired)
+ {
+ std::vector<sal_uInt16> unusedNums;
+ sal_uInt16 newNum = 0;
+ std::set<sal_uInt16>::iterator it;
+ //Start by using numbers from gaps in rUsedNums
+ for( it = rUsedNums.begin(); it != rUsedNums.end(); ++it )
+ {
+ while ( newNum < *it )
+ {
+ unusedNums.push_back( newNum++ );
+ if ( unusedNums.size() >= numRequired )
+ return unusedNums;
+ }
+ newNum++;
+ }
+ //Filled in all gaps. Fill the rest of the list with new numbers.
+ while ( unusedNums.size() < numRequired )
+ {
+ unusedNums.push_back( newNum++ );
+ }
+
+ return unusedNums;
+ }
+
+}
+
/*************************************************************************
|*
|* class SwFmtFtn
@@ -424,7 +504,8 @@ void SwTxtFtn::DelFrms( const SwFrm* pSib )
}
}
-
+/// Set the sequence number for the current footnote.
+/// @returns The new sequence number or USHRT_MAX if invalid.
sal_uInt16 SwTxtFtn::SetSeqRefNo()
{
if( !m_pTxtNode )
@@ -434,100 +515,25 @@ sal_uInt16 SwTxtFtn::SetSeqRefNo()
if( pDoc->IsInReading() )
return USHRT_MAX;
- sal_uInt16 n, nFtnCnt = pDoc->GetFtnIdxs().Count();
-
- const sal_uInt8 nTmp = 255 < nFtnCnt ? 255 : static_cast<sal_uInt8>(nFtnCnt);
- SvUShortsSort aArr( nTmp, nTmp );
-
- // dann testmal, ob die Nummer schon vergeben ist oder ob eine neue
- // bestimmt werden muss.
- SwTxtFtn* pTxtFtn;
- for( n = 0; n < nFtnCnt; ++n )
- {
- pTxtFtn = pDoc->GetFtnIdxs()[ n ];
- if ( pTxtFtn != this )
- {
- aArr.Insert( pTxtFtn->m_nSeqNo );
- }
- }
-
- // test if number is already in use
- if ( USHRT_MAX != m_nSeqNo )
- {
- for( n = 0; n < aArr.Count(); ++n )
- {
- if ( aArr[ n ] > m_nSeqNo )
- {
- return m_nSeqNo; // free -> use
- }
- else if ( aArr[ n ] == m_nSeqNo )
- {
- break; // used -> create new one
- }
- }
-
- if ( n == aArr.Count() )
- {
- return m_nSeqNo; // free -> use
- }
- }
-
- // alle Nummern entsprechend geflag, also bestimme die richtige Nummer
- for( n = 0; n < aArr.Count(); ++n )
- if( n != aArr[ n ] )
- break;
-
- return m_nSeqNo = n;
+ std::vector<SwTxtFtn*> badRefNums;
+ std::set<sal_uInt16> aUsedNums = ::lcl_GetUsedFtnRefNumbers(*pDoc, this, badRefNums);
+ if ( ::lcl_IsRefNumAvailable(aUsedNums, m_nSeqNo) )
+ return m_nSeqNo;
+ std::vector<sal_uInt16> unused = ::lcl_GetUnusedSeqRefNums(aUsedNums, 1);
+ return m_nSeqNo = unused[0];
}
+/// Set a unique sequential reference number for every footnote in the document.
+/// @param[in] rDoc The document to be processed.
void SwTxtFtn::SetUniqueSeqRefNo( SwDoc& rDoc )
{
- sal_uInt16 n, nStt = 0, nFtnCnt = rDoc.GetFtnIdxs().Count();
+ std::vector<SwTxtFtn*> badRefNums;
+ std::set<sal_uInt16> aUsedNums = ::lcl_GetUsedFtnRefNumbers(rDoc, NULL, badRefNums);
+ std::vector<sal_uInt16> unused = ::lcl_GetUnusedSeqRefNums(aUsedNums, badRefNums.size());
- const sal_uInt8 nTmp = 255 < nFtnCnt ? 255 : static_cast<sal_uInt8>(nFtnCnt);
- SvUShortsSort aArr( nTmp, nTmp );
-
- // dann alle Nummern zusammensammeln die schon existieren
- SwTxtFtn* pTxtFtn;
- for( n = 0; n < nFtnCnt; ++n )
+ for (size_t i = 0; i < badRefNums.size(); ++i)
{
- pTxtFtn = rDoc.GetFtnIdxs()[ n ];
- if ( USHRT_MAX != pTxtFtn->m_nSeqNo )
- {
- aArr.Insert( pTxtFtn->m_nSeqNo );
- }
- }
-
-
- for( n = 0; n < nFtnCnt; ++n )
- {
- pTxtFtn = rDoc.GetFtnIdxs()[ n ];
- if ( USHRT_MAX == pTxtFtn->m_nSeqNo )
- {
- for( ; nStt < aArr.Count(); ++nStt )
- {
- if ( nStt != aArr[ nStt ] )
- {
- pTxtFtn->m_nSeqNo = nStt;
- break;
- }
- }
-
- if ( USHRT_MAX == pTxtFtn->m_nSeqNo )
- {
- break; // found nothing
- }
- }
- }
-
- // alle Nummern schon vergeben, also mit nStt++ weitermachen
- for( ; n < nFtnCnt; ++n )
- {
- pTxtFtn = rDoc.GetFtnIdxs()[ n ];
- if ( USHRT_MAX == pTxtFtn->m_nSeqNo )
- {
- pTxtFtn->m_nSeqNo = nStt++;
- }
+ badRefNums[i]->m_nSeqNo = unused[i];
}
}
diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx
index e5f66241d1..810c98e1d4 100644
--- a/sw/source/core/txtnode/fmtatr2.cxx
+++ b/sw/source/core/txtnode/fmtatr2.cxx
@@ -814,7 +814,9 @@ void MetaField::GetPrefixAndSuffix(
(pShell) ? pShell->GetModel() : 0, uno::UNO_SET_THROW);
getPrefixAndSuffix(xModel, xMetaField, o_pPrefix, o_pSuffix);
}
- } catch (uno::Exception) {
+ }
+ catch (const uno::Exception&)
+ {
OSL_FAIL("exception?");
}
}
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index b5d62f8c22..714c1ff379 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -512,7 +512,7 @@ void SwFntObj::CreateScrFont( const ViewShell& rSh, const OutputDevice& rOut )
void SwFntObj::GuessLeading( const ViewShell&
-#if defined(WNT) || defined(PM2)
+#if defined(WNT)
rSh
#endif
, const FontMetric& rMet )
@@ -525,7 +525,7 @@ void SwFntObj::GuessLeading( const ViewShell&
return;
}
-#if defined(WNT) || defined(PM2)
+#if defined(WNT)
OutputDevice *pWin = rSh.GetWin() ?
rSh.GetWin() :
GetpApp()->GetDefaultDevice();
@@ -2166,10 +2166,9 @@ xub_StrLen SwFntObj::GetCrsrOfst( SwDrawTextInfo &rInf )
xub_StrLen nLastIdx = nIdx;
const xub_StrLen nEnd = rInf.GetIdx() + rInf.GetLen();
- // --> OD 2009-12-29 #i105901#
+ // #i105901#
// skip character cells for all script types
if ( pBreakIt->GetBreakIter().is() )
- // <--
{
aLang = rInf.GetFont()->GetLanguage();
bSkipCharacterCells = true;
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index cd2f17077e..68d83400ab 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -38,7 +38,6 @@
#include <editeng/tstpitem.hxx>
#include <svl/urihelper.hxx>
#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_ULONGS
#include <svl/svstdarr.hxx>
#endif
#include <svl/ctloptions.hxx>
@@ -633,7 +632,7 @@ SwCntntNode *SwTxtNode::JoinNext()
if( SwCntntNode::CanJoinNext( &aIdx ) )
{
SwDoc* pDoc = rNds.GetDoc();
- SvULongs aBkmkArr( 15, 15 );
+ std::vector<sal_uLong> aBkmkArr;
_SaveCntntIdx( pDoc, aIdx.GetIndex(), USHRT_MAX, aBkmkArr, SAVEFLY );
SwTxtNode *pTxtNode = aIdx.GetNode().GetTxtNode();
xub_StrLen nOldLen = m_Text.Len();
@@ -700,7 +699,7 @@ SwCntntNode *SwTxtNode::JoinNext()
pTxtNode->CutText( this, SwIndex(pTxtNode), pTxtNode->Len() );
}
// verschiebe noch alle Bookmarks/TOXMarks
- if( aBkmkArr.Count() )
+ if( !aBkmkArr.empty() )
_RestoreCntntIdx( pDoc, aBkmkArr, GetIndex(), nOldLen );
if( pTxtNode->HasAnyIndex() )
@@ -728,7 +727,7 @@ SwCntntNode *SwTxtNode::JoinPrev()
if( SwCntntNode::CanJoinPrev( &aIdx ) )
{
SwDoc* pDoc = rNds.GetDoc();
- SvULongs aBkmkArr( 15, 15 );
+ std::vector<sal_uLong> aBkmkArr;
_SaveCntntIdx( pDoc, aIdx.GetIndex(), USHRT_MAX, aBkmkArr, SAVEFLY );
SwTxtNode *pTxtNode = aIdx.GetNode().GetTxtNode();
xub_StrLen nLen = pTxtNode->Len();
@@ -795,7 +794,7 @@ SwCntntNode *SwTxtNode::JoinPrev()
pTxtNode->CutText( this, SwIndex(this), SwIndex(pTxtNode), nLen );
}
// verschiebe noch alle Bookmarks/TOXMarks
- if( aBkmkArr.Count() )
+ if( !aBkmkArr.empty() )
_RestoreCntntIdx( pDoc, aBkmkArr, GetIndex() );
if( pTxtNode->HasAnyIndex() )
@@ -1455,7 +1454,7 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const xub_StrLen nTxtStartIdx,
|* wird angehaengt
*************************************************************************/
-// --> OD 2008-11-18 #i96213#
+// #i96213#
// introduction of new optional parameter to control, if all attributes have to be copied.
void SwTxtNode::CopyText( SwTxtNode *const pDest,
const SwIndex &rStart,
@@ -1466,7 +1465,7 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
CopyText( pDest, aIdx, rStart, nLen, bForceCopyOfAllAttrs );
}
-// --> OD 2008-11-18 #i96213#
+// #i96213#
// introduction of new optional parameter to control, if all attributes have to be copied.
void SwTxtNode::CopyText( SwTxtNode *const pDest,
const SwIndex &rDestStart,
@@ -1494,12 +1493,11 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
if( HasSwAttrSet() )
{
// alle, oder nur die CharAttribute ?
- // --> OD 2008-11-18 #i96213#
+ // #i96213#
if ( !bForceCopyOfAllAttrs &&
( nDestStart ||
pDest->HasSwAttrSet() ||
nLen != pDest->GetTxt().Len() ) )
- // <--
{
SfxItemSet aCharSet( pDest->GetDoc()->GetAttrPool(),
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
@@ -1541,12 +1539,11 @@ void SwTxtNode::CopyText( SwTxtNode *const pDest,
if( HasSwAttrSet() )
{
// alle, oder nur die CharAttribute ?
- // --> OD 2008-11-18 #i96213#
+ // #i96213#
if ( !bForceCopyOfAllAttrs &&
( nDestStart ||
pDest->HasSwAttrSet() ||
nLen != pDest->GetTxt().Len() ) )
- // <--
{
SfxItemSet aCharSet( pDest->GetDoc()->GetAttrPool(),
RES_CHRATR_BEGIN, RES_CHRATR_END-1,
@@ -2229,10 +2226,9 @@ void SwTxtNode::EraseText(const SwIndex &rIdx, const xub_StrLen nCount,
!(IDocumentContentOperations::INS_EMPTYEXPAND & nMode) &&
( (RES_TXTATR_TOXMARK == nWhich) ||
(RES_TXTATR_REFMARK == nWhich) ||
- // --> FME 2006-03-03 #i62668# Ruby text attribute must be
+ // #i62668# Ruby text attribute must be
// treated just like toxmark and refmarks
(RES_TXTATR_CJK_RUBY == nWhich) ) )
- // <--
|| ( (nHintStart < nEndIdx) &&
pHt->HasDummyChar() )
)
@@ -2426,9 +2422,8 @@ SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, sal_Bool bNext,
{
/* hartes PageBreak/PageDesc/ColumnBreak aus AUTO-Set ignorieren */
SwAttrSet* pNewAttrSet = 0;
- // --> OD 2007-07-10 #i75353#
+ // #i75353#
bool bClearHardSetNumRuleWhenFmtCollChanges( false );
- // <--
if( HasSwAttrSet() )
{
pNewAttrSet = new SwAttrSet( *GetpSwAttrSet() );
@@ -2479,17 +2474,16 @@ SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, sal_Bool bNext,
pNewAttrSet->ClearItem(RES_PARATR_NUMRULE);
else
{
- // --> OD 2007-07-10 #i75353#
+ // #i75353#
// No clear of hard set numbering rule at an outline paragraph at this point.
// Only if the paragraph style changes - see below.
bClearHardSetNumRuleWhenFmtCollChanges = true;
- // <--
}
bRemoveFromCache = sal_True;
}
}
- if ( 0 != aClearWhichIds.size() )
+ if ( !aClearWhichIds.empty() )
bRemoveFromCache = 0 != ClearItemsFromAttrSet( aClearWhichIds );
if( !bNext && bRemoveFromCache && IsInCache() )
@@ -2510,12 +2504,11 @@ SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, sal_Bool bNext,
const SwNumRule* pRule = GetNumRule();
if( pRule && pRule == pNode->GetNumRule() && rNds.IsDocNodes() ) // #115901#
{
- // --> OD 2005-10-18 #i55459#
+ // #i55459#
// - correction: parameter <bNext> has to be checked, as it was in the
// previous implementation.
if ( !bNext && !IsCountedInList() )
SetCountedInList(true);
- // <--
}
// jetzt kann es sein, das durch die Nummerierung dem neuen Node eine
@@ -2530,11 +2523,11 @@ SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, sal_Bool bNext,
return pNode;
SwTxtFmtColl *pNextColl = &pColl->GetNextTxtFmtColl();
- // --> OD 2009-08-12 #i101870#
+ // #i101870#
// perform action on different paragraph styles before applying the new paragraph style
if (pNextColl != pColl)
{
- // --> OD 2007-07-10 #i75353#
+ // #i75353#
if ( bClearHardSetNumRuleWhenFmtCollChanges )
{
std::vector<sal_uInt16> aClearWhichIds;
@@ -2545,9 +2538,7 @@ SwTxtNode* SwTxtNode::_MakeNewTxtNode( const SwNodeIndex& rPos, sal_Bool bNext,
SetInCache( sal_False );
}
}
- // <--
}
- // <--
ChgFmtColl( pNextColl );
return pNode;
@@ -2640,7 +2631,7 @@ sal_Bool SwTxtNode::HasBullet() const
}
// <- #i29560#
-// --> OD 2005-11-17 #128041# - introduce parameter <_bInclPrefixAndSuffixStrings>
+// #128041# - introduce parameter <_bInclPrefixAndSuffixStrings>
//i53420 added max outline parameter
XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, const unsigned int _nRestrictToThisLevel ) const
{
@@ -2656,7 +2647,7 @@ XubString SwTxtNode::GetNumString( const bool _bInclPrefixAndSuffixStrings, cons
SvxNumberType const& rNumberType(
pRule->Get( static_cast<sal_uInt16>(GetActualListLevel()) ) );
if (rNumberType.IsTxtFmt() ||
- // #b6432095#
+ //
(style::NumberingType::NUMBER_NONE == rNumberType.GetNumberingType()))
{
return pRule->MakeNumString( GetNum()->GetNumberVector(),
@@ -2698,7 +2689,7 @@ long SwTxtNode::GetLeftMarginWithNum( sal_Bool bTxtLeft ) const
if ( AreListLevelIndentsApplicable() )
{
nRet = rFmt.GetIndentAt();
- // --> OD 2008-06-06 #i90401#
+ // #i90401#
// Only negative first line indents have consider for the left margin
if ( !bTxtLeft &&
rFmt.GetFirstLineIndent() < 0 )
@@ -2715,11 +2706,10 @@ long SwTxtNode::GetLeftMarginWithNum( sal_Bool bTxtLeft ) const
sal_Bool SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
{
sal_Bool bRet( sal_False );
- // --> OD 2009-09-08 #i95907#, #b6879723#
+ // #i95907#
rFLOffset = 0;
- // <--
- // --> OD 2005-11-02 #i51089 - TUNING#
+ // #i51089#
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if ( pRule )
{
@@ -2760,7 +2750,7 @@ sal_Bool SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
return bRet;
}
-// --> OD 2010-01-05 #b6884103#
+//
SwTwips SwTxtNode::GetAdditionalIndentForStartingNewList() const
{
SwTwips nAdditionalIndent = 0;
@@ -2804,7 +2794,7 @@ SwTwips SwTxtNode::GetAdditionalIndentForStartingNewList() const
return nAdditionalIndent;
}
-// --> OD 2008-12-02 #i96772#
+// #i96772#
void SwTxtNode::ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpaceItem ) const
{
if ( AreListLevelIndentsApplicable() )
@@ -2822,7 +2812,7 @@ void SwTxtNode::ClearLRSpaceItemDueToListLevelIndents( SvxLRSpaceItem& o_rLRSpac
}
}
-// --> OD 2008-07-01 #i91133#
+// #i91133#
long SwTxtNode::GetLeftMarginForTabCalculation() const
{
long nLeftMarginForTabCalc = 0;
@@ -2919,7 +2909,7 @@ void SwTxtNode::Replace0xFF( XubString& rTxt, xub_StrLen& rTxtStt,
* SwTxtNode::GetExpandTxt
* Expand fields
*************************************************************************/
-// --> OD 2007-11-15 #i83479# - handling of new parameters
+// #i83479# - handling of new parameters
XubString SwTxtNode::GetExpandTxt( const xub_StrLen nIdx,
const xub_StrLen nLen,
const bool bWithNum,
@@ -3281,6 +3271,20 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
}
namespace {
+ static void lcl_ResetParAttrs( SwTxtNode &rTxtNode )
+ {
+ std::set<sal_uInt16> aAttrs;
+ aAttrs.insert( aAttrs.end(), RES_PARATR_LIST_ID );
+ aAttrs.insert( aAttrs.end(), RES_PARATR_LIST_LEVEL );
+ aAttrs.insert( aAttrs.end(), RES_PARATR_LIST_ISRESTART );
+ aAttrs.insert( aAttrs.end(), RES_PARATR_LIST_RESTARTVALUE );
+ aAttrs.insert( aAttrs.end(), RES_PARATR_LIST_ISCOUNTED );
+ SwPaM aPam( rTxtNode );
+ // #i96644#
+ // suppress side effect "send data changed events"
+ rTxtNode.GetDoc()->ResetAttrs( aPam, sal_False, aAttrs, false );
+ }
+
// Helper method for special handling of modified attributes at text node.
// The following is handled:
// (1) on changing the paragraph style - RES_FMT_CHG:
@@ -3377,7 +3381,7 @@ namespace {
rTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
bNumRuleSet = true;
}
- // --> OD 2008-12-17 #i70748#
+ // #i70748#
// The new list style set at the paragraph.
const SwNumRule* pNumRuleAtTxtNode = rTxtNode.GetNumRule();
if ( pNumRuleAtTxtNode )
@@ -3397,18 +3401,7 @@ namespace {
rTxtNode.RemoveFromList();
if ( bParagraphStyleChanged )
{
- SvUShortsSort aResetAttrsArray;
- aResetAttrsArray.Insert( RES_PARATR_LIST_ID );
- aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL );
- aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART );
- aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE );
- aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED );
- SwPaM aPam( rTxtNode );
- // --> OD 2008-11-28 #i96644#
- // suppress side effect "send data changed events"
- rTxtNode.GetDoc()->ResetAttrs( aPam, sal_False,
- &aResetAttrsArray,
- false );
+ ::lcl_ResetParAttrs(rTxtNode);
}
}
else
@@ -3419,7 +3412,7 @@ namespace {
if ( sNumRule ==
String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ) )
{
- // --> OD 2008-09-10 #i70748#
+ // #i70748#
OSL_ENSURE( rTxtNode.GetTxtColl()->IsAssignedToListLevelOfOutlineStyle(),
"<HandleModifyAtTxtNode()> - text node with outline style, but its paragraph style is not assigned to outline style." );
int nNewListLevel =
@@ -3437,25 +3430,12 @@ namespace {
rTxtNode.RemoveFromList();
if ( bParagraphStyleChanged )
{
- SvUShortsSort aResetAttrsArray;
- aResetAttrsArray.Insert( RES_PARATR_LIST_ID );
- aResetAttrsArray.Insert( RES_PARATR_LIST_LEVEL );
- aResetAttrsArray.Insert( RES_PARATR_LIST_ISRESTART );
- aResetAttrsArray.Insert( RES_PARATR_LIST_RESTARTVALUE );
- aResetAttrsArray.Insert( RES_PARATR_LIST_ISCOUNTED );
- SwPaM aPam( rTxtNode );
- // --> OD 2008-11-28 #i96644#
- // suppress side effect "send data changed events"
- rTxtNode.GetDoc()->ResetAttrs( aPam, sal_False,
- &aResetAttrsArray,
- false );
- // <--
- // --> OD 2008-11-19 #i70748#
+ ::lcl_ResetParAttrs(rTxtNode);
+ // #i70748#
if ( dynamic_cast<const SfxUInt16Item &>(rTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, sal_False )).GetValue() > 0 )
{
rTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
}
- // <--
}
}
}
@@ -3494,9 +3474,8 @@ void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewVal
SwCntntNode::Modify( pOldValue, pNewValue );
SwDoc * pDoc = GetDoc();
- // --> OD 2005-11-02 #125329# - assure that text node is in document nodes array
+ // #125329# - assure that text node is in document nodes array
if ( pDoc && !pDoc->IsInDtor() && &pDoc->GetNodes() == &GetNodes() )
- // <--
{
pDoc->GetNodes().UpdateOutlineNode(*this);
}
@@ -3612,7 +3591,7 @@ void SwTxtNode::SetAttrOutlineLevel(int nLevel)
}
//<-end
-// --> OD 2008-11-19 #i70748#
+// #i70748#
bool SwTxtNode::IsEmptyListStyleDueToSetOutlineLevelAttr()
{
return mbEmptyListStyleSetDueToSetOutlineLevelAttr;
@@ -3635,7 +3614,6 @@ void SwTxtNode::ResetEmptyListStyleDueToResetOutlineLevelAttr()
mbEmptyListStyleSetDueToSetOutlineLevelAttr = false;
}
}
-// <--
void SwTxtNode::SetAttrListLevel( int nLevel )
@@ -3710,7 +3688,7 @@ bool SwTxtNode::HasVisibleNumberingOrBullet() const
const SwNumRule* pRule = GetNum() ? GetNum()->GetNumRule() : 0L;
if ( pRule && IsCountedInList())
{
- // --> OD 2008-03-19 #i87154#
+ // #i87154#
// Correction of #newlistlevelattrs#:
// The numbering type has to be checked for bullet lists.
const SwNumFmt& rFmt = pRule->Get( static_cast<sal_uInt16>(GetActualListLevel() ));
@@ -3719,7 +3697,6 @@ bool SwTxtNode::HasVisibleNumberingOrBullet() const
{
bRet = true;
}
- // <--
}
return bRet;
@@ -4094,7 +4071,7 @@ void SwTxtNode::CalcHiddenCharFlags() const
SwScriptInfo::GetBoundsOfHiddenRange( *this, 0, nStartPos, nEndPos );
}
-// --> FME 2004-06-08 #i12836# enhanced pdf export
+// #i12836# enhanced pdf export
bool SwTxtNode::IsHidden() const
{
if ( HasHiddenParaField() || HasHiddenCharAttribute( true ) )
@@ -4106,7 +4083,6 @@ bool SwTxtNode::IsHidden() const
return false;
}
-// <--
namespace {
// Helper class for special handling of setting attributes at text node:
@@ -4151,9 +4127,8 @@ namespace {
bool mbUpdateListLevel;
bool mbUpdateListRestart;
bool mbUpdateListCount;
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
bool mbOutlineLevelSet;
- // <--
};
HandleSetAttrAtTxtNode::HandleSetAttrAtTxtNode( SwTxtNode& rTxtNode,
@@ -4163,9 +4138,8 @@ namespace {
mbUpdateListLevel( false ),
mbUpdateListRestart( false ),
mbUpdateListCount( false ),
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
mbOutlineLevelSet( false )
- // <--
{
switch ( pItem.Which() )
{
@@ -4179,10 +4153,9 @@ namespace {
if ( pNumRuleItem.GetValue().Len() > 0 )
{
mbAddTxtNodeToList = true;
- // --> OD 2010-05-12 #i105562#
+ // #i105562#
//
mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
- // <--
}
}
break;
@@ -4257,7 +4230,7 @@ namespace {
}
break;
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
// handle RES_PARATR_OUTLINELEVEL
case RES_PARATR_OUTLINELEVEL:
{
@@ -4269,7 +4242,6 @@ namespace {
}
}
break;
- // <--
}
}
@@ -4281,9 +4253,8 @@ namespace {
mbUpdateListLevel( false ),
mbUpdateListRestart( false ),
mbUpdateListCount( false ),
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
mbOutlineLevelSet( false )
- // <--
{
const SfxPoolItem* pItem = 0;
// handle RES_PARATR_NUMRULE
@@ -4296,9 +4267,8 @@ namespace {
if ( pNumRuleItem->GetValue().Len() > 0 )
{
mbAddTxtNodeToList = true;
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
- // <--
}
}
@@ -4366,7 +4336,7 @@ namespace {
}
}
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
// handle RES_PARATR_OUTLINELEVEL
if ( rItemSet.GetItemState( RES_PARATR_OUTLINELEVEL, sal_False, &pItem ) == SFX_ITEM_SET )
{
@@ -4377,7 +4347,6 @@ namespace {
mbOutlineLevelSet = true;
}
}
- // <--
}
HandleSetAttrAtTxtNode::~HandleSetAttrAtTxtNode()
@@ -4411,7 +4380,7 @@ namespace {
}
}
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
if ( mbOutlineLevelSet )
{
if ( mrTxtNode.GetAttrOutlineLevel() == 0 )
@@ -4429,7 +4398,6 @@ namespace {
}
}
}
- // <--
}
// End of class <HandleSetAttrAtTxtNode>
}
@@ -4486,7 +4454,7 @@ namespace {
const sal_uInt16 nWhich1,
const sal_uInt16 nWhich2 );
HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
- const SvUShorts& rWhichArr );
+ const std::vector<sal_uInt16>& rWhichArr );
HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode );
~HandleResetAttrAtTxtNode();
@@ -4521,9 +4489,8 @@ namespace {
{
bRemoveFromList = mrTxtNode.GetpSwAttrSet() &&
mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, sal_False ) == SFX_ITEM_SET;
- // --> OD 2008-10-20 #i92898#
+ // #i92898#
mbListStyleOrIdReset = true;
- // <--
}
if ( !bRemoveFromList )
@@ -4546,13 +4513,12 @@ namespace {
!mrTxtNode.IsCountedInList() );
}
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
// RES_PARATR_OUTLINELEVEL
if ( nWhich1 <= RES_PARATR_OUTLINELEVEL && RES_PARATR_OUTLINELEVEL <= nWhich2 )
{
mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
}
- // <--
}
else
{
@@ -4566,17 +4532,15 @@ namespace {
{
bRemoveFromList = mrTxtNode.GetpSwAttrSet() &&
mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, sal_False ) == SFX_ITEM_SET;
- // --> OD 2008-10-20 #i92898#
+ // #i92898#
mbListStyleOrIdReset = true;
- // <--
}
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
// RES_PARATR_OUTLINELEVEL
else if ( nWhich1 == RES_PARATR_OUTLINELEVEL )
{
mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
}
- // <--
if ( !bRemoveFromList )
{
@@ -4603,7 +4567,7 @@ namespace {
}
HandleResetAttrAtTxtNode::HandleResetAttrAtTxtNode( SwTxtNode& rTxtNode,
- const SvUShorts& rWhichArr )
+ const std::vector<sal_uInt16>& rWhichArr )
: mrTxtNode( rTxtNode ),
mbListStyleOrIdReset( false ),
mbUpdateListLevel( false ),
@@ -4612,50 +4576,48 @@ namespace {
{
bool bRemoveFromList( false );
{
- const sal_uInt16 nEnd = rWhichArr.Count();
- for ( sal_uInt16 n = 0; n < nEnd; ++n )
+ std::vector<sal_uInt16>::const_iterator it;
+ for ( it = rWhichArr.begin(); it != rWhichArr.end(); ++it)
{
// RES_PARATR_NUMRULE and RES_PARATR_LIST_ID
- if ( rWhichArr[ n ] == RES_PARATR_NUMRULE )
+ if ( *it == RES_PARATR_NUMRULE )
{
bRemoveFromList = bRemoveFromList ||
mrTxtNode.GetNumRule() != 0;
mbListStyleOrIdReset = true;
}
- else if ( rWhichArr[ n ] == RES_PARATR_LIST_ID )
+ else if ( *it == RES_PARATR_LIST_ID )
{
bRemoveFromList = bRemoveFromList ||
( mrTxtNode.GetpSwAttrSet() &&
mrTxtNode.GetpSwAttrSet()->GetItemState( RES_PARATR_LIST_ID, sal_False ) == SFX_ITEM_SET );
- // --> OD 2008-10-20 #i92898#
+ // #i92898#
mbListStyleOrIdReset = true;
- // <--
}
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
// RES_PARATR_OUTLINELEVEL
- else if ( rWhichArr[ n ] == RES_PARATR_OUTLINELEVEL )
+ else if ( *it == RES_PARATR_OUTLINELEVEL )
{
mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
}
- // <--
if ( !bRemoveFromList )
{
// RES_PARATR_LIST_LEVEL
mbUpdateListLevel = mbUpdateListLevel ||
- ( rWhichArr[ n ] == RES_PARATR_LIST_LEVEL &&
+ ( *it == RES_PARATR_LIST_LEVEL &&
mrTxtNode.HasAttrListLevel() );
// RES_PARATR_LIST_ISRESTART and RES_PARATR_LIST_RESTARTVALUE
mbUpdateListRestart = mbUpdateListRestart ||
- ( rWhichArr[ n ] == RES_PARATR_LIST_ISRESTART &&
+ ( *it == RES_PARATR_LIST_ISRESTART &&
mrTxtNode.IsListRestart() ) ||
- ( rWhichArr[ n ] == RES_PARATR_LIST_RESTARTVALUE &&
+ ( *it == RES_PARATR_LIST_RESTARTVALUE &&
mrTxtNode.HasAttrListRestartValue() );
// RES_PARATR_LIST_ISCOUNTED
mbUpdateListCount = mbUpdateListCount ||
- ( rWhichArr[ n ] == RES_PARATR_LIST_ISCOUNTED &&
+ ( *it == RES_PARATR_LIST_ISCOUNTED &&
!mrTxtNode.IsCountedInList() );
}
}
@@ -4679,9 +4641,8 @@ namespace {
{
rTxtNode.RemoveFromList();
}
- // --> OD 2008-11-19 #i70748#
+ // #i70748#
mrTxtNode.ResetEmptyListStyleDueToResetOutlineLevelAttr();
- // <--
}
HandleResetAttrAtTxtNode::~HandleResetAttrAtTxtNode()
@@ -4693,7 +4654,7 @@ namespace {
if ( mrTxtNode.GetNumRule() &&
mrTxtNode.GetListId().Len() > 0 )
{
- // --> OD 2009-01-14 #i96062#
+ // #i96062#
// If paragraph has no list level attribute set and list style
// is the outline style, apply outline level as the list level.
if ( !mrTxtNode.HasAttrListLevel() &&
@@ -4707,17 +4668,15 @@ namespace {
mrTxtNode.SetAttrListLevel( nNewListLevel );
}
}
- // <--
mrTxtNode.AddToList();
}
- // --> OD 2008-11-19 #i70748#
- // --> OD 2010-05-12 #i105562#
+ // #i70748#
+ // #i105562#
else if ( mrTxtNode.GetpSwAttrSet() &&
dynamic_cast<const SfxUInt16Item &>(mrTxtNode.GetAttr( RES_PARATR_OUTLINELEVEL, sal_False )).GetValue() > 0 )
{
mrTxtNode.SetEmptyListStyleDueToSetOutlineLevelAttr();
}
- // <--
}
if ( mrTxtNode.IsInList() )
@@ -4759,7 +4718,7 @@ sal_Bool SwTxtNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 )
return bRet;
}
-sal_Bool SwTxtNode::ResetAttr( const SvUShorts& rWhichArr )
+sal_Bool SwTxtNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr )
{
const bool bOldIsSetOrResetAttr( mbInSetOrResetAttr );
mbInSetOrResetAttr = true;
@@ -4786,7 +4745,6 @@ sal_uInt16 SwTxtNode::ResetAllAttr()
return nRet;
}
-// <--
// sw::Metadatable
::sfx2::IXmlIdRegistry& SwTxtNode::GetRegistry()
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index b0bc6c5769..458155dccd 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -70,7 +70,7 @@
#include <txtfrm.hxx> // SwTxtFrm
#include <scriptinfo.hxx>
-#if defined(WNT) || defined(PM2)
+#if defined(WNT)
#define FNT_LEADING_HACK
#endif
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index b67be35b8b..7dc64531af 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -739,19 +739,17 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
{
if ( RES_TXTATR_CHARFMT == (*aIter)->Which() )
{
- // --> FME 2007-02-16 #i74589#
+ // #i74589#
const SwFmtCharFmt& rOtherCharFmt = (*aIter)->GetCharFmt();
const SwFmtCharFmt& rThisCharFmt = rNewHint.GetCharFmt();
const bool bSameCharFmt = rOtherCharFmt.GetCharFmt() == rThisCharFmt.GetCharFmt();
- // <--
- // --> OD 2009-03-24 #i90311#
+ // #i90311#
// Do not remove existing character format hint during XML import
if ( !rNode.GetDoc()->IsInXMLImport() &&
( !( nsSetAttrMode::SETATTR_DONTREPLACE & nMode ) ||
bNoLengthAttribute ||
bSameCharFmt ) )
- // <--
{
// Remove old hint
Delete( *aIter );
@@ -843,8 +841,8 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
SfxItemSet aNewSet( *pCurrentStyle );
aNewSet.Put( *pNewStyle );
- // --> FME 2007-4-11 #i75750# Remove attributes already set at whole paragraph
- // --> FME 2007-09-24 #i81764# This should not be applied for no length attributes!!! <--
+ // #i75750# Remove attributes already set at whole paragraph
+ // #i81764# This should not be applied for no length attributes!!! <--
if ( !bNoLengthAttribute && rNode.HasSwAttrSet() && aNewSet.Count() )
{
SfxItemIter aIter2( aNewSet );
@@ -864,7 +862,6 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
}
while (!aIter2.IsAtEnd() && 0 != (pItem = aIter2.NextItem()));
}
- // <--
// Remove old hint
Delete( pCurrentAutoStyle );
@@ -881,8 +878,8 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
bool bOptimizeAllowed = true;
SfxItemSet* pNewSet = 0;
- // --> FME 2007-4-11 #i75750# Remove attributes already set at whole paragraph
- // --> FME 2007-09-24 #i81764# This should not be applied for no length attributes!!! <--
+ // #i75750# Remove attributes already set at whole paragraph
+ // #i81764# This should not be applied for no length attributes!!! <--
if ( !bNoLengthAttribute && rNode.HasSwAttrSet() && pNewStyle->Count() )
{
SfxItemIter aIter2( *pNewStyle );
@@ -917,7 +914,6 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint,
delete pNewSet;
}
}
- // <--
// Create new AutoStyle
// If there is no current hint and start and end of rNewHint
@@ -1557,7 +1553,7 @@ void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich,
if ( SFX_ITEM_SET == pFmt->GetItemState( RES_CHRATR_HIDDEN, sal_True, &pItem ) )
SetCalcHiddenCharFlags();
}
- // --> FME 2007-03-16 #i75430# Recalc hidden flags if necessary
+ // #i75430# Recalc hidden flags if necessary
else if ( nWhich == RES_TXTATR_AUTOFMT )
{
// Check if auto style contains hidden attribute:
@@ -1565,7 +1561,6 @@ void SwTxtNode::DeleteAttributes( const sal_uInt16 nWhich,
if ( pHiddenItem )
SetCalcHiddenCharFlags();
}
- // <--
xub_StrLen const * const pEndIdx = pTxtHt->GetEnd();
@@ -1886,9 +1881,8 @@ sal_Bool SwTxtNode::GetAttr( SfxItemSet& rSet, xub_StrLen nStt, xub_StrLen nEnd,
}
else // es ist ein Bereich definiert
{
- // --> FME 2007-03-13 #i75299#
+ // #i75299#
::std::auto_ptr< std::vector< SwPoolItemEndPair > > pAttrArr;
- // <--
const sal_uInt16 coArrSz = static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) -
static_cast<sal_uInt16>(RES_CHRATR_BEGIN);
@@ -2134,7 +2128,8 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_uInt16 nLength,
const AttrSpan_t aSpan(*pHint->GetStart(), *pHint->GetEnd());
o_rSpanMap.insert(AttrSpanMap_t::value_type(aSpan, pHint));
- if (aSpan.first != nLastEnd)
+ // < not != because there may be multiple CHARFMT at same range
+ if (nLastEnd < aSpan.first)
{
// insert dummy span covering the gap
o_rSpanMap.insert(AttrSpanMap_t::value_type(
@@ -2610,7 +2605,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
((SwTxtCharFmt*)pHint)->ChgTxtNode( &rNode );
break;
}
- // --> FME 2007-03-16 #i75430# Recalc hidden flags if necessary
+ // #i75430# Recalc hidden flags if necessary
case RES_TXTATR_AUTOFMT:
{
// Check if auto style contains hidden attribute:
@@ -2619,7 +2614,6 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
rNode.SetCalcHiddenCharFlags();
break;
}
- // <--
case RES_TXTATR_INETFMT:
static_cast<SwTxtINetFmt*>(pHint)->InitINetFmt(rNode);
break;
@@ -2856,10 +2850,9 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode,
}
else
{
- // --> FME 2007-11-08 #i82989# Check sort numbers in NoHintAdjustMode
+ // #i82989# Check sort numbers in NoHintAdjustMode
if ( RES_TXTATR_CHARFMT == nWhich )
lcl_CheckSortNumber( *this, *static_cast<SwTxtCharFmt*>(pHint) );
- // <--
SwpHintsArray::Insert( pHint );
NoteInHistory( pHint, true );
@@ -2974,9 +2967,8 @@ sal_uInt16 SwTxtNode::GetLang( const xub_StrLen nBegin, const xub_StrLen nLen,
nScript = pBreakIt->GetRealScriptOfText( m_Text, nBegin );
}
- // --> FME 2008-09-29 #i91465# hennerdrewes: Consider nScript if pSwpHints == 0
+ // #i91465# Consider nScript if pSwpHints == 0
const sal_uInt16 nWhichId = GetWhichOfScript( RES_CHRATR_LANGUAGE, nScript );
- // <--
if ( HasHints() )
{
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index d54875a0e5..114d541d0b 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -636,7 +636,7 @@ XubString SwTxtNode::GetCurWord( xub_StrLen nPos ) const
{
sal_Int16 nWordType = WordType::DICTIONARY_WORD;
lang::Locale aLocale( pBreakIt->GetLocale( GetLang( nPos ) ) );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
sal_Bool bBegin = rxBreak->isBeginWord( m_Text, nPos, aLocale, nWordType );
sal_Bool bEnd = rxBreak->isEndWord ( m_Text, nPos, aLocale, nWordType );
(void)bBegin;
@@ -661,12 +661,12 @@ XubString SwTxtNode::GetCurWord( xub_StrLen nPos ) const
static_cast<xub_StrLen>(aBndry.endPos - aBndry.startPos) );
}
-SwScanner::SwScanner( const SwTxtNode& rNd, const String& rTxt, const LanguageType* pLang,
- const ModelToViewHelper::ConversionMap* pConvMap,
- sal_uInt16 nType, xub_StrLen nStart, xub_StrLen nEnde, sal_Bool bClp )
+SwScanner::SwScanner( const SwTxtNode& rNd, const rtl::OUString& rTxt,
+ const LanguageType* pLang, const ModelToViewHelper::ConversionMap* pConvMap,
+ sal_uInt16 nType, sal_Int32 nStart, sal_Int32 nEnde, sal_Bool bClp )
: rNode( rNd ), rText( rTxt), pLanguage( pLang ), pConversionMap( pConvMap ), nLen( 0 ), nWordType( nType ), bClip( bClp )
{
- OSL_ENSURE( rText.Len(), "SwScanner: EmptyString" );
+ OSL_ENSURE( !rText.isEmpty(), "SwScanner: EmptyString" );
nStartPos = nBegin = nStart;
nEndPos = nEnde;
@@ -677,7 +677,7 @@ SwScanner::SwScanner( const SwTxtNode& rNd, const String& rTxt, const LanguageTy
else
{
ModelToViewHelper::ModelPosition aModelBeginPos = ModelToViewHelper::ConvertToModelPosition( pConversionMap, nBegin );
- const xub_StrLen nModelBeginPos = (xub_StrLen)aModelBeginPos.mnPos;
+ const sal_Int32 nModelBeginPos = aModelBeginPos.mnPos;
aCurrLang = rNd.GetLang( nModelBeginPos );
}
}
@@ -693,22 +693,22 @@ sal_Bool SwScanner::NextWord()
while ( true )
{
// skip non-letter characters:
- while ( nBegin < rText.Len() )
+ while ( nBegin < rText.getLength() )
{
- if ( !lcl_IsSkippableWhiteSpace( rText.GetChar( nBegin ) ) )
+ if ( !lcl_IsSkippableWhiteSpace( rText[nBegin] ) )
{
if ( !pLanguage )
{
const sal_uInt16 nNextScriptType = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
ModelToViewHelper::ModelPosition aModelBeginPos = ModelToViewHelper::ConvertToModelPosition( pConversionMap, nBegin );
- const xub_StrLen nBeginModelPos = (xub_StrLen)aModelBeginPos.mnPos;
+ const sal_Int32 nBeginModelPos = aModelBeginPos.mnPos;
aCurrLang = rNode.GetLang( nBeginModelPos, 1, nNextScriptType );
}
if ( nWordType != i18n::WordType::WORD_COUNT )
{
rCC.setLocale( pBreakIt->GetLocale( aCurrLang ) );
- if ( rCC.isLetterNumeric( rText.GetChar( nBegin ) ) )
+ if ( rCC.isLetterNumeric( rText[nBegin] ) )
break;
}
else
@@ -717,7 +717,7 @@ sal_Bool SwScanner::NextWord()
++nBegin;
}
- if ( nBegin >= rText.Len() || nBegin >= nEndPos )
+ if ( nBegin >= rText.getLength() || nBegin >= nEndPos )
return sal_False;
// get the word boundaries
@@ -741,21 +741,21 @@ sal_Bool SwScanner::NextWord()
// #i89042, as discussed with HDU: don't evaluate script changes for word count. Use whole word.
if ( nWordType == i18n::WordType::WORD_COUNT )
{
- nBegin = Max( static_cast< xub_StrLen >(aBound.startPos), nBegin );
+ nBegin = Max(aBound.startPos, nBegin);
nLen = 0;
- if (static_cast< xub_StrLen >(aBound.endPos) > nBegin)
- nLen = static_cast< xub_StrLen >(aBound.endPos) - nBegin;
+ if (aBound.endPos > nBegin)
+ nLen = aBound.endPos - nBegin;
}
else
{
// we have to differenciate between these cases:
if ( aBound.startPos <= nBegin )
{
- OSL_ENSURE( aBound.endPos >= nBegin, "Unexpected aBound result" );
+ OSL_ENSURE( aBound.endPos >= nBegin, "Unexpected aBound result" );
// restrict boundaries to script boundaries and nEndPos
const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, nBegin );
- XubString aTmpWord = rText.Copy( nBegin, static_cast<xub_StrLen>(aBound.endPos - nBegin) );
+ rtl::OUString aTmpWord = rText.copy( nBegin, aBound.endPos - nBegin );
const sal_Int32 nScriptEnd = nBegin +
pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
@@ -765,42 +765,42 @@ sal_Bool SwScanner::NextWord()
if ( aBound.startPos < nBegin )
{
// search from nBegin backwards until the next script change
- aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
- static_cast<xub_StrLen>(nBegin - aBound.startPos + 1) );
+ aTmpWord = rText.copy( aBound.startPos,
+ nBegin - aBound.startPos + 1 );
nScriptBegin = aBound.startPos +
pBreakIt->GetBreakIter()->beginOfScript( aTmpWord, nBegin - aBound.startPos,
nCurrScript );
}
- nBegin = (xub_StrLen)Max( aBound.startPos, nScriptBegin );
- nLen = (xub_StrLen)(nEnd - nBegin);
+ nBegin = Max( aBound.startPos, nScriptBegin );
+ nLen = nEnd - nBegin;
}
else
{
const sal_uInt16 nCurrScript = pBreakIt->GetBreakIter()->getScriptType( rText, aBound.startPos );
- XubString aTmpWord = rText.Copy( static_cast<xub_StrLen>(aBound.startPos),
- static_cast<xub_StrLen>(aBound.endPos - aBound.startPos) );
+ rtl::OUString aTmpWord = rText.copy( aBound.startPos,
+ aBound.endPos - aBound.startPos );
const sal_Int32 nScriptEnd = aBound.startPos +
pBreakIt->GetBreakIter()->endOfScript( aTmpWord, 0, nCurrScript );
const sal_Int32 nEnd = Min( aBound.endPos, nScriptEnd );
- nBegin = (xub_StrLen)aBound.startPos;
- nLen = (xub_StrLen)(nEnd - nBegin);
+ nBegin = aBound.startPos;
+ nLen = nEnd - nBegin;
}
}
// optionally clip the result of getWordBoundaries:
if ( bClip )
{
- aBound.startPos = Max( (xub_StrLen)aBound.startPos, nStartPos );
- aBound.endPos = Min( (xub_StrLen)aBound.endPos, nEndPos );
- nBegin = (xub_StrLen)aBound.startPos;
- nLen = (xub_StrLen)(aBound.endPos - nBegin);
+ aBound.startPos = Max( aBound.startPos, nStartPos );
+ aBound.endPos = Min( aBound.endPos, nEndPos );
+ nBegin = aBound.startPos;
+ nLen = aBound.endPos - nBegin;
}
if( ! nLen )
return sal_False;
- aWord = rText.Copy( nBegin, nLen );
+ aWord = rText.copy( nBegin, nLen );
return sal_True;
}
@@ -947,7 +947,7 @@ void SwTxtNode::SetLanguageAndFont( const SwPaM &rPaM,
SfxItemSet aSet( pEditShell->GetAttrPool(), aRanges );
aSet.Put( SvxLanguageItem( nLang, nLangWhichId ) );
- DBG_ASSERT( pFont, "target font missing?" );
+ OSL_ENSURE( pFont, "target font missing?" );
if (pFont)
{
SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( nFontWhichId );
@@ -1071,7 +1071,7 @@ sal_uInt16 SwTxtNode::Convert( SwConversionArgs &rArgs )
if (bFound && bInSelection) // convertible text found within selection/range?
{
const XubString aTxtPortion = m_Text.Copy( nBegin, nLen );
- DBG_ASSERT( m_Text.Len() > 0, "convertible text portion missing!" );
+ OSL_ENSURE( m_Text.Len() > 0, "convertible text portion missing!" );
rArgs.aConvText = m_Text.Copy( nBegin, nLen );
rArgs.nConvTextLang = nLangFound;
@@ -1198,7 +1198,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV
if( bSpell && rWord.Len() > 0 )
{
// check for: bAlter => xHyphWord.is()
- DBG_ASSERT(!bSpell || xSpell.is(), "NULL pointer");
+ OSL_ENSURE(!bSpell || xSpell.is(), "NULL pointer");
if( !xSpell->isValid( rWord, eActLang, Sequence< PropertyValue >() ) )
{
@@ -1574,7 +1574,7 @@ void SwTxtNode::TransliterateText(
nStt = (xub_StrLen)aCurWordBndry.startPos;
nEnd = (xub_StrLen)aCurWordBndry.endPos;
sal_Int32 nLen = nEnd - nStt;
- DBG_ASSERT( nLen > 0, "invalid word length of 0" );
+ OSL_ENSURE( nLen > 0, "invalid word length of 0" );
#if OSL_DEBUG_LEVEL > 1
String aText( GetTxt().Copy( nStt, nLen ) );
#endif
@@ -1657,7 +1657,7 @@ void SwTxtNode::TransliterateText(
while (nCurrentStart < nLastEnd)
{
sal_Int32 nLen = nCurrentEnd - nCurrentStart;
- DBG_ASSERT( nLen > 0, "invalid word length of 0" );
+ OSL_ENSURE( nLen > 0, "invalid word length of 0" );
#if OSL_DEBUG_LEVEL > 1
String aText( GetTxt().Copy( nCurrentStart, nLen ) );
#endif
@@ -1730,7 +1730,7 @@ void SwTxtNode::TransliterateText(
delete pIter;
}
- if (aChanges.size() > 0)
+ if (!aChanges.empty())
{
// now apply the changes from end to start to leave the offsets of the
// yet unchanged text parts remain the same.
@@ -1849,10 +1849,9 @@ void SwTxtNode::CountWords( SwDocStat& rStat,
// count words in masked and expanded text:
if( pBreakIt->GetBreakIter().is() )
{
- const String aScannerText( aExpandText );
// zero is NULL for pLanguage -----------v last param = true for clipping
- SwScanner aScanner( *this, aScannerText, 0, pConversionMap, i18n::WordType::WORD_COUNT,
- (xub_StrLen)nExpandBegin, (xub_StrLen)nExpandEnd, true );
+ SwScanner aScanner( *this, aExpandText, 0, pConversionMap, i18n::WordType::WORD_COUNT,
+ nExpandBegin, nExpandEnd, true );
// used to filter out scanner returning almost empty strings (len=1; unichar=0x0001)
const rtl::OUString aBreakWord( CH_TXTATR_BREAKWORD );
@@ -1983,12 +1982,11 @@ SwWrongList* SwTxtNode::GetWrong()
return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->pWrong : 0;
}
-// --> OD 2008-05-27 #i71360#
+// #i71360#
const SwWrongList* SwTxtNode::GetWrong() const
{
return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->pWrong : 0;
}
-// <--
void SwTxtNode::SetGrammarCheck( SwGrammarMarkUp* pNew, bool bDelete )
{
diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx
index 7b0eb6ac52..4ebb67906c 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -41,12 +41,12 @@
#include <fmtcntnt.hxx>
#include <fmthdft.hxx>
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
#include <ndindex.hxx>
#endif
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
// Pure debug help function to have a quick look at the header/footer attributes.
void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
{
@@ -116,7 +116,7 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld,
{
OSL_ENSURE(0 != pDoc, "no document?");
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
DebugHeaderFooterContent( (SwPageDesc&)aOld );
DebugHeaderFooterContent( (SwPageDesc&)aNew );
#endif
@@ -179,7 +179,7 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld,
// After this exchange method the old page description will point to zero,
// the new one will point to the node position of the original content nodes.
ExchangeContentNodes( (SwPageDesc&)aOld, (SwPageDesc&)aNew );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
DebugHeaderFooterContent( (SwPageDesc&)aOld );
DebugHeaderFooterContent( (SwPageDesc&)aNew );
#endif
@@ -204,7 +204,7 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
rDest.GetMaster().GetAttrSet().GetItemState( RES_HEADER, sal_False, &pItem );
SfxPoolItem *pNewItem = pItem->Clone();
SwFrmFmt* pNewFmt = ((SwFmtHeader*)pNewItem)->GetHeaderFmt();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
const SwFmtCntnt& rSourceCntnt = rSourceHead.GetHeaderFmt()->GetCntnt();
(void)rSourceCntnt;
const SwFmtCntnt& rDestCntnt = rDestHead.GetHeaderFmt()->GetCntnt();
@@ -228,7 +228,7 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
rDest.GetLeft().GetAttrSet().GetItemState( RES_HEADER, sal_False, &pItem );
pNewItem = pItem->Clone();
pNewFmt = ((SwFmtHeader*)pNewItem)->GetHeaderFmt();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
const SwFmtCntnt& rSourceCntnt1 = rSourceLeftHead.GetHeaderFmt()->GetCntnt();
(void)rSourceCntnt1;
const SwFmtCntnt& rDestCntnt1 = rDest.GetLeft().GetHeader().GetHeaderFmt()->GetCntnt();
@@ -255,7 +255,7 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
pNewFmt->SetFmtAttr( rSourceFoot.GetFooterFmt()->GetCntnt() );
delete pNewItem;
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
const SwFmtCntnt& rFooterSourceCntnt = rSourceFoot.GetFooterFmt()->GetCntnt();
(void)rFooterSourceCntnt;
const SwFmtCntnt& rFooterDestCntnt = rDestFoot.GetFooterFmt()->GetCntnt();
@@ -270,7 +270,7 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
if( !rDest.IsFooterShared() )
{
const SwFmtFooter& rSourceLeftFoot = rSource.GetLeft().GetFooter();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
const SwFmtCntnt& rFooterSourceCntnt2 = rSourceLeftFoot.GetFooterFmt()->GetCntnt();
const SwFmtCntnt& rFooterDestCntnt2 =
rDest.GetLeft().GetFooter().GetFooterFmt()->GetCntnt();
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index 6bfc32e962..7aaaa4931c 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -48,6 +48,7 @@
#include <undo.hrc>
#include <editsh.hxx>
#include <unobaseclass.hxx>
+#include <limits>
#include <limits>
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index d6870dfbc1..1d77c66cd2 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -717,7 +717,7 @@ const ::rtl::OUString& SwHistoryBookmark::GetName() const
SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
- sal_uLong nNodePos, const SvUShortsSort& rSetArr )
+ sal_uLong nNodePos, const std::set<sal_uInt16> &rSetArr )
: SwHistoryHint( HSTRY_SETATTRSET )
, m_OldSet( rSet )
, m_ResetArray( 0, 4 )
@@ -727,9 +727,9 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet,
const SfxPoolItem* pItem = aIter.FirstItem(),
* pOrigItem = aOrigIter.FirstItem();
do {
- if( !rSetArr.Seek_Entry( pOrigItem->Which() ))
+ if( !rSetArr.count( pOrigItem->Which() ))
{
- m_ResetArray.Insert( pOrigItem->Which(), m_ResetArray.Count() );
+ m_ResetArray.push_back( pOrigItem->Which() );
m_OldSet.ClearItem( pOrigItem->Which() );
}
else
@@ -798,7 +798,7 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
if ( pNode->IsCntntNode() )
{
static_cast<SwCntntNode*>(pNode)->SetAttr( m_OldSet );
- if ( m_ResetArray.Count() )
+ if ( !m_ResetArray.empty() )
{
static_cast<SwCntntNode*>(pNode)->ResetAttr( m_ResetArray );
}
@@ -808,9 +808,9 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool )
SwFmt& rFmt =
*static_cast<SwTableNode*>(pNode)->GetTable().GetFrmFmt();
rFmt.SetFmtAttr( m_OldSet );
- if ( m_ResetArray.Count() )
+ if ( !m_ResetArray.empty() )
{
- rFmt.ResetFmtAttr( *m_ResetArray.GetData() );
+ rFmt.ResetFmtAttr( m_ResetArray.front() );
}
}
}
@@ -857,7 +857,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
}
else
{
- m_Array.Insert( aIter.GetCurItem()->Which(), m_Array.Count() );
+ m_Array.push_back( aIter.GetCurItem()->Which() );
}
if( aIter.IsAtEnd() )
@@ -868,7 +868,7 @@ SwHistoryResetAttrSet::SwHistoryResetAttrSet( const SfxItemSet& rSet,
if ( bAutoStyle )
{
- m_Array.Insert( RES_TXTATR_AUTOFMT, m_Array.Count() );
+ m_Array.push_back( RES_TXTATR_AUTOFMT );
}
}
@@ -882,22 +882,22 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool )
if (pCntntNd)
{
- const sal_uInt16* pArr = m_Array.GetData();
+ std::vector<sal_uInt16>::iterator it;
if ( USHRT_MAX == m_nEnd && USHRT_MAX == m_nStart )
{
// no area: use ContentNode
- for ( sal_uInt16 n = m_Array.Count(); n; --n, ++pArr )
+ for ( it = m_Array.begin(); it != m_Array.end(); ++it )
{
- pCntntNd->ResetAttr( *pArr );
+ pCntntNd->ResetAttr( *it );
}
}
else
{
// area: use TextNode
- for ( sal_uInt16 n = m_Array.Count(); n; --n, ++pArr )
+ for ( it = m_Array.begin(); it != m_Array.end(); ++it )
{
static_cast<SwTxtNode*>(pCntntNd)->
- DeleteAttributes( *pArr, m_nStart, m_nEnd );
+ DeleteAttributes( *it, m_nStart, m_nEnd );
}
}
}
@@ -1374,13 +1374,12 @@ SwRegHistory::SwRegHistory( const SwNode& rNd, SwHistory* pHst )
void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
{
- // --> OD 2010-10-05 #i114861#
+ // #i114861#
// Do not handle a "noop" modify
// - e.g. <SwTxtNode::NumRuleChgd()> uses such a "noop" modify
// if ( m_pHistory && ( pOld || pNew ) )
if ( m_pHistory && ( pOld || pNew ) &&
pOld != pNew )
- // <--
{
if ( pNew->Which() < POOLATTR_END )
{
@@ -1399,7 +1398,7 @@ void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
else
{
const SfxPoolItem* pItem = SfxItemIter( rSet ).FirstItem();
- if ( m_WhichIdSet.Seek_Entry( pItem->Which() ) )
+ if ( m_WhichIdSet.count( pItem->Which() ) )
{
pNewHstr = new SwHistorySetFmt( pItem, m_nNodeIndex );
}
@@ -1470,9 +1469,9 @@ void SwRegHistory::RegisterInModify( SwModify* pRegIn, const SwNode& rNd )
m_nNodeIndex = rNd.GetIndex();
_MakeSetWhichIds();
}
- else if ( m_WhichIdSet.Count() )
+ else
{
- m_WhichIdSet.Remove( 0, m_WhichIdSet.Count() );
+ m_WhichIdSet.clear();
}
}
@@ -1480,10 +1479,7 @@ void SwRegHistory::_MakeSetWhichIds()
{
if (!m_pHistory) return;
- if ( m_WhichIdSet.Count() )
- {
- m_WhichIdSet.Remove( 0, m_WhichIdSet.Count() );
- }
+ m_WhichIdSet.clear();
if( GetRegisteredIn() )
{
@@ -1504,7 +1500,7 @@ void SwRegHistory::_MakeSetWhichIds()
sal_uInt16 nW = aIter.FirstItem()->Which();
while( sal_True )
{
- m_WhichIdSet.Insert( nW );
+ m_WhichIdSet.insert( nW );
if( aIter.IsAtEnd() )
break;
nW = aIter.NextItem()->Which();
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 6010e446b5..5d3ab70b3d 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTSSORT
#include <UndoAttribute.hxx>
#include <svl/itemiter.hxx>
@@ -134,9 +132,8 @@ SwUndoFmtAttr::SwUndoFmtAttr( const SfxItemSet& rOldSet,
bool bSaveDrawPt )
: SwUndo( UNDO_INSFMTATTR )
, m_pFmt( &rChgFmt )
- // --> OD 2007-07-11 #i56253#
+ // #i56253#
, m_pOldSet( new SfxItemSet( rOldSet ) )
- // <--
, m_nNodeIndex( 0 )
, m_nFmtWhich( rChgFmt.Which() )
, m_bSaveDrawPt( bSaveDrawPt )
@@ -206,7 +203,7 @@ void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext)
if ( !m_pOldSet.get() || !m_pFmt || !IsFmtInDoc( &rContext.GetDoc() ))
return;
- // --> OD 2004-10-26 #i35443# - If anchor attribute has been successfull
+ // #i35443# - If anchor attribute has been successfull
// restored, all other attributes are also restored.
// Thus, keep track of its restoration
bool bAnchorAttrRestored( false );
@@ -228,7 +225,6 @@ void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext)
}
if ( !bAnchorAttrRestored )
- // <--
{
SwUndoFmtAttrHelper aTmp( *m_pFmt, m_bSaveDrawPt );
m_pFmt->SetFmtAttr( *m_pOldSet );
@@ -336,10 +332,9 @@ SwFmt* SwUndoFmtAttr::GetFmt( SwDoc& rDoc )
void SwUndoFmtAttr::RedoImpl(::sw::UndoRedoContext & rContext)
{
- // --> OD 2004-10-26 #i35443# - Because the undo stores the attributes for
+ // #i35443# - Because the undo stores the attributes for
// redo, the same code as for <Undo(..)> can be applied for <Redo(..)>
UndoImpl(rContext);
- // <--
}
void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext)
@@ -470,7 +465,7 @@ void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt )
m_pOldSet->Put( aAnchor );
}
-// --> OD 2004-10-26 #i35443# - Add return value, type <bool>.
+// #i35443# - Add return value, type <bool>.
// Return value indicates, if anchor attribute is restored.
// Note: If anchor attribute is restored, all other existing attributes
// are also restored.
@@ -491,10 +486,9 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
static_cast<SwStartNode*>(pNd)->GetStartNodeType()) )
: !pNd->IsTxtNode() )
{
- // --> OD 2004-10-26 #i35443# - invalid position.
+ // #i35443# - invalid position.
// Thus, anchor attribute not restored
return false;
- // <--
}
SwPosition aPos( *pNd );
@@ -505,10 +499,9 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
if ( aPos.nContent.GetIndex() >
static_cast<SwTxtNode*>(pNd)->GetTxt().Len() )
{
- // --> OD 2004-10-26 #i35443# - invalid position.
+ // #i35443# - invalid position.
// Thus, anchor attribute not restored
return false;
- // <--
}
}
aNewAnchor.SetAnchor( &aPos );
@@ -540,10 +533,9 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
}
const SwFmtAnchor &rOldAnch = pFrmFmt->GetAnchor();
- // --> OD 2006-03-13 #i54336#
+ // #i54336#
// Consider case, that as-character anchored object has moved its anchor position.
if (FLY_AS_CHAR == rOldAnch.GetAnchorId())
- // <--
{
//Bei InCntnt's wird es spannend: Das TxtAttribut muss vernichtet
//werden. Leider reisst dies neben den Frms auch noch das Format mit
@@ -621,9 +613,8 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext)
rContext.SetSelections(pFrmFmt, 0);
- // --> OD 2004-10-26 #i35443# - anchor attribute restored.
+ // #i35443# - anchor attribute restored.
return true;
- // <--
}
// -----------------------------------------------------
@@ -660,7 +651,6 @@ void SwUndoFmtResetAttr::RedoImpl(::sw::UndoRedoContext &)
m_pChangedFormat->ResetFmtAttr( m_nWhichId );
}
}
-// <--
// -----------------------------------------------------
@@ -709,7 +699,6 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext)
{
SwDoc & rDoc = rContext.GetDoc();
SwPaM & rPam = AddUndoRedoPaM(rContext);
- SvUShortsSort* pIdArr = m_Ids.Count() ? &m_Ids : 0;
switch ( m_nFormatId )
{
@@ -717,10 +706,10 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext)
rDoc.RstTxtAttrs(rPam);
break;
case RES_TXTFMTCOLL:
- rDoc.ResetAttrs(rPam, sal_False, pIdArr );
+ rDoc.ResetAttrs(rPam, sal_False, m_Ids );
break;
case RES_CONDTXTFMTCOLL:
- rDoc.ResetAttrs(rPam, sal_True, pIdArr );
+ rDoc.ResetAttrs(rPam, sal_True, m_Ids );
break;
case RES_TXTATR_TOXMARK:
@@ -771,29 +760,25 @@ void SwUndoResetAttr::RepeatImpl(::sw::RepeatContext & rContext)
return;
}
- SvUShortsSort* pIdArr = m_Ids.Count() ? &m_Ids : 0;
switch ( m_nFormatId )
{
case RES_CHRFMT:
rContext.GetDoc().RstTxtAttrs(rContext.GetRepeatPaM());
break;
case RES_TXTFMTCOLL:
- rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), false, pIdArr);
+ rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), false, m_Ids);
break;
case RES_CONDTXTFMTCOLL:
- rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), true, pIdArr);
+ rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), true, m_Ids);
break;
}
}
-void SwUndoResetAttr::SetAttrs( const SvUShortsSort& rArr )
+void SwUndoResetAttr::SetAttrs( const std::set<sal_uInt16> &rAttrs )
{
- if ( m_Ids.Count() )
- {
- m_Ids.Remove( 0, m_Ids.Count() );
- }
- m_Ids.Insert( &rArr );
+ m_Ids.clear();
+ m_Ids.insert( rAttrs.begin(), rAttrs.end() );
}
// -----------------------------------------------------
@@ -981,8 +966,8 @@ void SwUndoAttr::RemoveIdx( SwDoc& rDoc )
nCntnt = pHistoryHint->GetCntnt();
if ( STRING_MAXLEN != nCntnt )
{
- const SvUShorts& rArr = pHistoryHint->GetArr();
- for ( sal_uInt16 i = rArr.Count(); i; )
+ const std::vector<sal_uInt16>& rArr = pHistoryHint->GetArr();
+ for ( sal_uInt16 i = rArr.size(); i; )
{
if ( RES_TXTATR_FTN == rArr[ --i ] )
{
diff --git a/sw/source/core/undo/unbkmk.cxx b/sw/source/core/undo/unbkmk.cxx
index 2da644670b..ad9ce2fba3 100644
--- a/sw/source/core/undo/unbkmk.cxx
+++ b/sw/source/core/undo/unbkmk.cxx
@@ -104,4 +104,4 @@ void SwUndoInsBookmark::RedoImpl(::sw::UndoRedoContext & rContext)
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/undo.src b/sw/source/core/undo/undo.src
index 928c38e494..9a440d9c7c 100644
--- a/sw/source/core/undo/undo.src
+++ b/sw/source/core/undo/undo.src
@@ -139,7 +139,7 @@ String STR_DRAG_AND_MOVE
};
String STR_INSERT_RULER
{
- Text [ en-US ] = "Insert horizontal ruler" ;
+ Text [ en-US ] = "Insert horizontal rule" ;
};
String STR_INSERT_CHART
{
@@ -272,7 +272,7 @@ String STR_MERGE_TABLE
String STR_TRANSLITERATE
{
- Text [ en-US ] = "Case/Characters";
+ Text [ en-US ] = "~Change Case";
};
String STR_DELNUM
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 60eaaf35b4..cd8a9e0fdd 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -135,7 +135,7 @@ void SwUndRng::SetPaM( SwPaM & rPam, sal_Bool bCorrToCntnt ) const
}
SwPaM & SwUndRng::AddUndoRedoPaM(
- ::sw::UndoRedoContext & rContext, bool bCorrToCntnt) const
+ ::sw::UndoRedoContext & rContext, bool const bCorrToCntnt) const
{
SwPaM & rPaM( rContext.GetCursorSupplier().CreateNewShellCursor() );
SetPaM( rPaM, bCorrToCntnt );
@@ -549,7 +549,7 @@ void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, sal_Bool bMvBkwrd )
- Bookmarks
- Verzeichnisse
*/
-// --> OD 2007-10-17 #i81002# - extending method:
+// #i81002# - extending method
// delete certain (not all) cross-reference bookmarks at text node of <rMark>
// and at text node of <rPoint>, if these text nodes aren't the same.
void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
@@ -776,7 +776,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
for( sal_uInt16 n = 0; n < pMarkAccess->getMarksCount(); ++n )
{
- // --> OD 2007-10-17 #i81002#
+ // #i81002#
bool bSavePos = false;
bool bSaveOtherPos = false;
const ::sw::mark::IMark* pBkmk = (pMarkAccess->getMarksBegin() + n)->get();
@@ -792,7 +792,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
}
else
{
- // --> OD 2009-08-06 #i92125#
+ // #i92125#
bool bKeepCrossRefBkmk( false );
{
if ( rMark.nNode == rPoint.nNode &&
@@ -827,14 +827,12 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
}
}
}
- // <--
- // --> OD 2007-10-17 #i81002#
+ // #i81002#
const bool bDifferentTxtNodesAtMarkAndPoint(
rMark.nNode != rPoint.nNode &&
rMark.nNode.GetNode().GetTxtNode() &&
rPoint.nNode.GetNode().GetTxtNode() );
- // <--
if( !bSavePos && !bSaveOtherPos && bDifferentTxtNodesAtMarkAndPoint &&
dynamic_cast< const ::sw::mark::CrossRefBookmark* >(pBkmk))
{
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index fa7672a2d0..3b34bb2c6e 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -83,10 +83,9 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
if ( pDrawContact )
{
pDrawContact->InsertMasterIntoDrawPage();
- // --> OD 2005-01-31 #i40845# - follow-up of #i35635#
+ // #i40845# - follow-up of #i35635#
// move object to visible layer
pDrawContact->MoveObjToVisibleLayer( pDrawContact->GetMaster() );
- // <--
}
}
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 79284e7336..792bece755 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -558,7 +558,6 @@ void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext)
{
static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet();
}
- // <--
}
rContext.SetSelections(0, pMarkLst);
}
diff --git a/sw/source/core/undo/unfmco.cxx b/sw/source/core/undo/unfmco.cxx
index 620d730df8..957632012c 100644
--- a/sw/source/core/undo/unfmco.cxx
+++ b/sw/source/core/undo/unfmco.cxx
@@ -54,10 +54,9 @@ SwUndoFmtColl::SwUndoFmtColl( const SwPaM& rRange,
mbReset( bReset ),
mbResetListAttrs( bResetListAttrs )
{
- // --> FME 2004-08-06 #i31191#
+ // #i31191#
if ( pColl )
aFmtName = pColl->GetName();
- // <--
}
@@ -110,11 +109,10 @@ SwRewriter SwUndoFmtColl::GetRewriter() const
{
SwRewriter aResult;
- // --> FME 2004-08-06 #i31191# Use stored format name instead of
+ // #i31191# Use stored format name instead of
// pFmtColl->GetName(), because pFmtColl does not have to be available
// anymore.
aResult.AddRule(UNDO_ARG1, aFmtName );
- // <--
return aResult;
}
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 66fb10b6ef..b0df3b4b2e 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -215,6 +215,7 @@ SwUndoInsert::~SwUndoInsert()
else if( pTxt ) // der eingefuegte Text
delete pTxt;
delete pRedlData;
+ delete pUndoTxt;
}
diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx
index a6b1461457..463e272196 100644
--- a/sw/source/core/undo/unnum.cxx
+++ b/sw/source/core/undo/unnum.cxx
@@ -143,9 +143,8 @@ void SwUndoInsNum::RedoImpl(::sw::UndoRedoContext & rContext)
}
else
{
- // --> OD 2005-02-25 #i42921# - adapt to changed signature
+ // #i42921# - adapt to changed signature
rDoc.SetNumRule(rPam, aNumRule, false);
- // <--
}
}
}
@@ -163,9 +162,8 @@ void SwUndoInsNum::RepeatImpl(::sw::RepeatContext & rContext)
{
if( !sReplaceRule.Len() )
{
- // --> OD 2005-02-25 #i42921# - adapt to changed signature
+ // #i42921# - adapt to changed signature
rDoc.SetNumRule(rContext.GetRepeatPaM(), aNumRule, false);
- // <--
}
}
else
diff --git a/sw/source/core/undo/unoutl.cxx b/sw/source/core/undo/unoutl.cxx
index 11106dd6b1..ae035fbc2e 100644
--- a/sw/source/core/undo/unoutl.cxx
+++ b/sw/source/core/undo/unoutl.cxx
@@ -61,4 +61,4 @@ void SwUndoOutlineLeftRight::RepeatImpl(::sw::RepeatContext & rContext)
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index f3521c343b..58e10d4c52 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -538,4 +538,4 @@ void SwUndoCompDoc::RedoImpl(::sw::UndoRedoContext & rContext)
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index 9d4a870ac3..a39dd1d54a 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -106,10 +106,9 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
SwTableNode* pTblNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode();
- // --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting
+ // #i37739# A simple 'MakeFrms' after the node sorting
// does not work if the table is inside a frame and has no prev/next.
SwNode2Layout aNode2Layout( *pTblNd );
- // <--
pTblNd->DelFrms();
const SwTable& rTbl = pTblNd->GetTable();
@@ -131,11 +130,10 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
}
// Restore table frames:
- // --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting
+ // #i37739# A simple 'MakeFrms' after the node sorting
// does not work if the table is inside a frame and has no prev/next.
const sal_uLong nIdx = pTblNd->GetIndex();
aNode2Layout.RestoreUpperFrms( rDoc.GetNodes(), nIdx, nIdx + 1 );
- // <--
}
else
{
@@ -183,10 +181,9 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
SwTableNode* pTblNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode();
- // --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting
+ // #i37739# A simple 'MakeFrms' after the node sorting
// does not work if the table is inside a frame and has no prev/next.
SwNode2Layout aNode2Layout( *pTblNd );
- // <--
pTblNd->DelFrms();
const SwTable& rTbl = pTblNd->GetTable();
@@ -212,11 +209,10 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext)
}
// Restore table frames:
- // --> FME 2004-11-26 #i37739# A simple 'MakeFrms' after the node sorting
+ // #i37739# A simple 'MakeFrms' after the node sorting
// does not work if the table is inside a frame and has no prev/next.
const sal_uLong nIdx = pTblNd->GetIndex();
aNode2Layout.RestoreUpperFrms( rDoc.GetNodes(), nIdx, nIdx + 1 );
- // <--
}
else
{
@@ -279,4 +275,4 @@ void SwUndoSort::Insert( sal_uLong nOrgPos, sal_uLong nNewPos)
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index f26f2a120c..f054e25334 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -192,7 +192,6 @@ public:
};
void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos = 0 );
-void InsertSort( SvULongs& rArr, sal_uLong nIdx, sal_uInt16* pInsPos = 0 );
#if OSL_DEBUG_LEVEL > 1
#include "shellio.hxx"
@@ -241,7 +240,7 @@ sal_uInt16 aSave_BoxCntntSet[] = {
SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 nRw,
sal_uInt16 nAdj, const SwInsertTableOptions& rInsTblOpts,
const SwTableAutoFmt* pTAFmt,
- const SvUShorts* pColArr,
+ const std::vector<sal_uInt16> *pColArr,
const String & rName)
: SwUndo( UNDO_INSTABLE ),
aInsTblOpts( rInsTblOpts ), pDDEFldType( 0 ), pColWidth( 0 ), pRedlData( 0 ), pAutoFmt( 0 ),
@@ -249,8 +248,7 @@ SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 n
{
if( pColArr )
{
- pColWidth = new SvUShorts( 0, 1 );
- pColWidth->Insert( pColArr, 0 );
+ pColWidth = new std::vector<sal_uInt16>(*pColArr);
}
if( pTAFmt )
pAutoFmt = new SwTableAutoFmt( *pTAFmt );
@@ -570,7 +568,7 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd,
SwTableLine* pLine = new SwTableLine( pLineFmt, rSavedData.Count(), 0 );
pTblNd->GetTable().GetTabLines().C40_INSERT( SwTableLine, pLine, 0 );
- SvULongs aBkmkArr( 0, 4 );
+ std::vector<sal_uLong> aBkmkArr;
for( sal_uInt16 n = rSavedData.Count(); n; )
{
SwTblToTxtSave* pSave = rSavedData[ --n ];
@@ -589,14 +587,13 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd,
pTxtNd->EraseText( aCntPos, 1 );
SwCntntNode* pNewNd = pTxtNd->SplitCntntNode(
SwPosition( aSttIdx, aCntPos ));
- if( aBkmkArr.Count() )
+ if( !aBkmkArr.empty() )
_RestoreCntntIdx( aBkmkArr, *pNewNd, pSave->m_nCntnt,
pSave->m_nCntnt + 1 );
}
else
{
- if( aBkmkArr.Count() )
- aBkmkArr.Remove( 0, aBkmkArr.Count() );
+ aBkmkArr.clear();
if( pTxtNd )
_SaveCntntIdx( GetDoc(), aSttIdx.GetIndex(),
pTxtNd->GetTxt().Len(), aBkmkArr );
@@ -767,7 +764,7 @@ void SwUndoTxtToTbl::UndoImpl(::sw::UndoRedoContext & rContext)
if( pDelBoxes )
{
SwTable& rTbl = pTNd->GetTable();
- for( sal_uInt16 n = pDelBoxes->Count(); n; )
+ for( sal_uInt16 n = pDelBoxes->size(); n; )
{
SwTableBox* pBox = rTbl.GetTblBox( (*pDelBoxes)[ --n ] );
if( pBox )
@@ -848,8 +845,8 @@ void SwUndoTxtToTbl::RepeatImpl(::sw::RepeatContext & rContext)
void SwUndoTxtToTbl::AddFillBox( const SwTableBox& rBox )
{
if( !pDelBoxes )
- pDelBoxes = new SvULongs;
- pDelBoxes->Insert( rBox.GetSttIdx(), pDelBoxes->Count() );
+ pDelBoxes = new std::vector<sal_uLong>;
+ pDelBoxes->push_back( rBox.GetSttIdx() );
}
SwHistory& SwUndoTxtToTbl::GetHistory()
@@ -1547,7 +1544,6 @@ SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction,
long nMn, long nMx,
sal_uInt16 nCnt, sal_Bool bFlg, sal_Bool bSmHght )
: SwUndo( nAction ),
- aBoxes( rBoxes.Count() < 255 ? (sal_uInt8)rBoxes.Count() : 255, 10 ),
nMin( nMn ), nMax( nMx ),
nSttNode( rTblNd.GetIndex() ), nCurrBox( 0 ),
nCount( nCnt ), nRelDiff( 0 ), nAbsDiff( 0 ),
@@ -1555,14 +1551,13 @@ SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction,
bFlag( bFlg ),
bSameHeight( bSmHght )
{
- Ptrs.pNewSttNds = 0;
+ pNewSttNds = 0;
const SwTable& rTbl = rTblNd.GetTable();
pSaveTbl = new _SaveTable( rTbl );
// und die Selektion merken
- for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
- aBoxes.Insert( rBoxes[n]->GetSttIdx(), n );
+ ReNewBoxes( rBoxes );
}
@@ -1570,7 +1565,6 @@ SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction,
const SwSelBoxes& rBoxes,
const SwTableNode& rTblNd )
: SwUndo( nAction ),
- aBoxes( rBoxes.Count() < 255 ? (sal_uInt8)rBoxes.Count() : 255, 10 ),
nMin( 0 ), nMax( 0 ),
nSttNode( rTblNd.GetIndex() ), nCurrBox( 0 ),
nCount( 0 ), nRelDiff( 0 ), nAbsDiff( 0 ),
@@ -1578,23 +1572,22 @@ SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction,
bFlag( sal_False ),
bSameHeight( sal_False )
{
- Ptrs.pNewSttNds = 0;
+ pNewSttNds = 0;
const SwTable& rTbl = rTblNd.GetTable();
pSaveTbl = new _SaveTable( rTbl );
// und die Selektion merken
- for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
- aBoxes.Insert( rBoxes[n]->GetSttIdx(), n );
+ ReNewBoxes( rBoxes );
}
void SwUndoTblNdsChg::ReNewBoxes( const SwSelBoxes& rBoxes )
{
- if( rBoxes.Count() != aBoxes.Count() )
+ if( rBoxes.Count() != aBoxes.size() )
{
- aBoxes.Remove( 0, aBoxes.Count() );
+ aBoxes.clear();
for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
- aBoxes.Insert( rBoxes[n]->GetSttIdx(), n );
+ aBoxes.insert( rBoxes[n]->GetSttIdx() );
}
}
@@ -1603,9 +1596,9 @@ SwUndoTblNdsChg::~SwUndoTblNdsChg()
delete pSaveTbl;
if( IsDelBox() )
- delete Ptrs.pDelSects;
+ delete pDelSects;
else
- delete Ptrs.pNewSttNds;
+ delete pNewSttNds;
}
void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
@@ -1617,7 +1610,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
sal_uInt16 i;
OSL_ENSURE( ! IsDelBox(), "falsche Action" );
- Ptrs.pNewSttNds = new SvULongs( (sal_uInt8)(rTblBoxes.Count() - rOld.Count()), 5 );
+ pNewSttNds = new std::set<_BoxMove>;
for( n = 0, i = 0; n < rOld.Count(); ++i )
{
@@ -1625,12 +1618,12 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
++n;
else
// neue Box: sortiert einfuegen!!
- InsertSort( *Ptrs.pNewSttNds, rTblBoxes[ i ]->GetSttIdx() );
+ pNewSttNds->insert( _BoxMove(rTblBoxes[ i ]->GetSttIdx()) );
}
for( ; i < rTblBoxes.Count(); ++i )
// neue Box: sortiert einfuegen!!
- InsertSort( *Ptrs.pNewSttNds, rTblBoxes[ i ]->GetSttIdx() );
+ pNewSttNds->insert( _BoxMove(rTblBoxes[ i ]->GetSttIdx()) );
}
@@ -1664,13 +1657,13 @@ const SwTableLines& lcl_FindParentLines( const SwTable& rTable,
void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
const SwTableSortBoxes& rOld,
const SwSelBoxes& rBoxes,
- const SvULongs& rNodeCnts )
+ const std::vector<sal_uLong> &rNodeCnts )
{
const SwTable& rTbl = rTblNd.GetTable();
const SwTableSortBoxes& rTblBoxes = rTbl.GetTabSortBoxes();
OSL_ENSURE( ! IsDelBox(), "falsche Action" );
- Ptrs.pNewSttNds = new SvULongs( (sal_uInt8)(rTblBoxes.Count() - rOld.Count()), 5 );
+ pNewSttNds = new std::set<_BoxMove>;
OSL_ENSURE( rTbl.IsNewModel() || rOld.Count() + nCount * rBoxes.Count() == rTblBoxes.Count(),
"unexpected boxes" );
@@ -1686,9 +1679,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
else
{
// new box found: insert (obey sort order)
- sal_uInt16 nInsPos;
const SwTableBox* pBox = rTblBoxes[ i ];
- InsertSort( *Ptrs.pNewSttNds, pBox->GetSttIdx(), &nInsPos );
// find the source box. It must be one in rBoxes.
// We found the right one if it's in the same column as pBox.
@@ -1735,14 +1726,11 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
// then pBox received nodes from elsewhere.
// If bNodesMoved is set for pBox the undo must move the
// boxes back, otherwise it must delete them.
- // The bNodesMoved flag is stored in a seperate array
- // which mirrors Ptrs.pNewSttNds, i.e. Ptrs.pNewSttNds[i]
- // and aMvBoxes[i] belong together.
sal_Bool bNodesMoved =
( nNodes != ( pSourceBox->GetSttNd()->EndOfSectionIndex() -
pSourceBox->GetSttIdx() ) )
&& ( nNodes - 1 > nLineDiff );
- aMvBoxes.insert( aMvBoxes.begin() + nInsPos, bNodesMoved );
+ pNewSttNds->insert( _BoxMove(pBox->GetSttIdx(), bNodesMoved) );
}
}
}
@@ -1751,14 +1739,14 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd,
void SwUndoTblNdsChg::SaveSection( SwStartNode* pSttNd )
{
OSL_ENSURE( IsDelBox(), "falsche Action" );
- if( !Ptrs.pDelSects )
- Ptrs.pDelSects = new SwUndoSaveSections( 10, 5 );
+ if( !pDelSects )
+ pDelSects = new SwUndoSaveSections( 10, 5 );
SwTableNode* pTblNd = pSttNd->FindTableNode();
SwUndoSaveSection* pSave = new SwUndoSaveSection;
pSave->SaveSection( pSttNd->GetDoc(), SwNodeIndex( *pSttNd ));
- Ptrs.pDelSects->Insert( pSave, Ptrs.pDelSects->Count() );
+ pDelSects->Insert( pSave, pDelSects->Count() );
nSttNode = pTblNd->GetIndex();
}
@@ -1790,9 +1778,9 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
SwTableBoxes& rLnBoxes = pCpyBox->GetUpper()->GetTabBoxes();
// die Sections wieder herstellen
- for( sal_uInt16 n = Ptrs.pDelSects->Count(); n; )
+ for( sal_uInt16 n = pDelSects->Count(); n; )
{
- SwUndoSaveSection* pSave = (*Ptrs.pDelSects)[ --n ];
+ SwUndoSaveSection* pSave = (*pDelSects)[ --n ];
pSave->RestoreSection( &rDoc, &aIdx, SwTableBoxStartNode );
if( pSave->GetHistory() )
pSave->GetHistory()->Rollback( &rDoc );
@@ -1800,20 +1788,19 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
pCpyBox->GetUpper() );
rLnBoxes.C40_INSERT( SwTableBox, pBox, rLnBoxes.Count() );
}
- Ptrs.pDelSects->DeleteAndDestroy( 0, Ptrs.pDelSects->Count() );
+ pDelSects->DeleteAndDestroy( 0, pDelSects->Count() );
}
- else if( !aMvBoxes.empty() )
+ else if( !pNewSttNds->empty() )
{
// dann muessen Nodes verschoben und nicht geloescht werden!
// Dafuer brauchen wir aber ein temp Array
- SvULongs aTmp( 0, 5);
- aTmp.Insert( Ptrs.pNewSttNds, 0 );
+ std::vector<_BoxMove> aTmp( pNewSttNds->begin(), pNewSttNds->end() );
// von hinten anfangen
- for( sal_uInt16 n = aTmp.Count(); n; )
+ for( int n = aTmp.size() - 1; n >= 0 ; --n)
{
// Box aus der Tabellen-Struktur entfernen
- sal_uLong nIdx = aTmp[ --n ];
+ sal_uLong nIdx = aTmp[n].index;
SwTableBox* pBox = pTblNd->GetTable().GetTblBox( nIdx );
OSL_ENSURE( pBox, "Wo ist meine TabellenBox geblieben?" );
@@ -1821,7 +1808,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
if (pPCD)
pPCD->DeleteBox( &pTblNd->GetTable(), *pBox );
- if( aMvBoxes[ n ] )
+ if( aTmp[n].hasMoved )
{
SwNodeRange aRg( *pBox->GetSttNd(), 1,
*pBox->GetSttNd()->EndOfSectionNode() );
@@ -1833,8 +1820,8 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
sal_uInt16 i = n;
sal_uLong nSttIdx = aInsPos.GetIndex() - 2,
nNdCnt = aRg.aEnd.GetIndex() - aRg.aStart.GetIndex();
- while( i && aTmp[ --i ] > nSttIdx )
- aTmp[ i ] += nNdCnt;
+ while( i && aTmp[ --i ].index > nSttIdx )
+ aTmp[ i ].index += nNdCnt;
// erst die Box loeschen
delete pBox;
@@ -1849,9 +1836,10 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext)
else
{
// Remove nodes from nodes array (backwards!)
- for( sal_uInt16 n = Ptrs.pNewSttNds->Count(); n; )
+ std::set<_BoxMove>::reverse_iterator it;
+ for( it = pNewSttNds->rbegin(); it != pNewSttNds->rend(); ++it )
{
- sal_uLong nIdx = (*Ptrs.pNewSttNds)[ --n ];
+ sal_uLong nIdx = (*it).index;
SwTableBox* pBox = pTblNd->GetTable().GetTblBox( nIdx );
OSL_ENSURE( pBox, "Where's my table box?" );
// TL_CHART2: notify chart about box to be removed
@@ -1891,9 +1879,9 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext)
CHECK_TABLE( pTblNd->GetTable() )
SwSelBoxes aSelBoxes;
- for( sal_uInt16 n = 0; n < aBoxes.Count(); ++n )
+ for( std::set<sal_uLong>::iterator it = aBoxes.begin(); it != aBoxes.end(); ++it )
{
- SwTableBox* pBox = pTblNd->GetTable().GetTblBox( aBoxes[ n ] );
+ SwTableBox* pBox = pTblNd->GetTable().GetTblBox( *it );
aSelBoxes.Insert( pBox );
}
@@ -1977,8 +1965,8 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext)
if( pUndo )
{
- Ptrs.pDelSects->Insert( pUndo->Ptrs.pDelSects, 0 );
- pUndo->Ptrs.pDelSects->Remove( 0, pUndo->Ptrs.pDelSects->Count() );
+ pDelSects->Insert( pUndo->pDelSects, 0 );
+ pUndo->pDelSects->Remove( 0, pUndo->pDelSects->Count() );
delete pUndo;
}
@@ -2044,9 +2032,10 @@ CHECKTABLE(pTblNd->GetTable())
SwTxtFmtColl* pColl = rDoc.GetTxtCollFromPool( RES_POOLCOLL_STANDARD );
sal_uInt16 n;
- for( n = 0; n < aBoxes.Count(); ++n )
+ std::set<sal_uLong>::iterator it;
+ for( it = aBoxes.begin(); it != aBoxes.end(); ++it )
{
- aIdx = aBoxes[ n ];
+ aIdx = *it;
SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection( aIdx,
SwTableBoxStartNode, pColl );
pBox = new SwTableBox( (SwTableBoxFmt*)pCpyBox->GetFrmFmt(), *pSttNd,
@@ -2061,7 +2050,7 @@ CHECKTABLE(pTblNd->GetTable())
SwChartDataProvider *pPCD = rDoc.GetChartDataProvider();
// 2. die eingefuegten Boxen loeschen
// die Nodes loeschen (von Hinten!!)
- for( n = aNewSttNds.Count(); n; )
+ for( n = aNewSttNds.size(); n; )
{
// Box aus der Tabellen-Struktur entfernen
sal_uLong nIdx = aNewSttNds[ --n ];
@@ -2192,10 +2181,10 @@ void SwUndoTblMerge::SetSelBoxes( const SwSelBoxes& rBoxes )
{
// die Selektion merken
for( sal_uInt16 n = 0; n < rBoxes.Count(); ++n )
- InsertSort( aBoxes, rBoxes[n]->GetSttIdx() );
+ aBoxes.insert( rBoxes[n]->GetSttIdx() );
// als Trennung fuers einfuegen neuer Boxen nach dem Verschieben!
- aNewSttNds.Insert( (sal_uLong)0, aNewSttNds.Count() );
+ aNewSttNds.push_back( (sal_uLong)0 );
// The new table model does not delete overlapped cells (by row span),
// so the rBoxes array might be empty even some cells have been merged.
@@ -3222,33 +3211,6 @@ void InsertSort( SvUShorts& rArr, sal_uInt16 nIdx, sal_uInt16* pInsPos )
*pInsPos = nU;
}
-void InsertSort( SvULongs& rArr, sal_uLong nIdx, sal_uInt16* pInsPos )
-{
- sal_uInt16 nO = rArr.Count(), nM, nU = 0;
- if( nO > 0 )
- {
- nO--;
- while( nU <= nO )
- {
- nM = nU + ( nO - nU ) / 2;
- if( *(rArr.GetData() + nM) == nIdx )
- {
- OSL_FAIL( "Index ist schon vorhanden, darf nie sein!" );
- return;
- }
- if( *(rArr.GetData() + nM) < nIdx )
- nU = nM + 1;
- else if( nM == 0 )
- break;
- else
- nO = nM - 1;
- }
- }
- rArr.Insert( nIdx, nU );
- if( pInsPos )
- *pInsPos = nU;
-}
-
#if OSL_DEBUG_LEVEL > 1
diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx
index c74f072571..2c9e3cae6c 100644
--- a/sw/source/core/unocore/SwXTextDefaults.cxx
+++ b/sw/source/core/unocore/SwXTextDefaults.cxx
@@ -161,28 +161,28 @@ Any SAL_CALL SwXTextDefaults::getPropertyValue( const OUString& rPropertyName )
void SAL_CALL SwXTextDefaults::addPropertyChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- DBG_WARNING ( "not implemented" );
+ OSL_FAIL ( "not implemented" );
}
void SAL_CALL SwXTextDefaults::removePropertyChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< XPropertyChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- DBG_WARNING ( "not implemented" );
+ OSL_FAIL ( "not implemented" );
}
void SAL_CALL SwXTextDefaults::addVetoableChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- DBG_WARNING ( "not implemented" );
+ OSL_FAIL ( "not implemented" );
}
void SAL_CALL SwXTextDefaults::removeVetoableChangeListener( const OUString& /*rPropertyName*/, const uno::Reference< XVetoableChangeListener >& /*xListener*/ )
throw(UnknownPropertyException, WrappedTargetException, RuntimeException)
{
- DBG_WARNING ( "not implemented" );
+ OSL_FAIL ( "not implemented" );
}
diff --git a/sw/source/core/unocore/TextCursorHelper.cxx b/sw/source/core/unocore/TextCursorHelper.cxx
index f4a234ca3a..e9b9972793 100644
--- a/sw/source/core/unocore/TextCursorHelper.cxx
+++ b/sw/source/core/unocore/TextCursorHelper.cxx
@@ -31,14 +31,18 @@
#include "TextCursorHelper.hxx"
#include "unobaseclass.hxx"
-
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
+namespace
+{
+ class theOTextCursorHelperUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theOTextCursorHelperUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & OTextCursorHelper::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theOTextCursorHelperUnoTunnelId::get().getSeq();
}
//XUnoTunnel
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index cc0386a704..498541f7d1 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -44,7 +44,6 @@
#include <comphelper/types.hxx>
#include <tools/urlobj.hxx>
#include <tools/datetime.hxx>
-#include <tools/debug.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include <ucbhelper/contentbroker.hxx>
#include <ucbhelper/content.hxx>
@@ -230,7 +229,7 @@ sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
}
catch( UNO_NMSPC::Exception& )
{
- DBG_ERRORFILE( "create cursor failed!" );
+ OSL_FAIL( "create cursor failed!" );
}
if( xResultSet.is() )
@@ -274,13 +273,13 @@ sal_Bool UCB_GetFileListOfFolder( const String& rURL, SvStrings& rList,
}
catch( UNO_NMSPC::Exception& )
{
- DBG_ERRORFILE( "Exception caught!" );
+ OSL_FAIL( "Exception caught!" );
}
}
}
catch( UNO_NMSPC::Exception& )
{
- DBG_ERRORFILE( "Exception caught!" );
+ OSL_FAIL( "Exception caught!" );
bOk = sal_False;
}
return bOk;
diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx
index fbf96cd2ff..f75841feac 100644
--- a/sw/source/core/unocore/unobkm.cxx
+++ b/sw/source/core/unocore/unobkm.cxx
@@ -48,6 +48,7 @@
#include <SwRewriter.hxx>
#include <docsh.hxx>
#include <xmloff/odffields.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::sw::mark;
using namespace ::com::sun::star;
@@ -196,10 +197,14 @@ SwXBookmark::CreateXBookmark(SwDoc & rDoc, ::sw::mark::IMark & rBookmark)
return 0;
}
+namespace
+{
+ class theSwXBookmarkUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXBookmarkUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXBookmark::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXBookmarkUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -258,7 +263,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
m_pImpl->registerInMark(*this,
m_pImpl->m_pDoc->getIDocumentMarkAccess()->makeMark(
aPam, m_pImpl->m_sMarkName, eType));
- // --> OD 2007-10-23 #i81002#
+ // #i81002#
// Check, if bookmark has been created.
// E.g., the creation of a cross-reference bookmark is suppress,
// if the PaM isn't a valid one for cross-reference bookmarks.
@@ -268,7 +273,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
" - could not create Mark.");
throw lang::IllegalArgumentException();
}
- // <--
}
void SwXBookmark::attachToRange(
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx
index cf08a9cd76..f128bdc0fc 100644
--- a/sw/source/core/unocore/unochart.cxx
+++ b/sw/source/core/unocore/unochart.cxx
@@ -56,8 +56,8 @@
#include <ndole.hxx>
#include <swtypes.hxx>
#include <unocore.hrc>
-
#include <docary.hxx>
+#include <comphelper/servicehelper.hxx>
#define SN_DATA_PROVIDER "com.sun.star.chart2.data.DataProvider"
#define SN_DATA_SOURCE "com.sun.star.chart2.data.DataSource"
@@ -240,12 +240,12 @@ sal_Bool FillRangeDescriptor(
lcl_GetCellPosition( aTLName, rDesc.nLeft, rDesc.nTop );
lcl_GetCellPosition( aBRName, rDesc.nRight, rDesc.nBottom );
rDesc.Normalize();
- DBG_ASSERT( rDesc.nTop != -1 &&
+ OSL_ENSURE( rDesc.nTop != -1 &&
rDesc.nLeft != -1 &&
rDesc.nBottom != -1 &&
rDesc.nRight != -1,
"failed to get range descriptor" );
- DBG_ASSERT( rDesc.nTop <= rDesc.nBottom && rDesc.nLeft <= rDesc.nRight,
+ OSL_ENSURE( rDesc.nTop <= rDesc.nBottom && rDesc.nLeft <= rDesc.nRight,
"invalid range descriptor");
return sal_True;
}
@@ -277,8 +277,8 @@ static String GetCellRangeName( SwFrmFmt &rTblFmt, SwUnoCrsr &rTblCrsr )
pStart = pUnoTblCrsr->GetMark()->nNode.GetNode().FindTableBoxStartNode();
pStartBox = pTable->GetTblBox( pStart->GetIndex());
}
- DBG_ASSERT( pStartBox, "start box not found" );
- DBG_ASSERT( pEndBox, "end box not found" );
+ OSL_ENSURE( pStartBox, "start box not found" );
+ OSL_ENSURE( pEndBox, "end box not found" );
// need to switch start and end?
if (*pUnoTblCrsr->GetPoint() < *pUnoTblCrsr->GetMark())
{
@@ -302,8 +302,8 @@ static String GetRangeRepFromTableAndCells( const String &rTableName,
const String &rStartCell, const String &rEndCell,
sal_Bool bForceEndCellName )
{
- DBG_ASSERT( rTableName.Len(), "table name missing" );
- DBG_ASSERT( rStartCell.Len(), "cell name missing" );
+ OSL_ENSURE( rTableName.Len(), "table name missing" );
+ OSL_ENSURE( rStartCell.Len(), "cell name missing" );
String aRes( rTableName );
aRes += (sal_Unicode) '.';
aRes += rStartCell;
@@ -434,11 +434,10 @@ static void GetFormatAndCreateCursorFromRangeRep(
SwTable *pTable = pTblFmt ? SwTable::FindTable( pTblFmt ) : 0;
// create new SwUnoCrsr spanning the specified range
//! see also SwXTextTable::GetRangeByName
- // --> OD 2007-08-03 #i80314#
+ // #i80314#
// perform validation check. Thus, pass <true> as 2nd parameter to <SwTable::GetTblBox(..)>
const SwTableBox* pTLBox =
pTable ? pTable->GetTblBox( aStartCell, true ) : 0;
- // <--
if(pTLBox)
{
// hier muessen die Actions aufgehoben werden
@@ -449,10 +448,9 @@ static void GetFormatAndCreateCursorFromRangeRep(
SwUnoCrsr* pUnoCrsr = pTblFmt->GetDoc()->CreateUnoCrsr(aPos, sal_True);
pUnoCrsr->Move( fnMoveForward, fnGoNode );
pUnoCrsr->SetRemainInSection( sal_False );
- // --> OD 2007-08-03 #i80314#
+ // #i80314#
// perform validation check. Thus, pass <true> as 2nd parameter to <SwTable::GetTblBox(..)>
const SwTableBox* pBRBox = pTable->GetTblBox( aEndCell, true );
- // <--
if(pBRBox)
{
pUnoCrsr->SetMark();
@@ -599,7 +597,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
// false: DataSource will be sequence of rows
OUString aChartOleObjectName;//work around wrong writer ranges ( see Issue 58464 )
sal_Int32 nArgs = rArguments.getLength();
- DBG_ASSERT( nArgs != 0, "no properties provided" );
+ OSL_ENSURE( nArgs != 0, "no properties provided" );
if (nArgs == 0)
return xRes;
const beans::PropertyValue *pArg = rArguments.getConstArray();
@@ -741,12 +739,12 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
sal_Bool bOk2 = GetTableAndCellsFromRangeRep(
pSubRanges[i], aTblName, aStartCell, aEndCell );
(void) bOk2;
- DBG_ASSERT( bOk2, "failed to get table and start/end cells" );
+ OSL_ENSURE( bOk2, "failed to get table and start/end cells" );
sal_Int32 nStartRow, nStartCol, nEndRow, nEndCol;
lcl_GetCellPosition( aStartCell, nStartCol, nStartRow );
lcl_GetCellPosition( aEndCell, nEndCol, nEndRow );
- DBG_ASSERT( nStartRow <= nEndRow && nStartCol <= nEndCol,
+ OSL_ENSURE( nStartRow <= nEndRow && nStartCol <= nEndCol,
"cell range not normalized");
// test if the ranges span more than the available cells
@@ -934,13 +932,13 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
// create XDataSequence's from cursors
if (pLabelUnoCrsr)
pLabelSeqs[ nSeqsIdx ] = new SwChartDataSequence( *this, *pTblFmt, pLabelUnoCrsr );
- DBG_ASSERT( pDataUnoCrsr, "pointer to data sequence missing" );
+ OSL_ENSURE( pDataUnoCrsr, "pointer to data sequence missing" );
if (pDataUnoCrsr)
pDataSeqs [ nSeqsIdx ] = new SwChartDataSequence( *this, *pTblFmt, pDataUnoCrsr );
if (pLabelUnoCrsr || pDataUnoCrsr)
++nSeqsIdx;
}
- DBG_ASSERT( nSeqsIdx == nNumLDS,
+ OSL_ENSURE( nSeqsIdx == nNumLDS,
"mismatch between sequence size and num,ber of entries" );
// build data source from data and label sequences
@@ -986,7 +984,7 @@ uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createData
if (pOld_LDS[i].is())
pLDS[nNewCnt++] = pOld_LDS[i];
}
- DBG_ASSERT( nNewCnt == nNumLDS, "unexpected size of resulting sequence" );
+ OSL_ENSURE( nNewCnt == nNumLDS, "unexpected size of resulting sequence" );
}
xRes = new SwChartDataSource( aLDS );
@@ -1080,7 +1078,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
if (nNumDS_LDS == 0)
{
- DBG_WARNING( "XLabeledDataSequence in data source contains 0 entries" );
+ OSL_FAIL( "XLabeledDataSequence in data source contains 0 entries" );
return aResult;
}
@@ -1162,14 +1160,14 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
//
sal_Int32 nFirstCol = -1, nFirstRow = -1, nLastCol = -1, nLastRow = -1;
String aCell( aLabelStartCell.Len() ? aLabelStartCell : aValuesStartCell );
- DBG_ASSERT( aCell.Len() , "start cell missing?" );
+ OSL_ENSURE( aCell.Len() , "start cell missing?" );
lcl_GetCellPosition( aCell, nFirstCol, nFirstRow);
lcl_GetCellPosition( aValuesEndCell, nLastCol, nLastRow);
//
sal_Int16 nDirection = -1; // -1: not yet set, 0: columns, 1: rows, -2: failed
if (nFirstCol == nLastCol && nFirstRow == nLastRow) // a single cell...
{
- DBG_ASSERT( nCurLabelSeqLen == 0 && nCurValuesSeqLen == 1,
+ OSL_ENSURE( nCurLabelSeqLen == 0 && nCurValuesSeqLen == 1,
"trying to determine 'DataRowSource': something's fishy... should have been a single cell");
(void)nCurValuesSeqLen;
nDirection = 0; // default direction for a single cell should be 'columns'
@@ -1199,7 +1197,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
{
// build data to obtain 'SequenceMapping' later on
//
- DBG_ASSERT( nDtaSrcIsColumns == 0 || /* rows */
+ OSL_ENSURE( nDtaSrcIsColumns == 0 || /* rows */
nDtaSrcIsColumns == 1, /* columns */
"unexpected value for 'nDtaSrcIsColumns'" );
pSequenceMapping[nDS1] = nDtaSrcIsColumns ? nFirstCol : nFirstRow;
@@ -1271,7 +1269,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
{
lcl_GetCellPosition( aLabelStartCell, nStartCol, nStartRow);
lcl_GetCellPosition( aLabelEndCell, nEndCol, nEndRow);
- DBG_ASSERT( (nStartCol == nEndCol && (nEndRow - nStartRow + 1) == xCurLabel->getData().getLength()) ||
+ OSL_ENSURE( (nStartCol == nEndCol && (nEndRow - nStartRow + 1) == xCurLabel->getData().getLength()) ||
(nStartRow == nEndRow && (nEndCol - nStartCol + 1) == xCurLabel->getData().getLength()),
"label sequence length does not match range representation!" );
}
@@ -1279,7 +1277,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
{
lcl_GetCellPosition( aValuesStartCell, nStartCol, nStartRow);
lcl_GetCellPosition( aValuesEndCell, nEndCol, nEndRow);
- DBG_ASSERT( (nStartCol == nEndCol && (nEndRow - nStartRow + 1) == xCurValues->getData().getLength()) ||
+ OSL_ENSURE( (nStartCol == nEndCol && (nEndRow - nStartRow + 1) == xCurValues->getData().getLength()) ||
(nStartRow == nEndRow && (nEndCol - nStartCol + 1) == xCurValues->getData().getLength()),
"value sequence length does not match range representation!" );
}
@@ -1352,13 +1350,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
uno::Sequence< sal_Int32 > aSortedMapping( aSequenceMapping );
sal_Int32 *pSortedMapping = aSortedMapping.getArray();
std::sort( pSortedMapping, pSortedMapping + aSortedMapping.getLength() );
- DBG_ASSERT( aSortedMapping.getLength() == nNumDS_LDS, "unexpected size of sequence" );
+ OSL_ENSURE( aSortedMapping.getLength() == nNumDS_LDS, "unexpected size of sequence" );
sal_Bool bNeedSequenceMapping = sal_False;
for (sal_Int32 i = 0; i < nNumDS_LDS; ++i)
{
sal_Int32 *pIt = std::find( pSortedMapping, pSortedMapping + nNumDS_LDS,
pSequenceMapping[i] );
- DBG_ASSERT( pIt, "index not found" );
+ OSL_ENSURE( pIt, "index not found" );
if (!pIt)
return aResult; // failed -> return empty property sequence
pSequenceMapping[i] = pIt - pSortedMapping;
@@ -1375,13 +1373,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArgume
//
// build resulting properties
//
- DBG_ASSERT(nLabelSeqLen >= 0 || nLabelSeqLen == -2 /*not used*/,
+ OSL_ENSURE(nLabelSeqLen >= 0 || nLabelSeqLen == -2 /*not used*/,
"unexpected value for 'nLabelSeqLen'" );
sal_Bool bFirstCellIsLabel = sal_False; // default value if 'nLabelSeqLen' could not properly determined
if (nLabelSeqLen > 0) // == 0 means no label sequence in use
bFirstCellIsLabel = sal_True;
//
- DBG_ASSERT( aSortedCellRanges.getLength(), "CellRangeRepresentation missing" );
+ OSL_ENSURE( aSortedCellRanges.getLength(), "CellRangeRepresentation missing" );
OUString aBrokenCellRangeForExport( GetBrokenCellRangeForExport( aSortedCellRanges ) );
//
aResult.realloc(5);
@@ -1434,7 +1432,7 @@ uno::Reference< chart2::data::XDataSequence > SwChartDataProvider::Impl_createDa
if (aDesc.nTop != aDesc.nBottom && aDesc.nLeft != aDesc.nRight)
throw lang::IllegalArgumentException();
- DBG_ASSERT( pTblFmt && pUnoCrsr, "table format or cursor missing" );
+ OSL_ENSURE( pTblFmt && pUnoCrsr, "table format or cursor missing" );
uno::Reference< chart2::data::XDataSequence > xDataSeq;
if (!bTestOnly)
xDataSeq = new SwChartDataSequence( *this, *pTblFmt, pUnoCrsr );
@@ -1563,7 +1561,7 @@ void SwChartDataProvider::RemoveDataSequence( const SwTable &rTable, uno::Refere
void SwChartDataProvider::InvalidateTable( const SwTable *pTable )
{
- DBG_ASSERT( pTable, "table pointer is NULL" );
+ OSL_ENSURE( pTable, "table pointer is NULL" );
if (pTable)
{
if (!bDisposed)
@@ -1588,7 +1586,7 @@ void SwChartDataProvider::InvalidateTable( const SwTable *pTable )
sal_Bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox &rBox )
{
sal_Bool bRes = sal_False;
- DBG_ASSERT( pTable, "table pointer is NULL" );
+ OSL_ENSURE( pTable, "table pointer is NULL" );
if (pTable)
{
if (!bDisposed)
@@ -1637,7 +1635,7 @@ sal_Bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox
void SwChartDataProvider::DisposeAllDataSequences( const SwTable *pTable )
{
- DBG_ASSERT( pTable, "table pointer is NULL" );
+ OSL_ENSURE( pTable, "table pointer is NULL" );
if (pTable)
{
if (!bDisposed)
@@ -1716,7 +1714,7 @@ void SwChartDataProvider::AddRowCols(
sal_Int32 nFirstNewRow = bBehind ? nFirstRow + 1 : nFirstRow - nLines;
if (bAddCols)
{
- DBG_ASSERT( nFirstCol == nLastCol, "column indices seem broken" );
+ OSL_ENSURE( nFirstCol == nLastCol, "column indices seem broken" );
nFirstNewCol = bBehind ? nFirstCol + 1 : nFirstCol - nLines;
nFirstNewRow = nFirstRow;
}
@@ -1974,7 +1972,7 @@ SwChartDataSequence::SwChartDataSequence(
// check if it can properly convert into a SwUnoTableCrsr
// which is required for some functions
SwUnoTableCrsr* pUnoTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pTblCrsr);
- DBG_ASSERT(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr");
+ OSL_ENSURE(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr");
(void) pUnoTblCrsr;
#endif
}
@@ -2024,7 +2022,7 @@ SwChartDataSequence::SwChartDataSequence( const SwChartDataSequence &rObj ) :
// check if it can properly convert into a SwUnoTableCrsr
// which is required for some functions
SwUnoTableCrsr* pUnoTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pTblCrsr);
- DBG_ASSERT(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr");
+ OSL_ENSURE(pUnoTblCrsr, "SwChartDataSequence: cursor not SwUnoTableCrsr");
(void) pUnoTblCrsr;
#endif
}
@@ -2037,10 +2035,14 @@ SwChartDataSequence::~SwChartDataSequence()
delete pTblCrsr;
}
+namespace
+{
+ class theSwChartDataSequenceUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwChartDataSequenceUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwChartDataSequence::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwChartDataSequenceUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwChartDataSequence::getSomething( const uno::Sequence< sal_Int8 > &rId )
@@ -2097,7 +2099,7 @@ OUString SAL_CALL SwChartDataSequence::getSourceRangeRepresentation( )
{
aRes = pTblFmt->GetName();
String aCellRange( GetCellRangeName( *pTblFmt, *pTblCrsr ) );
- DBG_ASSERT( aCellRange.Len() != 0, "failed to get cell range" );
+ OSL_ENSURE( aCellRange.Len() != 0, "failed to get cell range" );
aRes += (sal_Unicode) '.';
aRes += aCellRange;
}
@@ -2124,16 +2126,16 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::generateLabel(
else
{
String aCellRange( GetCellRangeName( *pTblFmt, *pTblCrsr ) );
- DBG_ASSERT( aCellRange.Len() != 0, "failed to get cell range" );
+ OSL_ENSURE( aCellRange.Len() != 0, "failed to get cell range" );
bOk = FillRangeDescriptor( aDesc, aCellRange );
- DBG_ASSERT( bOk, "falied to get SwRangeDescriptor" );
+ OSL_ENSURE( bOk, "falied to get SwRangeDescriptor" );
}
if (bOk)
{
aDesc.Normalize();
sal_Int32 nColSpan = aDesc.nRight - aDesc.nLeft + 1;
sal_Int32 nRowSpan = aDesc.nBottom - aDesc.nTop + 1;
- DBG_ASSERT( nColSpan == 1 || nRowSpan == 1,
+ OSL_ENSURE( nColSpan == 1 || nRowSpan == 1,
"unexpected range of selected cells" );
String aTxt; // label text to be returned
@@ -2537,13 +2539,13 @@ sal_Bool SwChartDataSequence::DeleteBox( const SwTableBox &rBox )
lcl_GetCellPosition( aPointCellName, nPointCol, nPointRow );
lcl_GetCellPosition( aMarkCellName, nMarkCol, nMarkRow );
- DBG_ASSERT( nPointRow >= 0 && nPointCol >= 0, "invalid row and col" );
- DBG_ASSERT( nMarkRow >= 0 && nMarkCol >= 0, "invalid row and col" );
+ OSL_ENSURE( nPointRow >= 0 && nPointCol >= 0, "invalid row and col" );
+ OSL_ENSURE( nMarkRow >= 0 && nMarkCol >= 0, "invalid row and col" );
// move vertical or horizontal?
- DBG_ASSERT( nPointRow == nMarkRow || nPointCol == nMarkCol,
+ OSL_ENSURE( nPointRow == nMarkRow || nPointCol == nMarkCol,
"row/col indices not matching" );
- DBG_ASSERT( nPointRow != nMarkRow || nPointCol != nMarkCol,
+ OSL_ENSURE( nPointRow != nMarkRow || nPointCol != nMarkCol,
"point and mark are identical" );
sal_Bool bMoveVertical = (nPointCol == nMarkCol);
sal_Bool bMoveHorizontal = (nPointRow == nMarkRow);
@@ -2661,7 +2663,7 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
const SwTableBox *pEndBox = 0;
const SwTable* pTable = SwTable::FindTable( GetFrmFmt() );
- DBG_ASSERT( !pTable->IsTblComplex(), "table too complex" );
+ OSL_ENSURE( !pTable->IsTblComplex(), "table too complex" );
if (nCount < 1 || nFirstNew < 0 || pTable->IsTblComplex())
return false;
@@ -2688,7 +2690,7 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
{
// new column cells adjacent to the bottom of the
// current data-sequence to be added...
- DBG_ASSERT( aDesc.nLeft == aDesc.nRight, "data-sequence is not a column" );
+ OSL_ENSURE( aDesc.nLeft == aDesc.nRight, "data-sequence is not a column" );
aNewStartCell = lcl_GetCellName(aDesc.nLeft, aDesc.nTop);
aNewEndCell = lcl_GetCellName(aDesc.nRight, aDesc.nBottom + nCount);
bChanged = true;
@@ -2697,7 +2699,7 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
{
// new column cells adjacent to the top of the
// current data-sequence to be added...
- DBG_ASSERT( aDesc.nLeft == aDesc.nRight, "data-sequence is not a column" );
+ OSL_ENSURE( aDesc.nLeft == aDesc.nRight, "data-sequence is not a column" );
aNewStartCell = lcl_GetCellName(aDesc.nLeft, aDesc.nTop - nCount);
aNewEndCell = lcl_GetCellName(aDesc.nRight, aDesc.nBottom);
bChanged = true;
@@ -2706,7 +2708,7 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
{
// new row cells adjacent to the right of the
// current data-sequence to be added...
- DBG_ASSERT( aDesc.nTop == aDesc.nBottom, "data-sequence is not a row" );
+ OSL_ENSURE( aDesc.nTop == aDesc.nBottom, "data-sequence is not a row" );
aNewStartCell = lcl_GetCellName(aDesc.nLeft, aDesc.nTop);
aNewEndCell = lcl_GetCellName(aDesc.nRight + nCount, aDesc.nBottom);
bChanged = true;
@@ -2715,7 +2717,7 @@ bool SwChartDataSequence::ExtendTo( bool bExtendCol,
{
// new row cells adjacent to the left of the
// current data-sequence to be added...
- DBG_ASSERT( aDesc.nTop == aDesc.nBottom, "data-sequence is not a row" );
+ OSL_ENSURE( aDesc.nTop == aDesc.nBottom, "data-sequence is not a row" );
aNewStartCell = lcl_GetCellName(aDesc.nLeft - nCount, aDesc.nTop);
aNewEndCell = lcl_GetCellName(aDesc.nRight, aDesc.nBottom);
bChanged = true;
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index f2b7d71fb5..11c7b90358 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -1091,20 +1091,17 @@ SwXFrameEnumeration<T>::SwXFrameEnumeration(const SwDoc* const pDoc)
const SwSpzFrmFmts* const pFmts = pDoc->GetSpzFrmFmts();
if(!pFmts->Count())
return;
- // --> OD 2009-09-10 #i104937#
+ // #i104937#
// const SwFrmFmt* const pFmtsEnd = (*pFmts)[pFmts->Count()];
const sal_uInt16 nSize = pFmts->Count();
- // <--
::std::insert_iterator<frmcontainer_t> pInserter = ::std::insert_iterator<frmcontainer_t>(m_aFrames, m_aFrames.begin());
- // --> OD 2009-09-10 #i104937#
+ // #i104937#
SwFrmFmt* pFmt( 0 );
for( sal_uInt16 i = 0; i < nSize; ++i )
// for(SwFrmFmt* pFmt = (*pFmts)[0]; pFmt < pFmtsEnd; ++pFmt)
- // <--
{
- // --> OD 2009-09-10 #i104937#
+ // #i104937#
pFmt = (*pFmts)[i];
- // <--
if(pFmt->Which() != RES_FLYFRMFMT)
continue;
const SwNodeIndex* pIdx = pFmt->GetCntnt().GetCntntIdx();
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index a2732a73cb..fa37b4a4fb 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -72,7 +72,6 @@
#include <vcl/metric.hxx>
#include <svtools/ctrltool.hxx>
#define _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTSSORT
#include <svl/svstdarr.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
@@ -290,7 +289,6 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
{
*pAny <<= OUString();
}
- // <--
else /*if(rEntry.nWID == UNO_NAME_PARA_IS_NUMBERING_RESTART)*/
*pAny <<= false;
}
@@ -533,11 +531,11 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry
{
//now the attribute should start before or at the selection
//and it should end at the end of the selection or behind
- DBG_ASSERT(nAttrStart <= nPaMStart && nAttrEnd >=nPaMEnd,
+ OSL_ENSURE(nAttrStart <= nPaMStart && nAttrEnd >=nPaMEnd,
"attribute overlaps or is outside");
//now the name of the style has to be added to the sequence
aCharStyles.realloc(aCharStyles.getLength() + 1);
- DBG_ASSERT(pAttr->GetCharFmt().GetCharFmt(), "no character format set");
+ OSL_ENSURE(pAttr->GetCharFmt().GetCharFmt(), "no character format set");
aCharStyles.getArray()[aCharStyles.getLength() - 1] =
SwStyleNameMapper::GetProgName(
pAttr->GetCharFmt().GetCharFmt()->GetName(), nsSwGetPoolIdFromName::GET_POOLID_CHRFMT);
@@ -771,9 +769,9 @@ void resetCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry, SwPaM& rPa
break;
case FN_UNO_CHARFMT_SEQUENCE:
{
- SvUShortsSort aWhichIds;
- aWhichIds.Insert(RES_TXTATR_CHARFMT);
- pDoc->ResetAttrs(rPam, sal_True, &aWhichIds);
+ std::set<sal_uInt16> aWhichIds;
+ aWhichIds.insert( RES_TXTATR_CHARFMT);
+ pDoc->ResetAttrs(rPam, sal_True, aWhichIds);
}
break;
}
@@ -959,7 +957,7 @@ sal_Bool DocInsertStringSplitCR(
}
while (nIdx != STRING_NOTFOUND )
{
- DBG_ASSERT( nIdx - nStartIdx >= 0, "index negative!" );
+ OSL_ENSURE( nIdx - nStartIdx >= 0, "index negative!" );
aTxt = rText.Copy( nStartIdx, nIdx - nStartIdx );
if (aTxt.getLength() &&
!rDoc.InsertString( rNewCursor, aTxt, nInsertFlags ))
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index d0cd3de0b6..203261f3d1 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -72,6 +72,7 @@
#include <comphelper/extract.hxx>
#include <comphelper/stl_types.hxx>
#include <comphelper/makesequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <svx/scene3d.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
@@ -364,7 +365,7 @@ uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj )
OSL_FAIL( "<SwFmDrawPage::_CreateShape(..)> - could not retrieve type. Thus, no shape created." );
return xRet;
}
- DBG_ASSERT( eType != FLYCNTTYPE_ALL, "unexpected FlyCntType value for eType" );
+ OSL_ENSURE( eType != FLYCNTTYPE_ALL, "unexpected FlyCntType value for eType" );
xRet = SwXFrames::GetObject( *pFlyFmt, eType );
}
}
@@ -632,7 +633,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
uno::Reference< uno::XAggregation > xAgg = pShape->GetAggregationInterface();
- DBG_ASSERT(pSvxShape, "warum gibt es hier kein SvxShape?");
+ OSL_ENSURE(pSvxShape, "warum gibt es hier kein SvxShape?");
//diese Position ist auf jeden Fall in 1/100 mm
awt::Point aMM100Pos(pSvxShape->getPosition());
@@ -882,10 +883,14 @@ void SwXDrawPage::InvalidateSwDoc()
TYPEINIT1(SwXShape, SwClient);
+namespace
+{
+ class theSwXShapeUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXShapeUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXShape::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXShapeUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXShape::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -944,7 +949,6 @@ SwXShape::SwXShape(uno::Reference< uno::XInterface > & xShape) :
OSL_ENSURE( mxShape.is(),
"<SwXShape::SwXShape(..)> - no XShape found at <xShapeAgg>" );
}
- // <--
}
xShape = 0;
m_refCount++;
@@ -1172,7 +1176,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
else if(RES_OPAQUE == pEntry->nWID)
{
SvxShape* pSvxShape = GetSvxShape();
- DBG_ASSERT(pSvxShape, "No SvxShape found!");
+ OSL_ENSURE(pSvxShape, "No SvxShape found!");
if(pSvxShape)
{
SdrObject* pObj = pSvxShape->GetSdrObject();
@@ -1223,9 +1227,9 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt(
nIdx, RES_TXTATR_FLYCNT );
- DBG_ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+ OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
- DBG_ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFmt,
+ OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFmt,
"Wrong TxtFlyCnt-Hint." );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt())
.SetFlyFmt();
@@ -1235,7 +1239,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
RES_TXTATR_FLYCNT, nIdx );
//create a new one
SwTxtNode *pNd = pInternalPam->GetNode()->GetTxtNode();
- DBG_ASSERT( pNd, "Cursor not at TxtNode." );
+ OSL_ENSURE( pNd, "Cursor not at TxtNode." );
SwFmtFlyCnt aFmt( pFmt );
pNd->InsertItem(aFmt, pInternalPam->GetPoint()
->nContent.GetIndex(), 0 );
@@ -1309,9 +1313,9 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
SwTxtAttr * const pHnt =
pTxtNode->GetTxtAttrForCharAt(
nIdx, RES_TXTATR_FLYCNT );
- DBG_ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
+ OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
- DBG_ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFlyFmt,
+ OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFlyFmt,
"Wrong TxtFlyCnt-Hint." );
const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt())
.SetFlyFmt();
@@ -1347,7 +1351,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
{
//the RES_TXTATR_FLYCNT needs to be added now
SwTxtNode *pNd = aPam.GetNode()->GetTxtNode();
- DBG_ASSERT( pNd, "Crsr is not in a TxtNode." );
+ OSL_ENSURE( pNd, "Crsr is not in a TxtNode." );
SwFmtFlyCnt aFmt( pFlyFmt );
pNd->InsertItem(aFmt,
aPam.GetPoint()->nContent.GetIndex(), 0 );
@@ -1477,7 +1481,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
if(RES_OPAQUE == pEntry->nWID)
{
SvxShape* pSvxShape = GetSvxShape();
- DBG_ASSERT(pSvxShape, "No SvxShape found!");
+ OSL_ENSURE(pSvxShape, "No SvxShape found!");
if(pSvxShape)
{
SdrObject* pObj = pSvxShape->GetSdrObject();
@@ -1491,7 +1495,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName)
else if(FN_ANCHOR_POSITION == pEntry->nWID)
{
SvxShape* pSvxShape = GetSvxShape();
- DBG_ASSERT(pSvxShape, "No SvxShape found!");
+ OSL_ENSURE(pSvxShape, "No SvxShape found!");
if(pSvxShape)
{
SdrObject* pObj = pSvxShape->GetSdrObject();
@@ -1947,7 +1951,7 @@ void SwXShape::addVetoableChangeListener(
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXShape::removeVetoableChangeListener(
@@ -1956,7 +1960,7 @@ void SwXShape::removeVetoableChangeListener(
throw( beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXShape::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
@@ -2683,7 +2687,7 @@ SwXGroupShape::SwXGroupShape(uno::Reference< XInterface > & xShape) :
{
#if OSL_DEBUG_LEVEL > 1
uno::Reference<XShapes> xShapes(xShapeAgg, uno::UNO_QUERY);
- DBG_ASSERT(xShapes.is(), "no SvxShape found or shape is not a group shape");
+ OSL_ENSURE(xShapes.is(), "no SvxShape found or shape is not a group shape");
#endif
}
diff --git a/sw/source/core/unocore/unoevtlstnr.cxx b/sw/source/core/unocore/unoevtlstnr.cxx
index d87af6152f..a50d10cb51 100644
--- a/sw/source/core/unocore/unoevtlstnr.cxx
+++ b/sw/source/core/unocore/unoevtlstnr.cxx
@@ -31,7 +31,6 @@
#include <unoevtlstnr.hxx>
-#include <tools/debug.hxx>
#include <com/sun/star/lang/EventObject.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 835197038b..f0ea833b30 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -48,6 +48,7 @@
#include <viewsh.hxx>
#include <comphelper/types.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTimeRange.hpp>
#include <com/sun/star/util/DateTime.hpp>
@@ -396,10 +397,14 @@ sal_uInt16 lcl_GetPropertyMapOfService( sal_uInt16 nServiceId )
******************************************************************/
TYPEINIT1(SwXFieldMaster, SwClient);
+namespace
+{
+ class theSwXFieldMasterUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXFieldMasterUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXFieldMaster::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXFieldMasterUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXFieldMaster::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -625,7 +630,7 @@ void SwXFieldMaster::setPropertyValue( const OUString& rPropertyName,
throw uno::RuntimeException();
}
- DBG_ASSERT(pType2, "kein FieldType gefunden!" );
+ OSL_ENSURE(pType2, "kein FieldType gefunden!" );
}
else
{
@@ -882,22 +887,22 @@ uno::Any SwXFieldMaster::getPropertyValue(const OUString& rPropertyName)
void SwXFieldMaster::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXFieldMaster::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXFieldMaster::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXFieldMaster::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXFieldMaster::dispose(void) throw( uno::RuntimeException )
@@ -1066,10 +1071,14 @@ struct SwFieldProperties_Impl
TYPEINIT1(SwXTextField, SwClient);
+namespace
+{
+ class theSwXTextFieldUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextFieldUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextField::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextFieldUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextField::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -1878,7 +1887,7 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
{
// hier muss ein neuer Feldtyp angelegt werden und
// das Feld an den neuen Typ umgehaengt werden
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
else
{
@@ -2198,22 +2207,22 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName)
void SwXTextField::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextField::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextField::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextField::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextField::update( ) throw (uno::RuntimeException)
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index 4dab59b0aa..134578d917 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -53,6 +53,7 @@
#include <pagedesc.hxx>
#include <IGrammarContact.hxx>
#include <viewopt.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -78,17 +79,14 @@ uno::Sequence< uno::Type > SwXFlatParagraph::getTypes( ) throw(uno::RuntimeExce
return aTypes;
}
+namespace
+{
+ class theSwXFlatParagraphImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXFlatParagraphImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SwXFlatParagraph::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXFlatParagraphImplementationId::get().getSeq();
}
uno::Any SAL_CALL SwXFlatParagraph::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException)
@@ -266,15 +264,17 @@ css::uno::Sequence< ::sal_Int32 > SAL_CALL SwXFlatParagraph::getLanguagePortions
return css::uno::Sequence< ::sal_Int32>();
}
+namespace
+{
+ class theSwXFlatParagraphUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXFlatParagraphUnoTunnelId > {};
+}
const uno::Sequence< sal_Int8 >&
SwXFlatParagraph::getUnoTunnelId()
{
- static uno::Sequence<sal_Int8> aSeq(CreateUnoTunnelId());
- return aSeq;
+ return theSwXFlatParagraphUnoTunnelId::get().getSeq();
}
-
sal_Int64 SAL_CALL
SwXFlatParagraph::getSomething(
const uno::Sequence< sal_Int8 >& rId)
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 89bdae496b..63af5c2308 100644..100755
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -118,6 +118,7 @@
#include <fmtwrapinfluenceonobjpos.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <switerator.hxx>
+#include <comphelper/servicehelper.hxx>
// from fefly1.cxx
extern sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet );
@@ -701,13 +702,14 @@ bool SwOLEProperties_Impl::AnyToItemSet(
return sal_True;
}
-/******************************************************************
- * SwXFrame
- ******************************************************************/
+namespace
+{
+ class theSwXFrameUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXFrameUnoTunnelId > {};
+}
+
const :: uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXFrameUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXFrame::getSomething( const :: uno::Sequence< sal_Int8 >& rId )
@@ -893,9 +895,8 @@ SdrObject *SwXFrame::GetOrCreateSdrObject( SwFlyFrmFmt *pFmt )
if( !pObject )
{
SwDoc *pDoc = pFmt->GetDoc();
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
SdrModel *pDrawModel = pDoc->GetOrCreateDrawModel();
- // <--
SwFlyDrawContact* pContactObject
= new SwFlyDrawContact( pFmt, pDrawModel );
pObject = pContactObject->GetMaster();
@@ -1011,7 +1012,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
}
}
}
- // --> OD 2009-07-13 #i73249#
+ // #i73249#
// Attribute AlternativeText was never published.
// Now it has been replaced by Attribute Title - valid for all <SwXFrame> instances
// else if( FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID && eType != FLYCNTTYPE_FRM )
@@ -1052,7 +1053,6 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
GetOrCreateSdrObject( pFlyFmt );
pFlyFmt->GetDoc()->SetFlyFrmDescription( *(pFlyFmt), sDescription );
}
- // <--
else if(FN_UNO_FRAME_STYLE_NAME == pEntry->nWID)
{
SwFrmFmt *pFrmFmt = lcl_GetFrmFmt( aValue, pFmt->GetDoc() );
@@ -1061,7 +1061,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
UnoActionContext aAction(pFmt->GetDoc());
SfxItemSet* pSet = 0;
- // --> OD 2004-08-13 #i31771#, #i25798# - No adjustment of
+ // #i31771#, #i25798# - No adjustment of
// anchor ( no call of method <::lcl_ChkAndSetNewAnchor(..)> ),
// if document is currently in reading mode.
if ( !pFmt->GetDoc()->IsInReading() )
@@ -1085,7 +1085,6 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
}
}
}
- // <--
pFmt->GetDoc()->SetFrmFmtToFly( *pFmt, *pFrmFmt, pSet, sal_False );
delete pSet;
@@ -1341,7 +1340,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
aSet.Put(aAnchor);
}
- // --> OD 2004-08-13 #i31771#, #i25798# - No adjustment of
+ // #i31771#, #i25798# - No adjustment of
// anchor ( no call of method <::lcl_ChkAndSetNewAnchor(..)> ),
// if document is currently in reading mode.
if ( !pFmt->GetDoc()->IsInReading() )
@@ -1360,7 +1359,6 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
}
}
}
- // <--
pFmt->GetDoc()->SetFlyFrmAttr( *pFmt, aSet );
}
@@ -1520,7 +1518,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
{
aAny <<= OUString(SwStyleNameMapper::GetProgName(pFmt->DerivedFrom()->GetName(), nsSwGetPoolIdFromName::GET_POOLID_FRMFMT ) );
}
- // --> OD 2009-07-13 #i73249#
+ // #i73249#
// Attribute AlternativeText was never published.
// Now it has been replaced by Attribute Title - valid for all <SwXFrame> instances
// else if(eType != FLYCNTTYPE_FRM &&
@@ -1553,7 +1551,6 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
GetOrCreateSdrObject( pFlyFmt );
aAny <<= OUString(pFlyFmt->GetObjDescription());
}
- // <--
else if(eType == FLYCNTTYPE_GRF &&
(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_ACTUAL_SIZE))))
{
@@ -1561,8 +1558,24 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
if(pIdx)
{
SwNodeIndex aIdx(*pIdx, 1);
- SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode();
- Size aActSize = ((SwGrfNode*)pNoTxt)->GetTwipSize();
+ // --> OD #i85105#
+// SwNoTxtNode* pNoTxt = aIdx.GetNode().GetNoTxtNode();
+// Size aActSize = ((SwGrfNode*)pNoTxt)->GetTwipSize();
+ Size aActSize;
+ {
+ SwGrfNode* pGrfNode = dynamic_cast<SwGrfNode*>(aIdx.GetNode().GetNoTxtNode());
+ if ( pGrfNode )
+ {
+ aActSize = pGrfNode->GetTwipSize();
+ if ( aActSize.Width() == 0 && aActSize.Height() == 0 &&
+ pGrfNode->IsLinkedFile() )
+ {
+ pGrfNode->SwapIn( sal_True );
+ aActSize = pGrfNode->GetTwipSize();
+ }
+ }
+ }
+ // <--
awt::Size aTmp;
aTmp.Width = TWIP_TO_MM100(aActSize.Width());
aTmp.Height = TWIP_TO_MM100(aActSize.Height());
@@ -1587,7 +1600,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
{
SwDoc* pDoc = pFmt->GetDoc();
const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
- DBG_ASSERT( pCnt->GetCntntIdx() &&
+ OSL_ENSURE( pCnt->GetCntntIdx() &&
pDoc->GetNodes()[ pCnt->GetCntntIdx()->
GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
@@ -1635,7 +1648,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
SwFrm* pTmpFrm = SwIterator<SwFrm,SwFmt>::FirstElement( *pFmt );
if ( pTmpFrm )
{
- DBG_ASSERT( pTmpFrm->IsValid(), "frame not valid" );
+ OSL_ENSURE( pTmpFrm->IsValid(), "frame not valid" );
const SwRect &rRect = pTmpFrm->Frm();
Size aMM100Size = OutputDevice::LogicToLogic(
Size( rRect.Width(), rRect.Height() ),
@@ -1671,28 +1684,28 @@ void SwXFrame::addPropertyChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXFrame::removePropertyChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXFrame::addVetoableChangeListener(const OUString& /*PropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXFrame::removeVetoableChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName )
@@ -1802,7 +1815,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
}
}
}
- // --> OD 2009-07-13 #i73249#
+ // #i73249#
// Attribute AlternativeText was never published.
// Now it has been replaced by Attribute Title - valid for all <SwXFrame> instances
// else if( eType != FLYCNTTYPE_FRM && FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID )
@@ -1835,7 +1848,6 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
GetOrCreateSdrObject( pFlyFmt );
pFlyFmt->GetDoc()->SetFlyFrmDescription( *(pFlyFmt), aEmptyStr );
}
- // <--
else
{
SwDoc* pDoc = pFmt->GetDoc();
@@ -2072,6 +2084,8 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
aFrmSet.Put( SwFmtAnchor( FLY_AT_PAGE, 1 ));
}
+ aPam.DeleteMark(); // mark position node will be deleted!
+ aIntPam.DeleteMark(); // mark position node will be deleted!
pFmt = pDoc->MakeFlyAndMove( *m_pCopySource, aFrmSet,
0,
pParentFrmFmt );
@@ -2430,17 +2444,14 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( ) throw(uno::Runtim
return aTextFrameTypes;
}
+namespace
+{
+ class theSwXTextFrameImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXTextFrameImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static bool bInit = false;
- if(!bInit)
- {
- rtl_createUuid((sal_uInt8 *)(aId.getArray() ), 0, true);
- bInit = true;
- }
- return aId;
+ return theSwXTextFrameImplementationId::get().getSeq();
}
uno::Reference< text::XText > SwXTextFrame::getText(void) throw( uno::RuntimeException )
@@ -2725,17 +2736,14 @@ uno::Sequence< uno::Type > SAL_CALL
return aGraphicTypes;
}
+namespace
+{
+ class theSwXTextGraphicObjectImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXTextGraphicObjectImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXTextGraphicObject::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static bool bInit = false;
- if(!bInit)
- {
- rtl_createUuid((sal_uInt8 *)(aId.getArray() ), 0, true);
- bInit = true;
- }
- return aId;
+ return theSwXTextGraphicObjectImplementationId::get().getSeq();
}
void SwXTextGraphicObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException )
@@ -2859,17 +2867,14 @@ uno::Sequence< uno::Type > SAL_CALL SwXTextEmbeddedObject::getTypes( ) throw(un
return aTextEmbeddedTypes;
}
+namespace
+{
+ class theSwXTextEmbeddedObjectImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXTextEmbeddedObjectImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXTextEmbeddedObject::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static bool bInit = false;
- if(!bInit)
- {
- rtl_createUuid((sal_uInt8 *)(aId.getArray() ), 0, true);
- bInit = true;
- }
- return aId;
+ return theSwXTextEmbeddedObjectImplementationId::get().getSeq();
}
void SwXTextEmbeddedObject::attach(const uno::Reference< text::XTextRange > & xTextRange) throw( lang::IllegalArgumentException, uno::RuntimeException )
@@ -2907,7 +2912,7 @@ uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject(voi
{
SwDoc* pDoc = pFmt->GetDoc();
const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
- DBG_ASSERT( pCnt->GetCntntIdx() &&
+ OSL_ENSURE( pCnt->GetCntntIdx() &&
pDoc->GetNodes()[ pCnt->GetCntntIdx()->
GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
@@ -2947,7 +2952,7 @@ uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExte
{
SwDoc* pDoc = pFmt->GetDoc();
const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
- DBG_ASSERT( pCnt->GetCntntIdx() &&
+ OSL_ENSURE( pCnt->GetCntntIdx() &&
pDoc->GetNodes()[ pCnt->GetCntntIdx()->
GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
@@ -2985,7 +2990,7 @@ sal_Int64 SAL_CALL SwXTextEmbeddedObject::getAspect() throw (uno::RuntimeExcepti
{
SwDoc* pDoc = pFmt->GetDoc();
const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
- DBG_ASSERT( pCnt->GetCntntIdx() &&
+ OSL_ENSURE( pCnt->GetCntntIdx() &&
pDoc->GetNodes()[ pCnt->GetCntntIdx()->
GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
@@ -3002,7 +3007,7 @@ void SAL_CALL SwXTextEmbeddedObject::setAspect( sal_Int64 nAspect ) throw (uno::
{
SwDoc* pDoc = pFmt->GetDoc();
const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
- DBG_ASSERT( pCnt->GetCntntIdx() &&
+ OSL_ENSURE( pCnt->GetCntntIdx() &&
pDoc->GetNodes()[ pCnt->GetCntntIdx()->
GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
@@ -3017,7 +3022,7 @@ uno::Reference< graphic::XGraphic > SAL_CALL SwXTextEmbeddedObject::getReplaceme
{
SwDoc* pDoc = pFmt->GetDoc();
const SwFmtCntnt* pCnt = &pFmt->GetCntnt();
- DBG_ASSERT( pCnt->GetCntntIdx() &&
+ OSL_ENSURE( pCnt->GetCntntIdx() &&
pDoc->GetNodes()[ pCnt->GetCntntIdx()->
GetIndex() + 1 ]->GetOLENode(), "kein OLE-Node?");
diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx
index bf3eb9c39d..f2eef5f146 100644
--- a/sw/source/core/unocore/unoftn.cxx
+++ b/sw/source/core/unocore/unoftn.cxx
@@ -29,11 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <rtl/uuid.h>
-
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <unomid.h>
#include <unofootnote.hxx>
@@ -177,10 +176,14 @@ SwXFootnote::CreateXFootnote(SwDoc & rDoc, SwFmtFtn const& rFootnoteFmt)
: new SwXFootnote(rDoc, rFootnoteFmt);
}
+namespace
+{
+ class theSwXFootnoteUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXFootnoteUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXFootnote::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXFootnoteUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -236,18 +239,15 @@ SwXFootnote::getTypes() throw (uno::RuntimeException)
return ::comphelper::concatSequences(aTypes, aTextTypes);
}
+namespace
+{
+ class theSwXFootnoteImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXFootnoteImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL
SwXFootnote::getImplementationId() throw (uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXFootnoteImplementationId::get().getSeq();
}
uno::Any SAL_CALL
@@ -290,7 +290,7 @@ SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException)
if(pFmt)
{
const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn();
- DBG_ASSERT(pTxtFtn, "kein TextNode?");
+ OSL_ENSURE(pTxtFtn, "kein TextNode?");
SwTxtNode& rTxtNode = (SwTxtNode&)pTxtFtn->GetTxtNode();
SwPaM aPam(rTxtNode, *pTxtFtn->GetStart());
@@ -399,7 +399,7 @@ void SAL_CALL SwXFootnote::dispose() throw (uno::RuntimeException)
SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() );
SwTxtFtn const*const pTxtFtn = rFmt.GetTxtFtn();
- DBG_ASSERT(pTxtFtn, "no TextNode?");
+ OSL_ENSURE(pTxtFtn, "no TextNode?");
SwTxtNode& rTxtNode = const_cast<SwTxtNode&>(pTxtFtn->GetTxtNode());
const xub_StrLen nPos = *pTxtFtn->GetStart();
SwPaM aPam(rTxtNode, nPos, rTxtNode, nPos+1);
@@ -577,7 +577,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
if (pFmt)
{
SwTxtFtn const*const pTxtFtn = pFmt->GetTxtFtn();
- DBG_ASSERT(pTxtFtn, "no TextNode?");
+ OSL_ENSURE(pTxtFtn, "no TextNode?");
aRet <<= static_cast<sal_Int16>(pTxtFtn->GetSeqRefNo());
}
}
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index ad0163f3b9..f74d416d9f 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -37,7 +37,6 @@
#include <com/sun/star/text/BibliographyDataField.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
-#include <tools/debug.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <editeng/unolingu.hxx>
@@ -66,6 +65,7 @@
#include <chpfld.hxx>
#include <SwStyleNameMapper.hxx>
#include <unoevtlstnr.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -435,10 +435,14 @@ SwXDocumentIndex::CreateXDocumentIndex(
return xIndex;
}
+namespace
+{
+ class theSwXDocumentIndexUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXDocumentIndexUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXDocumentIndex::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXDocumentIndexUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -634,7 +638,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
throw lang::IllegalArgumentException();
}
lcl_ConvertTOUNameToUserName(sNewName);
- DBG_ASSERT(TOX_USER == eTxBaseType,
+ OSL_ENSURE(TOX_USER == eTxBaseType,
"tox type name can only be changed for user indexes");
if (pSectionFmt)
{
@@ -1636,10 +1640,14 @@ SwXDocumentIndexMark::CreateXDocumentIndexMark(
return xTOXMark;
}
+namespace
+{
+ class theSwXDocumentIndexMarkUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXDocumentIndexMarkUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXDocumentIndexMark::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXDocumentIndexMarkUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -1835,7 +1843,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
SwUnoInternalPaM aPam(*pDoc);
- //which must now return sal_True
+ //which must now return sal_True
::sw::XTextRangeToSwPaM(aPam, xTextRange);
SwTOXMark aMark (pTOXType);
if (m_pImpl->m_sAltText.getLength())
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index 72a4614f79..62bf2bdca6 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -476,7 +476,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider()
const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(sal_uInt16 nPropertyId)
{
- DBG_ASSERT(nPropertyId < PROPERTY_MAP_END, "Id ?" );
+ OSL_ENSURE(nPropertyId < PROPERTY_MAP_END, "Id ?" );
if( !aMapEntriesArr[ nPropertyId ] )
{
switch(nPropertyId)
@@ -2452,7 +2452,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
// get the cppu type from the comphelper
CppuTypes nTyp = (CppuTypes) (long) p->pType;
GenerateCppuType( nTyp, p->pType );
- DBG_ASSERT( nTyp != (CppuTypes) (long) p->pType, "unknown type" );
+ OSL_ENSURE( nTyp != (CppuTypes) (long) p->pType, "unknown type" );
}
}
return aMapEntriesArr[nPropertyId];
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 38ea6607d0..03c73a11cf 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -111,7 +111,6 @@
#include <vcl/svapp.hxx>
#include <fmtflcnt.hxx>
#define _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTSSORT
#include <svl/svstdarr.hxx>
#include <editeng/brshitem.hxx>
#include <editeng/unolingu.hxx>
@@ -124,6 +123,7 @@
#include <memory>
#include <unoparaframeenum.hxx>
#include <unoparagraph.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -131,18 +131,6 @@ using ::rtl::OUString;
using ::rtl::OUStringBuffer;
/****************************************************************************
- static methods
-****************************************************************************/
-uno::Sequence< sal_Int8 > CreateUnoTunnelId()
-{
- static osl::Mutex aCreateMutex;
- osl::Guard<osl::Mutex> aGuard( aCreateMutex );
- uno::Sequence< sal_Int8 > aSeq( 16 );
- rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
- return aSeq;
-}
-
-/****************************************************************************
Hilfsklassen
****************************************************************************/
SwUnoInternalPaM::SwUnoInternalPaM(SwDoc& rDoc) :
@@ -218,10 +206,9 @@ void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, OUString & rBuffer)
aOpt.SetCharSet( RTL_TEXTENCODING_UNICODE );
xWrt->SetAsciiOptions( aOpt );
xWrt->bUCS2_WithStartChar = sal_False;
- // --> FME #i68522#
+ // #i68522#
const sal_Bool bOldShowProgress = xWrt->bShowProgress;
xWrt->bShowProgress = sal_False;
- // <--
long lLen;
if( !IsError( aWriter.Write( xWrt ) ) &&
@@ -562,9 +549,8 @@ throw (lang::IllegalArgumentException)
lcl_SetNodeNumStart( rPam, rValue );
break;
case FN_UNO_NUM_LEVEL:
- // --> OD 2008-07-14 #i91601#
+ // #i91601#
case FN_UNO_LIST_ID:
- // <--
case FN_UNO_IS_NUMBER:
{
// multi selection is not considered
@@ -577,7 +563,7 @@ throw (lang::IllegalArgumentException)
pTxtNd->SetAttrListLevel(nLevel);
}
}
- // --> OD 2008-07-14 #i91601#
+ // #i91601#
else if (FN_UNO_LIST_ID == rEntry.nWID)
{
::rtl::OUString sListId;
@@ -586,7 +572,6 @@ throw (lang::IllegalArgumentException)
pTxtNd->SetListId( sListId );
}
}
- // <--
else if (FN_UNO_IS_NUMBER == rEntry.nWID)
{
sal_Bool bIsNumber(sal_False);
@@ -889,7 +874,7 @@ void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText,
const bool bSuccess(
SwUnoCursorHelper::DocInsertStringSplitCR(
*pDoc, *pCurrent, rText, bForceExpandHints ) );
- DBG_ASSERT( bSuccess, "Doc->Insert(Str) failed." );
+ OSL_ENSURE( bSuccess, "Doc->Insert(Str) failed." );
(void) bSuccess;
SwUnoCursorHelper::SelectPam(*pUnoCrsr, true);
@@ -1012,10 +997,14 @@ SwXTextCursor::getSupportedServiceNames() throw (uno::RuntimeException)
g_nServicesTextCursor, g_ServicesTextCursor);
}
+namespace
+{
+ class theSwXTextCursorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextCursorUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextCursor::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextCursorUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -1705,7 +1694,7 @@ throw (uno::RuntimeException)
// since MovePara(fnParaCurr, fnParaStart) only returns false
// if we were already at the start of the paragraph this function
// should always complete successfully.
- DBG_ASSERT( bRet, "gotoStartOfParagraph failed" );
+ OSL_ENSURE( bRet, "gotoStartOfParagraph failed" );
return bRet;
}
@@ -1730,7 +1719,7 @@ SwXTextCursor::gotoEndOfParagraph(sal_Bool Expand) throw (uno::RuntimeException)
// since MovePara(fnParaCurr, fnParaEnd) only returns false
// if we were already at the end of the paragraph this function
// should always complete successfully.
- DBG_ASSERT( bRet, "gotoEndOfParagraph failed" );
+ OSL_ENSURE( bRet, "gotoEndOfParagraph failed" );
return bRet;
}
@@ -2011,9 +2000,8 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER,
0L ));
}
- // --> OD 2006-07-12 #i63870#
+ // #i63870#
SwUnoCursorHelper::GetCrsrAttr( rPaM, *pSet );
- // <--
}
pStates[i] = ( pSet->Count() )
@@ -2026,10 +2014,9 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
if (!pSetParent.get())
{
pSetParent.reset( pSet->Clone( sal_False ) );
- // --> OD 2006-07-12 #i63870#
+ // #i63870#
SwUnoCursorHelper::GetCrsrAttr(
rPaM, *pSetParent, sal_True, sal_False );
- // <--
}
pStates[i] = ( (pSetParent)->Count() )
@@ -2057,7 +2044,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
static void
lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc,
- SvUShortsSort const*const pWhichIds = 0 )
+ std::set<sal_uInt16> const &rWhichIds )
{
// if we are reseting paragraph attributes, we need to select the full paragraph first
SwPosition aStart = *rPaM.Start();
@@ -2074,7 +2061,7 @@ lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc,
{
pTemp->MovePara(fnParaCurr, fnParaEnd);
}
- rDoc.ResetAttrs(*pTemp, sal_True, pWhichIds);
+ rDoc.ResetAttrs(*pTemp, sal_True, rWhichIds);
}
void SwUnoCursorHelper::SetPropertyToDefault(
@@ -2101,15 +2088,15 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
if (pEntry->nWID < RES_FRMATR_END)
{
- SvUShortsSort aWhichIds;
- aWhichIds.Insert(pEntry->nWID);
+ std::set<sal_uInt16> aWhichIds;
+ aWhichIds.insert( pEntry->nWID );
if (pEntry->nWID < RES_PARATR_BEGIN)
{
- rDoc.ResetAttrs(rPaM, sal_True, &aWhichIds);
+ rDoc.ResetAttrs(rPaM, sal_True, aWhichIds);
}
else
{
- lcl_SelectParaAndReset ( rPaM, rDoc, &aWhichIds );
+ lcl_SelectParaAndReset ( rPaM, rDoc, aWhichIds );
}
}
else
@@ -2340,7 +2327,7 @@ static sal_uInt16 g_ResetableSetRange[] = {
};
static void
-lcl_EnumerateIds(sal_uInt16 const* pIdRange, SvUShortsSort & rWhichIds)
+lcl_EnumerateIds(sal_uInt16 const* pIdRange, std::set<sal_uInt16> &rWhichIds)
{
while (*pIdRange)
{
@@ -2348,7 +2335,7 @@ lcl_EnumerateIds(sal_uInt16 const* pIdRange, SvUShortsSort & rWhichIds)
const sal_uInt16 nEnd = sal::static_int_cast<sal_uInt16>(*pIdRange++);
for (sal_uInt16 nId = nStart + 1; nId <= nEnd; ++nId)
{
- rWhichIds.Insert( nId );
+ rWhichIds.insert( rWhichIds.end(), nId );
}
}
}
@@ -2361,18 +2348,18 @@ throw (uno::RuntimeException)
SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() );
- SvUShortsSort aParaWhichIds;
- SvUShortsSort aWhichIds;
+ std::set<sal_uInt16> aParaWhichIds;
+ std::set<sal_uInt16> aWhichIds;
lcl_EnumerateIds(g_ParaResetableSetRange, aParaWhichIds);
lcl_EnumerateIds(g_ResetableSetRange, aWhichIds);
- if (aParaWhichIds.Count())
+ if (!aParaWhichIds.empty())
{
lcl_SelectParaAndReset(rUnoCursor, *rUnoCursor.GetDoc(),
- &aParaWhichIds);
+ aParaWhichIds);
}
- if (aWhichIds.Count())
+ if (!aWhichIds.empty())
{
- rUnoCursor.GetDoc()->ResetAttrs(rUnoCursor, sal_True, &aWhichIds);
+ rUnoCursor.GetDoc()->ResetAttrs(rUnoCursor, sal_True, aWhichIds);
}
}
@@ -2390,8 +2377,8 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
{
SwDoc & rDoc = *rUnoCursor.GetDoc();
const OUString * pNames = rPropertyNames.getConstArray();
- SvUShortsSort aWhichIds;
- SvUShortsSort aParaWhichIds;
+ std::set<sal_uInt16> aWhichIds;
+ std::set<sal_uInt16> aParaWhichIds;
for (sal_Int32 i = 0; i < nCount; i++)
{
SfxItemPropertySimpleEntry const*const pEntry =
@@ -2423,11 +2410,11 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
{
if (pEntry->nWID < RES_PARATR_BEGIN)
{
- aWhichIds.Insert(pEntry->nWID);
+ aWhichIds.insert( pEntry->nWID );
}
else
{
- aParaWhichIds.Insert(pEntry->nWID);
+ aParaWhichIds.insert( pEntry->nWID );
}
}
else if (pEntry->nWID == FN_UNO_NUM_START_VALUE)
@@ -2436,13 +2423,13 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
}
}
- if (aParaWhichIds.Count())
+ if (!aParaWhichIds.empty())
{
- lcl_SelectParaAndReset(rUnoCursor, rDoc, &aParaWhichIds);
+ lcl_SelectParaAndReset(rUnoCursor, rDoc, aParaWhichIds);
}
- if (aWhichIds.Count())
+ if (!aWhichIds.empty())
{
- rDoc.ResetAttrs(rUnoCursor, sal_True, &aWhichIds);
+ rDoc.ResetAttrs(rUnoCursor, sal_True, aWhichIds);
}
}
}
@@ -2549,7 +2536,7 @@ SwUnoCursorHelper::CreateSortDescriptor(const bool bFromTable)
uno::Sequence< OUString > aSeq(
GetAppCollator().listCollatorAlgorithms( aLang ) );
const sal_Int32 nLen = aSeq.getLength();
- DBG_ASSERT( nLen > 0, "list of collator algorithms is empty!");
+ OSL_ENSURE( nLen > 0, "list of collator algorithms is empty!");
OUString aCollAlg;
if (nLen > 0)
{
@@ -2920,7 +2907,7 @@ SwXTextCursor::createEnumeration() throw (uno::RuntimeException)
{
pParentText = ::sw::UnoTunnelGetImplementation<SwXText>(xTunnel);
}
- DBG_ASSERT(pParentText, "parent is not a SwXText");
+ OSL_ENSURE(pParentText, "parent is not a SwXText");
if (!pParentText)
{
throw uno::RuntimeException();
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 7a89db3f58..4f74f10c02 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -110,7 +110,6 @@
#include <vcl/svapp.hxx>
#include <fmtflcnt.hxx>
#define _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTSSORT
#define _SVSTDARR_XUB_STRLEN
#include <svl/svstdarr.hxx>
#include <editeng/brshitem.hxx>
@@ -125,6 +124,7 @@
#include <iterator>
#include <boost/bind.hpp>
#include <switerator.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -374,7 +374,7 @@ void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam,
//<-end,zhaojianwei
}
-// --> OD 2006-07-12 #i63870#
+// #i63870#
// split third parameter <bCurrentAttrOnly> into new parameters <bOnlyTxtAttr>
// and <bGetFromChrFmt> to get better control about resulting <SfxItemSet>
void SwUnoCursorHelper::GetCrsrAttr(SwPaM & rPam,
@@ -898,10 +898,14 @@ throw (uno::RuntimeException)
}
}
+namespace
+{
+ class theSwXTextRangeUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextRangeUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextRange::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextRangeUnoTunnelId::get().getSeq();
}
// XUnoTunnel
@@ -1123,7 +1127,7 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill,
: ((pPortion) ? pPortion->GetCursor() : 0);
if (pUnoCrsr && pDoc == rToFill.GetDoc())
{
- DBG_ASSERT((SwPaM*)pUnoCrsr->GetNext() == pUnoCrsr,
+ OSL_ENSURE((SwPaM*)pUnoCrsr->GetNext() == pUnoCrsr,
"what to do about rings?");
bRet = true;
*rToFill.GetPoint() = *pUnoCrsr->GetPoint();
@@ -1621,10 +1625,14 @@ SwXTextRanges::~SwXTextRanges()
{
}
+namespace
+{
+ class theSwXTextRangesUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextRangesUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextRanges::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextRangesUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -1718,7 +1726,7 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
String aText(rString);
const bool bSuccess( SwUnoCursorHelper::DocInsertStringSplitCR(
*pDoc, rCursor, aText, false ) );
- DBG_ASSERT( bSuccess, "DocInsertStringSplitCR" );
+ OSL_ENSURE( bSuccess, "DocInsertStringSplitCR" );
(void) bSuccess;
SwUnoCursorHelper::SelectPam(rCursor, true);
rCursor.Left(rString.getLength(), CRSR_SKIP_CHARS, sal_False, sal_False);
@@ -1813,7 +1821,7 @@ lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr,
else
{
const SwNodeIndex* pIdx = pFormat->GetCntnt().GetCntntIdx();
- DBG_ASSERT(pIdx, "where is the index?");
+ OSL_ENSURE(pIdx, "where is the index?");
SwNode const*const pNd =
i_rUnoCrsr.GetDoc()->GetNodes()[ pIdx->GetIndex() + 1 ];
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 3e703c4001..aa94bb91ca 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -47,7 +47,6 @@
#include <docsh.hxx>
#define _SVSTDARR_USHORTS
-#define _SVSTDARR_USHORTSSORT
#include <svl/svstdarr.hxx>
#include <com/sun/star/beans/SetPropertyTolerantFailed.hpp>
@@ -56,6 +55,7 @@
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -272,10 +272,14 @@ bool SwXParagraph::SelectPaM(SwPaM & rPaM)
return true;
}
+namespace
+{
+ class theSwXParagraphUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXParagraphUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXParagraph::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXParagraphUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -324,7 +328,7 @@ SwXParagraph::getSupportedServiceNames() throw (uno::RuntimeException)
void
SwXParagraph::attachToText(SwXText & rParent, SwTxtNode & rTxtNode)
{
- DBG_ASSERT(m_pImpl->m_bIsDescriptor, "Paragraph is not a descriptor");
+ OSL_ENSURE(m_pImpl->m_bIsDescriptor, "Paragraph is not a descriptor");
if (m_pImpl->m_bIsDescriptor)
{
m_pImpl->m_bIsDescriptor = false;
@@ -689,7 +693,7 @@ throw (uno::RuntimeException)
for (sal_Int32 i = 0; i < nProps; ++i)
{
- DBG_ASSERT( nIdx < nProps, "index out ouf bounds" );
+ OSL_ENSURE( nIdx < nProps, "index out ouf bounds" );
beans::GetDirectPropertyTolerantResult &rResult = pResult[nIdx];
try
@@ -748,7 +752,7 @@ throw (uno::RuntimeException)
nIdx++;
}
// this assertion should never occur!
- DBG_ASSERT( nIdx < 1 || pResult[nIdx - 1].Result != beans::TolerantPropertySetResultType::UNKNOWN_FAILURE,
+ OSL_ENSURE( nIdx < 1 || pResult[nIdx - 1].Result != beans::TolerantPropertySetResultType::UNKNOWN_FAILURE,
"unknown failure while retrieving property" );
}
@@ -1016,11 +1020,11 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
if (pEntry->nWID < RES_FRMATR_END)
{
- SvUShortsSort aWhichIds;
- aWhichIds.Insert(pEntry->nWID);
+ std::set<sal_uInt16> aWhichIds;
+ aWhichIds.insert( pEntry->nWID );
if (pEntry->nWID < RES_PARATR_BEGIN)
{
- aCursor.GetDoc()->ResetAttrs(aCursor, sal_True, &aWhichIds);
+ aCursor.GetDoc()->ResetAttrs(aCursor, sal_True, aWhichIds);
}
else
{
@@ -1042,7 +1046,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
{
pTemp->MovePara(fnParaCurr, fnParaEnd);
}
- pTemp->GetDoc()->ResetAttrs(*pTemp, sal_True, &aWhichIds);
+ pTemp->GetDoc()->ResetAttrs(*pTemp, sal_True, aWhichIds);
}
}
else
diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx
index 7320e075be..a1f324942c 100644
--- a/sw/source/core/unocore/unoport.cxx
+++ b/sw/source/core/unocore/unoport.cxx
@@ -54,6 +54,7 @@
#include <com/sun/star/beans/SetPropertyTolerantFailed.hpp>
#include <com/sun/star/beans/GetPropertyTolerantResult.hpp>
#include <com/sun/star/beans/TolerantPropertySetResultType.hpp>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -254,7 +255,7 @@ void SwXTextPortion::GetPropertyValue(
SwUnoCrsr *pUnoCrsr,
SfxItemSet *&pSet )
{
- DBG_ASSERT( pUnoCrsr, "UNO cursor missing" );
+ OSL_ENSURE( pUnoCrsr, "UNO cursor missing" );
if (!pUnoCrsr)
return;
if(pUnoCrsr)
@@ -734,22 +735,22 @@ void SwXTextPortion::addPropertyChangeListener(
const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextPortion::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextPortion::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextPortion::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
beans::PropertyState SwXTextPortion::getPropertyState(const OUString& rPropertyName)
@@ -891,10 +892,14 @@ uno::Reference< container::XEnumeration > SwXTextPortion::createContentEnumerat
}
+namespace
+{
+ class theSwXTextPortionUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextPortionUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextPortion::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextPortionUnoTunnelId::get().getSeq();
}
sal_Int64 SwXTextPortion::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 5bf32a1a65..5bab7c355e 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -32,9 +32,8 @@
#include <unoport.hxx>
#include <IMark.hxx>
-// --> OD 2007-10-23 #i81002#
+// #i81002#
#include <crossrefbookmark.hxx>
-// <--
#include <doc.hxx>
#include <txatbase.hxx>
#include <txtatr.hxx>
@@ -60,8 +59,8 @@
#include <crsskip.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
#include <set>
-
#include <boost/shared_ptr.hpp>
#include <boost/bind.hpp>
#include <algorithm>
@@ -155,12 +154,16 @@ namespace
++ppMark)
{
::sw::mark::IMark* const pBkmk = ppMark->get();
- bool hasOther = pBkmk->IsExpanded();
+ ::sw::mark::CrossRefBookmark *const pCrossRefMark(
+ dynamic_cast< ::sw::mark::CrossRefBookmark*>(pBkmk));
+ bool const hasOther = pBkmk->IsExpanded();
const SwPosition& rStartPos = pBkmk->GetMarkStart();
if(rStartPos.nNode == nOwnNode)
{
- const sal_uInt8 nType = hasOther ? BKM_TYPE_START : BKM_TYPE_START_END;
+ // #i109272#: cross reference marks: need special handling!
+ sal_uInt8 const nType = (hasOther || pCrossRefMark)
+ ? BKM_TYPE_START : BKM_TYPE_START_END;
rBkmArr.insert(SwXBookmarkPortion_ImplSharedPtr(
new SwXBookmarkPortion_Impl(
SwXBookmark::CreateXBookmark(rDoc, *pBkmk),
@@ -173,8 +176,10 @@ namespace
auto_ptr<SwPosition> pCrossRefEndPos;
const SwPosition* pEndPos = NULL;
if(hasOther)
+ {
pEndPos = &rEndPos;
- else if(dynamic_cast< ::sw::mark::CrossRefBookmark*>(pBkmk))
+ }
+ else if (pCrossRefMark)
{
// Crossrefbookmarks only remember the start position but have to span the whole paragraph
pCrossRefEndPos = auto_ptr<SwPosition>(new SwPosition(rEndPos));
@@ -193,13 +198,14 @@ namespace
}
}
-/******************************************************************
- * SwXTextPortionEnumeration
- ******************************************************************/
+namespace
+{
+ class theSwXTextPortionEnumerationUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextPortionEnumerationUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextPortionEnumeration::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextPortionEnumerationUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextPortionEnumeration::getSomething(
@@ -248,7 +254,7 @@ SwXTextPortionEnumeration::SwXTextPortionEnumeration(
rParaCrsr.GetDoc()->CreateUnoCrsr(*rParaCrsr.GetPoint(), sal_False);
pUnoCrsr->Add(this);
- DBG_ASSERT(nEnd == -1 || (nStart <= nEnd &&
+ OSL_ENSURE(nEnd == -1 || (nStart <= nEnd &&
nEnd <= pUnoCrsr->Start()->nNode.GetNode().GetTxtNode()->GetTxt().Len()),
"start or end value invalid!");
@@ -966,13 +972,13 @@ lcl_ExportBkmAndRedline(
SwSoftPageBreakList& rBreakArr,
const sal_uLong nIndex)
{
- if (rBkmArr.size())
+ if (!rBkmArr.empty())
lcl_ExportBookmark(rPortions, xParent, pUnoCrsr, rBkmArr, nIndex);
- if (rRedlineArr.size())
+ if (!rRedlineArr.empty())
lcl_ExportRedline(rPortions, xParent, pUnoCrsr, rRedlineArr, nIndex);
- if (rBreakArr.size())
+ if (!rBreakArr.empty())
lcl_ExportSoftPageBreak(rPortions, xParent, pUnoCrsr, rBreakArr, nIndex);
}
@@ -1014,7 +1020,7 @@ lcl_GetNextIndex(
SwXBookmarkPortion_ImplSharedPtr pPtr = (*rBkmArr.begin());
nRet = pPtr->getIndex();
}
- if(rRedlineArr.size())
+ if(!rRedlineArr.empty())
{
SwXRedlinePortion_ImplSharedPtr pPtr = (*rRedlineArr.begin());
sal_Int32 nTmp = pPtr->getRealIndex();
@@ -1046,7 +1052,7 @@ lcl_CreatePortions(
(pUnoCrsr->Start()->nContent.GetIndex() != i_nStartPos))
{
pUnoCrsr->DeleteMark();
- DBG_ASSERT(pUnoCrsr->Start()->nNode.GetNode().GetTxtNode() &&
+ OSL_ENSURE(pUnoCrsr->Start()->nNode.GetNode().GetTxtNode() &&
(i_nStartPos <= pUnoCrsr->Start()->nNode.GetNode().GetTxtNode()->
GetTxt().Len()), "Incorrect start position" );
// ??? should this be i_nStartPos - current position ?
diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx
index b6d31f4596..8001606d25 100644
--- a/sw/source/core/unocore/unoprnms.cxx
+++ b/sw/source/core/unocore/unoprnms.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <tools/debug.hxx>
#include <svl/itemprop.hxx>
#include <unoprnms.hxx>
@@ -795,7 +794,7 @@ const SwPropNameLen& SwGetPropName( sal_uInt16 nId )
}
const SwPropNameLen& GetPropName( sal_uInt16 nId )
{
- DBG_ASSERT( SW_PROPNAME_BEGIN <= nId && nId < SW_PROPNAME_END,
+ OSL_ENSURE( SW_PROPNAME_BEGIN <= nId && nId < SW_PROPNAME_END,
"GetPropName(): Wrong index" );
return aPropNameTab[ nId - SW_PROPNAME_BEGIN];
}
diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx
index 000516e800..3867c9d57f 100644
--- a/sw/source/core/unocore/unoredline.cxx
+++ b/sw/source/core/unocore/unoredline.cxx
@@ -35,6 +35,7 @@
#include <rtl/ustrbuf.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
#include <pagedesc.hxx>
#include "poolfmt.hxx"
@@ -105,18 +106,15 @@ uno::Sequence<uno::Type> SwXRedlineText::getTypes()
return aTypes;
}
+namespace
+{
+ class theSwXRedlineTextImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXRedlineTextImplementationId> {};
+}
+
uno::Sequence<sal_Int8> SwXRedlineText::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXRedlineTextImplementationId::get().getSeq();
}
uno::Reference<text::XTextCursor> SwXRedlineText::createTextCursor(void)
@@ -273,7 +271,7 @@ uno::Any SwXRedlinePortion::getPropertyValue( const OUString& rPropertyName )
aRet <<= xRet;
}
else {
- DBG_ASSERT(0, "Empty section in redline portion! (end node immediately follows start node)");
+ OSL_FAIL("Empty section in redline portion! (end node immediately follows start node)");
}
}
}
@@ -302,17 +300,14 @@ void SwXRedlinePortion::Validate() throw( uno::RuntimeException )
throw uno::RuntimeException();
}
+namespace
+{
+ class theSwXRedlinePortionImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXRedlinePortionImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXRedlinePortion::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXRedlinePortionImplementationId::get().getSeq();
}
uno::Any SwXRedlinePortion::GetPropertyValue( const OUString& rPropertyName, const SwRedline& rRedline ) throw()
@@ -397,7 +392,7 @@ uno::Sequence< beans::PropertyValue > SwXRedlinePortion::CreateRedlineProperties
pRet[nPropIdx++].Value <<= xRet;
}
else {
- DBG_ASSERT(0, "Empty section in redline portion! (end node immediately follows start node)");
+ OSL_FAIL("Empty section in redline portion! (end node immediately follows start node)");
}
}
if(pNext)
@@ -486,14 +481,14 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
case ND_SECTIONNODE:
{
SwSectionNode* pSectNode = pNode->GetSectionNode();
- DBG_ASSERT(pSectNode, "No section node!");
+ OSL_ENSURE(pSectNode, "No section node!");
xRet = SwXTextSections::GetObject( *pSectNode->GetSection().GetFmt() );
}
break;
case ND_TABLENODE :
{
SwTableNode* pTblNode = pNode->GetTableNode();
- DBG_ASSERT(pTblNode, "No table node!");
+ OSL_ENSURE(pTblNode, "No table node!");
SwTable& rTbl = pTblNode->GetTable();
SwFrmFmt* pTblFmt = rTbl.GetFrmFmt();
xRet = SwXTextTables::GetObject( *pTblFmt );
@@ -527,7 +522,7 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName )
aRet <<= xRet;
}
else {
- DBG_ASSERT(0, "Empty section in redline portion! (end node immediately follows start node)");
+ OSL_FAIL("Empty section in redline portion! (end node immediately follows start node)");
}
}
}
@@ -670,18 +665,15 @@ uno::Sequence<uno::Type> SwXRedline::getTypes()
return aTypes;
}
+namespace
+{
+ class theSwXRedlineImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXRedlineImplementationId > {};
+}
+
uno::Sequence<sal_Int8> SwXRedline::getImplementationId()
throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXRedlineImplementationId::get().getSeq();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx
index d977f2f678..e2f4c75294 100644
--- a/sw/source/core/unocore/unoredlines.cxx
+++ b/sw/source/core/unocore/unoredlines.cxx
@@ -31,7 +31,6 @@
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <tools/debug.hxx>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx
index 16749b2877..23d7240b43 100644
--- a/sw/source/core/unocore/unorefmk.cxx
+++ b/sw/source/core/unocore/unorefmk.cxx
@@ -45,6 +45,7 @@
#include <fmtrfmrk.hxx>
#include <txtrfmrk.hxx>
#include <hints.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -153,10 +154,14 @@ SwXReferenceMark::CreateXReferenceMark(
: new SwXReferenceMark(&rDoc, &rMarkFmt);
}
+namespace
+{
+ class theSwXReferenceMarkUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXReferenceMarkUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXReferenceMark::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXReferenceMarkUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -882,10 +887,14 @@ bool SwXMeta::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb)
return bForceExpandHints;
}
+namespace
+{
+ class theSwXMetaUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXMetaUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXMeta::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq( ::CreateUnoTunnelId() );
- return aSeq;
+ return theSwXMetaUnoTunnelId::get().getSeq();
}
// XUnoTunnel
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index df43031a69..dcc26fb851 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -65,6 +65,7 @@
#include <editeng/frmdiritem.hxx>
#include <fmtcntnt.hxx>
#include <editeng/lrspitem.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
@@ -85,7 +86,7 @@ struct SwTextSectionProperties_Impl
::std::auto_ptr<SvXMLAttrContainerItem> m_pXMLAttr;
::std::auto_ptr<SwFmtNoBalancedColumns> m_pNoBalanceItem;
::std::auto_ptr<SvxFrameDirectionItem> m_pFrameDirItem;
- ::std::auto_ptr<SvxLRSpaceItem> m_pLRSpaceItem;
+ ::std::auto_ptr<SvxLRSpaceItem> m_pLRSpaceItem;
bool m_bDDE;
bool m_bHidden;
@@ -212,10 +213,14 @@ SwXTextSection::~SwXTextSection()
{
}
+namespace
+{
+ class theSwXTextSectionUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextSectionUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextSection::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextSectionUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -349,7 +354,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
RES_COL, RES_COL,
RES_BACKGROUND, RES_BACKGROUND,
RES_FTN_AT_TXTEND, RES_FRAMEDIR,
- RES_LR_SPACE, RES_LR_SPACE,
+ RES_LR_SPACE, RES_LR_SPACE,
RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER,
0);
if (m_pImpl->m_pProps->m_pBrushItem.get())
@@ -1579,7 +1584,6 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
}
}
break;
- // <--
case FN_UNO_ANCHOR_TYPES:
case FN_UNO_TEXT_WRAP:
diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 4cdf7a39db..a0ef41b606 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -75,6 +75,7 @@
#include <com/sun/star/text/PositionAndSpaceMode.hpp>
#include <com/sun/star/text/LabelFollow.hpp>
#include <numrule.hxx>
+#include <comphelper/servicehelper.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -583,28 +584,28 @@ void SwXFootnoteProperties::addPropertyChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXFootnoteProperties::removePropertyChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXFootnoteProperties::addVetoableChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXFootnoteProperties::removeVetoableChangeListener(
const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
/******************************************************************
@@ -815,27 +816,27 @@ uno::Any SwXEndnoteProperties::getPropertyValue(const OUString& rPropertyName)
void SwXEndnoteProperties::addPropertyChangeListener(
const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXEndnoteProperties::removePropertyChangeListener(const OUString& /*PropertyName*/,
const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXEndnoteProperties::addVetoableChangeListener(const OUString& /*PropertyName*/,
const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXEndnoteProperties::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
/******************************************************************
@@ -1103,23 +1104,23 @@ Any SwXLineNumberingProperties::getPropertyValue(const OUString& rPropertyName)
void SwXLineNumberingProperties::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
-DBG_WARNING("not implemented");
+OSL_FAIL("not implemented");
}
void SwXLineNumberingProperties::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
-DBG_WARNING("not implemented");
+OSL_FAIL("not implemented");
}
void SwXLineNumberingProperties::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
-DBG_WARNING("not implemented");
+OSL_FAIL("not implemented");
}
void SwXLineNumberingProperties::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno:: Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
-DBG_WARNING("not implemented");
+OSL_FAIL("not implemented");
}
/******************************************************************
@@ -1132,10 +1133,14 @@ const String& SwXNumberingRules::GetInvalidStyle()
return sInvalidStyle;
}
+namespace
+{
+ class theSwXNumberingRulesUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXNumberingRulesUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXNumberingRules::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXNumberingRulesUnoTunnelId::get().getSeq();
}
// return implementation specific data
@@ -1221,9 +1226,8 @@ SwXNumberingRules::SwXNumberingRules(SwDoc& rDoc) :
sal_uInt16 nIndex =
#endif
rDoc.MakeNumRule( sCreatedNumRuleName, 0, sal_False,
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
#if OSL_DEBUG_LEVEL > 1
(void)nIndex;
#endif
@@ -1360,7 +1364,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
const SwNumRule& rNumRule, sal_Int32 nIndex) const
{
SolarMutexGuard aGuard;
- DBG_ASSERT( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
+ OSL_ENSURE( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
const SwNumFmt& rFmt = rNumRule.Get( (sal_uInt16)nIndex );
@@ -1548,7 +1552,6 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex(
// adjust conversion due to type mismatch between <Size> and <awt::Size>
awt::Size aAwtSize(TWIP_TO_MM100(aSize.Width()), TWIP_TO_MM100(aSize.Height()));
pData = new PropValData((void*)&aAwtSize, SW_PROP_NAME_STR(UNO_NAME_GRAPHIC_SIZE), ::getCppuType((const awt::Size*)0));
- // <--
aPropertyValues.Insert(pData, aPropertyValues.Count());
const SwFmtVertOrient* pOrient = rFmt.GetGraphicOrientation();
@@ -1629,7 +1632,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
throw( uno::RuntimeException, lang::IllegalArgumentException )
{
SolarMutexGuard aGuard;
- DBG_ASSERT( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
+ OSL_ENSURE( 0 <= nIndex && nIndex < MAXLEVEL, "index out of range" );
// the order of the names is important!
static const char* aNumPropertyNames[] =
@@ -1930,7 +1933,6 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
SvxUnoFontDescriptor::ConvertToFont( *pDesc, aFont );
aFmt.SetBulletFont(&aFont);
}
- // <--
}
else
bWrongArg = sal_True;
@@ -2051,7 +2053,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
SwTxtFmtColl &rTxtColl = *((*pColls)[k]);
if(rTxtColl.IsDefault())
continue;
- if ( rTxtColl.IsAssignedToListLevelOfOutlineStyle() &&
+ if ( rTxtColl.IsAssignedToListLevelOfOutlineStyle() &&
rTxtColl.GetAssignedOutlineStyleLevel() == nIndex &&
rTxtColl.GetName() != sStyleName )
{
@@ -2060,7 +2062,7 @@ void SwXNumberingRules::SetNumberingRuleByIndex(
else if ( rTxtColl.GetName() == sStyleName )
{
rTxtColl.AssignToListLevelOfOutlineStyle( nIndex );
- }
+ }
}
}
break;
@@ -2276,7 +2278,6 @@ OUString SwXNumberingRules::getName() throw( RuntimeException )
aString, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE, sal_True );
return OUString ( aString );
}
- // <--
else
return sCreatedNumRuleName;
}
@@ -2618,10 +2619,14 @@ void SwXTextColumns::removeVetoableChangeListener(
{
}
+namespace
+{
+ class theSwXTextColumnsUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextColumnsUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextColumns::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextColumnsUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextColumns::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx
index 003a96e262..9432a03caf 100644
--- a/sw/source/core/unocore/unosrch.cxx
+++ b/sw/source/core/unocore/unosrch.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/util/SearchFlags.hpp>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -498,10 +499,14 @@ SwXTextSearch::~SwXTextSearch()
delete pReplaceProperties;
}
+namespace
+{
+ class theSwXTextSearchUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextSearchUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextSearch::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextSearchUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextSearch::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -619,22 +624,22 @@ SET_UINT16:
void SwXTextSearch::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextSearch::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException,uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextSearch::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException,uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextSearch::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw(beans::UnknownPropertyException, lang::WrappedTargetException,uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
sal_Bool SwXTextSearch::getValueSearch(void) throw( uno::RuntimeException )
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 1aec961a8d..8539563df0 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -79,6 +79,8 @@
#include <fmtfsize.hxx>
#include <numrule.hxx>
+#include <comphelper/servicehelper.hxx>
+
#include <boost/shared_ptr.hpp>
#include "ccoll.hxx"
@@ -172,7 +174,7 @@ SwGetPoolIdFromName lcl_GetSwEnumFromSfxEnum ( SfxStyleFamily eFamily )
case SFX_STYLE_FAMILY_PSEUDO:
return nsSwGetPoolIdFromName::GET_POOLID_NUMRULE;
default:
- DBG_ASSERT(sal_False, "someone asking for all styles in unostyle.cxx!" );
+ OSL_ENSURE(sal_False, "someone asking for all styles in unostyle.cxx!" );
return nsSwGetPoolIdFromName::GET_POOLID_CHRFMT;
}
}
@@ -1170,10 +1172,14 @@ void SwStyleProperties_Impl::GetProperty( const OUString &rPropertyName, const u
rAny = rxPropertySet->getPropertyValue( rPropertyName );
}
+namespace
+{
+ class theSwXStyleUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXStyleUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXStyle::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXStyleUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXStyle::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -1339,7 +1345,7 @@ SwXStyle::SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam,
{
pBasePool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL );
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
- DBG_ASSERT(pBase, "where is the style?" );
+ OSL_ENSURE(pBase, "where is the style?" );
if(pBase)
{
const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(sStyleName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL);
@@ -1377,7 +1383,7 @@ OUString SwXStyle::getName(void) throw( uno::RuntimeException )
{
pBasePool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL );
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
- DBG_ASSERT(pBase, "where is the style?" );
+ OSL_ENSURE(pBase, "where is the style?" );
if(!pBase)
throw uno::RuntimeException();
SwStyleNameMapper::FillProgName(pBase->GetName(), aString, lcl_GetSwEnumFromSfxEnum ( eFamily ), sal_True);
@@ -1394,7 +1400,7 @@ void SwXStyle::setName(const OUString& rName) throw( uno::RuntimeException )
{
pBasePool->SetSearchMask(eFamily, SFXSTYLEBIT_ALL );
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
- DBG_ASSERT(pBase, "where is the style?" );
+ OSL_ENSURE(pBase, "where is the style?" );
sal_Bool bExcept = sal_True;
if(pBase && pBase->IsUserDefined())
{
@@ -1622,7 +1628,7 @@ struct SwStyleBase_Impl
sal_Bool HasItemSet() {return mxNewBase.is();}
SfxItemSet& GetItemSet()
{
- DBG_ASSERT(mxNewBase.is(), "no SwDocStyleSheet available");
+ OSL_ENSURE(mxNewBase.is(), "no SwDocStyleSheet available");
if(!pItemSet)
pItemSet = new SfxItemSet(mxNewBase->GetItemSet());
return *pItemSet;
@@ -1887,7 +1893,7 @@ void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
if (!(rValue >>= aSeq))
throw lang::IllegalArgumentException();
- DBG_ASSERT(COND_COMMAND_COUNT == 28,
+ OSL_ENSURE(COND_COMMAND_COUNT == 28,
"invalid size of comman count?");
const beans::NamedValue *pSeq = aSeq.getConstArray();
sal_Int32 nLen = aSeq.getLength();
@@ -2104,7 +2110,7 @@ void SAL_CALL SwXStyle::SetPropertyValues_Impl(
pBasePool->SetSearchMask(eFamily);
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
pBasePool->SetSearchMask(eFamily, nSaveMask );
- DBG_ASSERT(pBase, "where is the style?" );
+ OSL_ENSURE(pBase, "where is the style?" );
if(pBase)
aBaseImpl.mxNewBase = new SwDocStyleSheet(*(SwDocStyleSheet*)pBase);
else
@@ -2209,14 +2215,14 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
case FN_UNO_NUM_RULES: //Sonderbehandlung fuer das SvxNumRuleItem:
{
const SwNumRule* pRule = rBase.mxNewBase->GetNumRule();
- DBG_ASSERT(pRule, "Wo ist die NumRule?");
+ OSL_ENSURE(pRule, "Wo ist die NumRule?");
uno::Reference< container::XIndexReplace > xRules = new SwXNumberingRules(*pRule);
aRet.setValue(&xRules, ::getCppuType((uno::Reference<container::XIndexReplace>*)0));
}
break;
case RES_PARATR_OUTLINELEVEL:
{
- DBG_ASSERT( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
+ OSL_ENSURE( SFX_STYLE_FAMILY_PARA == eFamily, "only paras" );
int nLevel = rBase.mxNewBase->GetCollection()->GetAttrOutlineLevel();
aRet <<= static_cast<sal_Int16>( nLevel );
}
@@ -2264,7 +2270,7 @@ uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry,
break;
case FN_UNO_PARA_STYLE_CONDITIONS:
{
- DBG_ASSERT(COND_COMMAND_COUNT == 28,
+ OSL_ENSURE(COND_COMMAND_COUNT == 28,
"invalid size of comman count?");
uno::Sequence< beans::NamedValue > aSeq(COND_COMMAND_COUNT);
beans::NamedValue *pSeq = aSeq.getArray();
@@ -2510,28 +2516,28 @@ void SwXStyle::addPropertyChangeListener(const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXStyle::removePropertyChangeListener(const OUString& /*rPropertyName*/,
const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXStyle::addVetoableChangeListener(const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXStyle::removeVetoableChangeListener(const OUString& /*rPropertyName*/,
const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/)
throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
beans::PropertyState SwXStyle::getPropertyState(const OUString& rPropertyName)
@@ -2557,7 +2563,7 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates(
{
pBasePool->SetSearchMask(eFamily );
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
- DBG_ASSERT(pBase, "where is the style?" );
+ OSL_ENSURE(pBase, "where is the style?" );
if(pBase)
{
@@ -2657,7 +2663,7 @@ void SAL_CALL SwXStyle::setPropertiesToDefault( const uno::Sequence< OUString >&
{
pBasePool->SetSearchMask(eFamily);
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
- DBG_ASSERT(pBase, "Where is the style?");
+ OSL_ENSURE(pBase, "Where is the style?");
if(pBase)
{
@@ -2730,7 +2736,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault( )
{
pBasePool->SetSearchMask(eFamily);
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
- DBG_ASSERT(pBase, "where is the style, you fiend!?");
+ OSL_ENSURE(pBase, "where is the style, you fiend!?");
if(pBase)
{
@@ -2843,7 +2849,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::getPropertyDefaults( const uno::Seq
{
pBasePool->SetSearchMask(eFamily);
SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName);
- DBG_ASSERT(pBase, "Doesn't seem to be a style!");
+ OSL_ENSURE(pBase, "Doesn't seem to be a style!");
if(pBase)
{
@@ -2973,7 +2979,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl(
GetBasePool()->SetSearchMask(GetFamily());
SfxStyleSheetBase* pBase = GetBasePool()->Find(GetStyleName());
GetBasePool()->SetSearchMask(GetFamily(), nSaveMask );
- DBG_ASSERT(pBase, "where is the style?" );
+ OSL_ENSURE(pBase, "where is the style?" );
if(pBase)
aBaseImpl.mxNewBase = new SwDocStyleSheet(*(SwDocStyleSheet*)pBase);
else
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 64034bb0d8..fff58acc04 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -105,6 +105,7 @@
#include <rtl/math.hxx>
#include <editeng/frmdiritem.hxx>
#include <switerator.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using ::rtl::OUString;
@@ -385,7 +386,7 @@ void lcl_GetCellPosition( const String &rCellName,
}
}
#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT( rColumn != -1 && rRow != -1, "failed to get column or row index" );
+ OSL_ENSURE( rColumn != -1 && rRow != -1, "failed to get column or row index" );
#endif
}
@@ -469,13 +470,13 @@ String lcl_GetCellName( sal_Int32 nColumn, sal_Int32 nRow )
{
sal_Int32 nCol, nRow2;
lcl_GetCellPosition( String::CreateFromAscii("z1"), nCol, nRow2);
- DBG_ASSERT( nCol == 51, "lcl_GetCellPosition failed" );
+ OSL_ENSURE( nCol == 51, "lcl_GetCellPosition failed" );
lcl_GetCellPosition( String::CreateFromAscii("AA1"), nCol, nRow2);
- DBG_ASSERT( nCol == 52, "lcl_GetCellPosition failed" );
+ OSL_ENSURE( nCol == 52, "lcl_GetCellPosition failed" );
lcl_GetCellPosition( String::CreateFromAscii("AB1"), nCol, nRow2);
- DBG_ASSERT( nCol == 53, "lcl_GetCellPosition failed" );
+ OSL_ENSURE( nCol == 53, "lcl_GetCellPosition failed" );
lcl_GetCellPosition( String::CreateFromAscii("BB1"), nCol, nRow2);
- DBG_ASSERT( nCol == 105, "lcl_GetCellPosition failed" );
+ OSL_ENSURE( nCol == 105, "lcl_GetCellPosition failed" );
}
#endif
@@ -787,13 +788,16 @@ SwXCell::SwXCell(SwFrmFmt* pTblFmt, const SwStartNode& rStartNode) :
SwXCell::~SwXCell()
{
+}
+namespace
+{
+ class theSwXCellUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXCellUnoTunnelId > {};
}
const uno::Sequence< sal_Int8 > & SwXCell::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXCellUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXCell::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -831,17 +835,14 @@ uno::Sequence< uno::Type > SAL_CALL SwXCell::getTypes( ) throw(uno::RuntimeExce
return aRetTypes;
}
+namespace
+{
+ class theSwXCellImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXCellImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXCell::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXCellImplementationId::get().getSeq();
}
void SAL_CALL SwXCell::acquire( ) throw()
@@ -1164,22 +1165,22 @@ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName)
void SwXCell::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXCell::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXCell::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXCell::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) throw( uno::RuntimeException )
@@ -1446,22 +1447,22 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) throw(
void SwXTextTableRow::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTableRow::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTableRow::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTableRow::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTableRow::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
@@ -1845,7 +1846,7 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
break;
case RES_BOXATR_FORMAT:
//GetAttr fuer Tabellenselektion am Doc fehlt noch
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
break;
case FN_UNO_PARA_STYLE:
{
@@ -1878,22 +1879,22 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName)
void SwXTextTableCursor::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTableCursor::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTableCursor::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTableCursor::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTableCursor::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew)
@@ -2114,10 +2115,15 @@ void SwTableProperties_Impl::ApplyTblAttr(const SwTable& rTbl, SwDoc& rDoc)
rDoc.SetAttr( aSet, *rTbl.GetFrmFmt() );
}
}
+
+namespace
+{
+ class theSwXTextTableUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextTableUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextTable::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextTableUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextTable::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -3424,22 +3430,22 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be
void SwXTextTable::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTable::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTable::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXTextTable::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
OUString SwXTextTable::getName(void) throw( uno::RuntimeException )
@@ -3591,10 +3597,14 @@ uno::Sequence< OUString > SwXTextTable::getSupportedServiceNames(void) throw( un
return aRet;
}
+namespace
+{
+ class theSwXCellRangeUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXCellRangeUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXCellRange::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXCellRangeUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXCellRange::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -3939,7 +3949,7 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be
break;
case RES_BOXATR_FORMAT:
//GetAttr fuer Tabellenselektion am Doc fehlt noch
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
break;
case FN_UNO_PARA_STYLE:
{
@@ -3985,22 +3995,22 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be
void SwXCellRange::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXCellRange::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXCellRange::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXCellRange::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
}
void SwXCellRange::GetDataSequence(
@@ -4086,7 +4096,7 @@ void SwXCellRange::GetDataSequence(
fVal = lcl_getValue(*pXCell);
else
{
- DBG_ASSERT( table::CellContentType_TEXT == pXCell->getType(),
+ OSL_ENSURE( table::CellContentType_TEXT == pXCell->getType(),
"this branch of 'if' is only for text formatted cells" );
// now we'll try to get a useful numerical value
@@ -4138,7 +4148,7 @@ void SwXCellRange::GetDataSequence(
}
}
}
- DBG_ASSERT( nDtaCnt == nSize, "size mismatch. Invalid cell range?" );
+ OSL_ENSURE( nDtaCnt == nSize, "size mismatch. Invalid cell range?" );
if (pAnySeq)
pAnySeq->realloc( nDtaCnt );
else if (pTxtSeq)
@@ -4517,14 +4527,14 @@ void SwXCellRange::removeChartDataChangeEventListener(const uno::Reference< char
sal_Bool SwXCellRange::isNotANumber(double /*fNumber*/) throw( uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
return sal_False;
}
double SwXCellRange::getNotANumber(void) throw( uno::RuntimeException )
{
- DBG_WARNING("not implemented");
+ OSL_FAIL("not implemented");
return 0.;
}
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index bca7adee03..b344676bc8 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -38,11 +38,10 @@
#include <com/sun/star/text/ControlCharacter.hpp>
#include <com/sun/star/text/TableColumnSeparator.hpp>
-#include <rtl/uuid.h>
-
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
#include <cmdid.h>
#include <unotextbodyhf.hxx>
@@ -1001,7 +1000,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
const uno::Reference<lang::XUnoTunnel> xTunnel(xOwnCursor, uno::UNO_QUERY);
OTextCursorHelper *const pOwnCursor =
::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xTunnel);
- DBG_ASSERT(pOwnCursor, "OTextCursorHelper::getUnoTunnelId() ??? ");
+ OSL_ENSURE(pOwnCursor, "OTextCursorHelper::getUnoTunnelId() ??? ");
const SwStartNode* pOwnStartNode =
pOwnCursor->GetPaM()->GetNode()->StartOfSectionNode();
SwStartNodeType eSearchNodeType = SwNormalStartNode;
@@ -1070,7 +1069,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
}
else
{
- DBG_ASSERT(*pStart1 == *pStart2,
+ OSL_ENSURE(*pStart1 == *pStart2,
"SwPositions should be equal here");
nCompare = 0;
}
@@ -1230,10 +1229,14 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
OSL_FAIL("SwXText::removeVetoableChangeListener(): not implemented");
}
+namespace
+{
+ class theSwXTextUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXText::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL
@@ -1676,13 +1679,15 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
// DelFullPara is called
const uno::Reference< text::XTextRange> xInsertTextRange =
new SwXTextRange(aStartPam, this);
+ aStartPam.DeleteMark(); // mark position node may be deleted!
pNewFrame->attach( xInsertTextRange );
pNewFrame->setName(m_pImpl->m_pDoc->GetUniqueFrameName());
}
- if (!aStartPam.GetTxt().Len())
+ SwTxtNode *const pTxtNode(aStartPam.GetNode()->GetTxtNode());
+ OSL_ASSERT(pTxtNode);
+ if (!pTxtNode || !pTxtNode->Len()) // don't remove if it contains text!
{
- bool bMoved = false;
{ // has to be in a block to remove the SwIndexes before
// DelFullPara is called
SwPaM aMovePam( *aStartPam.GetNode() );
@@ -1694,14 +1699,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
m_pImpl->m_pDoc->SetAttr(
aNewAnchor, *pNewFrame->GetFrmFmt() );
}
- bMoved = true;
- }
- if (bMoved)
- {
- aStartPam.DeleteMark();
-// SwPaM aDelPam( *aStartPam.GetNode() );
- m_pImpl->m_pDoc->DelFullPara(aStartPam/*aDelPam*/);
}
+ m_pImpl->m_pDoc->DelFullPara(aStartPam);
}
}
catch (lang::IllegalArgumentException& rIllegal)
@@ -1968,7 +1967,7 @@ lcl_ApplyRowProperties(
}
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
//-->debug cell properties of all rows
static void
lcl_DebugCellProperties(
@@ -2062,7 +2061,7 @@ lcl_ApplyCellProperties(
else
{
// find the cell that
- DBG_ASSERT(rMergedCells.size(),
+ OSL_ENSURE(rMergedCells.size(),
"the first merged cell is missing");
if (rMergedCells.size())
{
@@ -2085,7 +2084,7 @@ lcl_ApplyCellProperties(
++aMergedIter;
}
#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT( bDbgFound,
+ OSL_ENSURE( bDbgFound,
"couldn't find first vertically merged cell" );
#endif
}
@@ -2249,7 +2248,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
xRows->getByIndex(nRow), aRowSeparators[nRow]);
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
lcl_DebugCellProperties(rCellProperties);
#endif
@@ -2388,18 +2387,15 @@ SwXBodyText::getTypes() throw (uno::RuntimeException)
return ::comphelper::concatSequences(aTypes, aTextTypes);
}
+namespace
+{
+ class theSwXBodyTextImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXBodyTextImplementationId> {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL
SwXBodyText::getImplementationId() throw (uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXBodyTextImplementationId::get().getSeq();
}
uno::Any SAL_CALL
@@ -2674,18 +2670,15 @@ SwXHeadFootText::getTypes() throw (uno::RuntimeException)
return ::comphelper::concatSequences(aTypes, aTextTypes);
}
+namespace
+{
+ class theSwXHeadFootTextImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXHeadFootTextImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL
SwXHeadFootText::getImplementationId() throw (uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static uno::Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXHeadFootTextImplementationId::get().getSeq();
}
uno::Any SAL_CALL
diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx
index 533f96fbde..366beee0fb 100644
--- a/sw/source/core/unocore/unotextmarkup.cxx
+++ b/sw/source/core/unocore/unotextmarkup.cxx
@@ -430,7 +430,6 @@ void SwXTextMarkup::Modify( const SfxPoolItem* /*pOld*/, const SfxPoolItem* /*pN
// therefore I remove the assertion in SwModify::_Remove()
if ( GetRegisteredIn() )
GetRegisteredInNonConst()->Remove( this );
- // <--
SolarMutexGuard aGuard;
mpTxtNode = 0;
diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx
index 955e98afdc..db5313d4fe 100644
--- a/sw/source/core/view/printdata.cxx
+++ b/sw/source/core/view/printdata.cxx
@@ -42,7 +42,6 @@
#include <svl/languageoptions.hxx>
#include <toolkit/awt/vclxdevice.hxx>
#include <tools/string.hxx>
-#include <tools/debug.hxx>
#include <tools/resary.hxx>
#include <unotools/moduleoptions.hxx>
#include <vcl/outdev.hxx>
@@ -72,15 +71,15 @@ SwRenderData::~SwRenderData()
{
delete m_pViewOptionAdjust; m_pViewOptionAdjust = 0;
delete m_pPrtOptions; m_pPrtOptions = 0;
- DBG_ASSERT( !m_pPostItShell, "m_pPostItShell should already have been deleted" );
- DBG_ASSERT( !m_pPostItDoc, "m_pPostItDoc should already have been deleted" );
- DBG_ASSERT( !m_pPostItFields, " should already have been deleted" );
+ OSL_ENSURE( !m_pPostItShell, "m_pPostItShell should already have been deleted" );
+ OSL_ENSURE( !m_pPostItDoc, "m_pPostItDoc should already have been deleted" );
+ OSL_ENSURE( !m_pPostItFields, " should already have been deleted" );
}
void SwRenderData::CreatePostItData( SwDoc *pDoc, const SwViewOption *pViewOpt, OutputDevice *pOutDev )
{
- DBG_ASSERT( !m_pPostItFields && !m_pPostItDoc && !m_pPostItShell, "some post-it data already exists" );
+ OSL_ENSURE( !m_pPostItFields && !m_pPostItDoc && !m_pPostItShell, "some post-it data already exists" );
m_pPostItFields = new _SetGetExpFlds;
lcl_GetPostIts( pDoc, m_pPostItFields );
m_pPostItDoc = new SwDoc;
@@ -118,7 +117,7 @@ void SwRenderData::ViewOptionAdjustStart( ViewShell &rSh, const SwViewOption &rV
{
if (m_pViewOptionAdjust)
{
- DBG_ASSERT( 0, "error: there should be no ViewOptionAdjust active when calling this function" );
+ OSL_FAIL("error: there should be no ViewOptionAdjust active when calling this function" );
}
m_pViewOptionAdjust = new SwViewOptionAdjust_Impl( rSh, rViewOptions );
}
@@ -196,7 +195,7 @@ SwPrintUIOptions::SwPrintUIOptions(
{
ResStringArray aLocalizedStrings( SW_RES( STR_PRINTOPTUI ) );
- DBG_ASSERT( aLocalizedStrings.Count() >= 30, "resource incomplete" );
+ OSL_ENSURE( aLocalizedStrings.Count() >= 30, "resource incomplete" );
if( aLocalizedStrings.Count() < 30 ) // bad resource ?
return;
@@ -327,7 +326,7 @@ SwPrintUIOptions::SwPrintUIOptions(
aHelpIds,
aPrintRangeName,
aChoices,
- bHasSelection ? 2 /*enable 'Selection' radio button*/ : 0 /* enable 'All pages' */,
+ 0 /* always default to 'All pages' */,
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Radio" ) ),
aChoicesDisabled
);
@@ -388,7 +387,7 @@ SwPrintUIOptions::SwPrintUIOptions(
// 0 : all pages (left & right)
// 1 : left pages
// 2 : right pages
- DBG_ASSERT( rDefaultPrintData.IsPrintLeftPage() || rDefaultPrintData.IsPrintRightPage(),
+ OSL_ENSURE( rDefaultPrintData.IsPrintLeftPage() || rDefaultPrintData.IsPrintRightPage(),
"unexpected value combination" );
sal_Int16 nPagesChoice = 0;
if (rDefaultPrintData.IsPrintLeftPage() && !rDefaultPrintData.IsPrintRightPage())
@@ -440,7 +439,7 @@ SwPrintUIOptions::SwPrintUIOptions(
}
- DBG_ASSERT( nIdx == nNumProps, "number of added properties is not as expected" );
+ OSL_ENSURE( nIdx == nNumProps, "number of added properties is not as expected" );
}
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index 425bba4441..4814d98915 100644..100755
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -103,7 +103,8 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
SwPrintData const*const pPrintData,
const SwRect& ,
const Color* _pPageBackgrdColor,
- const bool _bIsPageRightToLeft ) const
+ const bool _bIsPageRightToLeft,
+ sdr::contact::ViewObjectContactRedirector* pRedirector ) const
{
if ( HasDrawView() )
{
@@ -150,7 +151,7 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
SdrView &rSdrView = const_cast< SdrView & >(GetPageView()->GetView());
rSdrView.setHideDraw( !pPrintData->IsPrintDraw() );
}
- GetPageView()->DrawLayer(_nLayerID, pOutDev);
+ GetPageView()->DrawLayer( _nLayerID, pOutDev, pRedirector );
pOutDev->Pop();
// reset background color of the outliner
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index ec7813ef48..95d60ebbba 100644
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -92,7 +92,7 @@ void ViewShell::PrintProspect(
{
const sal_Int32 nMaxRenderer = rPrintData.GetRenderData().GetPagePairsForProspectPrinting().size() - 1;
#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds");
+ OSL_ENSURE( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds");
#endif
Printer *pPrinter = dynamic_cast< Printer * >(pOutDev);
if (!pPrinter || nMaxRenderer < 0 || nRenderer < 0 || nRenderer > nMaxRenderer)
@@ -105,8 +105,8 @@ void ViewShell::PrintProspect(
std::pair< sal_Int32, sal_Int32 > rPagesToPrint =
rPrintData.GetRenderData().GetPagePairsForProspectPrinting()[ nRenderer ];
#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT( rPagesToPrint.first == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.first ) == 1, "first Page not valid" );
- DBG_ASSERT( rPagesToPrint.second == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.second ) == 1, "second Page not valid" );
+ OSL_ENSURE( rPagesToPrint.first == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.first ) == 1, "first Page not valid" );
+ OSL_ENSURE( rPagesToPrint.second == -1 || rPrintData.GetRenderData().GetValidPagesSet().count( rPagesToPrint.second ) == 1, "second Page not valid" );
#endif
// create a new shell for the Printer
@@ -129,13 +129,13 @@ void ViewShell::PrintProspect(
if (rPagesToPrint.first > 0)
{
SwRenderData::ValidStartFramesMap_t::const_iterator aIt( rFrms.find( rPagesToPrint.first ) );
- DBG_ASSERT( aIt != rFrms.end(), "failed to find start frame" );
+ OSL_ENSURE( aIt != rFrms.end(), "failed to find start frame" );
pStPage = aIt->second;
}
if (rPagesToPrint.second > 0)
{
SwRenderData::ValidStartFramesMap_t::const_iterator aIt( rFrms.find( rPagesToPrint.second ) );
- DBG_ASSERT( aIt != rFrms.end(), "failed to find start frame" );
+ OSL_ENSURE( aIt != rFrms.end(), "failed to find start frame" );
pNxtPage = aIt->second;
}
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index f5b67cd5ae..b24ab0885a 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -77,6 +77,7 @@
#include "../../ui/inc/view.hxx"
#include <PostItMgr.hxx>
#include <vcl/virdev.hxx>
+#include <rootfrm.hxx>
#include <vcl/svapp.hxx>
@@ -96,6 +97,12 @@ TYPEINIT0(ViewShell);
using namespace ::com::sun::star;
+void ViewShell::ToggleHeaderFooterEdit( ) {
+ bHeaderFooterEdit = !bHeaderFooterEdit;
+ // Repaint everything to update the colors of the selected area
+ Paint( VisArea().SVRect() );
+}
+
//////////////////////////////////////////////////////////////////////////////
// #i72754# 2nd set of Pre/PostPaints
// This time it uses the lock counter (mPrePostPaintRegions empty/non-empty) to allow only one activation
@@ -646,7 +653,7 @@ void ViewShell::LayoutIdle()
SwSaveSetLRUOfst aSave( *SwTxtFrm::GetTxtCache(),
SwTxtFrm::GetTxtCache()->GetCurMax() - 50 );
- DBG_ASSERT(Imp(), "ViewShell already deleted?");
+ OSL_ENSURE(Imp(), "ViewShell already deleted?");
if(!Imp())
return;
SwLayIdle aIdle( GetLayout(), Imp() );
@@ -1042,12 +1049,16 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
i < pPage->GetSortedObjs()->Count(); ++i )
{
SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
- const Rectangle &rBound = pObj->GetObjRect().SVRect();
- const SwTwips nL = Max( 0L, rBound.Left() - nOfst );
- if ( nL < nMinLeft )
- nMinLeft = nL;
- if( rBound.Right() + nOfst > nMaxRight )
- nMaxRight = rBound.Right() + nOfst;
+ // ignore objects that are not actually placed on the page
+ if (pObj->IsFormatPossible())
+ {
+ const Rectangle &rBound = pObj->GetObjRect().SVRect();
+ const SwTwips nL = Max( 0L, rBound.Left() - nOfst );
+ if ( nL < nMinLeft )
+ nMinLeft = nL;
+ if( rBound.Right() + nOfst > nMaxRight )
+ nMaxRight = rBound.Right() + nOfst;
+ }
}
}
}
@@ -1985,10 +1996,9 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
if( bBrowseModeChanged )
{
- // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in
+ // #i44963# Good occasion to check if page sizes in
// page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
pDoc->CheckDefaultPageFmt();
- // <--
CheckBrowseView( sal_True );
}
@@ -2091,7 +2101,7 @@ void ViewShell::UISizeNotify()
void ViewShell::SetRestoreActions(sal_uInt16 nSet)
{
- DBG_ASSERT(!GetRestoreActions()||!nSet, "mehrfaches Restore der Actions ?");
+ OSL_ENSURE(!GetRestoreActions()||!nSet, "mehrfaches Restore der Actions ?");
Imp()->SetRestoreActions(nSet);
}
sal_uInt16 ViewShell::GetRestoreActions() const
@@ -2121,7 +2131,7 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > ViewShell::Create
uno::Reference< ::com::sun::star::accessibility::XAccessible >
ViewShell::CreateAccessiblePreview()
{
- DBG_ASSERT( IsPreView(),
+ OSL_ENSURE( IsPreView(),
"Can't create accessible preview for non-preview ViewShell" );
// We require a layout and an XModel to be accessible.
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 5cfb482b05..736c278f04 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -153,6 +153,7 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
mpTmpRef( 0 ),
pOpt( 0 ),
pAccOptions( new SwAccessibilityOptions ),
+ bHeaderFooterEdit( sal_False ),
mpTargetPaintWindow(0),
mpBufferedOut(0),
pDoc( &rDocument ),
@@ -174,7 +175,6 @@ ViewShell::ViewShell( SwDoc& rDocument, Window *pWindow,
// #i38810# Do not reset modified state of document, if it's already been modified.
const bool bIsDocModified( pDoc->IsModified() );
- // <--
pDoc->acquire();
pOutput = pOut;
Init( pNewOpt );
@@ -220,6 +220,7 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
mpTmpRef( 0 ),
pOpt( 0 ),
pAccOptions( new SwAccessibilityOptions ),
+ bHeaderFooterEdit( sal_False ),
mpTargetPaintWindow(0),
mpBufferedOut(0),
pDoc( rShell.GetDoc() ),
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index da0e3e57cb..ad9251a85c 100644
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -44,7 +44,6 @@
#include <editeng/pbinitem.hxx>
#include <svx/svdview.hxx>
#include <toolkit/awt/vclxdevice.hxx>
-#include <tools/debug.hxx>
#include <unotools/localedatawrapper.hxx>
#include <unotools/moduleoptions.hxx>
#include <unotools/syslocale.hxx>
@@ -447,7 +446,7 @@ sal_Bool ViewShell::PrintOrPDFExport(
const sal_Int32 nMaxRenderer = rPrintData.GetRenderData().GetPagesToPrint().size() - 1;
#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds");
+ OSL_ENSURE( 0 <= nRenderer && nRenderer <= nMaxRenderer, "nRenderer out of bounds");
#endif
if (!pOutDev || nMaxRenderer < 0 || nRenderer < 0 || nRenderer > nMaxRenderer)
return sal_False;
@@ -456,17 +455,13 @@ sal_Bool ViewShell::PrintOrPDFExport(
// output device is now provided by a call from outside the Writer)
pOutDev->Push();
- ViewShell *pShell;
- SwDoc *pOutDevDoc;
-
// Print/PDF export for (multi-)selection has already generated a
// temporary document with the selected text.
// (see XRenderable implementation in unotxdoc.cxx)
// It is implemented this way because PDF export calls this Prt function
// once per page and we do not like to always have the temporary document
// to be created that often here.
- pOutDevDoc = GetDoc();
- pShell = new ViewShell( *this, 0, pOutDev );
+ ViewShell *pShell = new ViewShell( *this, 0, pOutDev );
SdrView *pDrawView = pShell->GetDrawView();
if (pDrawView)
@@ -489,24 +484,24 @@ sal_Bool ViewShell::PrintOrPDFExport(
const sal_Int32 nPage = rPrintData.GetRenderData().GetPagesToPrint()[ nRenderer ];
#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT( nPage == 0 || rPrintData.GetRenderData().GetValidPagesSet().count( nPage ) == 1, "nPage not valid" );
+ OSL_ENSURE( nPage == 0 || rPrintData.GetRenderData().GetValidPagesSet().count( nPage ) == 1, "nPage not valid" );
#endif
const SwPageFrm *pStPage = 0;
if (nPage > 0) // a 'regular' page, not one from the post-it document
{
const SwRenderData::ValidStartFramesMap_t &rFrms = rPrintData.GetRenderData().GetValidStartFrames();
SwRenderData::ValidStartFramesMap_t::const_iterator aIt( rFrms.find( nPage ) );
- DBG_ASSERT( aIt != rFrms.end(), "failed to find start frame" );
+ OSL_ENSURE( aIt != rFrms.end(), "failed to find start frame" );
if (aIt == rFrms.end())
return sal_False;
pStPage = aIt->second;
}
else // a page from the post-its document ...
{
- DBG_ASSERT( nPage == 0, "unexpected page number. 0 for post-it pages expected" );
+ OSL_ENSURE( nPage == 0, "unexpected page number. 0 for post-it pages expected" );
pStPage = rPrintData.GetRenderData().GetPostItStartFrames()[ nRenderer ];
}
- DBG_ASSERT( pStPage, "failed to get start page" );
+ OSL_ENSURE( pStPage, "failed to get start page" );
//!! applying view options and formatting the dcoument should now only be done in getRendererCount!
diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx
index 9c6093ee16..a6b947a359 100644
--- a/sw/source/filter/ascii/wrtasc.cxx
+++ b/sw/source/filter/ascii/wrtasc.cxx
@@ -51,10 +51,8 @@ SwASCWriter::SwASCWriter( const String& rFltNm )
switch( 5 <= rFltNm.Len() ? rFltNm.GetChar( 4 ) : 0 )
{
case 'D':
-#if !defined(PM2)
aNewOpts.SetCharSet( RTL_TEXTENCODING_IBM_850 );
aNewOpts.SetParaFlags( LINEEND_CRLF );
-#endif
if( 5 < rFltNm.Len() )
switch( rFltNm.Copy( 5 ).ToInt32() )
{
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index 632d5c183e..ac3cb757e7 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -77,8 +77,7 @@ using rtl::OUString;
using namespace com::sun::star::uno;
using namespace com::sun::star;
-SwRead ReadAscii = 0, /*ReadSwg = 0, ReadSw3 = 0,*/
- ReadHTML = 0, ReadXML = 0;
+SwRead ReadAscii = 0, ReadHTML = 0, ReadXML = 0;
Reader* GetRTFReader();
Reader* GetWW8Reader();
@@ -96,7 +95,7 @@ SwReaderWriterEntry aReaderWriter[] =
SwReaderWriterEntry( 0, 0, sal_True ),
SwReaderWriterEntry( &::GetWW8Reader, 0, sal_True ),
SwReaderWriterEntry( 0, &::GetXMLWriter, sal_True ),
- SwReaderWriterEntry( 0, &::GetASCWriter, sal_True ),
+ SwReaderWriterEntry( 0, &::GetASCWriter, sal_False ),
SwReaderWriterEntry( 0, &::GetASCWriter, sal_True )
};
@@ -147,16 +146,15 @@ void _InitFilter()
void _FinitFilter()
{
- // die Reader vernichten
- for( sal_uInt16 n = 0; n < MAXFILTER; ++n )
- {
- SwReaderWriterEntry& rEntry = aReaderWriter[n];
- if( rEntry.bDelReader && rEntry.pReader )
- delete rEntry.pReader, rEntry.pReader = NULL;
- }
+ // die Reader vernichten
+ for( sal_uInt16 n = 0; n < MAXFILTER; ++n )
+ {
+ SwReaderWriterEntry& rEntry = aReaderWriter[n];
+ if( rEntry.bDelReader && rEntry.pReader )
+ delete rEntry.pReader, rEntry.pReader = NULL;
+ }
}
-
/* */
namespace SwReaderWriter {
@@ -209,8 +207,7 @@ sal_Bool StgWriter::IsStgWriter() const { return sal_True; }
sal_Bool SwReader::NeedsPasswd( const Reader& /*rOptions*/ )
{
- sal_Bool bRes = sal_False;
- return bRes;
+ return sal_False;
}
diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx
index 1f01c14e11..f00f233ab2 100644
--- a/sw/source/filter/basflt/iodetect.cxx
+++ b/sw/source/filter/basflt/iodetect.cxx
@@ -126,7 +126,7 @@ const SfxFilter* SwIoSystem::GetFilterOfFormat(const String& rFmtNm,
if( pFltCnt )
{
SfxFilterMatcher aMatcher( pFltCnt->GetName() );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFilter = aIter.First();
while ( pFilter )
{
@@ -234,7 +234,7 @@ sal_Bool SwIoSystem::IsFileFilter( SfxMedium& rMedium, const String& rFmtName,
}
SfxFilterMatcher aMatcher( rFltContainer.GetName() );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFltr = aIter.First();
while ( pFltr )
{
@@ -298,7 +298,7 @@ const SfxFilter* SwIoSystem::GetFileFilter(const String& rFileName,
return 0;
SfxFilterMatcher aMatcher( pFCntnr->GetName() );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFilter = aIter.First();
if ( !pFilter )
return 0;
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 032d457ba1..1cc399f658 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -379,7 +379,6 @@ sal_uLong SwReader::Read( const Reader& rOptions )
// SwDocShell::UpdateLinks() to new SwDoc::UpdateLinks():
// ATM still with Update
pDoc->UpdateLinks( sal_True );
- // <--
// not insert: set the redline mode read from settings.xml
eOld = static_cast<RedlineMode_t>(
@@ -475,7 +474,7 @@ SwDoc* Reader::GetTemplateDoc()
{
INetURLObject aTDir( aTemplateNm );
String aFileName = aTDir.GetMainURL( INetURLObject::NO_DECODE );
- DBG_ASSERT( !aTDir.HasError(), "No absolute path for template name!" );
+ OSL_ENSURE( !aTDir.HasError(), "No absolute path for template name!" );
DateTime aCurrDateTime;
sal_Bool bLoad = sal_False;
@@ -876,7 +875,6 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const String* pRealFileName )
// #i37248# - Modifications are only allowed at a new document.
// <pOutDoc> contains a new document, if <pDoc> is set - see above.
if ( pDoc && !pOutDoc->getPrinter( false ) )
- // <--
{
const SwPageDesc& rPgDsc = const_cast<const SwDoc *>(pOutDoc)->GetPageDesc( 0 );
//const SwPageDesc& rPgDsc = *pOutDoc->GetPageDescFromPool( RES_POOLPAGE_STANDARD );;
diff --git a/sw/source/filter/html/SwAppletImpl.cxx b/sw/source/filter/html/SwAppletImpl.cxx
index 6eb6531920..3718056059 100644
--- a/sw/source/filter/html/SwAppletImpl.cxx
+++ b/sw/source/filter/html/SwAppletImpl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -164,8 +164,8 @@ sal_Bool SwApplet_Impl::CreateApplet( const String& rBaseURL )
String aCode, aName, aCodeBase;
sal_Bool bMayScript = sal_False;
- sal_uInt32 nArgCount = aCommandList.Count();
- for( sal_uInt32 i=0; i<nArgCount; i++ )
+ size_t nArgCount = aCommandList.size();
+ for( size_t i = 0; i < nArgCount; i++ )
{
const SvCommand& rArg = aCommandList[i];
const String& rName = rArg.GetCommand();
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index aa209e2948..a71d538c10 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -101,6 +101,8 @@
#include <IDocumentStylePoolAccess.hxx>
#include <numrule.hxx>
+#include <rtl/strbuf.hxx>
+
using ::editeng::SvxBorderLine;
/*
@@ -112,7 +114,7 @@ using ::editeng::SvxBorderLine;
* diese Section und die dazugeherigen Tabellen muessen in folgenden Files
* gepflegt werden: rtf\rtfatr.cxx, sw6\sw6atr.cxx, w4w\w4watr.cxx
*/
-#if !defined(UNX) && !defined(MSC) && !defined(PPC) && !defined(__MINGW32__) && !defined(OS2)
+#if !defined(UNX) && !defined(MSC) && !defined(PPC) && !defined(__MINGW32__)
#define ATTRFNTAB_SIZE 130
#if ATTRFNTAB_SIZE != POOLATTR_END - POOLATTR_BEGIN
@@ -184,7 +186,7 @@ static Writer& OutCSS1_SvxFmtBreak_SwFmtPDesc_SvxFmtKeep( Writer& rWrt,
sal_Bool bDeep );
static Writer& OutCSS1_SwFmtLayoutSplit( Writer& rWrt, const SfxPoolItem& rHt );
-static void ConvToHex( sal_uInt16 nHex, ByteString& rStr )
+static rtl::OString ConvToHex(sal_uInt16 nHex)
{
sal_Char aNToABuf[] = "00";
@@ -198,16 +200,19 @@ static void ConvToHex( sal_uInt16 nHex, ByteString& rStr )
nHex >>= 4;
}
- rStr.Append( aNToABuf );
+ return rtl::OString(aNToABuf, 2);
}
-static void GetCSS1Color( const Color& rColor, ByteString& rStr )
+static rtl::OString GetCSS1Color(const Color& rColor)
{
- rStr += '#';
+ rtl::OStringBuffer aStr;
+ aStr.append('#');
+
+ aStr.append(ConvToHex(rColor.GetRed()));
+ aStr.append(ConvToHex(rColor.GetGreen()));
+ aStr.append(ConvToHex(rColor.GetBlue()));
- ConvToHex( rColor.GetRed(), rStr );
- ConvToHex( rColor.GetGreen(), rStr );
- ConvToHex( rColor.GetBlue(), rStr );
+ return aStr.makeStringAndClear();
}
class SwCSS1OutMode
@@ -321,13 +326,14 @@ void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp,
Strm() << sOut.GetBuffer();
}
-static void AddUnitPropertyValue( long nVal, FieldUnit eUnit, ByteString& rOut )
+static void AddUnitPropertyValue(rtl::OStringBuffer &rOut, long nVal,
+ FieldUnit eUnit)
{
if( nVal < 0 )
{
// Vorzeichen extra behandeln
nVal = -nVal;
- rOut += '-';
+ rOut.append('-');
}
// Die umgerechnete Einheit ergibt sich aus (x * nMul)/(nDiv*nFac*10)
@@ -416,12 +422,12 @@ static void AddUnitPropertyValue( long nVal, FieldUnit eUnit, ByteString& rOut )
rOut += (long)(nBigVal / nBigFac);
if( !(nBigVal % nBigFac).IsZero() )
{
- rOut += '.';
+ rOut.append('.');
while( nFac > 1 && !(nBigVal % nBigFac).IsZero() )
{
nFac /= 10;
nBigFac = nFac;
- rOut += (int)((nBigVal / nBigFac) % nBig10 );
+ rOut.append(static_cast<sal_Int32>((nBigVal / nBigFac) % nBig10));
}
}
bOutLongVal = sal_False;
@@ -440,15 +446,14 @@ static void AddUnitPropertyValue( long nVal, FieldUnit eUnit, ByteString& rOut )
}
else
{
- rOut += ByteString::CreateFromInt64( nBigVal / (sal_Int64)nFac );
+ rOut.append(nBigVal / (sal_Int64)nFac);
if( (nBigVal % (sal_Int64)nFac) != 0 )
{
- rOut += '.';
+ rOut.append('.');
while( nFac > 1 && (nBigVal % (sal_Int64)nFac) != 0 )
{
nFac /= 10;
- rOut += ByteString::CreateFromInt64(
- (nBigVal / (sal_Int64)nFac) % (sal_Int64)10 );
+ rOut.append((nBigVal / (sal_Int64)nFac) % (sal_Int64)10);
}
}
bOutLongVal = sal_False;
@@ -465,26 +470,26 @@ static void AddUnitPropertyValue( long nVal, FieldUnit eUnit, ByteString& rOut )
if( bOutLongVal )
{
- rOut += ByteString::CreateFromInt32( nLongVal/nFac );
+ rOut.append(static_cast<sal_Int32>(nLongVal/nFac));
if( (nLongVal % nFac) != 0 )
{
- rOut += '.';
+ rOut.append('.');
while( nFac > 1 && (nLongVal % nFac) != 0 )
{
nFac /= 10;
- rOut += ByteString::CreateFromInt32( (nLongVal / nFac) % 10 );
+ rOut.append(static_cast<sal_Int32>((nLongVal / nFac) % 10));
}
}
}
- rOut.Append( pUnit );
+ rOut.append(pUnit);
}
void SwHTMLWriter::OutCSS1_UnitProperty( const sal_Char *pProp, long nVal )
{
- ByteString sOut;
- AddUnitPropertyValue( nVal, eCSS1Unit, sOut );
- OutCSS1_PropertyAscii( pProp, sOut );
+ rtl::OStringBuffer sOut;
+ AddUnitPropertyValue(sOut, nVal, eCSS1Unit);
+ OutCSS1_PropertyAscii(pProp, sOut.makeStringAndClear());
}
void SwHTMLWriter::OutCSS1_PixelProperty( const sal_Char *pProp, long nVal,
@@ -499,9 +504,10 @@ void SwHTMLWriter::OutCSS1_PixelProperty( const sal_Char *pProp, long nVal,
nVal = 1;
}
- ByteString sOut( ByteString::CreateFromInt32( nVal ) );
- sOut.Append( sCSS1_UNIT_px );
- OutCSS1_PropertyAscii( pProp, sOut );
+ rtl::OStringBuffer sOut;
+ sOut.append(static_cast<sal_Int32>(nVal));
+ sOut.append(sCSS1_UNIT_px);
+ OutCSS1_PropertyAscii(pProp, sOut.makeStringAndClear());
}
void SwHTMLWriter::OutCSS1_SfxItemSet( const SfxItemSet& rItemSet,
@@ -1856,11 +1862,11 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc,
}
else
{
- ByteString sVal;
- AddUnitPropertyValue( rSz.Width(), rHTMLWrt.GetCSS1Unit(), sVal );
- sVal += ' ';
- AddUnitPropertyValue( rSz.Height(), rHTMLWrt.GetCSS1Unit(), sVal );
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_size, sVal );
+ rtl::OStringBuffer sVal;
+ AddUnitPropertyValue(sVal, rSz.Width(), rHTMLWrt.GetCSS1Unit());
+ sVal.append(' ');
+ AddUnitPropertyValue(sVal, rSz.Height(), rHTMLWrt.GetCSS1Unit());
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_size, sVal);
}
// Die Abstand-Attribute koennen auf gwohnte Weise exportiert werden
@@ -2417,9 +2423,7 @@ void SwHTMLWriter::OutCSS1_FrmFmtBackground( const SwFrmFmt& rFrmFmt )
aColor = pVSh->GetViewOptions()->GetRetoucheColor().GetColor();
}
- ByteString sOut;
- GetCSS1Color( aColor, sOut );
- OutCSS1_PropertyAscii( sCSS1_P_background, sOut );
+ OutCSS1_PropertyAscii(sCSS1_P_background, GetCSS1Color(aColor));
}
}
@@ -2561,21 +2565,27 @@ static Writer& OutCSS1_SvxCaseMap( Writer& rWrt, const SfxPoolItem& rHt )
{
SwHTMLWriter& rHTMLWrt = (SwHTMLWriter&)rWrt;
- if( !rHTMLWrt.IsHTMLMode(HTMLMODE_SMALL_CAPS) )
- return rWrt;
-
- const sal_Char *pStr = 0;
switch( ((const SvxCaseMapItem&)rHt).GetCaseMap() )
{
- case SVX_CASEMAP_NOT_MAPPED: pStr = sCSS1_PV_normal; break;
- case SVX_CASEMAP_KAPITAELCHEN: pStr = sCSS1_PV_small_caps; break;
+ case SVX_CASEMAP_NOT_MAPPED:
+ rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_variant, sCSS1_PV_normal );
+ break;
+ case SVX_CASEMAP_KAPITAELCHEN:
+ rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_variant, sCSS1_PV_small_caps );
+ break;
+ case SVX_CASEMAP_VERSALIEN:
+ rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_transform, sCSS1_PV_uppercase );
+ break;
+ case SVX_CASEMAP_GEMEINE:
+ rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_transform, sCSS1_PV_lowercase );
+ break;
+ case SVX_CASEMAP_TITEL:
+ rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_text_transform, sCSS1_PV_capitalize );
+ break;
default:
;
}
- if( pStr )
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_variant, pStr );
-
return rWrt;
}
@@ -2595,10 +2605,7 @@ static Writer& OutCSS1_SvxColor( Writer& rWrt, const SfxPoolItem& rHt )
if( COL_AUTO == aColor.GetColor() )
aColor.SetColor( COL_BLACK );
- ByteString sOut;
- GetCSS1Color( aColor, sOut );
-
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_color, sOut );
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_color, GetCSS1Color(aColor));
return rWrt;
}
@@ -2675,11 +2682,12 @@ static Writer& OutCSS1_SvxFontHeight( Writer& rWrt, const SfxPoolItem& rHt )
if( rHTMLWrt.aFontHeights[nSize-1] == nHeight )
return rWrt;
}
- ByteString sHeight( ByteString::CreateFromInt32(
- (sal_Int32)(nHeight/20) ) );
- sHeight.Append( sCSS1_UNIT_pt );
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_font_size, sHeight );
+ rtl::OStringBuffer sHeight;
+ sHeight.append(static_cast<sal_Int32>(nHeight/20));
+ sHeight.append(sCSS1_UNIT_pt);
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_font_size,
+ sHeight.makeStringAndClear());
return rWrt;
}
@@ -2733,21 +2741,22 @@ static Writer& OutCSS1_SvxKerning( Writer& rWrt, const SfxPoolItem& rHt )
sal_Int16 nValue = ((const SvxKerningItem&)rHt).GetValue();
if( nValue )
{
- ByteString sOut;
+ rtl::OStringBuffer sOut;
if( nValue < 0 )
{
- sOut = '-';
+ sOut.append('-');
nValue = -nValue;
}
// Breite als n.n pt
nValue = (nValue + 1) / 2; // 1/10pt
- sOut.Append( ByteString::CreateFromInt32( (sal_Int32)(nValue / 10) ) );
- sOut.Append( '.' );
- sOut.Append( ByteString::CreateFromInt32( (sal_Int32)(nValue % 10) ) );
- sOut.Append( sCSS1_UNIT_pt );
+ sOut.append(static_cast<sal_Int32>(nValue / 10));
+ sOut.append('.');
+ sOut.append(static_cast<sal_Int32>(nValue % 10));
+ sOut.append(sCSS1_UNIT_pt);
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_letter_spacing, sOut );
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_letter_spacing,
+ sOut.makeStringAndClear());
}
else
{
@@ -2916,14 +2925,14 @@ static Writer& OutCSS1_SvxLineSpacing( Writer& rWrt, const SfxPoolItem& rHt )
rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_line_height, (long)nHeight );
else if( nPrcHeight )
{
- ByteString sHeight(
- ByteString::CreateFromInt32( (sal_Int32)nPrcHeight ) );
- sHeight += '%';
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_line_height, sHeight );
+ rtl::OStringBuffer sHeight;
+ sHeight.append(static_cast<sal_Int32>(nPrcHeight));
+ sHeight.append('%');
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_line_height,
+ sHeight.makeStringAndClear());
}
return rWrt;
-
}
static Writer& OutCSS1_SvxAdjust( Writer& rWrt, const SfxPoolItem& rHt )
@@ -2981,8 +2990,8 @@ static Writer& OutCSS1_SvxWidows( Writer& rWrt, const SfxPoolItem& rHt )
{
SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
- ByteString aStr(
- ByteString::CreateFromInt32( ((const SvxWidowsItem&)rHt).GetValue() ) );
+ rtl::OString aStr(rtl::OString::valueOf(static_cast<sal_Int32>(
+ ((const SvxWidowsItem&)rHt).GetValue())));
rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_widows, aStr );
return rWrt;
@@ -2992,8 +3001,8 @@ static Writer& OutCSS1_SvxOrphans( Writer& rWrt, const SfxPoolItem& rHt )
{
SwHTMLWriter & rHTMLWrt = (SwHTMLWriter&)rWrt;
- ByteString aStr(
- ByteString::CreateFromInt32( ((const SvxOrphansItem&)rHt).GetValue() ) );
+ rtl::OString aStr(rtl::OString::valueOf(static_cast<sal_Int32>(
+ ((const SvxOrphansItem&)rHt).GetValue())));
rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_orphans, aStr );
return rWrt;
@@ -3007,9 +3016,10 @@ static void OutCSS1_SwFmtDropAttrs( SwHTMLWriter& rHWrt,
rHWrt.OutCSS1_PropertyAscii( sCSS1_P_float, sCSS1_PV_left );
// Anzahl der Zeilen -> %-Angabe fuer Font-Hoehe!
- ByteString sOut( ByteString::CreateFromInt32( rDrop.GetLines()*100 ) );
- sOut += '%';
- rHWrt.OutCSS1_PropertyAscii( sCSS1_P_font_size, sOut );
+ rtl::OStringBuffer sOut;
+ sOut.append(static_cast<sal_Int32>(rDrop.GetLines()*100));
+ sOut.append('%');
+ rHWrt.OutCSS1_PropertyAscii(sCSS1_P_font_size, sOut.makeStringAndClear());
// Abstand zum Text = rechter Rand
sal_uInt16 nDistance = rDrop.GetDistance();
@@ -3056,7 +3066,6 @@ static Writer& OutCSS1_SwFmtFrmSize( Writer& rWrt, const SfxPoolItem& rHt,
{
SwHTMLWriter& rHTMLWrt = (SwHTMLWriter&)rWrt;
- ByteString sOut;
const SwFmtFrmSize& rFSItem = (const SwFmtFrmSize&)rHt;
if( nMode & CSS1_FRMSIZE_WIDTH )
@@ -3064,8 +3073,11 @@ static Writer& OutCSS1_SwFmtFrmSize( Writer& rWrt, const SfxPoolItem& rHt,
sal_uInt8 nPrcWidth = rFSItem.GetWidthPercent();
if( nPrcWidth )
{
- (sOut = ByteString::CreateFromInt32( nPrcWidth) ) += '%';
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_width, sOut );
+ rtl::OStringBuffer sOut;
+ sOut.append(static_cast<sal_Int32>(nPrcWidth));
+ sOut.append('%');
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_width,
+ sOut.makeStringAndClear());
}
else if( nMode & CSS1_FRMSIZE_PIXEL )
{
@@ -3103,8 +3115,11 @@ static Writer& OutCSS1_SwFmtFrmSize( Writer& rWrt, const SfxPoolItem& rHt,
sal_uInt8 nPrcHeight = rFSItem.GetHeightPercent();
if( nPrcHeight )
{
- (sOut = ByteString::CreateFromInt32( nPrcHeight ) ) += '%';
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_height, sOut );
+ rtl::OStringBuffer sOut;
+ sOut.append(static_cast<sal_Int32>(nPrcHeight));
+ sOut.append('%');
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_height,
+ sOut.makeStringAndClear());
}
else if( nMode & CSS1_FRMSIZE_PIXEL )
{
@@ -3485,9 +3500,9 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt,
{
if( bColor )
{
- ByteString sTmp;
- GetCSS1Color( aColor, sTmp );
- sOut += String( sTmp, RTL_TEXTENCODING_ASCII_US );
+ rtl::OString sTmp(GetCSS1Color(aColor));
+ sOut += String(rtl::OStringToOUString(sTmp,
+ RTL_TEXTENCODING_ASCII_US));
}
if( pLink )
@@ -3542,38 +3557,37 @@ static void OutCSS1_SvxBorderLine( SwHTMLWriter& rHTMLWrt,
sal_Int32 nWidth = pLine->GetWidth();
- ByteString sOut;
+ rtl::OStringBuffer sOut;
if( Application::GetDefaultDevice() &&
nWidth <= Application::GetDefaultDevice()->PixelToLogic(
Size( 1, 1 ), MapMode( MAP_TWIP) ).Width() )
{
// Wenn die Breite kleiner ist als ein Pixel, dann als 1px
// ausgeben, damit Netscape und IE die Linie auch darstellen.
- sOut += "1px";
+ sOut.append(RTL_CONSTASCII_STRINGPARAM("1px"));
}
else
{
nWidth *= 5; // 1/100pt
// Breite als n.nn pt
- sOut += ByteString::CreateFromInt32( nWidth / 100 );
- (((sOut += '.')
- += ByteString::CreateFromInt32((nWidth/10) % 10))
- += ByteString::CreateFromInt32(nWidth % 10)) += sCSS1_UNIT_pt;
+ sOut.append(static_cast<sal_Int32>(nWidth / 100));
+ sOut.append('.').append(static_cast<sal_Int32>((nWidth/10) % 10)).
+ append(static_cast<sal_Int32>(nWidth % 10)).append(sCSS1_UNIT_pt);
}
// Linien-Stil: solid oder double
- sOut += ' ';
+ sOut.append(' ');
switch ( pLine->GetStyle( ) )
{
case ::editeng::SOLID:
- sOut += sCSS1_PV_solid;
+ sOut.append(sCSS1_PV_solid);
break;
case ::editeng::DOTTED:
- sOut += sCSS1_PV_dotted;
+ sOut.append(sCSS1_PV_dotted);
break;
case ::editeng::DASHED:
- sOut += sCSS1_PV_dashed;
+ sOut.append(sCSS1_PV_dashed);
break;
case ::editeng::DOUBLE:
case ::editeng::THINTHICK_SMALLGAP:
@@ -3582,29 +3596,29 @@ static void OutCSS1_SvxBorderLine( SwHTMLWriter& rHTMLWrt,
case ::editeng::THICKTHIN_SMALLGAP:
case ::editeng::THICKTHIN_MEDIUMGAP:
case ::editeng::THICKTHIN_LARGEGAP:
- sOut += sCSS1_PV_double;
+ sOut.append(sCSS1_PV_double);
break;
case ::editeng::EMBOSSED:
- sOut += sCSS1_PV_ridge;
+ sOut.append(sCSS1_PV_ridge);
break;
case ::editeng::ENGRAVED:
- sOut += sCSS1_PV_groove;
+ sOut.append(sCSS1_PV_groove);
break;
case ::editeng::INSET:
- sOut += sCSS1_PV_inset;
+ sOut.append(sCSS1_PV_inset);
break;
case ::editeng::OUTSET:
- sOut += sCSS1_PV_outset;
+ sOut.append(sCSS1_PV_outset);
break;
default:
- sOut += sCSS1_PV_none;
+ sOut.append(sCSS1_PV_none);
}
- sOut += ' ';
+ sOut.append(' ');
// und noch die Farbe
- GetCSS1Color( pLine->GetColor(), sOut );
+ sOut.append(GetCSS1Color(pLine->GetColor()));
- rHTMLWrt.OutCSS1_PropertyAscii( pProperty, sOut );
+ rHTMLWrt.OutCSS1_PropertyAscii(pProperty, sOut.makeStringAndClear());
}
Writer& OutCSS1_SvxBox( Writer& rWrt, const SfxPoolItem& rHt )
@@ -3641,14 +3655,14 @@ Writer& OutCSS1_SvxBox( Writer& rWrt, const SfxPoolItem& rHt )
if( nTopDist == nBottomDist && nLeftDist == nRightDist )
{
- ByteString sVal;
- AddUnitPropertyValue( nTopDist, rHTMLWrt.GetCSS1Unit(), sVal );
+ rtl::OStringBuffer sVal;
+ AddUnitPropertyValue(sVal, nTopDist, rHTMLWrt.GetCSS1Unit());
if( nTopDist != nLeftDist )
{
- sVal += ' ';
- AddUnitPropertyValue( nLeftDist, rHTMLWrt.GetCSS1Unit(), sVal );
+ sVal.append(' ');
+ AddUnitPropertyValue(sVal, nLeftDist, rHTMLWrt.GetCSS1Unit());
}
- rHTMLWrt.OutCSS1_PropertyAscii( sCSS1_P_padding, sVal );
+ rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_padding, sVal.makeStringAndClear());
}
else
{
diff --git a/sw/source/filter/html/css1kywd.cxx b/sw/source/filter/html/css1kywd.cxx
index ba7ab32536..7874c6fd69 100644
--- a/sw/source/filter/html/css1kywd.cxx
+++ b/sw/source/filter/html/css1kywd.cxx
@@ -109,6 +109,11 @@ sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_extra_bold, "extra-bold" );
sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_lighter, "lighter" );
sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_bolder, "bolder" );
+sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_text_transform, "text-transform" );
+
+sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_capitalize, "capitalize" );
+sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_uppercase, "uppercase" );
+sal_Char CSS1_CONSTASCII_DEF( sCSS1_PV_lowercase, "lowercase" );
sal_Char CSS1_CONSTASCII_DEF( sCSS1_P_font_size, "font-size" );
diff --git a/sw/source/filter/html/css1kywd.hxx b/sw/source/filter/html/css1kywd.hxx
index e3f8f05221..539ad90ff5 100644
--- a/sw/source/filter/html/css1kywd.hxx
+++ b/sw/source/filter/html/css1kywd.hxx
@@ -102,6 +102,11 @@ extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_variant, "font-variant" );
//sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_normal, "normal" );
extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_small_caps, "small-caps" );
+extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_text_transform, "text-transform" );
+
+extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_capitalize, "capitalize" );
+extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_uppercase, "uppercase" );
+extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_PV_lowercase, "lowercase" );
extern sal_Char CSS1_CONSTASCII_DECL( sCSS1_P_font_weight, "font-weight" );
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 4b1ce0e7f7..86fff26f37 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -91,6 +91,7 @@
#include <wrthtml.hxx>
#include <htmlfly.hxx>
#include <numrule.hxx>
+#include <rtl/strbuf.hxx>
using namespace ::com::sun::star;
@@ -103,7 +104,7 @@ using namespace ::com::sun::star;
* diese Section und die dazugeherigen Tabellen muessen in folgenden Files
* gepflegt werden: rtf\rtfatr.cxx, sw6\sw6atr.cxx, w4w\w4watr.cxx
*/
-#if !defined(UNX) && !defined(MSC) && !defined(PPC) && !defined(__MINGW32__) && !defined(OS2)
+#if !defined(UNX) && !defined(MSC) && !defined(PPC) && !defined(__MINGW32__)
#define ATTRFNTAB_SIZE 130
#if ATTRFNTAB_SIZE != POOLATTR_END - POOLATTR_BEGIN
@@ -147,13 +148,14 @@ static Writer& OutHTML_HoriSpacer( Writer& rWrt, sal_Int16 nSize )
->LogicToPixel( Size(nSize,0), MapMode(MAP_TWIP) ).Width();
}
- ByteString sOut( '<' );
- (((((((((sOut += OOO_STRING_SVTOOLS_HTML_spacer)
- += ' ') += OOO_STRING_SVTOOLS_HTML_O_type) += '=') += OOO_STRING_SVTOOLS_HTML_SPTYPE_horizontal)
- += ' ') += OOO_STRING_SVTOOLS_HTML_O_size) += '=')
- +=ByteString::CreateFromInt32(nSize)) += '>';
+ rtl::OStringBuffer sOut;
+ sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_spacer).append(' ').
+ append(OOO_STRING_SVTOOLS_HTML_O_type).append('=').
+ append(OOO_STRING_SVTOOLS_HTML_SPTYPE_horizontal).append(' ').
+ append(OOO_STRING_SVTOOLS_HTML_O_size).append('=').
+ append(static_cast<sal_Int32>(nSize)).append('>');
- rWrt.Strm() << sOut.GetBuffer();
+ rWrt.Strm() << sOut.getStr();
return rWrt;
}
@@ -628,8 +630,7 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
{
nNumStart = static_cast< sal_uInt16 >(pTxtNd->GetActualListStartValue());
}
- // <--
- DBG_ASSERT( rHWrt.nLastParaToken == 0,
+ OSL_ENSURE( rHWrt.nLastParaToken == 0,
"<PRE> wurde nicht vor <LI> beendet." );
}
}
@@ -921,13 +922,15 @@ void OutHTML_SwFmt( Writer& rWrt, const SwFmt& rFmt,
// ggf ein List-Item aufmachen
if( rInfo.bInNumBulList && bNumbered )
{
- ByteString sOut( '<' );
- sOut += OOO_STRING_SVTOOLS_HTML_li;
+ rtl::OStringBuffer sOut;
+ sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_li);
if( USHRT_MAX != nNumStart )
- (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_value) += '=')
- += ByteString::CreateFromInt32(nNumStart);
- sOut += '>';
- rWrt.Strm() << sOut.GetBuffer();
+ {
+ sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_value).
+ append('=').append(static_cast<sal_Int32>(nNumStart));
+ }
+ sOut.append('>');
+ rWrt.Strm() << sOut.getStr();
}
if( rHWrt.nDefListLvl > 0 && !bForceDL )
@@ -1506,8 +1509,8 @@ HTMLOnOffState HTMLEndPosLst::GetHTMLItemState( const SfxPoolItem& rItem )
break;
case RES_CHRATR_CASEMAP:
- if( IsHTMLMode(HTMLMODE_SMALL_CAPS) )
- eState = HTML_STYLE_VALUE;
+ eState = HTML_STYLE_VALUE;
+ break;
case RES_CHRATR_KERNING:
if( IsHTMLMode(HTMLMODE_FULL_STYLES) )
@@ -2410,7 +2413,6 @@ Writer& OutHTML_SwTxtNode( Writer& rWrt, const SwCntntNode& rNode )
// because the outline numbering isn't exported as a numbering - see <SwHTMLNumRuleInfo::Set(..)>
if ( pNd->IsOutline() &&
pNd->GetNumRule() == pNd->GetDoc()->GetOutlineNumRule() )
- // <--
{
aOutlineTxt = pNd->GetNumString();
nOffset = nOffset + aOutlineTxt.Len();
@@ -2857,14 +2859,14 @@ static Writer& OutHTML_SvxFontHeight( Writer& rWrt, const SfxPoolItem& rHt )
if( rHTMLWrt.bTagOn )
{
- ByteString sOut( '<' );
- sOut += OOO_STRING_SVTOOLS_HTML_font;
+ rtl::OStringBuffer sOut;
+ sOut.append('<').append(OOO_STRING_SVTOOLS_HTML_font);
sal_uInt32 nHeight = ((const SvxFontHeightItem&)rHt).GetHeight();
sal_uInt16 nSize = rHTMLWrt.GetHTMLFontSize( nHeight );
- (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_size) += '=')
- += ByteString::CreateFromInt32( nSize );
- rWrt.Strm() << sOut.GetBuffer();
+ sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_size).append('=').
+ append(static_cast<sal_Int32>(nSize));
+ rWrt.Strm() << sOut.getStr();
if( rHTMLWrt.bCfgOutStyles && rHTMLWrt.bTxtAttr &&
rHTMLWrt.aFontHeights[nSize-1] != nHeight )
diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx
index b6d3efd8dc..5d026ea132 100644
--- a/sw/source/filter/html/htmlcss1.cxx
+++ b/sw/source/filter/html/htmlcss1.cxx
@@ -1238,7 +1238,7 @@ SwCharFmt* SwCSS1Parser::GetChrFmt( sal_uInt16 nToken2, const String& rClass ) c
}
else
{
- SvxCSS1MapEntry *pClass = GetClass( aClass );
+ const SvxCSS1MapEntry *pClass = GetClass( aClass );
if( pClass )
{
pCFmt = pDoc->MakeCharFmt( aTmp, pCFmt );
@@ -1723,12 +1723,12 @@ void SwHTMLParser::NewStyle()
{
String sType;
- const HTMLOptions *pOptions2 = GetOptions();
- for( sal_uInt16 i = pOptions2->Count(); i; )
+ const HTMLOptions& rOptions2 = GetOptions();
+ for (size_t i = rOptions2.size(); i; )
{
- const HTMLOption *pOption = (*pOptions2)[--i];
- if( HTML_O_TYPE==pOption->GetToken() )
- sType = pOption->GetString();
+ const HTMLOption& rOption = rOptions2[--i];
+ if( HTML_O_TYPE == rOption.GetToken() )
+ sType = rOption.GetString();
}
bIgnoreRawData = sType.Len() &&
@@ -1766,7 +1766,7 @@ sal_Bool SwHTMLParser::FileDownload( const String& rURL,
aStream << *pStream;
aStream.Seek( STREAM_SEEK_TO_END );
- DBG_ASSERT( aStream.Tell() < STRING_MAXLEN,
+ OSL_ENSURE( aStream.Tell() < STRING_MAXLEN,
"File zu lang fuer einen String, Ende abgeschnitten" );
xub_StrLen nLen = aStream.Tell() < STRING_MAXLEN
? (xub_StrLen)aStream.Tell()
@@ -1818,20 +1818,20 @@ void SwHTMLParser::InsertLink()
{
String sRel, sHRef, sType;
- const HTMLOptions *pOptions2 = GetOptions();
- for( sal_uInt16 i = pOptions2->Count(); i; )
+ const HTMLOptions& rOptions2 = GetOptions();
+ for (size_t i = rOptions2.size(); i; )
{
- const HTMLOption *pOption = (*pOptions2)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rOptions2[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_REL:
- sRel = pOption->GetString();
+ sRel = rOption.GetString();
break;
case HTML_O_HREF:
- sHRef = URIHelper::SmartRel2Abs( INetURLObject( sBaseURL ), pOption->GetString(), Link(), false );
+ sHRef = URIHelper::SmartRel2Abs( INetURLObject( sBaseURL ), rOption.GetString(), Link(), false );
break;
case HTML_O_TYPE:
- sType = pOption->GetString();
+ sType = rOption.GetString();
break;
}
}
@@ -1884,7 +1884,7 @@ sal_Bool SwCSS1Parser::ParseStyleSheet( const String& rIn )
SwPageDesc *pMasterPageDesc =
pDoc->GetPageDescFromPool( RES_POOLPAGE_HTML, false );
- SvxCSS1MapEntry *pPageEntry = GetPage( aEmptyStr, sal_False );
+ SvxCSS1MapEntry *pPageEntry = GetPage( aEmptyStr, false );
if( pPageEntry )
{
// @page (wirkt auf alle Seiten, die es schon gibt
@@ -1942,7 +1942,7 @@ sal_Bool SwHTMLParser::ParseStyleOptions( const String &rStyle,
{
String aClass( rClass );
SwCSS1Parser::GetScriptFromClass( aClass );
- SvxCSS1MapEntry *pClass = pCSS1Parser->GetClass( aClass );
+ const SvxCSS1MapEntry *pClass = pCSS1Parser->GetClass( aClass );
if( pClass )
{
pCSS1Parser->MergeStyles( pClass->GetItemSet(),
@@ -1954,7 +1954,7 @@ sal_Bool SwHTMLParser::ParseStyleOptions( const String &rStyle,
if( rId.Len() )
{
- SvxCSS1MapEntry *pId = pCSS1Parser->GetId( rId );
+ const SvxCSS1MapEntry *pId = pCSS1Parser->GetId( rId );
if( pId )
pCSS1Parser->MergeStyles( pId->GetItemSet(),
pId->GetPropertyInfo(),
diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx
index 9fa931c69c..c7b615cf1a 100644
--- a/sw/source/filter/html/htmldraw.cxx
+++ b/sw/source/filter/html/htmldraw.cxx
@@ -294,93 +294,92 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
sal_Int16 nAmount = -6;
Color aBGColor;
- const HTMLOptions *pHTMLOptions = GetOptions();
- sal_uInt16 nArrLen = pHTMLOptions->Count();
- for ( sal_uInt16 i=0; i<nArrLen; i++ )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = 0, n = rHTMLOptions.size(); i < n; ++i)
{
- const HTMLOption *pOption = (*pHTMLOptions)[i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_BEHAVIOR:
eAniKind =
- (SdrTextAniKind)pOption->GetEnum( aHTMLMarqBehaviorTable,
+ (SdrTextAniKind)rOption.GetEnum( aHTMLMarqBehaviorTable,
static_cast< sal_uInt16 >(eAniKind) );
break;
case HTML_O_BGCOLOR:
- pOption->GetColor( aBGColor );
+ rOption.GetColor( aBGColor );
bBGColor = sal_True;
break;
case HTML_O_DIRECTION:
eAniDir =
- (SdrTextAniDirection)pOption->GetEnum( aHTMLMarqDirectionTable,
+ (SdrTextAniDirection)rOption.GetEnum( aHTMLMarqDirectionTable,
static_cast< sal_uInt16 >(eAniDir) );
bDirection = sal_True;
break;
case HTML_O_LOOP:
- if( pOption->GetString().
+ if( rOption.GetString().
EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_LOOP_infinite) )
{
nCount = 0;
}
else
{
- sal_uInt32 nLoop = pOption->GetSNumber();
+ sal_uInt32 nLoop = rOption.GetSNumber();
nCount = (sal_uInt16)(nLoop>0 ? nLoop : 0 );
}
break;
case HTML_O_SCROLLAMOUNT:
- nAmount = -((sal_Int16)pOption->GetNumber());
+ nAmount = -((sal_Int16)rOption.GetNumber());
break;
case HTML_O_SCROLLDELAY:
- nDelay = (sal_uInt16)pOption->GetNumber();
+ nDelay = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_WIDTH:
// erstmal nur als Pixelwerte merken!
- nWidth = pOption->GetNumber();
- bPrcWidth = pOption->GetString().Search('%') != STRING_NOTFOUND;
+ nWidth = rOption.GetNumber();
+ bPrcWidth = rOption.GetString().Search('%') != STRING_NOTFOUND;
if( bPrcWidth && nWidth>100 )
nWidth = 100;
break;
case HTML_O_HEIGHT:
// erstmal nur als Pixelwerte merken!
- nHeight = pOption->GetNumber();
- if( pOption->GetString().Search('%') != STRING_NOTFOUND )
+ nHeight = rOption.GetNumber();
+ if( rOption.GetString().Search('%') != STRING_NOTFOUND )
nHeight = 0;
break;
case HTML_O_HSPACE:
// erstmal nur als Pixelwerte merken!
- aSpace.Height() = pOption->GetNumber();
+ aSpace.Height() = rOption.GetNumber();
break;
case HTML_O_VSPACE:
// erstmal nur als Pixelwerte merken!
- aSpace.Width() = pOption->GetNumber();
+ aSpace.Width() = rOption.GetNumber();
break;
case HTML_O_ALIGN:
eVertOri =
- pOption->GetEnum( aHTMLImgVAlignTable,
+ rOption.GetEnum( aHTMLImgVAlignTable,
text::VertOrientation::TOP );
eHoriOri =
- pOption->GetEnum( aHTMLImgHAlignTable,
+ rOption.GetEnum( aHTMLImgHAlignTable,
text::HoriOrientation::NONE );
break;
}
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx
index bcf734672e..81d612f9a8 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -231,35 +231,35 @@ void SwHTMLParser::NewField()
String aValue, aNumFmt, aNumValue, aName;
const HTMLOption *pSubOption=0, *pFmtOption=0;
- const HTMLOptions *pHTMLOptions = GetOptions();
- sal_uInt16 i;
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ size_t i;
- for( i = pHTMLOptions->Count(); i; )
+ for ( i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_TYPE:
- bKnownType = pOption->GetEnum( nType, aHTMLFldTypeTable );
+ bKnownType = rOption.GetEnum( nType, aHTMLFldTypeTable );
break;
case HTML_O_SUBTYPE:
- pSubOption = pOption;
+ pSubOption = &rOption;
break;
case HTML_O_FORMAT:
- pFmtOption = pOption;
+ pFmtOption = &rOption;
break;
case HTML_O_NAME:
- aName = pOption->GetString();
+ aName = rOption.GetString();
break;
case HTML_O_VALUE:
- aValue = pOption->GetString();
+ aValue = rOption.GetString();
break;
case HTML_O_SDNUM:
- aNumFmt = pOption->GetString();
+ aNumFmt = rOption.GetString();
bHasNumFmt = sal_True;
break;
case HTML_O_SDVAL:
- aNumValue = pOption->GetString();
+ aNumValue = rOption.GetString();
bHasNumValue = sal_True;
break;
case HTML_O_SDFIXED:
@@ -282,13 +282,13 @@ void SwHTMLParser::NewField()
SvtUserOptions aOpt;
const String& rUser = aOpt.GetFullName();
SwDocShell *pDocShell(pDoc->GetDocShell());
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
if (pDocShell) {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "Doc has no DocumentProperties");
+ OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties");
const String& rChanged = xDocProps->getModifiedBy();
const String& rCreated = xDocProps->getAuthor();
if( !rUser.Len() ||
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index c4447b15a1..dc88e9e1f1 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -972,7 +972,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
xShape = uno::Reference< drawing::XShape >( xCreate, UNO_QUERY );
- DBG_ASSERT( xShape.is(), "XShape nicht erhalten" );
+ OSL_ENSURE( xShape.is(), "XShape nicht erhalten" );
awt::Size aTmpSz;
aTmpSz.Width = rSize.Width();
aTmpSz.Height = rSize.Height();
@@ -1342,30 +1342,30 @@ void SwHTMLParser::NewForm( sal_Bool bAppend )
ScriptType eDfltScriptType = GetScriptType( pHeaderAttrs );
const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs );
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
+ const HTMLOption& rOption = rHTMLOptions[--i];
ScriptType eScriptType2 = eDfltScriptType;
sal_uInt16 nEvent = 0;
sal_Bool bSetEvent = sal_False;
- switch( pOption->GetToken() )
+ switch( rOption.GetToken() )
{
case HTML_O_ACTION:
- aAction = pOption->GetString();
+ aAction = rOption.GetString();
break;
case HTML_O_METHOD:
- nMethod = pOption->GetEnum( aHTMLFormMethodTable, nMethod );
+ nMethod = rOption.GetEnum( aHTMLFormMethodTable, nMethod );
break;
case HTML_O_ENCTYPE:
- nEncType = pOption->GetEnum( aHTMLFormEncTypeTable, nEncType );
+ nEncType = rOption.GetEnum( aHTMLFormEncTypeTable, nEncType );
break;
case HTML_O_TARGET:
- sTarget = pOption->GetString();
+ sTarget = rOption.GetString();
break;
case HTML_O_NAME:
- sName = pOption->GetString();
+ sName = rOption.GetString();
break;
case HTML_O_SDONSUBMIT:
@@ -1383,15 +1383,15 @@ void SwHTMLParser::NewForm( sal_Bool bAppend )
break;
default:
- lcl_html_getEvents( pOption->GetTokenString(),
- pOption->GetString(),
+ lcl_html_getEvents( rOption.GetTokenString(),
+ rOption.GetString(),
aUnoMacroTbl, aUnoMacroParamTbl );
break;
}
if( bSetEvent )
{
- String sEvent( pOption->GetString() );
+ String sEvent( rOption.GetString() );
if( sEvent.Len() )
{
sEvent.ConvertLineEnd();
@@ -1415,7 +1415,7 @@ void SwHTMLParser::NewForm( sal_Bool bAppend )
return;
uno::Reference< XForm > xForm( xInt, UNO_QUERY );
- DBG_ASSERT( xForm.is(), "keine Form?" );
+ OSL_ENSURE( xForm.is(), "keine Form?" );
uno::Reference< container::XIndexContainer > xFormComps( xForm, UNO_QUERY );
pFormImpl->SetFormComps( xFormComps );
@@ -1516,33 +1516,33 @@ void SwHTMLParser::InsertInput()
const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs );
sal_uInt16 nKeepCRLFToken = HTML_O_VALUE;
- const HTMLOptions *pHTMLOptions = GetOptions( &nKeepCRLFToken );
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions( &nKeepCRLFToken );
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
+ const HTMLOption& rOption = rHTMLOptions[--i];
ScriptType eScriptType2 = eDfltScriptType;
sal_uInt16 nEvent = 0;
sal_Bool bSetEvent = sal_False;
- switch( pOption->GetToken() )
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_TYPE:
- eType = pOption->GetInputType();
+ eType = rOption.GetInputType();
break;
case HTML_O_NAME:
- sName = pOption->GetString();
+ sName = rOption.GetString();
break;
case HTML_O_VALUE:
- sText = pOption->GetString();
+ sText = rOption.GetString();
bValue = sal_True;
break;
case HTML_O_CHECKED:
@@ -1552,31 +1552,31 @@ void SwHTMLParser::InsertInput()
bDisabled = sal_True;
break;
case HTML_O_MAXLENGTH:
- nMaxLen = (sal_Int16)pOption->GetNumber();
+ nMaxLen = (sal_Int16)rOption.GetNumber();
break;
case HTML_O_SIZE:
- nSize = (sal_uInt16)pOption->GetNumber();
+ nSize = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_SRC:
- sImgSrc = pOption->GetString();
+ sImgSrc = rOption.GetString();
break;
case HTML_O_WIDTH:
// erstmal nur als Pixelwerte merken!
- nWidth = pOption->GetNumber();
+ nWidth = rOption.GetNumber();
break;
case HTML_O_HEIGHT:
// erstmal nur als Pixelwerte merken!
- nHeight = pOption->GetNumber();
+ nHeight = rOption.GetNumber();
break;
case HTML_O_ALIGN:
eVertOri =
- pOption->GetEnum( aHTMLImgVAlignTable, eVertOri );
+ rOption.GetEnum( aHTMLImgVAlignTable, eVertOri );
eHoriOri =
- pOption->GetEnum( aHTMLImgHAlignTable, eHoriOri );
+ rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri );
break;
case HTML_O_TABINDEX:
// erstmal nur als Pixelwerte merken!
- nTabIndex = pOption->GetNumber();
+ nTabIndex = rOption.GetNumber();
break;
case HTML_O_SDONFOCUS:
@@ -1615,15 +1615,15 @@ void SwHTMLParser::InsertInput()
break;
default:
- lcl_html_getEvents( pOption->GetTokenString(),
- pOption->GetString(),
+ lcl_html_getEvents( rOption.GetTokenString(),
+ rOption.GetString(),
aUnoMacroTbl, aUnoMacroParamTbl );
break;
}
if( bSetEvent )
{
- String sEvent( pOption->GetString() );
+ String sEvent( rOption.GetString() );
if( sEvent.Len() )
{
sEvent.ConvertLineEnd();
@@ -2007,43 +2007,43 @@ void SwHTMLParser::NewTextArea()
ScriptType eDfltScriptType = GetScriptType( pHeaderAttrs );
const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs );
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
+ const HTMLOption& rOption = rHTMLOptions[--i];
ScriptType eScriptType2 = eDfltScriptType;
sal_uInt16 nEvent = 0;
sal_Bool bSetEvent = sal_False;
- switch( pOption->GetToken() )
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_NAME:
- sName = pOption->GetString();
+ sName = rOption.GetString();
break;
case HTML_O_DISABLED:
bDisabled = sal_True;
break;
case HTML_O_ROWS:
- nRows = (sal_uInt16)pOption->GetNumber();
+ nRows = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_COLS:
- nCols = (sal_uInt16)pOption->GetNumber();
+ nCols = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_WRAP:
- nWrap = pOption->GetEnum( aHTMLTextAreaWrapTable, nWrap );
+ nWrap = rOption.GetEnum( aHTMLTextAreaWrapTable, nWrap );
break;
case HTML_O_TABINDEX:
- nTabIndex = pOption->GetSNumber();
+ nTabIndex = rOption.GetSNumber();
break;
case HTML_O_SDONFOCUS:
@@ -2082,15 +2082,15 @@ void SwHTMLParser::NewTextArea()
break;
default:
- lcl_html_getEvents( pOption->GetTokenString(),
- pOption->GetString(),
+ lcl_html_getEvents( rOption.GetTokenString(),
+ rOption.GetString(),
aUnoMacroTbl, aUnoMacroParamTbl );
break;
}
if( bSetEvent )
{
- String sEvent( pOption->GetString() );
+ String sEvent( rOption.GetString() );
if( sEvent.Len() )
{
sEvent.ConvertLineEnd();
@@ -2119,7 +2119,7 @@ void SwHTMLParser::NewTextArea()
}
uno::Reference< XFormComponent > xFComp( xInt, UNO_QUERY );
- DBG_ASSERT( xFComp.is(), "keine FormComponent?" );
+ OSL_ENSURE( xFComp.is(), "keine FormComponent?" );
uno::Reference< beans::XPropertySet > xPropSet( xFComp, UNO_QUERY );
@@ -2297,27 +2297,27 @@ void SwHTMLParser::NewSelect()
ScriptType eDfltScriptType = GetScriptType( pHeaderAttrs );
const String& rDfltScriptType = GetScriptTypeString( pHeaderAttrs );
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
+ const HTMLOption& rOption = rHTMLOptions[--i];
ScriptType eScriptType2 = eDfltScriptType;
sal_uInt16 nEvent = 0;
sal_Bool bSetEvent = sal_False;
- switch( pOption->GetToken() )
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_NAME:
- sName = pOption->GetString();
+ sName = rOption.GetString();
break;
case HTML_O_MULTIPLE:
bMultiple = sal_True;
@@ -2326,11 +2326,11 @@ void SwHTMLParser::NewSelect()
bDisabled = sal_True;
break;
case HTML_O_SIZE:
- nSelectEntryCnt = (sal_uInt16)pOption->GetNumber();
+ nSelectEntryCnt = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_TABINDEX:
- nTabIndex = pOption->GetSNumber();
+ nTabIndex = rOption.GetSNumber();
break;
case HTML_O_SDONFOCUS:
@@ -2362,15 +2362,15 @@ void SwHTMLParser::NewSelect()
break;
default:
- lcl_html_getEvents( pOption->GetTokenString(),
- pOption->GetString(),
+ lcl_html_getEvents( rOption.GetTokenString(),
+ rOption.GetString(),
aUnoMacroTbl, aUnoMacroParamTbl );
break;
}
if( bSetEvent )
{
- String sEvent( pOption->GetString() );
+ String sEvent( rOption.GetString() );
if( sEvent.Len() )
{
sEvent.ConvertLineEnd();
@@ -2398,7 +2398,7 @@ void SwHTMLParser::NewSelect()
}
uno::Reference< XFormComponent > xFComp( xInt, UNO_QUERY );
- DBG_ASSERT(xFComp.is(), "keine FormComponent?");
+ OSL_ENSURE(xFComp.is(), "keine FormComponent?");
uno::Reference< beans::XPropertySet > xPropSet( xFComp, UNO_QUERY );
@@ -2601,11 +2601,11 @@ void SwHTMLParser::InsertSelectOption()
bLBEntrySelected = sal_False;
String aValue;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
// erstmal weglassen!!!
@@ -2614,7 +2614,7 @@ void SwHTMLParser::InsertSelectOption()
bLBEntrySelected = sal_True;
break;
case HTML_O_VALUE:
- aValue = pOption->GetString();
+ aValue = rOption.GetString();
if( !aValue.Len() )
aValue.AssignAscii( "$$$empty$$$" );
break;
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 10935a2ee7..61765bd964 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -337,70 +337,70 @@ void SwHTMLParser::InsertImage()
String sDfltScriptType;
GetDefaultScriptType( eDfltScriptType, sDfltScriptType );
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
sal_uInt16 nEvent = 0;
ScriptType eScriptType2 = eDfltScriptType;
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_SRC:
- sGrfNm = pOption->GetString();
+ sGrfNm = rOption.GetString();
if( !InternalImgToPrivateURL(sGrfNm) )
sGrfNm = INetURLObject::GetAbsURL( sBaseURL, sGrfNm );
break;
case HTML_O_ALIGN:
eVertOri =
- pOption->GetEnum( aHTMLImgVAlignTable,
+ rOption.GetEnum( aHTMLImgVAlignTable,
text::VertOrientation::TOP );
eHoriOri =
- pOption->GetEnum( aHTMLImgHAlignTable,
+ rOption.GetEnum( aHTMLImgHAlignTable,
text::HoriOrientation::NONE );
break;
case HTML_O_WIDTH:
// erstmal nur als Pixelwerte merken!
- nWidth = pOption->GetNumber();
- bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND);
+ nWidth = rOption.GetNumber();
+ bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND);
if( bPrcWidth && nWidth>100 )
nWidth = 100;
break;
case HTML_O_HEIGHT:
// erstmal nur als Pixelwerte merken!
- nHeight = pOption->GetNumber();
- bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND);
+ nHeight = rOption.GetNumber();
+ bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND);
if( bPrcHeight && nHeight>100 )
nHeight = 100;
break;
case HTML_O_VSPACE:
- nVSpace = pOption->GetNumber();
+ nVSpace = rOption.GetNumber();
break;
case HTML_O_HSPACE:
- nHSpace = pOption->GetNumber();
+ nHSpace = rOption.GetNumber();
break;
case HTML_O_ALT:
- sAltNm = pOption->GetString();
+ sAltNm = rOption.GetString();
break;
case HTML_O_BORDER:
- nBorder = (sal_uInt16)pOption->GetNumber();
+ nBorder = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_ISMAP:
bIsMap = sal_True;
break;
case HTML_O_USEMAP:
- aMap = pOption->GetString();
+ aMap = rOption.GetString();
break;
case HTML_O_NAME:
- sHTMLGrfName = pOption->GetString();
+ sHTMLGrfName = rOption.GetString();
break;
case HTML_O_SDONLOAD:
@@ -422,7 +422,7 @@ void SwHTMLParser::InsertImage()
goto IMAGE_SETEVENT;
IMAGE_SETEVENT:
{
- String sTmp( pOption->GetString() );
+ String sTmp( rOption.GetString() );
if( sTmp.Len() )
{
sTmp.ConvertLineEnd();
@@ -816,36 +816,36 @@ void SwHTMLParser::InsertBodyOptions()
String sDfltScriptType;
GetDefaultScriptType( eDfltScriptType, sDfltScriptType );
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
+ const HTMLOption& rOption = rHTMLOptions[--i];
ScriptType eScriptType2 = eDfltScriptType;
rtl::OUString aEvent;
sal_Bool bSetEvent = sal_False;
- switch( pOption->GetToken() )
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_BACKGROUND:
- aBackGround = pOption->GetString();
+ aBackGround = rOption.GetString();
break;
case HTML_O_BGCOLOR:
- pOption->GetColor( aBGColor );
+ rOption.GetColor( aBGColor );
bBGColor = sal_True;
break;
case HTML_O_TEXT:
- pOption->GetColor( aTextColor );
+ rOption.GetColor( aTextColor );
bTextColor = sal_True;
break;
case HTML_O_LINK:
- pOption->GetColor( aLinkColor );
+ rOption.GetColor( aLinkColor );
bLinkColor = sal_True;
break;
case HTML_O_VLINK:
- pOption->GetColor( aVLinkColor );
+ rOption.GetColor( aVLinkColor );
bVLinkColor = sal_True;
break;
@@ -881,20 +881,20 @@ void SwHTMLParser::InsertBodyOptions()
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
bTextColor = sal_True;
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
if( bSetEvent )
{
- const String& rEvent = pOption->GetString();
+ const String& rEvent = rOption.GetString();
if( rEvent.Len() )
InsertBasicDocEvent( aEvent, rEvent, eScriptType2,
sDfltScriptType );
@@ -1050,43 +1050,43 @@ void SwHTMLParser::NewAnchor()
String sDfltScriptType;
GetDefaultScriptType( eDfltScriptType, sDfltScriptType );
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
sal_uInt16 nEvent = 0;
ScriptType eScriptType2 = eDfltScriptType;
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_NAME:
- aName = pOption->GetString();
+ aName = rOption.GetString();
break;
case HTML_O_HREF:
- sHRef = pOption->GetString();
+ sHRef = rOption.GetString();
bHasHRef = sal_True;
break;
case HTML_O_TARGET:
- sTarget = pOption->GetString();
+ sTarget = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_SDFIXED:
bFixed = sal_True;
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
case HTML_O_SDONCLICK:
@@ -1108,7 +1108,7 @@ void SwHTMLParser::NewAnchor()
goto ANCHOR_SETEVENT;
ANCHOR_SETEVENT:
{
- String sTmp( pOption->GetString() );
+ String sTmp( rOption.GetString() );
if( sTmp.Len() )
{
sTmp.ConvertLineEnd();
@@ -1377,7 +1377,6 @@ void SwHTMLParser::StripTrailingPara()
const SwPaM aPaM(aNewPos);
pMarkAccess->repositionMark(ppMark->get(), aPaM);
}
- // <--
}
else if( nBookNdIdx > nNodeIdx )
break;
diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx
index 36cde4e703..93811d2a64 100644
--- a/sw/source/filter/html/htmlnum.cxx
+++ b/sw/source/filter/html/htmlnum.cxx
@@ -88,9 +88,7 @@ void SwHTMLNumRuleInfo::Set( const SwTxtNode& rTxtNd )
// Start value <USHRT_MAX> indicates, that at this text node the numbering
// is restarted with the value given at the corresponding level.
bRestart = rTxtNd.IsListRestart() && !rTxtNd.HasAttrListRestartValue();
- // <--
}
- // <--
else
{
pNumRule = 0;
@@ -151,7 +149,6 @@ void SwHTMLParser::NewNumBulList( int nToken )
{
aNumFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
}
- // <--
aNumFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aNumFmt.SetBulletChar( cBulletChar ); // das Bulletzeichen !!
nChrFmtPoolId = RES_POOLCHR_BUL_LEVEL;
@@ -183,23 +180,23 @@ void SwHTMLParser::NewNumBulList( int nToken )
String aId, aStyle, aClass, aBulletSrc, aLang, aDir;
sal_Int16 eVertOri = text::VertOrientation::NONE;
sal_uInt16 nWidth=USHRT_MAX, nHeight=USHRT_MAX;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_TYPE:
- if( bNewNumFmt && pOption->GetString().Len() )
+ if( bNewNumFmt && rOption.GetString().Len() )
{
switch( nToken )
{
case HTML_ORDERLIST_ON:
bChangeNumFmt = sal_True;
- switch( pOption->GetString().GetChar(0) )
+ switch( rOption.GetString().GetChar(0) )
{
case 'A': aNumFmt.SetNumberingType(SVX_NUM_CHARS_UPPER_LETTER); break;
case 'a': aNumFmt.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER); break;
@@ -210,7 +207,7 @@ void SwHTMLParser::NewNumBulList( int nToken )
break;
case HTML_UNORDERLIST_ON:
- aNumFmt.SetBulletChar( (sal_Unicode)pOption->GetEnum(
+ aNumFmt.SetBulletChar( (sal_Unicode)rOption.GetEnum(
aHTMLULTypeTable,aNumFmt.GetBulletChar() ) );
bChangeNumFmt = sal_True;
break;
@@ -219,7 +216,7 @@ void SwHTMLParser::NewNumBulList( int nToken )
break;
case HTML_O_START:
{
- sal_uInt16 nStart = (sal_uInt16)pOption->GetNumber();
+ sal_uInt16 nStart = (sal_uInt16)rOption.GetNumber();
if( bNewNumFmt )
{
aNumFmt.SetStart( nStart );
@@ -232,34 +229,34 @@ void SwHTMLParser::NewNumBulList( int nToken )
}
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
case HTML_O_SRC:
if( bNewNumFmt )
{
- aBulletSrc = pOption->GetString();
+ aBulletSrc = rOption.GetString();
if( !InternalImgToPrivateURL(aBulletSrc) )
aBulletSrc = URIHelper::SmartRel2Abs( INetURLObject( sBaseURL ), aBulletSrc, Link(), false );
}
break;
case HTML_O_WIDTH:
- nWidth = (sal_uInt16)pOption->GetNumber();
+ nWidth = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_HEIGHT:
- nHeight = (sal_uInt16)pOption->GetNumber();
+ nHeight = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_ALIGN:
eVertOri =
- (sal_Int16)pOption->GetEnum( aHTMLImgVAlignTable,
+ (sal_Int16)rOption.GetEnum( aHTMLImgVAlignTable,
static_cast< sal_uInt16 >(eVertOri) );
break;
}
@@ -357,7 +354,6 @@ void SwHTMLParser::NewNumBulList( int nToken )
pDoc->ChgNumRuleFmts( *rInfo.GetNumRule() );
bChangeNumFmt = sal_False;
}
- // <--
DoPositioning( aItemSet, aPropInfo, pCntxt );
@@ -434,7 +430,6 @@ void SwHTMLParser::EndNumBulList( int nToken )
{
aNumFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
}
- // <--
aNumFmt.SetBulletChar( cBulletChar );
}
aNumFmt.SetAbsLSpace( (i+1) * HTML_NUMBUL_MARGINLEFT );
@@ -458,7 +453,6 @@ void SwHTMLParser::EndNumBulList( int nToken )
{
// the next paragraph not numbered first
SetNodeNum( rInfo.GetLevel(), false );
- // <--
}
}
@@ -491,29 +485,29 @@ void SwHTMLParser::NewNumBulListItem( int nToken )
if( USHRT_MAX != nStart )
GetNumInfo().SetNodeStartValue( nLevel );
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_VALUE:
- nStart = (sal_uInt16)pOption->GetNumber();
+ nStart = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
}
@@ -543,7 +537,6 @@ void SwHTMLParser::NewNumBulListItem( int nToken )
{
aNumFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
}
- // <--
aNumFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
aNumFmt.SetBulletChar( cBulletChar ); // das Bulletzeichen !!
aNumFmt.SetCharFmt( pCSS1Parser->GetCharFmtFromPool(RES_POOLCHR_BUL_LEVEL) );
@@ -570,7 +563,6 @@ void SwHTMLParser::NewNumBulListItem( int nToken )
{
pTxtNode->SetCountedInList( bCountedInList );
}
- // <--
// #i57919#
// correction of refactoring done by cws swnumtree
// - <nStart> contains the start value, if the numbering has to be restarted
@@ -581,7 +573,6 @@ void SwHTMLParser::NewNumBulListItem( int nToken )
pTxtNode->SetListRestart( true );
pTxtNode->SetAttrListRestartValue( nStart );
}
- // <--
if( GetNumInfo().GetNumRule() )
GetNumInfo().GetNumRule()->SetInvalidRule( sal_True );
@@ -805,7 +796,7 @@ Writer& OutHTML_NumBulListStart( SwHTMLWriter& rWrt,
}
- DBG_ASSERT( rWrt.nLastParaToken == 0,
+ OSL_ENSURE( rWrt.nLastParaToken == 0,
"<PRE> wurde nicht vor <OL> beendet." );
sal_uInt16 nPrevDepth =
(bSameRule && !rInfo.IsRestart()) ? rPrevInfo.GetDepth() : 0;
@@ -918,7 +909,7 @@ Writer& OutHTML_NumBulListEnd( SwHTMLWriter& rWrt,
return rWrt;
}
- DBG_ASSERT( rWrt.nLastParaToken == 0,
+ OSL_ENSURE( rWrt.nLastParaToken == 0,
"<PRE> wurde nicht vor </OL> beendet." );
sal_uInt16 nNextDepth =
(bSameRule && !rNextInfo.IsRestart()) ? rNextInfo.GetDepth() : 0;
diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx
index 9a64e64c1e..31f8a01793 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -313,78 +313,77 @@ void SwHTMLParser::InsertEmbed()
sal_Int16 eVertOri = text::VertOrientation::NONE;
sal_Int16 eHoriOri = text::HoriOrientation::NONE;
SvCommandList aCmdLst;
- const HTMLOptions *pHTMLOptions = GetOptions();
+ const HTMLOptions& rHTMLOptions = GetOptions();
// Die Optionen werden vorwaerts gelesen, weil die Plugins sie in
// dieser Reihenfolge erwarten. Trotzdem darf immer nur der erste
// Wert einer Option beruecksichtigt werden.
- sal_uInt16 nArrLen = pHTMLOptions->Count();
- for( sal_uInt16 i=0; i<nArrLen; i++ )
+ for (size_t i = 0, n = rHTMLOptions.size(); i < n; ++i)
{
- const HTMLOption *pOption = (*pHTMLOptions)[i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_NAME:
- aName = pOption->GetString();
+ aName = rOption.GetString();
break;
case HTML_O_SRC:
if( !aURL.Len() )
- aURL = pOption->GetString();
+ aURL = rOption.GetString();
break;
case HTML_O_ALT:
- aAlt = pOption->GetString();
+ aAlt = rOption.GetString();
break;
case HTML_O_TYPE:
if( !aType.Len() )
- aType = pOption->GetString();
+ aType = rOption.GetString();
break;
case HTML_O_ALIGN:
if( eVertOri==text::VertOrientation::NONE && eHoriOri==text::HoriOrientation::NONE )
{
- eVertOri = pOption->GetEnum( aHTMLImgVAlignTable, eVertOri );
- eHoriOri = pOption->GetEnum( aHTMLImgHAlignTable, eHoriOri );
+ eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri );
+ eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri );
}
break;
case HTML_O_WIDTH:
if( USHRT_MAX==aSize.Width() )
{
- bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- aSize.Width() = (long)pOption->GetNumber();
+ bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ aSize.Width() = (long)rOption.GetNumber();
}
break;
case HTML_O_HEIGHT:
if( USHRT_MAX==aSize.Height() )
{
- bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- aSize.Height() = (long)pOption->GetNumber();
+ bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ aSize.Height() = (long)rOption.GetNumber();
}
break;
case HTML_O_HSPACE:
if( USHRT_MAX==aSpace.Width() )
- aSpace.Width() = (long)pOption->GetNumber();
+ aSpace.Width() = (long)rOption.GetNumber();
break;
case HTML_O_VSPACE:
if( USHRT_MAX==aSpace.Height() )
- aSpace.Height() = (long)pOption->GetNumber();
+ aSpace.Height() = (long)rOption.GetNumber();
break;
case HTML_O_UNKNOWN:
- if( pOption->GetTokenString().EqualsIgnoreCaseAscii( OOO_STRING_SW_HTML_O_Hidden ) )
+ if( rOption.GetTokenString().EqualsIgnoreCaseAscii( OOO_STRING_SW_HTML_O_Hidden ) )
bHidden =
- !pOption->GetString().EqualsIgnoreCaseAscii( sHTML_O_Hidden_False );
+ !rOption.GetString().EqualsIgnoreCaseAscii( sHTML_O_Hidden_False );
break;
}
// Es werden alle Parameter an das Plugin weitergereicht
- aCmdLst.Append( pOption->GetTokenString(), pOption->GetString() );
+ aCmdLst.Append( rOption.GetTokenString(), rOption.GetString() );
}
SfxItemSet aItemSet( pDoc->GetAttrPool(), pCSS1Parser->GetWhichMap() );
@@ -513,26 +512,26 @@ void SwHTMLParser::NewObject()
pAppletImpl = new SwApplet_Impl( pDoc->GetAttrPool(),
RES_FRMATR_BEGIN, RES_FRMATR_END-1 );
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_DECLARE:
bDeclare = sal_True;
break;
case HTML_O_CLASSID:
- aClassID = pOption->GetString();
+ aClassID = rOption.GetString();
break;
case HTML_O_CODEBASE:
break;
@@ -546,30 +545,30 @@ void SwHTMLParser::NewObject()
case HTML_O_UNKNOWN:
break;
case HTML_O_STANDBY:
- aStandBy = pOption->GetString();
+ aStandBy = rOption.GetString();
break;
case HTML_O_WIDTH:
- bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- aSize.Width() = (long)pOption->GetNumber();
+ bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ aSize.Width() = (long)rOption.GetNumber();
break;
case HTML_O_HEIGHT:
- bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- aSize.Height() = (long)pOption->GetNumber();
+ bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ aSize.Height() = (long)rOption.GetNumber();
break;
case HTML_O_ALIGN:
- eVertOri = pOption->GetEnum( aHTMLImgVAlignTable, eVertOri );
- eHoriOri = pOption->GetEnum( aHTMLImgHAlignTable, eHoriOri );
+ eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri );
+ eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri );
break;
case HTML_O_USEMAP:
break;
case HTML_O_NAME:
- aName = pOption->GetString();
+ aName = rOption.GetString();
break;
case HTML_O_HSPACE:
- aSpace.Width() = (long)pOption->GetNumber();
+ aSpace.Width() = (long)rOption.GetNumber();
break;
case HTML_O_VSPACE:
- aSpace.Height() = (long)pOption->GetNumber();
+ aSpace.Height() = (long)rOption.GetNumber();
break;
case HTML_O_BORDER:
break;
@@ -583,8 +582,8 @@ void SwHTMLParser::NewObject()
break;
}
// Es werden alle Parameter auch an das Applet weitergereicht
- pAppletImpl->AppendParam( pOption->GetTokenString(),
- pOption->GetString() );
+ pAppletImpl->AppendParam( rOption.GetTokenString(),
+ rOption.GetString() );
}
@@ -682,50 +681,50 @@ void SwHTMLParser::InsertApplet()
delete pAppletImpl;
pAppletImpl = new SwApplet_Impl( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 );
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_CODEBASE:
- aCodeBase = pOption->GetString();
+ aCodeBase = rOption.GetString();
break;
case HTML_O_CODE:
- aCode = pOption->GetString();
+ aCode = rOption.GetString();
break;
case HTML_O_NAME:
- aName = pOption->GetString();
+ aName = rOption.GetString();
break;
case HTML_O_ALT:
- aAlt = pOption->GetString();
+ aAlt = rOption.GetString();
break;
case HTML_O_ALIGN:
- eVertOri = pOption->GetEnum( aHTMLImgVAlignTable, eVertOri );
- eHoriOri = pOption->GetEnum( aHTMLImgHAlignTable, eHoriOri );
+ eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri );
+ eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri );
break;
case HTML_O_WIDTH:
- bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- aSize.Width() = (long)pOption->GetNumber();
+ bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ aSize.Width() = (long)rOption.GetNumber();
break;
case HTML_O_HEIGHT:
- bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- aSize.Height() = (long)pOption->GetNumber();
+ bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ aSize.Height() = (long)rOption.GetNumber();
break;
case HTML_O_HSPACE:
- aSpace.Width() = (long)pOption->GetNumber();
+ aSpace.Width() = (long)rOption.GetNumber();
break;
case HTML_O_VSPACE:
- aSpace.Height() = (long)pOption->GetNumber();
+ aSpace.Height() = (long)rOption.GetNumber();
break;
case HTML_O_MAYSCRIPT:
bMayScript = sal_True;
@@ -733,8 +732,8 @@ void SwHTMLParser::InsertApplet()
}
// Es werden alle Parameter auch an das Applet weitergereicht
- pAppletImpl->AppendParam( pOption->GetTokenString(),
- pOption->GetString() );
+ pAppletImpl->AppendParam( rOption.GetTokenString(),
+ rOption.GetString() );
}
if( !aCode.Len() )
@@ -807,17 +806,17 @@ void SwHTMLParser::InsertParam()
String aName, aValue;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_NAME:
- aName = pOption->GetString();
+ aName = rOption.GetString();
break;
case HTML_O_VALUE:
- aValue = pOption->GetString();
+ aValue = rOption.GetString();
break;
}
}
@@ -841,44 +840,43 @@ void SwHTMLParser::InsertFloatingFrame()
sal_Int16 eVertOri = text::VertOrientation::TOP;
sal_Int16 eHoriOri = text::HoriOrientation::NONE;
- const HTMLOptions *pHTMLOptions = GetOptions();
+ const HTMLOptions& rHTMLOptions = GetOptions();
// Erstmal die Optionen f?r das Writer-Frame-Format holen
- sal_uInt16 nArrLen = pHTMLOptions->Count();
- for ( sal_uInt16 i=0; i<nArrLen; i++ )
+ for (size_t i = 0, n = rHTMLOptions.size(); i < n; ++i)
{
- const HTMLOption *pOption = (*pHTMLOptions)[i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_ALT:
- aAlt = pOption->GetString();
+ aAlt = rOption.GetString();
break;
case HTML_O_ALIGN:
- eVertOri = pOption->GetEnum( aHTMLImgVAlignTable, eVertOri );
- eHoriOri = pOption->GetEnum( aHTMLImgHAlignTable, eHoriOri );
+ eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri );
+ eHoriOri = rOption.GetEnum( aHTMLImgHAlignTable, eHoriOri );
break;
case HTML_O_WIDTH:
- bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- aSize.Width() = (long)pOption->GetNumber();
+ bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ aSize.Width() = (long)rOption.GetNumber();
break;
case HTML_O_HEIGHT:
- bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- aSize.Height() = (long)pOption->GetNumber();
+ bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ aSize.Height() = (long)rOption.GetNumber();
break;
case HTML_O_HSPACE:
- aSpace.Width() = (long)pOption->GetNumber();
+ aSpace.Width() = (long)rOption.GetNumber();
break;
case HTML_O_VSPACE:
- aSpace.Height() = (long)pOption->GetNumber();
+ aSpace.Height() = (long)rOption.GetNumber();
break;
}
}
@@ -886,7 +884,7 @@ void SwHTMLParser::InsertFloatingFrame()
// und jetzt die fuer den SfxFrame
SfxFrameDescriptor aFrameDesc;
- SfxFrameHTMLParser::ParseFrameOptions( &aFrameDesc, pHTMLOptions, sBaseURL );
+ SfxFrameHTMLParser::ParseFrameOptions( &aFrameDesc, rHTMLOptions, sBaseURL );
// den Floating-Frame anlegen
comphelper::EmbeddedObjectContainer aCnt;
@@ -1171,8 +1169,8 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
SvCommandList aCommands;
aCommands.FillFromSequence( aProps );
- SvULongs aParams;
- sal_uLong i = aCommands.Count();
+ std::vector<sal_uLong> aParams;
+ size_t i = aCommands.size();
while( i > 0 )
{
const SvCommand& rCommand = aCommands[ --i ];
@@ -1188,7 +1186,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
}
else if( SWHTML_OPTTYPE_PARAM == nType )
{
- aParams.Insert( i, aParams.Count() );
+ aParams.push_back( i );
}
}
@@ -1196,7 +1194,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
rHTMLWrt.IncIndentLevel(); // Inhalt von Applet einruecken
- sal_uInt16 ii = aParams.Count();
+ sal_uInt16 ii = aParams.size();
while( ii > 0 )
{
const SvCommand& rCommand = aCommands[ aParams[--ii] ];
@@ -1213,7 +1211,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
}
rHTMLWrt.DecIndentLevel(); // Inhalt von Applet einruecken
- if( aCommands.Count() )
+ if( aCommands.size() )
rHTMLWrt.OutNewLine();
HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_applet, sal_False );
}
@@ -1228,7 +1226,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt,
SvCommandList aCommands;
aCommands.FillFromSequence( aProps );
- for( sal_uLong i=0; i<aCommands.Count(); i++ )
+ for( size_t i = 0; i < aCommands.size(); i++ )
{
const SvCommand& rCommand = aCommands[ i ];
const String& rName = rCommand.GetCommand();
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index 0c10a13fad..d5f526a69d 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -73,9 +73,6 @@
using namespace ::com::sun::star;
-
-/* */
-
void SwHTMLParser::NewDivision( int nToken )
{
String aId, aHRef, aStyle, aClass, aLang, aDir;
@@ -83,38 +80,38 @@ void SwHTMLParser::NewDivision( int nToken )
: SVX_ADJUST_END;
sal_Bool bHeader=sal_False, bFooter=sal_False;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_ALIGN:
if( HTML_DIVISION_ON==nToken )
- eAdjust = (SvxAdjust)pOption->GetEnum( aHTMLPAlignTable,
+ eAdjust = (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable,
static_cast< sal_uInt16 >(eAdjust) );
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
case HTML_O_HREF:
- aHRef = pOption->GetString();
+ aHRef = rOption.GetString();
break;
case HTML_O_TYPE:
{
- const String& rType = pOption->GetString();
+ const String& rType = rOption.GetString();
if( rType.EqualsIgnoreCaseAscii( "HEADER" ) )
bHeader = sal_True;
else if( rType.EqualsIgnoreCaseAscii( "FOOTER" ) )
@@ -547,8 +544,6 @@ sal_Bool SwHTMLParser::EndSections( sal_Bool bLFStripped )
return bSectionClosed;
}
-/* */
-
void SwHTMLParser::NewMultiCol()
{
String aId, aStyle, aClass, aLang, aDir;
@@ -556,40 +551,38 @@ void SwHTMLParser::NewMultiCol()
sal_uInt16 nCols = 0, nGutter = 10;
sal_Bool bPrcWidth = sal_True;
- const HTMLOptions *pHTMLOptions = GetOptions();
- sal_uInt16 i;
-
- for( i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
case HTML_O_COLS:
- nCols = (sal_uInt16)pOption->GetNumber();
+ nCols = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_WIDTH:
- nWidth = pOption->GetNumber();
- bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND);
+ nWidth = rOption.GetNumber();
+ bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND);
if( bPrcWidth && nWidth>100 )
nWidth = 100;
break;
case HTML_O_GUTTER:
- nGutter = (sal_uInt16)pOption->GetNumber();
+ nGutter = (sal_uInt16)rOption.GetNumber();
break;
}
@@ -600,7 +593,7 @@ void SwHTMLParser::NewMultiCol()
//.is the multicol elememt contained in a container? That may be the
// case for 5.0 documents.
sal_Bool bInCntnr = sal_False;
- i = aContexts.Count();
+ sal_uInt16 i = aContexts.Count();
while( !bInCntnr && i > nContextStMin )
bInCntnr = 0 != aContexts[--i]->GetFrmItemSet();
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index cffc6339f6..d4c1a1b899 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -86,10 +86,7 @@ static HTMLOptionEnum aHTMLTblVAlignTable[] =
{ 0, 0 }
};
-
-/* */
-
-// Die Optionen eines Table-Tags
+// table tags options
struct HTMLTableOptions
{
@@ -116,18 +113,16 @@ struct HTMLTableOptions
String aBGImage, aStyle, aId, aClass, aDir;
- HTMLTableOptions( const HTMLOptions *pOptions, SvxAdjust eParentAdjust );
+ HTMLTableOptions( const HTMLOptions& rOptions, SvxAdjust eParentAdjust );
};
-/* */
-
class _HTMLTableContext
{
- SwHTMLNumRuleInfo aNumRuleInfo; // Vor der Tabelle gueltige Numerierung
+ SwHTMLNumRuleInfo aNumRuleInfo; // Numbering valid before the table
- SwTableNode *pTblNd; // der Tabellen-Node
- SwFrmFmt *pFrmFmt; // der Fly frame::Frame, in dem die Tabelle steht
- SwPosition *pPos; // die Position hinter der Tabelle
+ SwTableNode *pTblNd; // table node
+ SwFrmFmt *pFrmFmt; // der Fly frame::Frame, containing the table
+ SwPosition *pPos; // position behind the table
sal_uInt16 nContextStAttrMin;
sal_uInt16 nContextStMin;
@@ -138,7 +133,7 @@ class _HTMLTableContext
public:
- _HTMLAttrTable aAttrTab; // und die Attribute
+ _HTMLAttrTable aAttrTab; // attributes
_HTMLTableContext( SwPosition *pPs, sal_uInt16 nCntxtStMin,
sal_uInt16 nCntxtStAttrMin ) :
@@ -176,16 +171,16 @@ public:
/* */
-// der Inhalt einer Zelle ist eine verkettete Liste mit SwStartNodes und
+// Cell content is a linked list with SwStartNodes and
// HTMLTables.
class HTMLTableCnts
{
- HTMLTableCnts *pNext; // der naechste Inhalt
+ HTMLTableCnts *pNext; // next content
- // von den beiden naechsten Pointern darf nur einer gesetzt sein!
- const SwStartNode *pStartNode; // ein Abastz
- HTMLTable *pTable; // eine Tabelle
+ // Only one of the next two pointers must be set!
+ const SwStartNode *pStartNode; // a paragraph
+ HTMLTable *pTable; // a table
SwHTMLTableLayoutCnts* pLayoutInfo;
@@ -198,17 +193,17 @@ public:
HTMLTableCnts( const SwStartNode* pStNd );
HTMLTableCnts( HTMLTable* pTab );
- ~HTMLTableCnts(); // nur in ~HTMLTableCell erlaubt
+ ~HTMLTableCnts(); // only allowed in ~HTMLTableCell
- // Ermitteln des SwStartNode bzw. der HTMLTable
+ // Determine SwStartNode and HTMLTable respectively
const SwStartNode *GetStartNode() const { return pStartNode; }
const HTMLTable *GetTable() const { return pTable; }
HTMLTable *GetTable() { return pTable; }
- // hinzufuegen eines neuen Knotens am Listenende
+ // Add a new node at the end of the list
void Add( HTMLTableCnts* pNewCnts );
- // Ermitteln des naechsten Knotens
+ // Determine next node
const HTMLTableCnts *Next() const { return pNext; }
HTMLTableCnts *Next() { return pNext; }
@@ -221,24 +216,23 @@ public:
/* */
-// Eine Zelle der HTML-Tabelle
-
+// Cell of a HTML table
class HTMLTableCell
{
- // !!!ACHTUNG!!!!! Fuer jeden neuen Pointer muss die SetProtected-
- // Methode (und natuerlich der Destruktor) bearbeitet werden.
- HTMLTableCnts *pContents; // der Inhalt der Zelle
- SvxBrushItem *pBGBrush; // Hintergrund der Zelle
- // !!!ACHTUNG!!!!!
+ // !!!ATTENTION!!!!! For each new pointer the SetProtected
+ // method (and the dtor) has to be executed.
+ HTMLTableCnts *pContents; // cell content
+ SvxBrushItem *pBGBrush; // cell background
+ // !!!ATTENTION!!!!!
sal_uInt32 nNumFmt;
- sal_uInt16 nRowSpan; // ROWSPAN der Zelle
- sal_uInt16 nColSpan; // COLSPAN der Zelle
- sal_uInt16 nWidth; // WIDTH der Zelle
+ sal_uInt16 nRowSpan; // cell ROWSPAN
+ sal_uInt16 nColSpan; // cell COLSPAN
+ sal_uInt16 nWidth; // cell WIDTH
double nValue;
- sal_Int16 eVertOri; // vertikale Ausrichtung der Zelle
- sal_Bool bProtected : 1; // Zelle darf nicht belegt werden
- sal_Bool bRelWidth : 1; // nWidth ist %-Angabe
+ sal_Int16 eVertOri; // vertical alignment of the cell
+ sal_Bool bProtected : 1; // cell must not filled
+ sal_Bool bRelWidth : 1; // nWidth is given in %
sal_Bool bHasNumFmt : 1;
sal_Bool bHasValue : 1;
sal_Bool bNoWrap : 1;
@@ -246,25 +240,25 @@ class HTMLTableCell
public:
- HTMLTableCell(); // neue Zellen sind immer leer
+ HTMLTableCell(); // new cells always empty
- ~HTMLTableCell(); // nur in ~HTMLTableRow erlaubt
+ ~HTMLTableCell(); // only allowed in ~HTMLTableRow
- // Belegen einer nicht-leeren Zelle
+ // Fill a not empty cell
void Set( HTMLTableCnts *pCnts, sal_uInt16 nRSpan, sal_uInt16 nCSpan,
sal_Int16 eVertOri, SvxBrushItem *pBGBrush,
sal_Bool bHasNumFmt, sal_uInt32 nNumFmt,
sal_Bool bHasValue, double nValue, sal_Bool bNoWrap, sal_Bool bCovered );
- // Schuetzen einer leeren 1x1-Zelle
+ // Protect an empty 1x1 cell
void SetProtected();
- // Setzen/Ermitteln des Inhalts einer Zelle
+ // Set/Get cell content
void SetContents( HTMLTableCnts *pCnts ) { pContents = pCnts; }
const HTMLTableCnts *GetContents() const { return pContents; }
HTMLTableCnts *GetContents() { return pContents; }
- // ROWSPAN/COLSPAN der Zelle Setzen/Ermitteln
+ // Set/Get cell ROWSPAN/COLSPAN
void SetRowSpan( sal_uInt16 nRSpan ) { nRowSpan = nRSpan; }
sal_uInt16 GetRowSpan() const { return nRowSpan; }
@@ -280,7 +274,7 @@ public:
sal_Int16 GetVertOri() const { return eVertOri; }
- // Ist die Zelle belegt oder geschuetzt?
+ // Is the cell filled or protected ?
sal_Bool IsUsed() const { return pContents!=0 || bProtected; }
SwHTMLTableLayoutCell *CreateLayoutInfo();
@@ -290,41 +284,38 @@ public:
/* */
-// Eine Zeile der HTML-Tabelle
-
+// Row of a HTML table
typedef HTMLTableCell* HTMLTableCellPtr;
SV_DECL_PTRARR_DEL(HTMLTableCells,HTMLTableCellPtr,5,5)
class HTMLTableRow
{
- HTMLTableCells *pCells; // die Zellen der Zeile
+ HTMLTableCells *pCells; // cells of the row
sal_Bool bIsEndOfGroup : 1;
sal_Bool bSplitable : 1;
- sal_uInt16 nHeight; // Optionen von <TR>/<TD>
- sal_uInt16 nEmptyRows; // wieviele Leere Zeilen folgen
+ sal_uInt16 nHeight; // options of <TR>/<TD>
+ sal_uInt16 nEmptyRows; // number of empty rows are following
SvxAdjust eAdjust;
sal_Int16 eVertOri;
- SvxBrushItem *pBGBrush; // Hintergrund der Zelle aus STYLE
+ SvxBrushItem *pBGBrush; // background of cell from STYLE
public:
- sal_Bool bBottomBorder; // kommt hinter der Zeile eine Linie?
+ sal_Bool bBottomBorder; // Is there a line after the row?
- HTMLTableRow( sal_uInt16 nCells=0 ); // die Zellen der Zeile sind leer
+ HTMLTableRow( sal_uInt16 nCells=0 ); // cells of the row are empty
~HTMLTableRow();
inline void SetHeight( sal_uInt16 nHeight );
sal_uInt16 GetHeight() const { return nHeight; }
- // Ermitteln einer Zelle
inline HTMLTableCell *GetCell( sal_uInt16 nCell ) const;
inline const HTMLTableCells *GetCells() const { return pCells; }
-
inline void SetAdjust( SvxAdjust eAdj ) { eAdjust = eAdj; }
inline SvxAdjust GetAdjust() const { return eAdjust; }
@@ -340,25 +331,23 @@ public:
void IncEmptyRows() { nEmptyRows++; }
sal_uInt16 GetEmptyRows() const { return nEmptyRows; }
- // Expandieren einer Zeile durch hinzufuegen leerer Zellen
+ // Expand row by adding empty cells
void Expand( sal_uInt16 nCells, sal_Bool bOneCell=sal_False );
- // Verkuerzen einer Zeile durch loesen von leeren Zellen
+ // Shrink row by deleting empty cells
void Shrink( sal_uInt16 nCells );
void SetSplitable( sal_Bool bSet ) { bSplitable = bSet; }
sal_Bool IsSplitable() const { return bSplitable; }
};
-/* */
-
-// Eine Spalte der HTML-Tabelle
+// Column of a HTML table
class HTMLTableColumn
{
sal_Bool bIsEndOfGroup;
- sal_uInt16 nWidth; // Optionen von <COL>
+ sal_uInt16 nWidth; // options of <COL>
sal_Bool bRelWidth;
SvxAdjust eAdjust;
@@ -371,7 +360,7 @@ class HTMLTableColumn
public:
- sal_Bool bLeftBorder; // kommt vor der Spalte eine Linie
+ sal_Bool bLeftBorder; // is there a line before the column
HTMLTableColumn();
@@ -394,10 +383,8 @@ public:
SwHTMLTableLayoutColumn *CreateLayoutInfo();
};
-/* */
-
-// eine HTML-Tabelle
+// HTML table
typedef HTMLTableRow* HTMLTableRowPtr;
SV_DECL_PTRARR_DEL(HTMLTableRows,HTMLTableRowPtr,5,5)
@@ -413,16 +400,15 @@ class HTMLTable
String aClass;
String aDir;
- SdrObjects *pResizeDrawObjs;// SDR-Objekte
- SvUShorts *pDrawObjPrcWidths; // Spalte des Zeichen-Objekts und dessen
- // relative Breite
+ SdrObjects *pResizeDrawObjs;// SDR objects
+ SvUShorts *pDrawObjPrcWidths; // column of draw object and its rel. width
- HTMLTableRows *pRows; // die Zeilen der Tabelle
- HTMLTableColumns *pColumns; // die Spalten der Tabelle
+ HTMLTableRows *pRows; // table rows
+ HTMLTableColumns *pColumns; // table columns
- sal_uInt16 nRows; // Anzahl Zeilen
- sal_uInt16 nCols; // Anzahl Spalten
- sal_uInt16 nFilledCols; // Anzahl tatsaechlich gefuellter Spalten
+ sal_uInt16 nRows; // number of rows
+ sal_uInt16 nCols; // number of columns
+ sal_uInt16 nFilledCols; // number of filled columns
sal_uInt16 nCurRow; // aktuelle Zeile
sal_uInt16 nCurCol; // aktuelle Spalte
@@ -3041,14 +3027,14 @@ SvxBrushItem* SwHTMLParser::CreateBrushItem( const Color *pColor,
{
String aClass( rClass );
SwCSS1Parser::GetScriptFromClass( aClass );
- SvxCSS1MapEntry *pClass = pCSS1Parser->GetClass( aClass );
+ const SvxCSS1MapEntry *pClass = pCSS1Parser->GetClass( aClass );
if( pClass )
aItemSet.Put( pClass->GetItemSet() );
}
if( rId.Len() )
{
- SvxCSS1MapEntry *pId = pCSS1Parser->GetId( rId );
+ const SvxCSS1MapEntry *pId = pCSS1Parser->GetId( rId );
if( pId )
aItemSet.Put( pId->GetItemSet() );
}
@@ -3241,71 +3227,71 @@ _CellSaveStruct::_CellSaveStruct( SwHTMLParser& rParser, HTMLTable *pCurTable,
if( bReadOpt )
{
- const HTMLOptions *pOptions = rParser.GetOptions();
- for( sal_uInt16 i = pOptions->Count(); i; )
+ const HTMLOptions& rOptions = rParser.GetOptions();
+ for (size_t i = rOptions.size(); i; )
{
- const HTMLOption *pOption = (*pOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_COLSPAN:
- nColSpan = (sal_uInt16)pOption->GetNumber();
+ nColSpan = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_ROWSPAN:
- nRowSpan = (sal_uInt16)pOption->GetNumber();
+ nRowSpan = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_ALIGN:
- eAdjust = (SvxAdjust)pOption->GetEnum(
+ eAdjust = (SvxAdjust)rOption.GetEnum(
aHTMLPAlignTable, static_cast< sal_uInt16 >(eAdjust) );
break;
case HTML_O_VALIGN:
- eVertOri = pOption->GetEnum(
+ eVertOri = rOption.GetEnum(
aHTMLTblVAlignTable, eVertOri );
break;
case HTML_O_WIDTH:
- nWidth = (sal_uInt16)pOption->GetNumber(); // nur fuer Netscape
- bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND);
+ nWidth = (sal_uInt16)rOption.GetNumber(); // nur fuer Netscape
+ bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND);
if( bPrcWidth && nWidth>100 )
nWidth = 100;
break;
case HTML_O_HEIGHT:
- nHeight = (sal_uInt16)pOption->GetNumber(); // nur fuer Netscape
- if( pOption->GetString().Search('%') != STRING_NOTFOUND)
+ nHeight = (sal_uInt16)rOption.GetNumber(); // nur fuer Netscape
+ if( rOption.GetString().Search('%') != STRING_NOTFOUND)
nHeight = 0; // keine %-Angaben beruecksichtigen
break;
case HTML_O_BGCOLOR:
// Leere BGCOLOR bei <TABLE>, <TR> und <TD>/<TH> wie Netscape
// ignorieren, bei allen anderen Tags *wirklich* nicht.
- if( pOption->GetString().Len() )
+ if( rOption.GetString().Len() )
{
- pOption->GetColor( aBGColor );
+ rOption.GetColor( aBGColor );
bBGColor = sal_True;
}
break;
case HTML_O_BACKGROUND:
- aBGImage = pOption->GetString();
+ aBGImage = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
case HTML_O_SDNUM:
- aNumFmt = pOption->GetString();
+ aNumFmt = rOption.GetString();
bHasNumFmt = sal_True;
break;
case HTML_O_SDVAL:
bHasValue = sal_True;
- aValue = pOption->GetString();
+ aValue = rOption.GetString();
break;
case HTML_O_NOWRAP:
bNoWrap = sal_True;
@@ -3988,14 +3974,14 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, sal_Bool bReadOptions,
// Diese Schleife muss vorwartes sein, weil die
// erste Option immer gewinnt.
sal_Bool bNeedsSection = sal_False;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i=0; i<pHTMLOptions->Count(); i++ )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = 0; i < rHTMLOptions.size(); ++i)
{
- const HTMLOption *pOption = (*pHTMLOptions)[i];
- if( HTML_O_ALIGN==pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[i];
+ if( HTML_O_ALIGN==rOption.GetToken() )
{
SvxAdjust eAdjust =
- (SvxAdjust)pOption->GetEnum(
+ (SvxAdjust)rOption.GetEnum(
aHTMLPAlignTable, SVX_ADJUST_END );
bNeedsSection = SVX_ADJUST_LEFT == eAdjust ||
SVX_ADJUST_RIGHT == eAdjust;
@@ -4287,40 +4273,40 @@ void SwHTMLParser::BuildTableRow( HTMLTable *pCurTable, sal_Bool bReadOptions,
if( bReadOptions )
{
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_ALIGN:
- eAdjust = (SvxAdjust)pOption->GetEnum(
+ eAdjust = (SvxAdjust)rOption.GetEnum(
aHTMLPAlignTable, static_cast< sal_uInt16 >(eAdjust) );
break;
case HTML_O_VALIGN:
- eVertOri = pOption->GetEnum(
+ eVertOri = rOption.GetEnum(
aHTMLTblVAlignTable, eVertOri );
break;
case HTML_O_BGCOLOR:
// Leere BGCOLOR bei <TABLE>, <TR> und <TD>/<TH> wie Netsc.
// ignorieren, bei allen anderen Tags *wirklich* nicht.
- if( pOption->GetString().Len() )
+ if( rOption.GetString().Len() )
{
- pOption->GetColor( aBGColor );
+ rOption.GetColor( aBGColor );
bBGColor = sal_True;
}
break;
case HTML_O_BACKGROUND:
- aBGImage = pOption->GetString();
+ aBGImage = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass= pOption->GetString();
+ aClass= rOption.GetString();
break;
}
}
@@ -4486,23 +4472,23 @@ void SwHTMLParser::BuildTableSection( HTMLTable *pCurTable,
if( bReadOptions )
{
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- InsertBookmark( pOption->GetString() );
+ InsertBookmark( rOption.GetString() );
break;
case HTML_O_ALIGN:
pSaveStruct->eAdjust =
- (SvxAdjust)pOption->GetEnum( aHTMLPAlignTable,
+ (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable,
static_cast< sal_uInt16 >(pSaveStruct->eAdjust) );
break;
case HTML_O_VALIGN:
pSaveStruct->eVertOri =
- pOption->GetEnum( aHTMLTblVAlignTable,
+ rOption.GetEnum( aHTMLTblVAlignTable,
pSaveStruct->eVertOri );
break;
}
@@ -4674,31 +4660,31 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable,
pSaveStruct = new _TblColGrpSaveStruct;
if( bReadOptions )
{
- const HTMLOptions *pColGrpOptions = GetOptions();
- for( sal_uInt16 i = pColGrpOptions->Count(); i; )
+ const HTMLOptions& rColGrpOptions = GetOptions();
+ for (size_t i = rColGrpOptions.size(); i; )
{
- const HTMLOption *pColGrpOption = (*pColGrpOptions)[--i];
- switch( pColGrpOption->GetToken() )
+ const HTMLOption& rOption = rColGrpOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- InsertBookmark( pColGrpOption->GetString() );
+ InsertBookmark( rOption.GetString() );
break;
case HTML_O_SPAN:
- pSaveStruct->nColGrpSpan = (sal_uInt16)pColGrpOption->GetNumber();
+ pSaveStruct->nColGrpSpan = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_WIDTH:
- pSaveStruct->nColGrpWidth = (sal_uInt16)pColGrpOption->GetNumber();
+ pSaveStruct->nColGrpWidth = (sal_uInt16)rOption.GetNumber();
pSaveStruct->bRelColGrpWidth =
- (pColGrpOption->GetString().Search('*') != STRING_NOTFOUND);
+ (rOption.GetString().Search('*') != STRING_NOTFOUND);
break;
case HTML_O_ALIGN:
pSaveStruct->eColGrpAdjust =
- (SvxAdjust)pColGrpOption->GetEnum( aHTMLPAlignTable,
+ (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable,
static_cast< sal_uInt16 >(pSaveStruct->eColGrpAdjust) );
break;
case HTML_O_VALIGN:
pSaveStruct->eColGrpVertOri =
- pColGrpOption->GetEnum( aHTMLTblVAlignTable,
+ rOption.GetEnum( aHTMLTblVAlignTable,
pSaveStruct->eColGrpVertOri );
break;
}
@@ -4757,31 +4743,31 @@ void SwHTMLParser::BuildTableColGroup( HTMLTable *pCurTable,
SvxAdjust eColAdjust = pSaveStruct->eColGrpAdjust;
sal_Int16 eColVertOri = pSaveStruct->eColGrpVertOri;
- const HTMLOptions *pColOptions = GetOptions();
- for( sal_uInt16 i = pColOptions->Count(); i; )
+ const HTMLOptions& rColOptions = GetOptions();
+ for (size_t i = rColOptions.size(); i; )
{
- const HTMLOption *pColOption = (*pColOptions)[--i];
- switch( pColOption->GetToken() )
+ const HTMLOption& rOption = rColOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- InsertBookmark( pColOption->GetString() );
+ InsertBookmark( rOption.GetString() );
break;
case HTML_O_SPAN:
- nColSpan = (sal_uInt16)pColOption->GetNumber();
+ nColSpan = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_WIDTH:
- nColWidth = (sal_uInt16)pColOption->GetNumber();
+ nColWidth = (sal_uInt16)rOption.GetNumber();
bRelColWidth =
- (pColOption->GetString().Search('*') != STRING_NOTFOUND);
+ (rOption.GetString().Search('*') != STRING_NOTFOUND);
break;
case HTML_O_ALIGN:
eColAdjust =
- (SvxAdjust)pColOption->GetEnum( aHTMLPAlignTable,
+ (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable,
static_cast< sal_uInt16 >(eColAdjust) );
break;
case HTML_O_VALIGN:
eColVertOri =
- pColOption->GetEnum( aHTMLTblVAlignTable,
+ rOption.GetEnum( aHTMLTblVAlignTable,
eColVertOri );
break;
}
@@ -4902,13 +4888,13 @@ void SwHTMLParser::BuildTableCaption( HTMLTable *pCurTable )
}
sal_Bool bTop = sal_True;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for ( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for ( size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- if( HTML_O_ALIGN == pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ if( HTML_O_ALIGN == rOption.GetToken() )
{
- if( pOption->GetString().EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_VA_bottom))
+ if( rOption.GetString().EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_VA_bottom))
bTop = sal_False;
}
}
@@ -5114,7 +5100,7 @@ void _TblSaveStruct::MakeTable( sal_uInt16 nWidth, SwPosition& rPos, SwDoc *pDoc
}
-HTMLTableOptions::HTMLTableOptions( const HTMLOptions *pOptions,
+HTMLTableOptions::HTMLTableOptions( const HTMLOptions& rOptions,
SvxAdjust eParentAdjust ) :
nCols( 0 ),
nWidth( 0 ), nHeight( 0 ),
@@ -5131,38 +5117,38 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions *pOptions,
sal_Bool bBorderColor = sal_False;
sal_Bool bHasFrame = sal_False, bHasRules = sal_False;
- for( sal_uInt16 i = pOptions->Count(); i; )
+ for (size_t i = rOptions.size(); i; )
{
- const HTMLOption *pOption = (*pOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_COLS:
- nCols = (sal_uInt16)pOption->GetNumber();
+ nCols = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_WIDTH:
- nWidth = (sal_uInt16)pOption->GetNumber();
- bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND);
+ nWidth = (sal_uInt16)rOption.GetNumber();
+ bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND);
if( bPrcWidth && nWidth>100 )
nWidth = 100;
break;
case HTML_O_HEIGHT:
- nHeight = (sal_uInt16)pOption->GetNumber();
- if( pOption->GetString().Search('%') != STRING_NOTFOUND )
+ nHeight = (sal_uInt16)rOption.GetNumber();
+ if( rOption.GetString().Search('%') != STRING_NOTFOUND )
nHeight = 0; // keine %-Anagben benutzen!!!
break;
case HTML_O_CELLPADDING:
- nCellPadding = (sal_uInt16)pOption->GetNumber();
+ nCellPadding = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_CELLSPACING:
- nCellSpacing = (sal_uInt16)pOption->GetNumber();
+ nCellSpacing = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_ALIGN:
{
sal_uInt16 nAdjust = static_cast< sal_uInt16 >(eAdjust);
- if( pOption->GetEnum( nAdjust, aHTMLPAlignTable ) )
+ if( rOption.GetEnum( nAdjust, aHTMLPAlignTable ) )
{
eAdjust = (SvxAdjust)nAdjust;
bTableAdjust = sal_True;
@@ -5170,13 +5156,13 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions *pOptions,
}
break;
case HTML_O_VALIGN:
- eVertOri = pOption->GetEnum( aHTMLTblVAlignTable, eVertOri );
+ eVertOri = rOption.GetEnum( aHTMLTblVAlignTable, eVertOri );
break;
case HTML_O_BORDER:
// BORDER und BORDER=BORDER wie BORDER=1 behandeln
- if( pOption->GetString().Len() &&
- !pOption->GetString().EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_O_border) )
- nBorder = (sal_uInt16)pOption->GetNumber();
+ if( rOption.GetString().Len() &&
+ !rOption.GetString().EqualsIgnoreCaseAscii(OOO_STRING_SVTOOLS_HTML_O_border) )
+ nBorder = (sal_uInt16)rOption.GetNumber();
else
nBorder = 1;
@@ -5186,47 +5172,47 @@ HTMLTableOptions::HTMLTableOptions( const HTMLOptions *pOptions,
eRules = ( nBorder ? HTML_TR_ALL : HTML_TR_NONE );
break;
case HTML_O_FRAME:
- eFrame = pOption->GetTableFrame();
+ eFrame = rOption.GetTableFrame();
bHasFrame = sal_True;
break;
case HTML_O_RULES:
- eRules = pOption->GetTableRules();
+ eRules = rOption.GetTableRules();
bHasRules = sal_True;
break;
case HTML_O_BGCOLOR:
// Leere BGCOLOR bei <TABLE>, <TR> und <TD>/<TH> wie Netscape
// ignorieren, bei allen anderen Tags *wirklich* nicht.
- if( pOption->GetString().Len() )
+ if( rOption.GetString().Len() )
{
- pOption->GetColor( aBGColor );
+ rOption.GetColor( aBGColor );
bBGColor = sal_True;
}
break;
case HTML_O_BACKGROUND:
- aBGImage = pOption->GetString();
+ aBGImage = rOption.GetString();
break;
case HTML_O_BORDERCOLOR:
- pOption->GetColor( aBorderColor );
+ rOption.GetColor( aBorderColor );
bBorderColor = sal_True;
break;
case HTML_O_BORDERCOLORDARK:
if( !bBorderColor )
- pOption->GetColor( aBorderColor );
+ rOption.GetColor( aBorderColor );
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
case HTML_O_HSPACE:
- nHSpace = (sal_uInt16)pOption->GetNumber();
+ nHSpace = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_VSPACE:
- nVSpace = (sal_uInt16)pOption->GetNumber();
+ nVSpace = (sal_uInt16)rOption.GetNumber();
break;
}
}
diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx
index f4dc79a0dc..0b277f9477 100644
--- a/sw/source/filter/html/parcss1.cxx
+++ b/sw/source/filter/html/parcss1.cxx
@@ -34,7 +34,6 @@
#include <stdio.h>
#include <limits.h>
#include <rtl/ustrbuf.hxx>
-#include <tools/debug.hxx>
#include <vcl/svapp.hxx>
#include <svtools/htmltokn.h>
@@ -54,7 +53,7 @@
#define LOOP_CHECK_RESTART \
nOldInPos = STRING_MAXLEN;
#define LOOP_CHECK_CHECK( where ) \
- DBG_ASSERT( nOldInPos!=nInPos || cNextCh==(sal_Unicode)EOF, where ); \
+ OSL_ENSURE( nOldInPos!=nInPos || cNextCh==(sal_Unicode)EOF, where ); \
if( nOldInPos==nInPos && cNextCh!=(sal_Unicode)EOF ) \
break; \
else \
@@ -462,7 +461,7 @@ CSS1Token CSS1Parser::GetNextToken()
}
double nScale = 0.0;
- DBG_ASSERT( pCmp1, "Wo kommt das erste Zeichen her?" );
+ OSL_ENSURE( pCmp1, "Wo kommt das erste Zeichen her?" );
if( aIdent.EqualsIgnoreCaseAscii(pCmp1) )
{
nScale = nScale1;
@@ -966,7 +965,7 @@ CSS1Selector *CSS1Parser::ParseSelector()
// falls ein Selektor angelegt wurd, ihn speichern
if( pNew )
{
- DBG_ASSERT( (pRoot!=0) == (pLast!=0),
+ OSL_ENSURE( (pRoot!=0) == (pLast!=0),
"Root-Selektor, aber kein Last" );
if( pLast )
pLast->SetNext( pNew );
@@ -1113,7 +1112,7 @@ CSS1Expression *CSS1Parser::ParseDeclaration( String& rProperty )
// falls ein Expression angelegt wurde, diesen speichern
if( pNew )
{
- DBG_ASSERT( (pRoot!=0) == (pLast!=0),
+ OSL_ENSURE( (pRoot!=0) == (pLast!=0),
"Root-Selektor, aber kein Last" );
if( pLast )
pLast->SetNext( pNew );
@@ -1231,10 +1230,10 @@ sal_Bool CSS1Parser::ParseStyleOption( const String& rIn )
return sal_True;
}
-sal_Bool CSS1Parser::SelectorParsed( const CSS1Selector * /* pSelector */, sal_Bool /*bFirst*/ )
+bool CSS1Parser::SelectorParsed( CSS1Selector* /* pSelector */, bool /*bFirst*/ )
{
// Selektor loeschen
- return sal_True;
+ return true;
}
sal_Bool CSS1Parser::DeclarationParsed( const String& /*rProperty*/,
@@ -1250,8 +1249,6 @@ CSS1Selector::~CSS1Selector()
delete pNext;
}
-/* */
-
CSS1Expression::~CSS1Expression()
{
delete pNext;
@@ -1259,9 +1256,9 @@ CSS1Expression::~CSS1Expression()
sal_Bool CSS1Expression::GetURL( String& rURL ) const
{
- DBG_ASSERT( CSS1_URL==eType, "CSS1-Ausruck ist keine Farbe URL" );
+ OSL_ENSURE( CSS1_URL==eType, "CSS1-Ausruck ist keine Farbe URL" );
- DBG_ASSERT( aValue.CompareIgnoreCaseToAscii( sCSS1_url, 3 ) ==
+ OSL_ENSURE( aValue.CompareIgnoreCaseToAscii( sCSS1_url, 3 ) ==
COMPARE_EQUAL &&
aValue.Len() > 5 &&
'(' == aValue.GetChar(3) &&
@@ -1283,12 +1280,12 @@ sal_Bool CSS1Expression::GetURL( String& rURL ) const
sal_Bool CSS1Expression::GetColor( Color &rColor ) const
{
- DBG_ASSERT( CSS1_IDENT==eType || CSS1_RGB==eType ||
+ OSL_ENSURE( CSS1_IDENT==eType || CSS1_RGB==eType ||
CSS1_HEXCOLOR==eType || CSS1_STRING==eType,
"CSS1-Ausruck kann keine Farbe sein" );
sal_Bool bRet = sal_False;
- sal_uLong nColor = ULONG_MAX;
+ sal_uInt32 nColor = SAL_MAX_UINT32;
switch( eType )
{
@@ -1296,7 +1293,7 @@ sal_Bool CSS1Expression::GetColor( Color &rColor ) const
{
sal_uInt8 aColors[3] = { 0, 0, 0 };
- DBG_ASSERT( aValue.CompareIgnoreCaseToAscii( sCSS1_rgb, 3 )
+ OSL_ENSURE( aValue.CompareIgnoreCaseToAscii( sCSS1_rgb, 3 )
== COMPARE_EQUAL &&
aValue.Len() > 5 &&
'(' == aValue.GetChar( 3 ) &&
@@ -1358,7 +1355,7 @@ sal_Bool CSS1Expression::GetColor( Color &rColor ) const
String aTmp( aValue );
aTmp.ToUpperAscii();
nColor = GetHTMLColor( aTmp );
- bRet = nColor != ULONG_MAX;
+ bRet = nColor != SAL_MAX_UINT32;
}
if( bRet || CSS1_STRING != eType || !aValue.Len() ||
aValue.GetChar( 0 )!='#' )
@@ -1403,7 +1400,7 @@ sal_Bool CSS1Expression::GetColor( Color &rColor ) const
}
- if( bRet && nColor!=ULONG_MAX )
+ if( bRet && nColor!=SAL_MAX_UINT32 )
{
rColor.SetRed( (sal_uInt8)((nColor & 0x00ff0000UL) >> 16) );
rColor.SetGreen( (sal_uInt8)((nColor & 0x0000ff00UL) >> 8) );
diff --git a/sw/source/filter/html/parcss1.hxx b/sw/source/filter/html/parcss1.hxx
index 3a6fa46e69..f12dea4cba 100644
--- a/sw/source/filter/html/parcss1.hxx
+++ b/sw/source/filter/html/parcss1.hxx
@@ -33,8 +33,6 @@
class Color;
-/* */
-
// Die Tokens des CSS1-Parsers
enum CSS1Token
{
@@ -74,7 +72,6 @@ enum CSS1Token
CSS1_RGB
};
-
// die Zustaende des Parsers
enum CSS1ParserState
{
@@ -83,9 +80,6 @@ enum CSS1ParserState
CSS1_PAR_ERROR
};
-
-/* */
-
enum CSS1SelectorType
{
CSS1_SELTYPE_ELEMENT,
@@ -130,9 +124,6 @@ public:
const CSS1Selector *GetNext() const { return pNext; }
};
-
-/* */
-
// Die folegende Klasse beschreibt einen Teil-Ausdruck einer
// CSS1-Deklaration sie besteht aus
//
@@ -193,8 +184,6 @@ inline sal_Int32 CSS1Expression::GetSLength() const
return (sal_Int32)(nValue + (nValue < 0. ? -.5 : .5 ));
}
-/* */
-
// Diese Klasse parst den Inhalt eines Style-Elements oder eine Style-Option
// und bereitet ihn ein wenig auf.
//
@@ -270,8 +259,7 @@ protected:
// Deklaration. Wird sal_True zurueckgegeben, wird der Selektor
// geloscht, sonst nicht.
// Die Implementierung dieser Methode gibt nur sal_True zuruck.
- virtual sal_Bool SelectorParsed( const CSS1Selector *pSelector,
- sal_Bool bFirst );
+ virtual bool SelectorParsed( CSS1Selector* pSelector, bool bFirst );
// Diese Methode wird fuer jede geparsete Property aufgerufen. Wird
// sal_True zurueckgegeben wird der Selektor geloscht, sonst nicht.
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index e1c7567c66..a80243b70d 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -65,17 +65,14 @@
#include "css1kywd.hxx"
#include "svxcss1.hxx"
+#include <memory>
+
// die Funktionen zum Parsen einer CSS1-Property sind von folgendem Typ:
typedef void (*FnParseCSS1Prop)( const CSS1Expression *pExpr,
SfxItemSet& rItemSet,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& rParser );
-SV_IMPL_PTRARR( CSS1Selectors, CSS1Selector* )
-
-
-/* */
-
static CSS1PropertyEnum const aFontSizeTable[] =
{
{ sCSS1_PV_xx_small, 0 },
@@ -128,6 +125,14 @@ static CSS1PropertyEnum const aFontVariantTable[] =
{ 0, 0 }
};
+static CSS1PropertyEnum const aTextTransformTable[] =
+{
+ { sCSS1_PV_uppercase, SVX_CASEMAP_VERSALIEN },
+ { sCSS1_PV_lowercase, SVX_CASEMAP_GEMEINE },
+ { sCSS1_PV_capitalize, SVX_CASEMAP_TITEL },
+ { 0, 0 }
+};
+
static CSS1PropertyEnum const aDirectionTable[] =
{
{ sCSS1_PV_ltr, FRMDIR_HORI_LEFT_TOP },
@@ -136,8 +141,6 @@ static CSS1PropertyEnum const aDirectionTable[] =
{ 0, 0 }
};
-/* */
-
static CSS1PropertyEnum const aBGRepeatTable[] =
{
{ sCSS1_PV_repeat, GPOS_TILED },
@@ -163,8 +166,6 @@ static CSS1PropertyEnum const aBGVertPosTable[] =
{ 0, 0 }
};
-/* */
-
static CSS1PropertyEnum const aTextAlignTable[] =
{
{ sCSS1_PV_left, SVX_ADJUST_LEFT },
@@ -174,8 +175,6 @@ static CSS1PropertyEnum const aTextAlignTable[] =
{ 0, 0 }
};
-/* */
-
static CSS1PropertyEnum const aBorderWidthTable[] =
{
{ sCSS1_PV_thin, 0 }, // DEF_LINE_WIDTH_0 / DEF_DOUBLE_LINE0
@@ -237,8 +236,6 @@ static CSS1PropertyEnum const aPageBreakTable[] =
// /Feature: PrintExt
-/* */
-
static sal_uInt16 const aBorderWidths[] =
{
DEF_LINE_WIDTH_0,
@@ -249,8 +246,6 @@ static sal_uInt16 const aBorderWidths[] =
#undef SBORDER_ENTRY
#undef DBORDER_ENTRY
-/* */
-
struct SvxCSS1ItemIds
{
sal_uInt16 nFont;
@@ -368,9 +363,6 @@ void SvxCSS1BorderInfo::SetBorderLine( sal_uInt16 nLine, SvxBoxItem &rBoxItem )
rBoxItem.SetLine( &aBorderLine, nLine );
}
-
-/* */
-
SvxCSS1PropertyInfo::SvxCSS1PropertyInfo()
{
for( sal_uInt16 i=0; i<4; i++ )
@@ -675,9 +667,6 @@ void SvxCSS1PropertyInfo::SetBoxItem( SfxItemSet& rItemSet,
DestroyBorderInfos();
}
-
-/* */
-
SvxCSS1MapEntry::SvxCSS1MapEntry( const String& rKey, const SfxItemSet& rItemSet,
const SvxCSS1PropertyInfo& rProp ) :
aKey( rKey ),
@@ -700,10 +689,6 @@ sal_Bool operator<( const SvxCSS1MapEntry& rE1, const SvxCSS1MapEntry& rE2 )
}
#endif
-SV_IMPL_OP_PTRARR_SORT( SvxCSS1Map, SvxCSS1MapEntryPtr )
-
-/* */
-
sal_Bool SvxCSS1Parser::StyleParsed( const CSS1Selector * /*pSelector*/,
SfxItemSet& /*rItemSet*/,
SvxCSS1PropertyInfo& /*rPropInfo*/ )
@@ -712,38 +697,33 @@ sal_Bool SvxCSS1Parser::StyleParsed( const CSS1Selector * /*pSelector*/,
return sal_True;
}
-sal_Bool SvxCSS1Parser::SelectorParsed( const CSS1Selector *pSelector,
- sal_Bool bFirst )
+bool SvxCSS1Parser::SelectorParsed( CSS1Selector *pSelector, bool bFirst )
{
if( bFirst )
{
- DBG_ASSERT( pSheetItemSet, "Where is the Item-Set for Style-Sheets?" );
+ OSL_ENSURE( pSheetItemSet, "Where is the Item-Set for Style-Sheets?" );
- // Dieses ist der erste Selektor einer Rule, also muessen
- // die bisher geparsten Items auf die Styles verteilt werden
-// pSheetPropInfo->CreateBoxItem( *pSheetItemSet, GetDfltBorderDist() );
- for( sal_uInt16 i=0; i<aSelectors.Count(); i++ )
+ for (size_t i = 0; i < aSelectors.size(); ++i)
{
- StyleParsed( aSelectors[i], *pSheetItemSet, *pSheetPropInfo );
+ StyleParsed( &aSelectors[i], *pSheetItemSet, *pSheetPropInfo );
}
pSheetItemSet->ClearItem();
pSheetPropInfo->Clear();
// und die naechste Rule vorbereiten
- if( aSelectors.Count() )
- aSelectors.DeleteAndDestroy( 0, aSelectors.Count() );
+ aSelectors.clear();
}
- aSelectors.C40_INSERT( CSS1Selector, pSelector, aSelectors.Count() );
+ aSelectors.push_back(pSelector);
- return sal_False; // den Selektor haben wir gespeichert. Loeschen toedlich!
+ return false; // den Selektor haben wir gespeichert. Loeschen toedlich!
}
sal_Bool SvxCSS1Parser::DeclarationParsed( const String& rProperty,
const CSS1Expression *pExpr )
{
- DBG_ASSERT( pExpr, "DeclarationParsed() without Expression" );
+ OSL_ENSURE( pExpr, "DeclarationParsed() without Expression" );
if( !pExpr )
return sal_True;
@@ -822,8 +802,65 @@ SvxCSS1Parser::~SvxCSS1Parser()
delete pSearchEntry;
}
+void SvxCSS1Parser::InsertId( const String& rId,
+ const SfxItemSet& rItemSet,
+ const SvxCSS1PropertyInfo& rProp )
+{
+ InsertMapEntry( rId, rItemSet, rProp, aIds );
+}
-/* */
+const SvxCSS1MapEntry* SvxCSS1Parser::GetId( const String& rId ) const
+{
+ CSS1Map::const_iterator itr = aIds.find(rId);
+ return itr == aIds.end() ? NULL : itr->second;
+}
+
+void SvxCSS1Parser::InsertClass( const String& rClass,
+ const SfxItemSet& rItemSet,
+ const SvxCSS1PropertyInfo& rProp )
+{
+ InsertMapEntry( rClass, rItemSet, rProp, aClasses );
+}
+
+const SvxCSS1MapEntry* SvxCSS1Parser::GetClass( const String& rClass ) const
+{
+ CSS1Map::const_iterator itr = aClasses.find(rClass);
+ return itr == aClasses.end() ? NULL : itr->second;
+}
+
+void SvxCSS1Parser::InsertPage( const String& rPage,
+ sal_Bool bPseudo,
+ const SfxItemSet& rItemSet,
+ const SvxCSS1PropertyInfo& rProp )
+{
+ String aKey( rPage );
+ if( bPseudo )
+ aKey.Insert( ':', 0 );
+ InsertMapEntry( aKey, rItemSet, rProp, aPages );
+}
+
+SvxCSS1MapEntry* SvxCSS1Parser::GetPage( const String& rPage, bool bPseudo )
+{
+ String aKey( rPage );
+ if( bPseudo )
+ aKey.Insert( ':', 0 );
+
+ CSS1Map::iterator itr = aPages.find(aKey);
+ return itr == aPages.end() ? NULL : itr->second;
+}
+
+void SvxCSS1Parser::InsertTag( const String& rTag,
+ const SfxItemSet& rItemSet,
+ const SvxCSS1PropertyInfo& rProp )
+{
+ InsertMapEntry( rTag, rItemSet, rProp, aTags );
+}
+
+SvxCSS1MapEntry* SvxCSS1Parser::GetTag( const String& rTag )
+{
+ CSS1Map::iterator itr = aTags.find(rTag);
+ return itr == aTags.end() ? NULL : itr->second;
+}
sal_Bool SvxCSS1Parser::ParseStyleSheet( const String& rIn )
{
@@ -832,14 +869,13 @@ sal_Bool SvxCSS1Parser::ParseStyleSheet( const String& rIn )
sal_Bool bSuccess = CSS1Parser::ParseStyleSheet( rIn );
- for( sal_uInt16 i=0; i<aSelectors.Count(); i++ )
+ for (size_t i = 0; i < aSelectors.size(); ++i)
{
- StyleParsed( aSelectors[i], *pSheetItemSet, *pSheetPropInfo );
+ StyleParsed( &aSelectors[i], *pSheetItemSet, *pSheetPropInfo );
}
// und etwas aufrauemen
- if( aSelectors.Count() )
- aSelectors.DeleteAndDestroy( 0, aSelectors.Count() );
+ aSelectors.clear();
pSheetItemSet->ClearItem();
pSheetPropInfo->Clear();
@@ -923,37 +959,25 @@ const FontList *SvxCSS1Parser::GetFontList() const
return 0;
}
-SvxCSS1MapEntry *SvxCSS1Parser::GetMapEntry( const String& rKey,
- const SvxCSS1Map& rMap ) const
-{
- pSearchEntry->SetKey( rKey );
-
- SvxCSS1MapEntry *pRet = 0;
- sal_uInt16 nPos;
- if( rMap.Seek_Entry( pSearchEntry, &nPos ) )
- pRet = rMap[nPos];
-
- return pRet;
-}
-
void SvxCSS1Parser::InsertMapEntry( const String& rKey,
const SfxItemSet& rItemSet,
const SvxCSS1PropertyInfo& rProp,
- SvxCSS1Map& rMap )
+ CSS1Map& rMap )
{
- SvxCSS1MapEntry *pEntry = GetMapEntry( rKey, rMap );
- if( pEntry )
+ CSS1Map::iterator itr = rMap.find(rKey);
+ if (itr == rMap.end())
{
- MergeStyles( rItemSet, rProp,
- pEntry->GetItemSet(), pEntry->GetPropertyInfo(), sal_True );
+ std::auto_ptr<SvxCSS1MapEntry> p(new SvxCSS1MapEntry(rKey, rItemSet, rProp));
+ rMap.insert(rKey, p);
}
else
{
- rMap.Insert( new SvxCSS1MapEntry( rKey, rItemSet, rProp ) );
+ SvxCSS1MapEntry* p = itr->second;
+ MergeStyles( rItemSet, rProp,
+ p->GetItemSet(), p->GetPropertyInfo(), sal_True );
}
}
-
void SvxCSS1Parser::MergeStyles( const SfxItemSet& rSrcSet,
const SvxCSS1PropertyInfo& rSrcInfo,
SfxItemSet& rTargetSet,
@@ -1017,7 +1041,7 @@ static void ParseCSS1_font_size( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& rParser )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
sal_uLong nHeight = 0;
sal_uInt16 nPropHeight = 100;
@@ -1082,7 +1106,7 @@ static void ParseCSS1_font_family( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& rParser )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
String aName, aStyleName, aDfltName;
FontFamily eFamily = FAMILY_DONTKNOW;
@@ -1163,7 +1187,7 @@ static void ParseCSS1_font_weight( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& rParser )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
switch( pExpr->GetType() )
{
@@ -1222,7 +1246,7 @@ static void ParseCSS1_font_style( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& rParser )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
sal_Bool bPosture = sal_False;
sal_Bool bCaseMap = sal_False;
@@ -1293,7 +1317,7 @@ static void ParseCSS1_font_variant( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
// normal | small-caps
@@ -1314,6 +1338,32 @@ static void ParseCSS1_font_variant( const CSS1Expression *pExpr,
}
}
+static void ParseCSS1_text_transform( const CSS1Expression *pExpr,
+ SfxItemSet &rItemSet,
+ SvxCSS1PropertyInfo& /*rPropInfo*/,
+ const SvxCSS1Parser& /*rParser*/ )
+{
+ OSL_ENSURE( pExpr, "no expression" );
+
+ // none | capitalize | uppercase | lowercase
+
+ switch( pExpr->GetType() )
+ {
+ case CSS1_IDENT:
+ {
+ sal_uInt16 nCaseMap;
+ if( SvxCSS1Parser::GetEnum( aTextTransformTable, pExpr->GetString(),
+ nCaseMap ) )
+ {
+ rItemSet.Put( SvxCaseMapItem( (SvxCaseMap)nCaseMap,
+ aItemIds.nCaseMap ) );
+ }
+ }
+ default:
+ ;
+ }
+}
+
/* */
static void ParseCSS1_color( const CSS1Expression *pExpr,
@@ -1321,7 +1371,7 @@ static void ParseCSS1_color( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
switch( pExpr->GetType() )
{
@@ -1345,7 +1395,7 @@ static void ParseCSS1_direction( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
sal_uInt16 nDir;
switch( pExpr->GetType() )
@@ -1369,7 +1419,7 @@ static void ParseCSS1_direction( const CSS1Expression *pExpr,
static void MergeHori( SvxGraphicPosition& ePos, SvxGraphicPosition eHori )
{
- DBG_ASSERT( GPOS_LT==eHori || GPOS_MT==eHori || GPOS_RT==eHori,
+ OSL_ENSURE( GPOS_LT==eHori || GPOS_MT==eHori || GPOS_RT==eHori,
"vertical position not at the top" );
switch( ePos )
@@ -1399,7 +1449,7 @@ static void MergeHori( SvxGraphicPosition& ePos, SvxGraphicPosition eHori )
static void MergeVert( SvxGraphicPosition& ePos, SvxGraphicPosition eVert )
{
- DBG_ASSERT( GPOS_LT==eVert || GPOS_LM==eVert || GPOS_LB==eVert,
+ OSL_ENSURE( GPOS_LT==eVert || GPOS_LM==eVert || GPOS_LB==eVert,
"horizontal position not on the left side" );
switch( ePos )
@@ -1432,7 +1482,7 @@ static void ParseCSS1_background( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& rParser )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
Color aColor;
String aURL;
@@ -1572,7 +1622,7 @@ static void ParseCSS1_background_color( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
Color aColor;
@@ -1620,7 +1670,7 @@ static void ParseCSS1_line_height( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& rParser )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
sal_uInt16 nHeight = 0;
sal_uInt8 nPropHeight = 0;
@@ -1662,7 +1712,6 @@ static void ParseCSS1_line_height( const CSS1Expression *pExpr,
aLSItem.SetLineHeight( nHeight );
// interpret <line-height> attribute as minimum line height
aLSItem.GetLineSpaceRule() = SVX_LINE_SPACE_MIN;
- // <--
aLSItem.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF;
rItemSet.Put( aLSItem );
}
@@ -1686,7 +1735,7 @@ static void ParseCSS1_font( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& rParser )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
FontItalic eItalic = ITALIC_NONE;
SvxCaseMap eCaseMap = SVX_CASEMAP_NOT_MAPPED;
@@ -1796,7 +1845,7 @@ static void ParseCSS1_letter_spacing( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
switch( pExpr->GetType() )
{
@@ -1841,7 +1890,7 @@ static void ParseCSS1_text_decoration( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
sal_Bool bUnderline = sal_False;
sal_Bool bOverline = sal_False;
@@ -1951,7 +2000,7 @@ static void ParseCSS1_text_align( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& /*rPropInfo*/,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
if( CSS1_IDENT==pExpr->GetType() ||
CSS1_STRING==pExpr->GetType() ) // MS-IE, mal wieder
@@ -1973,7 +2022,7 @@ static void ParseCSS1_text_indent( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
short nIndent = 0;
sal_Bool bSet = sal_False;
@@ -2026,7 +2075,7 @@ static void ParseCSS1_margin_left( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
long nLeft = 0;
sal_Bool bSet = sal_False;
@@ -2083,7 +2132,7 @@ static void ParseCSS1_margin_right( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
long nRight = 0;
sal_Bool bSet = sal_False;
@@ -2140,7 +2189,7 @@ static void ParseCSS1_margin_top( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
sal_uInt16 nUpper = 0;
sal_Bool bSet = sal_False;
@@ -2200,7 +2249,7 @@ static void ParseCSS1_margin_bottom( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
sal_uInt16 nLower = 0;
sal_Bool bSet = sal_False;
@@ -2260,7 +2309,7 @@ static void ParseCSS1_margin( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
long nMargins[4] = { 0, 0, 0, 0 };
sal_Bool bSetMargins[4] = { sal_False, sal_False, sal_False, sal_False };
@@ -2403,7 +2452,7 @@ static sal_Bool ParseCSS1_padding_xxx( const CSS1Expression *pExpr,
const SvxCSS1Parser& /*rParser*/,
sal_uInt16 nWhichLine )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
sal_Bool bSet = sal_False;
sal_uInt16 nDist = 0;
@@ -2525,7 +2574,7 @@ static void ParseCSS1_border_xxx( const CSS1Expression *pExpr,
const SvxCSS1Parser& /*rParser*/,
sal_uInt16 nWhichLine, sal_Bool bAll )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
sal_uInt16 nWidth = USHRT_MAX; // die Linien-Dicke
sal_uInt16 nNWidth = 1; // benannte Linien-Dicke (und default)
@@ -2620,7 +2669,7 @@ static void ParseCSS1_border_xxx_width( const CSS1Expression *pExpr,
const SvxCSS1Parser& /*rParser*/,
sal_uInt16 nWhichLine )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
sal_uInt16 nWidth = USHRT_MAX; // die Linien-Dicke
sal_uInt16 nNWidth = 1; // benannte Linien-Dicke (und default)
@@ -2812,7 +2861,7 @@ static void ParseCSS1_float( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
if( CSS1_IDENT==pExpr->GetType() )
{
@@ -2830,7 +2879,7 @@ static void ParseCSS1_position( const CSS1Expression *pExpr,
SvxCSS1PropertyInfo& rPropInfo,
const SvxCSS1Parser& /*rParser*/ )
{
- DBG_ASSERT( pExpr, "no expression" );
+ OSL_ENSURE( pExpr, "no expression" );
if( CSS1_IDENT==pExpr->GetType() )
{
@@ -3141,6 +3190,7 @@ static CSS1PropEntry aCSS1PropFnTab[] =
CSS1_PROP_ENTRY(text_align),
CSS1_PROP_ENTRY(text_decoration),
CSS1_PROP_ENTRY(text_indent),
+ CSS1_PROP_ENTRY(text_transform),
CSS1_PROP_ENTRY(margin_left),
CSS1_PROP_ENTRY(margin_right),
CSS1_PROP_ENTRY(margin_top),
@@ -3173,14 +3223,7 @@ static int bSortedPropFns = sal_False;
extern "C"
{
-static int
-#if defined( WNT )
- __cdecl
-#endif
-#if defined( ICC )
- _Optlink
-#endif
- CSS1PropEntryCompare( const void *pFirst, const void *pSecond)
+static int SAL_CALL CSS1PropEntryCompare( const void *pFirst, const void *pSecond)
{
int nRet;
if( ((CSS1PropEntry*)pFirst)->pFunc )
@@ -3209,7 +3252,7 @@ static int
void SvxCSS1Parser::ParseProperty( const String& rProperty,
const CSS1Expression *pExpr )
{
- DBG_ASSERT( pItemSet, "DeclarationParsed() without ItemSet" );
+ OSL_ENSURE( pItemSet, "DeclarationParsed() without ItemSet" );
if( !bSortedPropFns )
{
diff --git a/sw/source/filter/html/svxcss1.hxx b/sw/source/filter/html/svxcss1.hxx
index 95d682d806..cbe6383745 100644
--- a/sw/source/filter/html/svxcss1.hxx
+++ b/sw/source/filter/html/svxcss1.hxx
@@ -39,12 +39,13 @@
#include <rtl/textenc.h>
#include "parcss1.hxx"
+#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/ptr_container/ptr_map.hpp>
+
class SfxItemPool;
class SvxBoxItem;
class FontList;
-/* */
-
enum SvxCSS1Position
{
SVX_CSS1_POS_NONE, // nichts angegeben
@@ -93,21 +94,14 @@ enum SvxCSS1PageBreak
#define CSS1_SCRIPT_CTL 0x04
#define CSS1_SCRIPT_ALL 0x07
-/* */
-
struct CSS1PropertyEnum
{
const sal_Char *pName; // Wert einer Property
sal_uInt16 nEnum; // und der dazugehoerige Wert eines Enums
};
-
-/* */
-
namespace editeng { class SvxBorderLine; }
-SV_DECL_PTRARR_DEL( CSS1Selectors, CSS1Selector*, 1, 1 )
-
#define SVX_CSS1_BORDERINFO_WIDTH 1
#define SVX_CSS1_BORDERINFO_COLOR 2
#define SVX_CSS1_BORDERINFO_STYLE 4
@@ -202,10 +196,6 @@ public:
const SvxCSS1MapEntry& rE2 );
};
-typedef SvxCSS1MapEntry *SvxCSS1MapEntryPtr;
-SV_DECL_PTRARR_SORT_DEL( SvxCSS1Map, SvxCSS1MapEntryPtr, 5, 5 )
-
-
#if !defined( ICC )
inline sal_Bool operator==( const SvxCSS1MapEntry& rE1, const SvxCSS1MapEntry& rE2 )
{
@@ -227,12 +217,14 @@ inline sal_Bool operator<( const SvxCSS1MapEntry& rE1, const SvxCSS1MapEntry& rE
class SvxCSS1Parser : public CSS1Parser
{
+ typedef ::boost::ptr_vector<CSS1Selector> CSS1Selectors;
+ typedef ::boost::ptr_map<String, SvxCSS1MapEntry> CSS1Map;
CSS1Selectors aSelectors; // Liste der "offenen" Selectoren
- SvxCSS1Map aIds;
- SvxCSS1Map aClasses;
- SvxCSS1Map aPages;
- SvxCSS1Map aTags;
+ CSS1Map aIds;
+ CSS1Map aClasses;
+ CSS1Map aPages;
+ CSS1Map aTags;
String sBaseURL;
@@ -277,8 +269,7 @@ protected:
// zuletzt angelegten Styles kopiert.
// Diese Methode sollte in abgleiteten Parsern nicht mehr
// ueberladen werden!
- virtual sal_Bool SelectorParsed( const CSS1Selector *pSelector,
- sal_Bool bFirst );
+ virtual bool SelectorParsed( CSS1Selector *pSelector, bool bFirst );
// Diese Methode wird fuer jede geparste Property aufgerufen
// sie fuegt das Item in den ItemSet 'pItemSet' ein
@@ -321,35 +312,29 @@ public:
const sal_uInt16 *GetWhichMap() const { return aWhichMap.GetData(); }
- SvxCSS1MapEntry *GetMapEntry( const String& rKey,
- const SvxCSS1Map& rMap ) const;
-
void InsertMapEntry( const String& rKey, const SfxItemSet& rItemSet,
- const SvxCSS1PropertyInfo& rProp, SvxCSS1Map& rMap );
+ const SvxCSS1PropertyInfo& rProp, CSS1Map& rMap );
void InsertId( const String& rId, const SfxItemSet& rItemSet,
const SvxCSS1PropertyInfo& rProp );
- inline SvxCSS1MapEntry *GetId( const String& rId ) const;
+ const SvxCSS1MapEntry* GetId( const String& rId ) const;
void InsertClass( const String& rClass, const SfxItemSet& rItemSet,
const SvxCSS1PropertyInfo& rProp );
- inline SvxCSS1MapEntry *GetClass( const String& rClass ) const;
+ const SvxCSS1MapEntry* GetClass( const String& rClass ) const;
- inline void InsertPage( const String& rPage, sal_Bool bPseudo,
+ void InsertPage( const String& rPage, sal_Bool bPseudo,
const SfxItemSet& rItemSet,
const SvxCSS1PropertyInfo& rProp );
- inline SvxCSS1MapEntry *GetPage( const String& rPage, sal_Bool bPseudo ) const;
-
- inline SvxCSS1MapEntry *GetPage( sal_uInt16 i ) const { return aPages[i]; }
- sal_uInt16 GetPageCount() const { return aPages.Count(); }
+ SvxCSS1MapEntry* GetPage( const String& rPage, bool bPseudo );
void InsertTag( const String& rTag, const SfxItemSet& rItemSet,
const SvxCSS1PropertyInfo& rProp );
- inline SvxCSS1MapEntry *GetTag( const String& rTag ) const;
+ SvxCSS1MapEntry* GetTag( const String& rTag );
void MergeStyles( const SfxItemSet& rSrcSet,
const SvxCSS1PropertyInfo& rSrcInfo,
@@ -370,63 +355,6 @@ public:
};
-inline void SvxCSS1Parser::InsertId( const String& rId,
- const SfxItemSet& rItemSet,
- const SvxCSS1PropertyInfo& rProp )
-{
- InsertMapEntry( rId, rItemSet, rProp, aIds );
-}
-
-inline SvxCSS1MapEntry *SvxCSS1Parser::GetId( const String& rId ) const
-{
- return GetMapEntry( rId, aIds );
-}
-
-inline void SvxCSS1Parser::InsertClass( const String& rClass,
- const SfxItemSet& rItemSet,
- const SvxCSS1PropertyInfo& rProp )
-{
- InsertMapEntry( rClass, rItemSet, rProp, aClasses );
-}
-
-inline SvxCSS1MapEntry *SvxCSS1Parser::GetClass( const String& rClass ) const
-{
- return GetMapEntry( rClass, aClasses );
-}
-
-inline void SvxCSS1Parser::InsertPage( const String& rPage,
- sal_Bool bPseudo,
- const SfxItemSet& rItemSet,
- const SvxCSS1PropertyInfo& rProp )
-{
- String aKey( rPage );
- if( bPseudo )
- aKey.Insert( ':', 0 );
- InsertMapEntry( aKey, rItemSet, rProp, aPages );
-}
-
-inline SvxCSS1MapEntry *SvxCSS1Parser::GetPage( const String& rPage,
- sal_Bool bPseudo ) const
-{
- String aKey( rPage );
- if( bPseudo )
- aKey.Insert( ':', 0 );
- return GetMapEntry( aKey, aPages );
-}
-
-inline void SvxCSS1Parser::InsertTag( const String& rTag,
- const SfxItemSet& rItemSet,
- const SvxCSS1PropertyInfo& rProp )
-{
- InsertMapEntry( rTag, rItemSet, rProp, aTags );
-}
-
-inline SvxCSS1MapEntry *SvxCSS1Parser::GetTag( const String& rTag ) const
-{
- return GetMapEntry( rTag, aTags );
-}
-
-
#endif
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 4f7f9458f7..a272dfdf58 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -186,7 +186,6 @@ String HTMLReader::GetTemplateName() const
// no OpenDocument Writer/Web template found.
// search for OpenOffice.org Writer/Web template
sTemplate.AppendAscii( TOOLS_CONSTASCII_STRINGPARAM(".stw") );
- // <--
bSet = aPathOpt.SearchFile( sTemplate, SvtPathOptions::PATH_TEMPLATE );
}
#endif
@@ -302,7 +301,6 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn,
// #i83625#
nContextStMin( 0 ),
nContextStAttrMin( 0 ),
- // <--
nOpenParaToken( 0 ),
eJumpTo( JUMPTO_NONE ),
#if OSL_DEBUG_LEVEL > 1
@@ -340,16 +338,16 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn,
memset( &aAttrTab, 0, sizeof( _HTMLAttrTable ));
// Die Font-Groessen 1-7 aus der INI-Datei lesen
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
- aFontHeights[0] = pHtmlOptions->GetFontSize( 0 ) * 20;
- aFontHeights[1] = pHtmlOptions->GetFontSize( 1 ) * 20;
- aFontHeights[2] = pHtmlOptions->GetFontSize( 2 ) * 20;
- aFontHeights[3] = pHtmlOptions->GetFontSize( 3 ) * 20;
- aFontHeights[4] = pHtmlOptions->GetFontSize( 4 ) * 20;
- aFontHeights[5] = pHtmlOptions->GetFontSize( 5 ) * 20;
- aFontHeights[6] = pHtmlOptions->GetFontSize( 6 ) * 20;
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
+ aFontHeights[0] = rHtmlOptions.GetFontSize( 0 ) * 20;
+ aFontHeights[1] = rHtmlOptions.GetFontSize( 1 ) * 20;
+ aFontHeights[2] = rHtmlOptions.GetFontSize( 2 ) * 20;
+ aFontHeights[3] = rHtmlOptions.GetFontSize( 3 ) * 20;
+ aFontHeights[4] = rHtmlOptions.GetFontSize( 4 ) * 20;
+ aFontHeights[5] = rHtmlOptions.GetFontSize( 5 ) * 20;
+ aFontHeights[6] = rHtmlOptions.GetFontSize( 6 ) * 20;
- bKeepUnknown = pHtmlOptions->IsImportUnknown();
+ bKeepUnknown = rHtmlOptions.IsImportUnknown();
if(bReadNewDoc)
{
@@ -367,7 +365,7 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn,
pDoc->set(IDocumentSettingAccess::HTML_MODE, true);
pCSS1Parser = new SwCSS1Parser( pDoc, aFontHeights, sBaseURL, IsNewDoc() );
- pCSS1Parser->SetIgnoreFontFamily( pHtmlOptions->IsIgnoreFontFamily() );
+ pCSS1Parser->SetIgnoreFontFamily( rHtmlOptions.IsIgnoreFontFamily() );
if( bReadUTF8 )
{
@@ -518,7 +516,6 @@ IMPL_LINK( SwHTMLParser, AsyncCallback, void*, /*pVoid*/ )
// wurde der Import vom SFX abgebrochen?
eState = SVPAR_ERROR;
}
- // <--
GetAsynchCallLink().Call(0);
return 0;
@@ -856,13 +853,13 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_False ).nNode.GetIndex() )
if( IsNewDoc() )
{
SwDocShell *pDocShell(pDoc->GetDocShell());
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
if (pDocShell) {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+ OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
if ( xDocProps.is() && (xDocProps->getAutoloadSecs() > 0) &&
(xDocProps->getAutoloadURL().getLength() == 0) )
{
@@ -1016,7 +1013,7 @@ void SwHTMLParser::NextToken( int nToken )
uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "no DocumentProperties");
+ OSL_ENSURE(xDocProps.is(), "no DocumentProperties");
if (xDocProps.is()) {
xDocProps->setTitle(sTitle);
}
@@ -1235,7 +1232,8 @@ void SwHTMLParser::NextToken( int nToken )
else if( aUnknownToken.Len() )
{
// Paste content of unknown tags.
- if (aToken.Len() > 0)
+ // (but surely if we are not in the header section) fdo#36080 fdo#34666
+ if (aToken.Len() > 0 && !IsInHeader() )
{
if( !bDocInitalized )
DocumentDetected();
@@ -1304,29 +1302,29 @@ void SwHTMLParser::NextToken( int nToken )
case HTML_BASE:
{
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[ --i ];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_HREF:
- sBaseURL = pOption->GetString();
+ sBaseURL = rOption.GetString();
break;
case HTML_O_TARGET:
if( IsNewDoc() )
{
SwDocShell *pDocShell(pDoc->GetDocShell());
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
if (pDocShell) {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties>
xDocProps(xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(),"no DocumentProperties");
+ OSL_ENSURE(xDocProps.is(),"no DocumentProperties");
if (xDocProps.is()) {
xDocProps->setDefaultTarget(
- pOption->GetString());
+ rOption.GetString());
}
}
}
@@ -1346,7 +1344,7 @@ void SwHTMLParser::NextToken( int nToken )
pHTTPHeader = pDocSh->GetHeaderAttributes();
}
SwDocShell *pDocShell(pDoc->GetDocShell());
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
if (pDocShell)
{
uno::Reference<document::XDocumentProperties> xDocProps;
@@ -1355,7 +1353,7 @@ void SwHTMLParser::NextToken( int nToken )
const uno::Reference<document::XDocumentPropertiesSupplier>
xDPS( pDocShell->GetModel(), uno::UNO_QUERY_THROW );
xDocProps = xDPS->getDocumentProperties();
- DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+ OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
}
ParseMetaOptions( xDocProps, pHTTPHeader );
}
@@ -1918,13 +1916,13 @@ void SwHTMLParser::NextToken( int nToken )
break; // don't evaluate further???
case HTML_HTML_ON:
{
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[ --i ];
- if( HTML_O_DIR == pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ if( HTML_O_DIR == rOption.GetToken() )
{
- const String& rDir = pOption->GetString();
+ const String& rDir = rOption.GetString();
SfxItemSet aItemSet( pDoc->GetAttrPool(),
pCSS1Parser->GetWhichMap() );
SvxCSS1PropertyInfo aPropInfo;
@@ -2027,6 +2025,8 @@ void SwHTMLParser::NextToken( int nToken )
case HTML_UNKNOWNCONTROL_ON:
// Ignore content of unknown token in the header, if the token
// does not start with a '!'.
+ // (but judging from the code, also if does not start with a '%')
+ // (and also if we're not somewhere we consider PRE)
if( IsInHeader() && !IsReadPRE() && !aUnknownToken.Len() &&
sSaveToken.Len() && '!' != sSaveToken.GetChar(0) &&
'%' != sSaveToken.GetChar(0) )
@@ -3355,32 +3355,30 @@ void SwHTMLParser::InsertAttrs( _HTMLAttrs& rAttrs )
}
}
-/* */
-
void SwHTMLParser::NewStdAttr( int nToken )
{
String aId, aStyle, aClass, aLang, aDir;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
}
@@ -3414,26 +3412,26 @@ void SwHTMLParser::NewStdAttr( int nToken,
{
String aId, aStyle, aClass, aLang, aDir;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
}
@@ -3495,29 +3493,29 @@ void SwHTMLParser::NewBasefontAttr()
String aId, aStyle, aClass, aLang, aDir;
sal_uInt16 nSize = 3;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_SIZE:
- nSize = (sal_uInt16)pOption->GetNumber();
+ nSize = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
}
@@ -3592,21 +3590,21 @@ void SwHTMLParser::NewFontAttr( int nToken )
sal_uInt16 nSize = 0; // Fontgroesse in Netscape-Notation (1-7)
sal_Bool bColor = sal_False;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_SIZE:
- if( HTML_FONT_ON==nToken && pOption->GetString().Len() )
+ if( HTML_FONT_ON==nToken && rOption.GetString().Len() )
{
sal_Int32 nSSize;
- if( '+' == pOption->GetString().GetChar(0) ||
- '-' == pOption->GetString().GetChar(0) )
- nSSize = nBaseSize + pOption->GetSNumber();
+ if( '+' == rOption.GetString().GetChar(0) ||
+ '-' == rOption.GetString().GetChar(0) )
+ nSSize = nBaseSize + rOption.GetSNumber();
else
- nSSize = (sal_Int32)pOption->GetNumber();
+ nSSize = (sal_Int32)rOption.GetNumber();
if( nSSize < 1 )
nSSize = 1;
@@ -3620,28 +3618,28 @@ void SwHTMLParser::NewFontAttr( int nToken )
case HTML_O_COLOR:
if( HTML_FONT_ON==nToken )
{
- pOption->GetColor( aColor );
+ rOption.GetColor( aColor );
bColor = sal_True;
}
break;
case HTML_O_FACE:
if( HTML_FONT_ON==nToken )
- aFace = pOption->GetString();
+ aFace = rOption.GetString();
break;
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
}
@@ -3815,29 +3813,29 @@ void SwHTMLParser::NewPara()
eParaAdjust = SVX_ADJUST_END;
String aId, aStyle, aClass, aLang, aDir;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_ALIGN:
- eParaAdjust = (SvxAdjust)pOption->GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eParaAdjust) );
+ eParaAdjust = (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eParaAdjust) );
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
}
@@ -3935,29 +3933,29 @@ void SwHTMLParser::NewHeading( int nToken )
String aId, aStyle, aClass, aLang, aDir;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_ALIGN:
- eParaAdjust = (SvxAdjust)pOption->GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eParaAdjust) );
+ eParaAdjust = (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eParaAdjust) );
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
}
@@ -4061,26 +4059,26 @@ void SwHTMLParser::NewTxtFmtColl( int nToken, sal_uInt16 nColl )
{
String aId, aStyle, aClass, aLang, aDir;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
}
@@ -4190,26 +4188,26 @@ void SwHTMLParser::NewDefList()
{
String aId, aStyle, aClass, aLang, aDir;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
}
@@ -4713,26 +4711,26 @@ void SwHTMLParser::NewCharFmt( int nToken )
{
String aId, aStyle, aClass, aLang, aDir;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
case HTML_O_LANG:
- aLang = pOption->GetString();
+ aLang = rOption.GetString();
break;
case HTML_O_DIR:
- aDir = pOption->GetString();
+ aDir = rOption.GetString();
break;
}
}
@@ -4785,39 +4783,39 @@ void SwHTMLParser::InsertSpacer()
sal_Bool bPrcHeight = sal_False;
sal_uInt16 nType = HTML_SPTYPE_HORI;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_TYPE:
- pOption->GetEnum( nType, aHTMLSpacerTypeTable );
+ rOption.GetEnum( nType, aHTMLSpacerTypeTable );
break;
case HTML_O_ALIGN:
eVertOri =
- pOption->GetEnum( aHTMLImgVAlignTable,
+ rOption.GetEnum( aHTMLImgVAlignTable,
eVertOri );
eHoriOri =
- pOption->GetEnum( aHTMLImgHAlignTable,
+ rOption.GetEnum( aHTMLImgHAlignTable,
eHoriOri );
break;
case HTML_O_WIDTH:
// erstmal nur als Pixelwerte merken!
- bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- aSize.Width() = (long)pOption->GetNumber();
+ bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ aSize.Width() = (long)rOption.GetNumber();
break;
case HTML_O_HEIGHT:
// erstmal nur als Pixelwerte merken!
- bPrcHeight = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- aSize.Height() = (long)pOption->GetNumber();
+ bPrcHeight = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ aSize.Height() = (long)rOption.GetNumber();
break;
case HTML_O_SIZE:
// erstmal nur als Pixelwerte merken!
- nSize = pOption->GetNumber();
+ nSize = rOption.GetNumber();
break;
}
}
@@ -4990,13 +4988,13 @@ SwTwips SwHTMLParser::GetCurrentBrowseWidth()
void SwHTMLParser::InsertIDOption()
{
String aId;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- if( HTML_O_ID==pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ if( HTML_O_ID==rOption.GetToken() )
{
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
}
}
@@ -5032,15 +5030,15 @@ void SwHTMLParser::InsertLineBreak()
sal_Bool bCleared = sal_False; // wurde ein CLEAR ausgefuehrt?
// dann holen wir mal die Optionen
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_CLEAR:
{
- const String &aClear = pOption->GetString();
+ const String &aClear = rOption.GetString();
if( aClear.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_AL_all ) )
{
bClearLeft = sal_True;
@@ -5053,13 +5051,13 @@ void SwHTMLParser::InsertLineBreak()
}
break;
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_STYLE:
- aStyle = pOption->GetString();
+ aStyle = rOption.GetString();
break;
case HTML_O_CLASS:
- aClass = pOption->GetString();
+ aClass = rOption.GetString();
break;
}
}
@@ -5179,21 +5177,21 @@ void SwHTMLParser::InsertHorzRule()
String aId;
// dann holen wir mal die Optionen
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[--i];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_ID:
- aId = pOption->GetString();
+ aId = rOption.GetString();
break;
case HTML_O_SIZE:
- nSize = (sal_uInt16)pOption->GetNumber();
+ nSize = (sal_uInt16)rOption.GetNumber();
break;
case HTML_O_WIDTH:
- bPrcWidth = (pOption->GetString().Search('%') != STRING_NOTFOUND);
- nWidth = (sal_uInt16)pOption->GetNumber();
+ bPrcWidth = (rOption.GetString().Search('%') != STRING_NOTFOUND);
+ nWidth = (sal_uInt16)rOption.GetNumber();
if( bPrcWidth && nWidth>=100 )
{
// 100%-Linien sind der default-Fall (keine Attrs neotig)
@@ -5203,13 +5201,13 @@ void SwHTMLParser::InsertHorzRule()
break;
case HTML_O_ALIGN:
eAdjust =
- (SvxAdjust)pOption->GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eAdjust) );
+ (SvxAdjust)rOption.GetEnum( aHTMLPAlignTable, static_cast< sal_uInt16 >(eAdjust) );
break;
case HTML_O_NOSHADE:
bNoShade = sal_True;
break;
case HTML_O_COLOR:
- pOption->GetColor( aColor );
+ rOption.GetColor( aColor );
bColor = sal_True;
break;
}
@@ -5330,22 +5328,22 @@ void SwHTMLParser::ParseMoreMetaOptions()
String aName, aContent;
sal_Bool bHTTPEquiv = sal_False;
- const HTMLOptions *pHTMLOptions = GetOptions();
- for( sal_uInt16 i = pHTMLOptions->Count(); i; )
+ const HTMLOptions& rHTMLOptions = GetOptions();
+ for (size_t i = rHTMLOptions.size(); i; )
{
- const HTMLOption *pOption = (*pHTMLOptions)[ --i ];
- switch( pOption->GetToken() )
+ const HTMLOption& rOption = rHTMLOptions[--i];
+ switch( rOption.GetToken() )
{
case HTML_O_NAME:
- aName = pOption->GetString();
+ aName = rOption.GetString();
bHTTPEquiv = sal_False;
break;
case HTML_O_HTTPEQUIV:
- aName = pOption->GetString();
+ aName = rOption.GetString();
bHTTPEquiv = sal_True;
break;
case HTML_O_CONTENT:
- aContent = pOption->GetString();
+ aContent = rOption.GetString();
break;
}
}
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index ab5eb53389..a2b895c753 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -781,7 +781,7 @@ private:
// ein Event an ein VC-Control anhaengen (htmlform.cxx)
void InsertBasicCtrlEvent( sal_uInt16 nEvent, const String& rName );
- // Einfuegen von Styles
+ // Inserting styles
// <STYLE>
void NewStyle();
@@ -796,9 +796,9 @@ private:
const String *pLang=0, const String *pDir=0 );
- // Einfuegen von Controls und ::com::sun::star::form::Forms (htmlform.cxx)
+ // Inserting Controls and ::com::sun::star::form::Forms (htmlform.cxx)
- // Ein Draw-Objekt in das Dokuement eintragen
+ // Insert draw object into document
void InsertDrawObject( SdrObject* pNewDrawObj, const Size& rSpace,
sal_Int16 eVertOri,
sal_Int16 eHoriOri,
@@ -827,12 +827,10 @@ private:
void RegisterDrawObjectToTable( HTMLTable *pCurTable, SdrObject* pObj,
sal_uInt8 nWidth );
-
- // eine neue Form beginnen
void NewForm( sal_Bool bAppend=sal_True );
void EndForm( sal_Bool bAppend=sal_True );
- // die Einfuege-Methoden fuer <INPUT>, <TEXTAREA> und <SELECT>
+ // Insert methods for <INPUT>, <TEXTAREA> und <SELECT>
void InsertInput();
void NewTextArea();
@@ -844,23 +842,21 @@ private:
void InsertSelectText();
void EndSelect();
- // Einfuegen von Tabellen (htmltab.cxx)
-
-public: // wird in Tabellen benoetigt
+ // Inserting tables (htmltab.cxx)
+public:
- // einen Boxen-Inhalt hinter dem angegebenen Node einfuegen
+ // Insert box content after the given node
const SwStartNode *InsertTableSection( const SwStartNode *pPrevStNd );
- // Einen Boxen-Inhalt am Ende der Tabelle einfuegen, in der der PaM
- // steht un den PaM in die Zelle schieben
+ // Insert box content at the end of the table containing the PaM
+ // and move the PaM into the cell
const SwStartNode *InsertTableSection( sal_uInt16 nPoolId );
- // Einfeuge-Methoden fuer die diversen Tabellen-Tags
+ // Insert methods for various table tags
HTMLTableCnts *InsertTableContents( sal_Bool bHead );
private:
- // Eine Section fuer die voruebergende Aufnahme der Tabellen-Ueberschrift
- // anlegen
+ // Create a section for the temporary storage of the table caption
SwStartNode *InsertTempTableCaptionSection();
void BuildTableCell( HTMLTable *pTable, sal_Bool bReadOptions, sal_Bool bHead );
@@ -876,7 +872,7 @@ private:
sal_Bool bHasToFlow = sal_False );
- // sonstiges ...
+ // misc ...
void ParseMoreMetaOptions();
@@ -895,19 +891,18 @@ private:
SwNodeIndex *GetFootEndNoteSection( const String& rName );
void DeleteFootEndNoteImpl();
- // Line-Break am Ende eines Absatzes entfernen
xub_StrLen StripTrailingLF();
- // Einen leeren Absatz an der PaM-Position entfernen
+ // Remove empty paragraph at the PaM position
void StripTrailingPara();
- // sind im aktuellen Absatz Fly-Frames vorhanden?
+ // Are there fly frames in the current paragraph?
sal_Bool HasCurrentParaFlys( sal_Bool bNoSurroundOnly = sal_False,
sal_Bool bSurroundOnly = sal_False ) const;
-public: // wird in Tabellen benoetigt
+public: // used in tables
- // generieren eines BrushItems (mit new) oder 0
+ // Create brush item (with new) or 0
SvxBrushItem* CreateBrushItem( const Color *pColor,
const String &rImageURL,
const String &rStyle,
@@ -915,11 +910,11 @@ public: // wird in Tabellen benoetigt
const String &rClass );
protected:
- // wird fuer jedes Token gerufen, das in CallParser erkannt wird
+ // Executed for each token recognized by CallParser
virtual void NextToken( int nToken );
virtual ~SwHTMLParser();
- // wird das Dok geloescht, ist auch der Parser zu loeschen
+ // If the document is removed, remove the parser as well
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew );
virtual void AddMetaUserDefined( ::rtl::OUString const & i_rMetaName );
@@ -933,12 +928,12 @@ public:
SfxMedium* pMed = 0, sal_Bool bReadUTF8 = sal_False,
sal_Bool bIgnoreHTMLComments = sal_False );
- virtual SvParserState CallParser(); // Aufruf des Parsers
+ virtual SvParserState CallParser();
sal_uInt16 ToTwips( sal_uInt16 nPixel ) const;
- // fuers asynchrone lesen aus dem SvStream
+ // for reading asynchronously from SvStream
virtual void Continue( int nToken );
virtual bool ParseMetaOptions( const ::com::sun::star::uno::Reference<
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 6f1e6a4b2e..0e78fae867 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -127,20 +127,20 @@ SwHTMLWriter::~SwHTMLWriter()
sal_uLong SwHTMLWriter::WriteStream()
{
// neue Konfiguration setzen
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
// die Fontgroessen 1-7
- aFontHeights[0] = pHtmlOptions->GetFontSize( 0 ) * 20;
- aFontHeights[1] = pHtmlOptions->GetFontSize( 1 ) * 20;
- aFontHeights[2] = pHtmlOptions->GetFontSize( 2 ) * 20;
- aFontHeights[3] = pHtmlOptions->GetFontSize( 3 ) * 20;
- aFontHeights[4] = pHtmlOptions->GetFontSize( 4 ) * 20;
- aFontHeights[5] = pHtmlOptions->GetFontSize( 5 ) * 20;
- aFontHeights[6] = pHtmlOptions->GetFontSize( 6 ) * 20;
+ aFontHeights[0] = rHtmlOptions.GetFontSize( 0 ) * 20;
+ aFontHeights[1] = rHtmlOptions.GetFontSize( 1 ) * 20;
+ aFontHeights[2] = rHtmlOptions.GetFontSize( 2 ) * 20;
+ aFontHeights[3] = rHtmlOptions.GetFontSize( 3 ) * 20;
+ aFontHeights[4] = rHtmlOptions.GetFontSize( 4 ) * 20;
+ aFontHeights[5] = rHtmlOptions.GetFontSize( 5 ) * 20;
+ aFontHeights[6] = rHtmlOptions.GetFontSize( 6 ) * 20;
// ueberhaupt Styles ausgeben
// (dann auch obere und untere Absatz-Abstaende)
- nExportMode = pHtmlOptions->GetExportMode();
+ nExportMode = rHtmlOptions.GetExportMode();
nHTMLMode = GetHtmlMode(0);
if( HTML_CFG_WRITER==nExportMode ||
HTML_CFG_NS40==nExportMode )
@@ -187,7 +187,7 @@ sal_uLong SwHTMLWriter::WriteStream()
sal_Bool bWriteUTF8 = bWriteClipboardDoc;
eDestEnc = bWriteUTF8 ? RTL_TEXTENCODING_UTF8
- : pHtmlOptions->GetTextEncoding();
+ : rHtmlOptions.GetTextEncoding();
const sal_Char *pCharSet =
rtl_getBestMimeCharsetFromTextEncoding( eDestEnc );
eDestEnc = rtl_getTextEncodingFromMimeCharset( pCharSet );
@@ -195,10 +195,10 @@ sal_uLong SwHTMLWriter::WriteStream()
// Nur noch fuer den MS-IE ziehen wir den Export von Styles vor.
bCfgPreferStyles = HTML_CFG_MSIE==nExportMode;
- bCfgStarBasic = pHtmlOptions->IsStarBasic();
+ bCfgStarBasic = rHtmlOptions.IsStarBasic();
bCfgFormFeed = !IsHTMLMode(HTMLMODE_PRINT_EXT);
- bCfgCpyLinkedGrfs = pHtmlOptions->IsSaveGraphicsLocal();
+ bCfgCpyLinkedGrfs = rHtmlOptions.IsSaveGraphicsLocal();
// die HTML-Vorlage holen
sal_Bool bOldHTMLMode = sal_False;
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index e83c582485..4e040f1b1e 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -381,6 +381,8 @@ public:
const sal_Char *pVal );
inline void OutCSS1_PropertyAscii( const sal_Char *pProp,
const ByteString& rVal );
+ inline void OutCSS1_PropertyAscii( const sal_Char *pProp,
+ const rtl::OString& rVal );
inline void OutCSS1_Property( const sal_Char *pProp, const String& rVal );
void OutCSS1_Property( const sal_Char *pProp, const sal_Char *pVal,
const String *pSVal );
@@ -514,6 +516,12 @@ inline void SwHTMLWriter::OutCSS1_PropertyAscii( const sal_Char *pProp,
OutCSS1_Property( pProp, rVal.GetBuffer(), 0 );
}
+inline void SwHTMLWriter::OutCSS1_PropertyAscii( const sal_Char *pProp,
+ const rtl::OString& rVal )
+{
+ OutCSS1_Property( pProp, rVal.getStr(), 0 );
+}
+
inline void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp,
const String& rVal )
{
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 2c43abd8b8..f467932603 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -28,8 +28,6 @@
#ifndef _FLTSHELL_HXX
#define _FLTSHELL_HXX
-#include <deque>
-
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
@@ -40,8 +38,12 @@
#include <poolfmt.hxx>
#include <fmtornt.hxx>
#include <ndindex.hxx>
+#include <pam.hxx>
#include <IDocumentRedlineAccess.hxx>
+#include <boost/noncopyable.hpp>
+#include <boost/ptr_container/ptr_deque.hpp>
+
class SwTOXBase;
class SwFltShell;
class SwField;
@@ -62,34 +64,76 @@ inline void SwFltSetFlag(sal_uLong& rFieldFlags, int no)
inline sal_Bool SwFltGetFlag(sal_uLong nFieldFlags, int no)
{ return (nFieldFlags & (1L << no)) != 0; }
+//Subvert the Node/Content system to get positions which don't update as
+//content is appended to them
+struct SW_DLLPUBLIC SwFltPosition
+{
+public:
+ SwNodeIndex m_nNode;
+ xub_StrLen m_nCntnt;
+public:
+ SwFltPosition(const SwFltPosition &rOther)
+ : m_nNode(rOther.m_nNode)
+ , m_nCntnt(rOther.m_nCntnt)
+ {
+ }
+ SwFltPosition &operator=(const SwFltPosition &rOther)
+ {
+ m_nNode = rOther.m_nNode;
+ m_nCntnt = rOther.m_nCntnt;
+ return *this;
+ }
+ bool operator==(const SwFltPosition &rOther) const
+ {
+ return (m_nCntnt == rOther.m_nCntnt &&
+ m_nNode == rOther.m_nNode);
+ }
+ void SetPos(SwNodeIndex &rNode, sal_uInt16 nIdx)
+ {
+ m_nNode = rNode;
+ m_nCntnt = nIdx;
+ }
+ //operators with SwPosition, where the node is hacked to the previous one,
+ //and the offset to content is de-dynamic-ified
+ SwFltPosition(const SwPosition &rPos)
+ : m_nNode(rPos.nNode, -1)
+ , m_nCntnt(rPos.nContent.GetIndex())
+ {
+ }
+ void SetPos(const SwPosition &rPos)
+ {
+ m_nNode = rPos.nNode.GetIndex()-1;
+ m_nCntnt = rPos.nContent.GetIndex();
+ }
+};
+
// Stack-Eintrag fuer die Attribute Es werden immer Pointer auf neue Attribute uebergeben.
-class SwFltStackEntry
+class SwFltStackEntry : private ::boost::noncopyable
{
public:
- SwNodeIndex nMkNode;
- SwNodeIndex nPtNode;
+ SwFltPosition m_aMkPos;
+ SwFltPosition m_aPtPos;
+
SfxPoolItem * pAttr;// Format Attribute
- long nHandle; // fuer verschachtelte Attrs, z.B. Bookmarks
- xub_StrLen nMkCntnt;// Nachbildung von Mark()
- xub_StrLen nPtCntnt;// Nachbildung von GetPoint()
sal_Bool bOld; // to mark Attributes *before* skipping field results
- sal_Bool bLocked;
- sal_Bool bCopied;
+ sal_Bool bOpen; //Entry open, awaiting being closed
sal_Bool bConsumedByField;
SW_DLLPUBLIC SwFltStackEntry(const SwPosition & rStartPos, SfxPoolItem* pHt );
- SW_DLLPUBLIC SwFltStackEntry(const SwFltStackEntry& rEntry);
SW_DLLPUBLIC ~SwFltStackEntry();
void SetStartPos(const SwPosition & rStartPos);
SW_DLLPUBLIC void SetEndPos( const SwPosition & rEndPos);
- SW_DLLPUBLIC sal_Bool MakeRegion(SwDoc* pDoc, SwPaM& rRegion, sal_Bool bCheck );
+ SW_DLLPUBLIC bool MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck) const;
+ SW_DLLPUBLIC static bool MakeRegion(SwDoc* pDoc, SwPaM& rRegion,
+ bool bCheck, const SwFltPosition &rMkPos, const SwFltPosition &rPtPos,
+ sal_uInt16 nWhich=0);
};
-class SW_DLLPUBLIC SwFltControlStack
+class SW_DLLPUBLIC SwFltControlStack : private ::boost::noncopyable
{
- typedef std::deque<SwFltStackEntry*> Entries;
+ typedef boost::ptr_deque<SwFltStackEntry> Entries;
typedef Entries::iterator myEIter;
Entries maEntries;
friend class SwFltShell;
@@ -102,7 +146,7 @@ protected:
sal_Bool bIsEndStack;
void MoveAttrs( const SwPosition& rPos );
- virtual void SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry* pEntry);
+ virtual void SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry& rEntry);
public:
enum Flags
@@ -125,17 +169,18 @@ public:
void NewAttr(const SwPosition& rPos, const SfxPoolItem & rAttr );
- virtual void SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId=0, sal_Bool bTstEnde=sal_True, long nHand = LONG_MAX, sal_Bool consumedByField=sal_False);
+ virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId=0, sal_Bool bTstEnde=sal_True, long nHand = LONG_MAX, sal_Bool consumedByField=sal_False);
- void StealAttr(const SwPosition* pPos, sal_uInt16 nAttrId = 0);
+ void StealAttr(const SwNodeIndex& rNode, sal_uInt16 nAttrId = 0);
void MarkAllAttrsOld();
void KillUnlockedAttrs(const SwPosition& pPos);
SfxPoolItem* GetFmtStackAttr(sal_uInt16 nWhich, sal_uInt16 * pPos = 0);
const SfxPoolItem* GetFmtAttr(const SwPosition& rPos, sal_uInt16 nWhich);
void Delete(const SwPaM &rPam);
- Entries::size_type Count() { return maEntries.size(); }
- SwFltStackEntry* operator[](Entries::size_type nIndex)
+ bool empty() const { return maEntries.empty(); }
+ Entries::size_type size() const { return maEntries.size(); }
+ SwFltStackEntry& operator[](Entries::size_type nIndex)
{ return maEntries[nIndex]; }
void DeleteAndDestroy(Entries::size_type nCnt);
};
@@ -403,7 +448,6 @@ public:
{
// #i73790# - method renamed
pColl->ResetAllFmtAttr();
- // <--
pColl->SetAuto(sal_False); // nach Empfehlung JP
}
void Derived(SwTxtFmtColl* pBase)
diff --git a/sw/source/filter/inc/msfilter.hxx b/sw/source/filter/inc/msfilter.hxx
index 62239f462c..69885d156a 100644
--- a/sw/source/filter/inc/msfilter.hxx
+++ b/sw/source/filter/inc/msfilter.hxx
@@ -43,6 +43,8 @@
#include <shellio.hxx>
#include <svl/zforlist.hxx>
+#include <boost/noncopyable.hpp>
+
#define CREATE_CONST_ASC(s) String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM(s))
class SwDoc;
@@ -316,7 +318,6 @@ namespace sw
public:
String msPrimary;
String msSecondary;
- bool HasDistinctSecondary() const;
FontMapExport(const String &rFontDescription);
};
@@ -363,7 +364,7 @@ namespace sw
@author
<a href="mailto:mmaher@openoffice.org">Martin Maher</a>
*/
- class RedlineStack
+ class RedlineStack : public boost::noncopyable
{
private:
std::vector<SwFltStackEntry *> maStack;
@@ -377,10 +378,6 @@ namespace sw
WW8TabDesc* pTabDesc );
void closeall(const SwPosition& rPos);
~RedlineStack();
- private:
- //No copying
- RedlineStack(const RedlineStack&);
- RedlineStack& operator=(const RedlineStack&);
};
/**
@@ -403,20 +400,20 @@ namespace sw
@author
<a href="mailto:mmaher@openoffice.org">Martin Maher</a>
*/
- class CloseIfOpen //Subclass from something ?
+ class SetEndIfOpen //Subclass from something ?
{
private:
const SwPosition &mrPos;
public:
- explicit CloseIfOpen(const SwPosition &rPos) : mrPos(rPos) {}
+ explicit SetEndIfOpen(const SwPosition &rPos) : mrPos(rPos) {}
void operator()(SwFltStackEntry *pEntry) const
{
- if (pEntry->bLocked)
+ if (pEntry->bOpen)
pEntry->SetEndPos(mrPos);
}
private:
//No assignment
- CloseIfOpen& operator=(const CloseIfOpen&);
+ SetEndIfOpen& operator=(const SetEndIfOpen&);
};
/**
@@ -432,16 +429,12 @@ namespace sw
const;
};
- class WrtRedlineAuthor
+ class WrtRedlineAuthor : public boost::noncopyable
{
protected:
std::vector<String> maAuthors; // Array of Sw - Bookmarknames
sal_uInt16 GetPos( const String& rNm );
-
- //No copying
- WrtRedlineAuthor(const WrtRedlineAuthor&);
- WrtRedlineAuthor& operator=(const WrtRedlineAuthor&);
public:
WrtRedlineAuthor() {}
virtual ~WrtRedlineAuthor() {}
diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx
index 4d7eb4c940..081f93a36b 100644
--- a/sw/source/filter/inc/wrtswtbl.hxx
+++ b/sw/source/filter/inc/wrtswtbl.hxx
@@ -56,7 +56,7 @@ namespace editeng { class SvxBorderLine; }
//-----------------------------------------------------------------------
-class SwWriteTableCell
+class SW_DLLPUBLIC SwWriteTableCell
{
const SwTableBox *pBox; // SwTableBox der Zelle
const SvxBrushItem *pBackground; // geerbter Hintergrund einer Zeile
@@ -111,7 +111,7 @@ SV_DECL_PTRARR_DEL( SwWriteTableCells, SwWriteTableCellPtr, 5, 5 )
//-----------------------------------------------------------------------
-class SwWriteTableRow
+class SW_DLLPUBLIC SwWriteTableRow
{
SwWriteTableCells aCells; // Alle Zellen der Rows
const SvxBrushItem *pBackground;// Hintergrund
@@ -180,7 +180,7 @@ SV_DECL_PTRARR_SORT_DEL( SwWriteTableRows, SwWriteTableRowPtr, 5, 5 )
//-----------------------------------------------------------------------
-class SwWriteTableCol
+class SW_DLLPUBLIC SwWriteTableCol
{
sal_uInt32 nPos; // End Position der Spalte
diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx
index 8d66cad29b..f5d90588ec 100644
--- a/sw/source/filter/rtf/rtffld.cxx
+++ b/sw/source/filter/rtf/rtffld.cxx
@@ -687,9 +687,15 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr )
}
SwFmtRuby aRuby( aData.sUp );
- SwCharFmt * pCharFmt = -1 != aData.nStyleNo
- ? aCharFmtTbl.Get( aData.nStyleNo )
- : 0;
+ SwCharFmt * pCharFmt = NULL;
+
+ if ( aData.nStyleNo != -1)
+ {
+ std::map<sal_Int32,SwCharFmt*>::iterator iter = aCharFmtTbl.find(aData.nStyleNo);
+
+ if (iter != aCharFmtTbl.end())
+ pCharFmt = iter->second;
+ }
if( !pCharFmt )
{
diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx
index 3e023996b7..eb59eae295 100644
--- a/sw/source/filter/rtf/rtffly.cxx
+++ b/sw/source/filter/rtf/rtffly.cxx
@@ -66,7 +66,6 @@
#include <utility>
// #i27767#
#include <fmtwrapinfluenceonobjpos.hxx>
-// <--
#include <editeng/brshitem.hxx>
#include <fmtfollowtextflow.hxx>
#include "dcontact.hxx"
@@ -506,7 +505,6 @@ void SwRTFParser::SetFlysInDoc()
new SwFlyDrawContact( pFmt,
pFmt->GetDoc()->GetOrCreateDrawModel() );
pContact->GetMaster()->SetOrdNum( n );
- // <--
delete pFlySave;
}
@@ -557,7 +555,6 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet )
SwFmtAnchor aAnchor( FLY_AT_PARA );
SwFmtHoriOrient aHori( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME );
SwFmtVertOrient aVert( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME );
- // <--
SvxFrameDirectionItem aFrmDir( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR );
@@ -949,7 +946,6 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet )
// #i35017# - constant name has changed
pSet->Put( SwFmtWrapInfluenceOnObjPos(
text::WrapInfluenceOnPosition::ONCE_SUCCESSIVE ));
- // <--
SwFmtFollowTextFlow aFollowTextFlow( sal_False );
pSet->Put( aFollowTextFlow );
diff --git a/sw/source/filter/rtf/rtfnum.cxx b/sw/source/filter/rtf/rtfnum.cxx
index 60d5724a04..be2ec0fefb 100644
--- a/sw/source/filter/rtf/rtfnum.cxx
+++ b/sw/source/filter/rtf/rtfnum.cxx
@@ -593,18 +593,18 @@ void SwRTFParser::ReadListOverrideTable()
MakeStyleTab();
const SfxPoolItem* pItem( 0 );
- const SwTxtFmtColl* pColl( 0 );
+ std::map<sal_Int32,SwTxtFmtColl*>::const_iterator iterColl;
sal_uInt16 nRulePos( USHRT_MAX );
const SwNumRule *pNumRule = 0;
SvxRTFStyleType* pStyle = GetStyleTbl().First();
do {
if ( MAXLEVEL > pStyle->nOutlineNo )
{
- pColl = aTxtCollTbl.Get( (sal_uInt16)GetStyleTbl().GetCurKey() );
- if ( pColl )
+ iterColl = aTxtCollTbl.find( (sal_uInt16)GetStyleTbl().GetCurKey() );
+ if ( iterColl != aTxtCollTbl.end() )
{
const SfxItemState eItemState =
- pColl->GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem );
+ iterColl->second->GetItemState( RES_PARATR_NUMRULE, sal_False, &pItem );
if ( eItemState == SFX_ITEM_SET )
{
nRulePos = pDoc->FindNumRule( ((SwNumRuleItem*)pItem)->GetValue() );
@@ -634,7 +634,6 @@ void SwRTFParser::ReadListOverrideTable()
}
}
}
- // <--
pStyle->aAttrSet.ClearItem( FN_PARAM_NUM_LEVEL );
diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx
index 3b3b318659..5b46a54bf7 100644
--- a/sw/source/filter/rtf/rtftbl.cxx
+++ b/sw/source/filter/rtf/rtftbl.cxx
@@ -701,9 +701,13 @@ void SwRTFParser::ReadTable( int nToken )
if( aBoxFmts.Count() )
{
// setze das default Style
- SwTxtFmtColl* pColl = aTxtCollTbl.Get( 0 );
- if( !pColl )
+ SwTxtFmtColl* pColl = NULL;
+ std::map<sal_Int32,SwTxtFmtColl*>::iterator iter = aTxtCollTbl.find(0);
+
+ if( iter == aTxtCollTbl.end() )
pColl = pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false );
+ else
+ pColl = iter->second;
sal_uInt16 nStt = 0;
if( bNewTbl )
@@ -907,9 +911,14 @@ void SwRTFParser::NewTblLine()
// alle Nodes in den Boxen auf die "default" Vorlage setzten
{
- SwTxtFmtColl* pColl = aTxtCollTbl.Get( 0 );
- if( !pColl )
+ SwTxtFmtColl* pColl = NULL;
+ std::map<sal_Int32,SwTxtFmtColl*>::iterator iter = aTxtCollTbl.find( 0 );
+
+ if( iter == aTxtCollTbl.end() )
pColl = pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false );
+ else
+ pColl = iter->second;
+
pPam->SetMark();
pLine = (*pLns)[ pLns->Count()-1 ];
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index 49a6f77fec..640b0efffb 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -153,7 +153,7 @@ sal_uLong RtfReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPam, con
sal_uLong nRet = 0;
SwDocShell *pDocShell(rDoc.GetDocShell());
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
uno::Reference<document::XDocumentProperties> xDocProps;
if (pDocShell) {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
@@ -471,7 +471,6 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_False ).nNode.GetIndex() )
}
}
}
- // <--
if ( !bAnchoredObjs )
DelLastNode();
@@ -2035,9 +2034,14 @@ void SwRTFParser::InsertPara()
if( !bStyleTabValid )
MakeStyleTab();
- SwTxtFmtColl* pColl = aTxtCollTbl.Get( 0 );
- if( !pColl )
+ SwTxtFmtColl* pColl = NULL;
+ std::map<sal_Int32,SwTxtFmtColl*>::iterator iter = aTxtCollTbl.find(0);
+
+ if( iter == aTxtCollTbl.end() )
pColl = pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false );
+ else
+ pColl = iter->second;
+
pDoc->SetTxtFmtColl( *pPam, pColl );
::SetProgressState( rInput.Tell(), pDoc->GetDocShell() );
@@ -2130,9 +2134,11 @@ void SwRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet )
// setze jetzt das Style
if( !bStyleTabValid )
MakeStyleTab();
- SwTxtFmtColl* pColl = aTxtCollTbl.Get( rSet.StyleNo() );
- if( pColl )
- pDoc->SetTxtFmtColl( aPam, pColl, false );
+
+ std::map<sal_Int32,SwTxtFmtColl*>::iterator iter = aTxtCollTbl.find(rSet.StyleNo());
+
+ if (iter != aTxtCollTbl.end())
+ pDoc->SetTxtFmtColl( aPam, iter->second, false );
}
const SfxPoolItem* pItem;
@@ -2656,11 +2662,13 @@ void SwRTFParser::ReadDocControls( int nToken )
MakeStyleTab();
- SwTxtFmtColl* pColl = aTxtCollTbl.Get(0);
- if (!pColl)
- {
+ SwTxtFmtColl *pColl = NULL;
+ std::map<sal_Int32,SwTxtFmtColl*>::iterator iter = aTxtCollTbl.find(0);
+
+ if (iter == aTxtCollTbl.end())
pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD, false );
- }
+ else
+ pColl = iter->second;
OSL_ENSURE(pColl, "impossible to have no standard style");
@@ -2702,11 +2710,11 @@ void SwRTFParser::MakeStyleTab()
sal_uInt16 nNo = sal_uInt16( GetStyleTbl().GetCurKey() );
if( pStyle->bIsCharFmt )
{
- if( !aCharFmtTbl.Get( nNo ) )
+ if(aCharFmtTbl.find( nNo ) == aCharFmtTbl.end())
// existiert noch nicht, also anlegen
MakeCharStyle( nNo, *pStyle );
}
- else if( !aTxtCollTbl.Get( nNo ) )
+ else if( aTxtCollTbl.find( nNo ) == aTxtCollTbl.end() )
{
// existiert noch nicht, also anlegen
MakeStyle( nNo, *pStyle );
@@ -3189,9 +3197,14 @@ void SwRTFParser::ReadPageDescTbl()
// diese auch in den Headers/Footer benutzt werden koennen!
MakeStyleTab();
// das default-Style schon gleich am ersten Node setzen
- SwTxtFmtColl* pColl = aTxtCollTbl.Get( 0 );
- if( !pColl )
+ SwTxtFmtColl* pColl = NULL;
+ std::map<sal_Int32,SwTxtFmtColl*>::iterator iter = aTxtCollTbl.find( 0 );
+
+ if( iter == aTxtCollTbl.end() )
pColl = pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false );
+ else
+ pColl = iter->second;
+
pDoc->SetTxtFmtColl( *pPam, pColl );
int nToken, bSaveChkStyleAttr = IsChkStyleAttr();
@@ -3652,9 +3665,14 @@ void SwRTFParser::ReadHeaderFooter( int nToken, SwPageDesc* pPageDesc )
pPam->GetPoint()->nNode = *pNode->EndOfSectionNode();
pPam->Move( fnMoveBackward );
- SwTxtFmtColl* pColl = aTxtCollTbl.Get( 0 );
- if( !pColl )
+ SwTxtFmtColl* pColl = NULL;
+ std::map<sal_Int32,SwTxtFmtColl*>::iterator iter = aTxtCollTbl.find( 0 );
+
+ if( iter == aTxtCollTbl.end() )
pColl = pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false );
+ else
+ pColl = iter->second;
+
pDoc->SetTxtFmtColl( *pPam, pColl );
SetNewGroup( sal_True );
@@ -3928,7 +3946,7 @@ SwTxtFmtColl* SwRTFParser::MakeStyle( sal_uInt16 nNo, const SvxRTFStyleType& rSt
bool bCollExist;
SwTxtFmtColl* pColl = MakeColl( rStyle.sName, sal_uInt16(nNo),
rStyle.nOutlineNo, bCollExist);
- aTxtCollTbl.Insert( nNo, pColl );
+ aTxtCollTbl.insert(std::make_pair(nNo,pColl));
// in bestehendes Dok einfuegen, dann keine Ableitung usw. setzen
if( bCollExist )
@@ -3938,14 +3956,19 @@ SwTxtFmtColl* SwRTFParser::MakeStyle( sal_uInt16 nNo, const SvxRTFStyleType& rSt
if( rStyle.bBasedOnIsSet && nStyleNo != nNo )
{
SvxRTFStyleType* pDerivedStyle = GetStyleTbl().Get( nStyleNo );
- SwTxtFmtColl* pDerivedColl = aTxtCollTbl.Get( nStyleNo );
- if( !pDerivedColl ) // noch nicht vorhanden, also anlegen
+
+ SwTxtFmtColl* pDerivedColl = NULL;
+ std::map<sal_Int32,SwTxtFmtColl*>::iterator iter = aTxtCollTbl.find(nStyleNo);
+
+ if(iter == aTxtCollTbl.end() ) // noch nicht vorhanden, also anlegen
{
// ist die ueberhaupt als Style vorhanden ?
pDerivedColl = pDerivedStyle
? MakeStyle( nStyleNo, *pDerivedStyle )
: pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false );
}
+ else
+ pDerivedColl = iter->second;
if( pColl == pDerivedColl )
((SfxItemSet&)pColl->GetAttrSet()).Put( rStyle.aAttrSet );
@@ -3971,8 +3994,10 @@ SwTxtFmtColl* SwRTFParser::MakeStyle( sal_uInt16 nNo, const SvxRTFStyleType& rSt
nStyleNo = rStyle.nNext;
if( nStyleNo != nNo )
{
- SwTxtFmtColl* pNext = aTxtCollTbl.Get( nStyleNo );
- if( !pNext ) // noch nicht vorhanden, also anlegen
+ SwTxtFmtColl* pNext = NULL;
+ std::map<sal_Int32,SwTxtFmtColl*>::iterator iter = aTxtCollTbl.find( nStyleNo );
+
+ if( iter == aTxtCollTbl.end()) // noch nicht vorhanden, also anlegen
{
// ist die ueberhaupt als Style vorhanden ?
SvxRTFStyleType* pMkStyle = GetStyleTbl().Get( nStyleNo );
@@ -3980,6 +4005,9 @@ SwTxtFmtColl* SwRTFParser::MakeStyle( sal_uInt16 nNo, const SvxRTFStyleType& rSt
? MakeStyle( nStyleNo, *pMkStyle )
: pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false );
}
+ else
+ pNext = iter->second;
+
pColl->SetNextTxtFmtColl( *pNext );
}
return pColl;
@@ -3989,7 +4017,7 @@ SwCharFmt* SwRTFParser::MakeCharStyle( sal_uInt16 nNo, const SvxRTFStyleType& rS
{
int bCollExist;
SwCharFmt* pFmt = MakeCharFmt( rStyle.sName, sal_uInt16(nNo), bCollExist );
- aCharFmtTbl.Insert( nNo, pFmt );
+ aCharFmtTbl.insert(std::make_pair(nNo,pFmt));
// in bestehendes Dok einfuegen, dann keine Ableitung usw. setzen
if( bCollExist )
@@ -3999,14 +4027,18 @@ SwCharFmt* SwRTFParser::MakeCharStyle( sal_uInt16 nNo, const SvxRTFStyleType& rS
if( rStyle.bBasedOnIsSet && nStyleNo != nNo )
{
SvxRTFStyleType* pDerivedStyle = GetStyleTbl().Get( nStyleNo );
- SwCharFmt* pDerivedFmt = aCharFmtTbl.Get( nStyleNo );
- if( !pDerivedFmt ) // noch nicht vorhanden, also anlegen
+ SwCharFmt* pDerivedFmt = NULL;
+ std::map<sal_Int32,SwCharFmt*>::iterator iter = aCharFmtTbl.find( nStyleNo );
+
+ if(iter == aCharFmtTbl.end()) // noch nicht vorhanden, also anlegen
{
// ist die ueberhaupt als Style vorhanden ?
pDerivedFmt = pDerivedStyle
? MakeCharStyle( nStyleNo, *pDerivedStyle )
: pDoc->GetDfltCharFmt();
}
+ else
+ pDerivedFmt = iter->second;
if( pFmt == pDerivedFmt )
((SfxItemSet&)pFmt->GetAttrSet()).Put( rStyle.aAttrSet );
@@ -4142,9 +4174,10 @@ void SwRTFParser::UnknownAttrToken( int nToken, SfxItemSet* pSet )
break;
case RTF_CS:
{
- SwCharFmt* pFmt = aCharFmtTbl.Get( nTokenValue );
- if( pFmt )
- pSet->Put( SwFmtCharFmt( pFmt ));
+ std::map<sal_Int32,SwCharFmt*>::iterator iter = aCharFmtTbl.find( nTokenValue );
+
+ if(iter != aCharFmtTbl.end())
+ pSet->Put( SwFmtCharFmt(iter->second));
}
break;
diff --git a/sw/source/filter/rtf/swparrtf.hxx b/sw/source/filter/rtf/swparrtf.hxx
index 0d83382e99..7ad4d54c82 100644
--- a/sw/source/filter/rtf/swparrtf.hxx
+++ b/sw/source/filter/rtf/swparrtf.hxx
@@ -31,6 +31,7 @@
#include <deque>
#include <vector>
+#include <map>
#include <editeng/svxrtf.hxx>
#include <editeng/numitem.hxx>
@@ -145,8 +146,6 @@ struct SwListEntry
bRuleUsed = sal_False; }
};
-DECLARE_TABLE( SwRTFStyleTbl, SwTxtFmtColl* )
-DECLARE_TABLE( SwRTFCharStyleTbl, SwCharFmt* )
typedef SwFlySave* SwFlySavePtr;
SV_DECL_PTRARR_DEL( SwFlySaveArr, SwFlySavePtr, 0, 20 )
typedef std::deque< SwListEntry > SwListArr;
@@ -286,8 +285,8 @@ class SwRTFParser : public SvxRTFParser
rtfSections maSegments;
sw::util::InsertedTablesManager maInsertedTables;
- SwRTFStyleTbl aTxtCollTbl;
- SwRTFCharStyleTbl aCharFmtTbl;
+ std::map<sal_Int32,SwTxtFmtColl*> aTxtCollTbl;
+ std::map<sal_Int32,SwCharFmt*> aCharFmtTbl;
SwFlySaveArr aFlyArr; // Flys als Letzes im Doc setzen
std::vector<bool> aMergeBoxes; // Flags fuer gemergte Zellen
SwListArr aListArr;
diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx
index bd3a78c107..8e555056f7 100644
--- a/sw/source/filter/writer/writer.cxx
+++ b/sw/source/filter/writer/writer.cxx
@@ -427,7 +427,6 @@ void Writer::PutNumFmtFontsInAttrPool()
const SwNumFmt* pFmt;
const Font* pFont;
const Font* pDefFont = &numfunc::GetDefBulletFont();
- // <--
sal_Bool bCheck = sal_False;
for( sal_uInt16 nGet = rListTbl.Count(); nGet; )
@@ -467,14 +466,6 @@ void Writer::PutEditEngFontsInAttrPool( sal_Bool bIncl_CJK_CTL )
}
}
-void Writer::PutCJKandCTLFontsInAttrPool()
-{
- SfxItemPool& rPool = pDoc->GetAttrPool();
- _AddFontItems( rPool, RES_CHRATR_CJK_FONT );
- _AddFontItems( rPool, RES_CHRATR_CTL_FONT );
-}
-
-
void Writer::_AddFontItems( SfxItemPool& rPool, sal_uInt16 nW )
{
const SvxFontItem* pFont = (const SvxFontItem*)&rPool.GetDefaultItem( nW );
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index 6cdc136124..b1333fa560 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -29,7 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <hintids.hxx>
-#include <tools/debug.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brshitem.hxx>
#include <tools/fract.hxx>
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 55dda614ca..3b6db4bcdf 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -91,31 +91,16 @@ static SwCntntNode* GetCntntNode(SwDoc* pDoc, SwNodeIndex& rIdx, sal_Bool bNext)
}
// ------ Stack-Eintrag fuer die gesamten - Attribute vom Text -----------
-SwFltStackEntry::SwFltStackEntry(const SwPosition& rStartPos, SfxPoolItem* pHt ) :
- nMkNode(rStartPos.nNode, -1),
- nPtNode(nMkNode)
+SwFltStackEntry::SwFltStackEntry(const SwPosition& rStartPos, SfxPoolItem* pHt)
+ : m_aMkPos(rStartPos)
+ , m_aPtPos(rStartPos)
{
- // Anfang vom Bereich merken
- nMkCntnt = rStartPos.nContent.GetIndex();
pAttr = pHt; // speicher eine Kopie vom Attribut
bOld = sal_False; // used for marking Attributes *before* skipping field results
- bLocked = sal_True; // locke das Attribut --> darf erst
- bCopied = sal_False; // gesetzt werden, wenn es wieder geunlocked ist
+ bOpen = sal_True; // locke das Attribut --> darf erst
bConsumedByField = sal_False;
}
-SwFltStackEntry::SwFltStackEntry(const SwFltStackEntry& rEntry) :
- nMkNode(rEntry.nMkNode),
- nPtNode(rEntry.nPtNode)
-{
- pAttr = rEntry.pAttr->Clone();
- nMkCntnt= rEntry.nMkCntnt;
- bOld = rEntry.bOld;
- bLocked = bCopied = sal_True; // when rEntry were NOT bLocked we would never have been called
- bConsumedByField = rEntry.bConsumedByField;
-}
-
-
SwFltStackEntry::~SwFltStackEntry()
{
// Attribut kam zwar als Pointer, wird aber hier geloescht
@@ -130,35 +115,37 @@ void SwFltStackEntry::SetEndPos(const SwPosition& rEndPos)
// Cursor-Position auch der Bereich vom Attribut weiter
// verschoben wird.
// Das ist aber nicht das gewollte!
- bLocked = sal_False; // freigeben und das ENDE merken
- nPtNode = rEndPos.nNode.GetIndex()-1;
- nPtCntnt = rEndPos.nContent.GetIndex();
-}
-
-sal_Bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, sal_Bool bCheck )
-{
- // wird ueberhaupt ein Bereich umspannt ??
- // - ist kein Bereich, dann nicht returnen wenn am Anfang vom Absatz
- // - Felder aussortieren, koennen keinen Bereich haben !!
- if (
- nMkNode.GetIndex() == nPtNode.GetIndex() && nMkCntnt == nPtCntnt &&
- nPtCntnt && RES_TXTATR_FIELD != pAttr->Which()
- )
+ bOpen = sal_False; // freigeben und das ENDE merken
+ m_aPtPos.SetPos(rEndPos);
+}
+
+bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck,
+ const SwFltPosition &rMkPos, const SwFltPosition &rPtPos,
+ sal_uInt16 nWhich)
+{
+ // does this range actually contain something?
+ // empty range is allowed if at start of empty paragraph
+ // fields are special: never have range, so leave them
+ SwCntntNode *const pCntntNode(
+ SwNodeIndex(rMkPos.m_nNode, +1).GetNode().GetCntntNode());
+ if (rMkPos == rPtPos &&
+ ((0 != rPtPos.m_nCntnt) || (pCntntNode && (0 != pCntntNode->Len())))
+ && (RES_TXTATR_FIELD != nWhich))
{
- return sal_False;
+ return false;
}
// !!! Die Content-Indizies beziehen sich immer auf den Node !!!
- rRegion.GetPoint()->nNode = nMkNode.GetIndex() + 1;
+ rRegion.GetPoint()->nNode = rMkPos.m_nNode.GetIndex() + 1;
SwCntntNode* pCNd = GetCntntNode(pDoc, rRegion.GetPoint()->nNode, sal_True);
- rRegion.GetPoint()->nContent.Assign(pCNd, nMkCntnt);
+ rRegion.GetPoint()->nContent.Assign(pCNd, rMkPos.m_nCntnt);
rRegion.SetMark();
- if( nMkNode != nPtNode )
+ if (rMkPos.m_nNode != rPtPos.m_nNode)
{
- rRegion.GetPoint()->nNode = nPtNode.GetIndex() + 1;
+ rRegion.GetPoint()->nNode = rPtPos.m_nNode.GetIndex() + 1;
pCNd = GetCntntNode(pDoc, rRegion.GetPoint()->nNode, sal_False);
}
- rRegion.GetPoint()->nContent.Assign(pCNd, nPtCntnt);
+ rRegion.GetPoint()->nContent.Assign(pCNd, rPtPos.m_nCntnt);
#if OSL_DEBUG_LEVEL > 1
OSL_ENSURE( CheckNodesRange( rRegion.Start()->nNode,
rRegion.End()->nNode, sal_True ),
@@ -168,7 +155,13 @@ sal_Bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, sal_Bool bChec
return CheckNodesRange( rRegion.Start()->nNode,
rRegion.End()->nNode, sal_True );
else
- return sal_True;
+ return true;
+}
+
+bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck) const
+{
+ return MakeRegion(pDoc, rRegion, bCheck, m_aMkPos, m_aPtPos,
+ pAttr->Which());
}
SwFltControlStack::SwFltControlStack(SwDoc* pDo, sal_uLong nFieldFl)
@@ -179,7 +172,7 @@ SwFltControlStack::SwFltControlStack(SwDoc* pDo, sal_uLong nFieldFl)
SwFltControlStack::~SwFltControlStack()
{
- OSL_ENSURE(!Count(), "noch Attribute auf dem Stack");
+ OSL_ENSURE(maEntries.empty(), "There are still Attributes on the stack");
}
// MoveAttrs() ist fuer folgendes Problem:
@@ -192,24 +185,30 @@ SwFltControlStack::~SwFltControlStack()
// nach rechts verschoben werden.
void SwFltControlStack::MoveAttrs( const SwPosition& rPos )
{
- sal_uInt16 nCnt = static_cast< sal_uInt16 >(Count());
- SwFltStackEntry* pEntry;
+ size_t nCnt = maEntries.size();
sal_uLong nPosNd = rPos.nNode.GetIndex();
sal_uInt16 nPosCt = rPos.nContent.GetIndex() - 1;
- for (sal_uInt16 i=0; i < nCnt; i++){
- pEntry = (*this)[ i ];
- if(( pEntry->nMkNode.GetIndex() + 1 == nPosNd )
- &&( pEntry->nMkCntnt >= nPosCt )){
- pEntry->nMkCntnt++;
- OSL_ENSURE( pEntry->nMkCntnt
+ for (size_t i=0; i < nCnt; ++i)
+ {
+ SwFltStackEntry& rEntry = maEntries[i];
+ if (
+ (rEntry.m_aMkPos.m_nNode.GetIndex()+1 == nPosNd) &&
+ (rEntry.m_aMkPos.m_nCntnt >= nPosCt)
+ )
+ {
+ rEntry.m_aMkPos.m_nCntnt++;
+ OSL_ENSURE( rEntry.m_aMkPos.m_nCntnt
<= pDoc->GetNodes()[nPosNd]->GetCntntNode()->Len(),
"Attribut-Anfang hinter Zeilenende" );
}
- if(( pEntry->nPtNode.GetIndex() + 1 == nPosNd )
- &&( pEntry->nPtCntnt >= nPosCt )){
- pEntry->nPtCntnt++;
- OSL_ENSURE( pEntry->nPtCntnt
+ if (
+ (rEntry.m_aPtPos.m_nNode.GetIndex()+1 == nPosNd) &&
+ (rEntry.m_aPtPos.m_nCntnt >= nPosCt)
+ )
+ {
+ rEntry.m_aPtPos.m_nCntnt++;
+ OSL_ENSURE( rEntry.m_aPtPos.m_nCntnt
<= pDoc->GetNodes()[nPosNd]->GetCntntNode()->Len(),
"Attribut-Ende hinter Zeilenende" );
}
@@ -218,19 +217,44 @@ void SwFltControlStack::MoveAttrs( const SwPosition& rPos )
void SwFltControlStack::MarkAllAttrsOld()
{
- sal_uInt16 nCnt = static_cast< sal_uInt16 >(Count());
- for (sal_uInt16 i=0; i < nCnt; i++)
- (*this)[ i ]->bOld = sal_True;
+ size_t nCnt = maEntries.size();
+ for (sal_uInt16 i=0; i < nCnt; ++i)
+ maEntries[i].bOld = sal_True;
}
-void SwFltControlStack::NewAttr(const SwPosition& rPos, const SfxPoolItem & rAttr )
+namespace
{
- SwFltStackEntry *pTmp = new SwFltStackEntry(rPos, rAttr.Clone() );
- sal_uInt16 nWhich = pTmp->pAttr->Which();
- SetAttr(rPos, nWhich);// Ende von evtl. gleichen Attributen auf dem Stack
- // Setzen, damit sich die Attribute nicht auf
- // dem Stack haeufen
- maEntries.push_back(pTmp);
+ bool couldExtendEntry(const SwFltStackEntry *pExtendCandidate,
+ const SfxPoolItem& rAttr)
+ {
+ return (pExtendCandidate &&
+ !pExtendCandidate->bConsumedByField &&
+ //potentially more, but lets keep it simple
+ (isPARATR_LIST(rAttr.Which()) || isCHRATR(rAttr.Which())) &&
+ *(pExtendCandidate->pAttr) == rAttr);
+ }
+}
+
+void SwFltControlStack::NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr)
+{
+ sal_uInt16 nWhich = rAttr.Which();
+ // Ende von evtl. gleichen Attributen auf dem Stack Setzen, damit sich die
+ // Attribute nicht auf dem Stack haeufen
+ SwFltStackEntry *pExtendCandidate = SetAttr(rPos, nWhich);
+ if (couldExtendEntry(pExtendCandidate, rAttr))
+ {
+ //Here we optimize by seeing if there is an attribute uncommited
+ //to the document which
+ //
+ //a) has the same value as this attribute
+ //b) is already open, or ends at the same place as where we're starting
+ //from. If so we merge it with this one and elide adding another
+ //to the stack
+ pExtendCandidate->SetEndPos(rPos);
+ pExtendCandidate->bOpen=true;
+ }
+ else
+ maEntries.push_back(new SwFltStackEntry(rPos, rAttr.Clone()));
}
void SwFltControlStack::DeleteAndDestroy(Entries::size_type nCnt)
@@ -239,7 +263,6 @@ void SwFltControlStack::DeleteAndDestroy(Entries::size_type nCnt)
if (nCnt < maEntries.size())
{
myEIter aElement = maEntries.begin() + nCnt;
- delete *aElement;
maEntries.erase(aElement);
}
}
@@ -247,46 +270,42 @@ void SwFltControlStack::DeleteAndDestroy(Entries::size_type nCnt)
// SwFltControlStack::StealAttr() loescht Attribute des angegebenen Typs vom Stack.
// Als nAttrId sind erlaubt: 0 fuer alle, oder ein spezieller Typ.
// Damit erscheinen sie nicht in der Doc-Struktur. Dabei werden nur die
-// Attribute entfernt, die im selben Absatz wie pPos stehen.
+// Attribute entfernt, die im selben Absatz wie rPos stehen.
// Wird fuer Grafik-Apos -> Grafiken benutzt.
-void SwFltControlStack::StealAttr(const SwPosition* pPos, sal_uInt16 nAttrId /* = 0 */)
+void SwFltControlStack::StealAttr(const SwNodeIndex& rNode, sal_uInt16 nAttrId)
{
- sal_uInt16 nCnt = static_cast< sal_uInt16 >(Count());
-
- SwFltStackEntry* pEntry;
+ size_t nCnt = maEntries.size();
while (nCnt)
{
nCnt --;
- pEntry = (*this)[ nCnt ];
- if (pEntry->nPtNode.GetIndex()+1 == pPos->nNode.GetIndex() &&
- (!nAttrId || nAttrId == pEntry->pAttr->Which()))
+ SwFltStackEntry& rEntry = maEntries[nCnt];
+ if (rEntry.m_aPtPos.m_nNode.GetIndex()+1 == rNode.GetIndex() &&
+ (!nAttrId || nAttrId == rEntry.pAttr->Which()))
+ {
DeleteAndDestroy(nCnt); // loesche aus dem Stack
+ }
}
}
// SwFltControlStack::KillUnlockedAttr() loescht alle Attribute vom Stack,
-// welche punktuell auf pPos aufgespannt sind.
+// welche punktuell auf rPos aufgespannt sind.
// Damit erscheinen sie nicht in der Doc-Struktur.
// Wird im WW Import benoetigt zum ignorieren der auf dem 0x0c Section-
// Break-Symbol gesetzten Attribute.
-void SwFltControlStack::KillUnlockedAttrs(const SwPosition& pPos)
+void SwFltControlStack::KillUnlockedAttrs(const SwPosition& rPos)
{
- SwNodeIndex aAktNode( pPos.nNode, -1 );
- sal_uInt16 nAktIdx = pPos.nContent.GetIndex();
+ SwFltPosition aFltPos(rPos);
- sal_uInt16 nCnt = static_cast< sal_uInt16 >(Count());
- SwFltStackEntry* pEntry;
+ size_t nCnt = maEntries.size();
while( nCnt )
{
nCnt --;
- pEntry = (*this)[ nCnt ];
- if( !pEntry->bOld
- && !pEntry->bLocked
- && (pEntry->nMkNode == aAktNode)
- && (pEntry->nMkCntnt == nAktIdx )
- && (pEntry->nPtNode == aAktNode)
- && (pEntry->nPtCntnt == nAktIdx ))
+ SwFltStackEntry& rEntry = maEntries[nCnt];
+ if( !rEntry.bOld
+ && !rEntry.bOpen
+ && (rEntry.m_aMkPos == aFltPos)
+ && (rEntry.m_aPtPos == aFltPos))
{
DeleteAndDestroy( nCnt ); // loesche aus dem Stack
}
@@ -297,39 +316,55 @@ void SwFltControlStack::KillUnlockedAttrs(const SwPosition& pPos)
// alle anderen im Document setzen und wieder aus dem Stack loeschen
// Returned, ob das gesuchte Attribut / die gesuchten Attribute
// ueberhaupt auf dem Stack standen
-void SwFltControlStack::SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId,
- sal_Bool bTstEnde, long nHand, sal_Bool consumedByField )
+SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
+ sal_uInt16 nAttrId, sal_Bool bTstEnde, long nHand,
+ sal_Bool consumedByField)
{
+ SwFltStackEntry *pRet = NULL;
+
+ SwFltPosition aFltPos(rPos);
+
OSL_ENSURE(!nAttrId ||
(POOLATTR_BEGIN <= nAttrId && POOLATTR_END > nAttrId) ||
(RES_FLTRATTR_BEGIN <= nAttrId && RES_FLTRATTR_END > nAttrId),
"Falsche Id fuers Attribut");
- sal_uInt16 nCnt = static_cast< sal_uInt16 >(Count());
-
- SwFltStackEntry* pEntry;
-
- for (sal_uInt16 i=0; i < nCnt; i++)
+ myEIter aI = maEntries.begin();
+ while (aI != maEntries.end())
{
- pEntry = (*this)[ i ];
- if (pEntry->bLocked)
+ SwFltStackEntry& rEntry = *aI;
+ if (rEntry.bOpen)
{
// setze das Ende vom Attribut
bool bF = false;
- if (!nAttrId ){
+ if (!nAttrId )
+ {
bF = true;
- }else if( nAttrId == pEntry->pAttr->Which()){
- if( nAttrId != RES_FLTR_BOOKMARK ){ // Handle abfragen
+ }
+ else if (nAttrId == rEntry.pAttr->Which())
+ {
+ if( nAttrId != RES_FLTR_BOOKMARK )
+ {
+ // Handle abfragen
bF = true;
- }else if( nHand == ((SwFltBookmark*)(pEntry->pAttr))->GetHandle() )
+ }
+ else if (nHand == ((SwFltBookmark*)(rEntry.pAttr))->GetHandle())
{
bF = true;
}
}
- if (bF) {
- pEntry->bConsumedByField = consumedByField;
- pEntry->SetEndPos(rPos);
+ if (bF)
+ {
+ rEntry.bConsumedByField = consumedByField;
+ rEntry.SetEndPos(rPos);
+ if (nAttrId == rEntry.pAttr->Which())
+ {
+ //potential candidate for merging with an identical
+ //property beginning at rPos
+ pRet = &rEntry;
+ }
}
+ ++aI;
continue;
}
@@ -339,35 +374,54 @@ void SwFltControlStack::SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId,
// Beim Ende-Stack niemals ausser am DocEnde reinsetzen
if (bTstEnde)
{
- if (bIsEndStack || pEntry->nPtNode.GetIndex()+1 ==
- rPos.nNode.GetIndex())
- continue;
+ if (bIsEndStack)
+ {
+ ++aI;
+ continue;
+ }
+
+ //defer inserting this attribute into the document until
+ //we advance to the next node, or finish processing the document
+ if (rEntry.m_aPtPos.m_nNode.GetIndex() == aFltPos.m_nNode.GetIndex())
+ {
+ if (nAttrId == rEntry.pAttr->Which() &&
+ rEntry.m_aPtPos.m_nCntnt == aFltPos.m_nCntnt)
+ {
+ //potential candidate for merging with an identical
+ //property beginning at rPos
+ pRet = &rEntry;
+ }
+
+ ++aI;
+ continue;
+ }
}
- SetAttrInDoc(rPos, pEntry);
- DeleteAndDestroy(i); // loesche aus dem Stack
- i--; nCnt--; // Danach rutschen alle folgenden nach unten
+ SetAttrInDoc(rPos, rEntry);
+ aI = maEntries.erase(aI);
}
+
+ return pRet;
}
-static void MakePoint(SwFltStackEntry* pEntry, SwDoc* pDoc, SwPaM& rRegion)
+static void MakePoint(const SwFltStackEntry& rEntry, SwDoc* pDoc,
+ SwPaM& rRegion)
{
- // der Anker ist der Point vom Pam. Dieser wird beim Einfugen
- // von Text usw. veraendert; darum wird er auf dem Stack
- // gespeichert. Das Attribut muss nur noch im Format
- // gesetzt werden.
+ // der Anker ist der Point vom Pam. Dieser wird beim Einfugen von Text usw.
+ // veraendert; darum wird er auf dem Stack gespeichert. Das Attribut muss
+ // nur noch im Format gesetzt werden.
rRegion.DeleteMark();
- rRegion.GetPoint()->nNode = pEntry->nMkNode.GetIndex() + 1;
+ rRegion.GetPoint()->nNode = rEntry.m_aMkPos.m_nNode.GetIndex() + 1;
SwCntntNode* pCNd = GetCntntNode(pDoc, rRegion.GetPoint()->nNode, sal_True);
- rRegion.GetPoint()->nContent.Assign(pCNd, pEntry->nMkCntnt);
+ rRegion.GetPoint()->nContent.Assign(pCNd, rEntry.m_aMkPos.m_nCntnt);
}
// MakeBookRegionOrPoint() ist wie MakeRegionOrPoint, aber die besonderen
// Beschraenkungen von Bookmarks in Tabellen werden beachtet.
// ( Anfang und Ende muessen in selber Zelle sein )
-static void MakeBookRegionOrPoint(SwFltStackEntry* pEntry, SwDoc* pDoc,
+static void MakeBookRegionOrPoint(const SwFltStackEntry& rEntry, SwDoc* pDoc,
SwPaM& rRegion, sal_Bool bCheck )
{
- if (pEntry->MakeRegion(pDoc, rRegion, bCheck )){
+ if (rEntry.MakeRegion(pDoc, rRegion, bCheck )){
// sal_Bool b1 = rNds[rRegion.GetPoint()->nNode]->FindTableNode() != 0;
if (rRegion.GetPoint()->nNode.GetNode().FindTableBoxStartNode()
!= rRegion.GetMark()->nNode.GetNode().FindTableBoxStartNode())
@@ -376,7 +430,7 @@ static void MakeBookRegionOrPoint(SwFltStackEntry* pEntry, SwDoc* pDoc,
rRegion.DeleteMark(); // -> beide auf Mark
}
}else{
- MakePoint(pEntry, pDoc, rRegion);
+ MakePoint(rEntry, pDoc, rRegion);
}
}
@@ -411,18 +465,19 @@ static sal_Bool IterateNumrulePiece( const SwNodeIndex& rEnd,
return rTmpStart <= rTmpEnd; // gueltig ?
}
-void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry* pEntry)
+void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
+ SwFltStackEntry& rEntry)
{
SwPaM aRegion( rTmpPos );
- switch(pEntry->pAttr->Which())
+ switch(rEntry.pAttr->Which())
{
case RES_FLTR_ANCHOR:
{
- SwFrmFmt* pFmt = ((SwFltAnchor*)pEntry->pAttr)->GetFrmFmt();
+ SwFrmFmt* pFmt = ((SwFltAnchor*)rEntry.pAttr)->GetFrmFmt();
if (pFmt != NULL)
{
- MakePoint(pEntry, pDoc, aRegion);
+ MakePoint(rEntry, pDoc, aRegion);
SwFmtAnchor aAnchor(pFmt->GetAnchor());
aAnchor.SetAnchor(aRegion.GetPoint());
pFmt->SetFmtAttr(aAnchor);
@@ -444,11 +499,11 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry*
break;
case RES_FLTR_NUMRULE: // Numrule 'reinsetzen
{
- const String& rNumNm = ((SfxStringItem*)pEntry->pAttr)->GetValue();
+ const String& rNumNm = ((SfxStringItem*)rEntry.pAttr)->GetValue();
SwNumRule* pRul = pDoc->FindNumRulePtr( rNumNm );
if( pRul )
{
- if( pEntry->MakeRegion(pDoc, aRegion, sal_True))
+ if( rEntry.MakeRegion(pDoc, aRegion, sal_True))
{
SwNodeIndex aTmpStart( aRegion.Start()->nNode );
SwNodeIndex aTmpEnd( aTmpStart );
@@ -473,15 +528,15 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry*
break;
case RES_FLTR_BOOKMARK: // eigentlich nur fuer den Ende-Stack
{
- SwFltBookmark* pB = (SwFltBookmark*)pEntry->pAttr;
- const String& rName = ((SwFltBookmark*)pEntry->pAttr)->GetName();
+ SwFltBookmark* pB = (SwFltBookmark*)rEntry.pAttr;
+ const String& rName = ((SwFltBookmark*)rEntry.pAttr)->GetName();
if (IsFlagSet(BOOK_TO_VAR_REF))
{
if (pB->IsPgRef() && !pB->IsRef())
{
// XRefs und Bookmarks sind bereits geUpcased
- MakeBookRegionOrPoint(pEntry, pDoc, aRegion, sal_True);
+ MakeBookRegionOrPoint(rEntry, pDoc, aRegion, sal_True);
pDoc->InsertPoolItem(aRegion, SwFmtRefMark(rName), 0);
}
else if( !pB->IsOnlyRef() )
@@ -495,26 +550,26 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry*
SwSetExpField aFld((SwSetExpFieldType*)pFT,
pB->GetValSys());
aFld.SetSubType( nsSwExtendedSubType::SUB_INVISIBLE );
- MakePoint(pEntry, pDoc, aRegion);
+ MakePoint(rEntry, pDoc, aRegion);
pDoc->InsertPoolItem(aRegion, SwFmtFld(aFld), 0);
MoveAttrs( *(aRegion.GetPoint()) );
}
}
if( !pB->IsOnlyRef() &&
- ( !IsFlagSet(HYPO) || IsFlagSet(BOOK_AND_REF) ) && !pEntry->bConsumedByField)
+ ( !IsFlagSet(HYPO) || IsFlagSet(BOOK_AND_REF) ) && !rEntry.bConsumedByField)
{
- MakeBookRegionOrPoint(pEntry, pDoc, aRegion, sal_True);
+ MakeBookRegionOrPoint(rEntry, pDoc, aRegion, sal_True);
pDoc->getIDocumentMarkAccess()->makeMark( aRegion, rName, IDocumentMarkAccess::BOOKMARK);
}
}
break;
case RES_FLTR_TOX:
{
- MakePoint(pEntry, pDoc, aRegion);
+ MakePoint(rEntry, pDoc, aRegion);
SwPosition* pPoint = aRegion.GetPoint();
- SwFltTOX* pTOXAttr = (SwFltTOX*)pEntry->pAttr;
+ SwFltTOX* pTOXAttr = (SwFltTOX*)rEntry.pAttr;
// test if on this node there had been a pagebreak BEFORE the
// tox attribut was put on the stack
@@ -553,20 +608,20 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry*
}
break;
case RES_FLTR_SECTION:
- MakePoint(pEntry, pDoc, aRegion); // bislang immer Point==Mark
+ MakePoint(rEntry, pDoc, aRegion); // bislang immer Point==Mark
pDoc->InsertSwSection(aRegion,
- *(static_cast<SwFltSection*>(pEntry->pAttr))->GetSectionData(),
+ *(static_cast<SwFltSection*>(rEntry.pAttr))->GetSectionData(),
0, 0, false);
- delete (((SwFltSection*)pEntry->pAttr)->GetSectionData());
+ delete (((SwFltSection*)rEntry.pAttr)->GetSectionData());
break;
case RES_FLTR_REDLINE:
{
- if (pEntry->MakeRegion(pDoc, aRegion, sal_True))
+ if (rEntry.MakeRegion(pDoc, aRegion, sal_True))
{
pDoc->SetRedlineMode((RedlineMode_t)( nsRedlineMode_t::REDLINE_ON
| nsRedlineMode_t::REDLINE_SHOW_INSERT
| nsRedlineMode_t::REDLINE_SHOW_DELETE ));
- SwFltRedline& rFltRedline = *((SwFltRedline*)pEntry->pAttr);
+ SwFltRedline& rFltRedline = *((SwFltRedline*)rEntry.pAttr);
if( USHRT_MAX != rFltRedline.nAutorNoPrev )
{
@@ -592,9 +647,9 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry*
}
break;
default:
- if (pEntry->MakeRegion(pDoc, aRegion, sal_False))
+ if (rEntry.MakeRegion(pDoc, aRegion, sal_False))
{
- pDoc->InsertPoolItem(aRegion, *pEntry->pAttr, 0);
+ pDoc->InsertPoolItem(aRegion, *rEntry.pAttr, 0);
}
break;
}
@@ -602,19 +657,18 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry*
SfxPoolItem* SwFltControlStack::GetFmtStackAttr(sal_uInt16 nWhich, sal_uInt16 * pPos)
{
- SwFltStackEntry* pEntry;
- sal_uInt16 nSize = static_cast< sal_uInt16 >(Count());
+ size_t nSize = maEntries.size();
while (nSize)
{
// ist es das gesuchte Attribut ? (gueltig sind nur gelockte,
// also akt. gesetzte Attribute!!)
- if ((pEntry = (*this)[ --nSize ])->bLocked &&
- pEntry->pAttr->Which() == nWhich)
+ SwFltStackEntry &rEntry = maEntries[--nSize];
+ if (rEntry.bOpen && rEntry.pAttr->Which() == nWhich)
{
if (pPos)
*pPos = nSize;
- return (SfxPoolItem*)pEntry->pAttr; // Ok, dann Ende
+ return (SfxPoolItem*)rEntry.pAttr; // Ok, dann Ende
}
}
return 0;
@@ -651,25 +705,29 @@ void SwFltControlStack::Delete(const SwPaM &rPam)
if (aEndNode != aStartNode)
return;
- for (sal_uInt16 nSize = static_cast< sal_uInt16 >(Count()); nSize > 0;)
+ for (size_t nSize = maEntries.size(); nSize > 0;)
{
- SwFltStackEntry* pEntry = (*this)[--nSize];
+ SwFltStackEntry& rEntry = maEntries[--nSize];
bool bEntryStartAfterSelStart =
- (pEntry->nMkNode == aStartNode && pEntry->nMkCntnt >= nStartIdx);
+ (rEntry.m_aMkPos.m_nNode == aStartNode &&
+ rEntry.m_aMkPos.m_nCntnt >= nStartIdx);
bool bEntryStartBeforeSelEnd =
- (pEntry->nMkNode == aEndNode && pEntry->nMkCntnt <= nEndIdx);
+ (rEntry.m_aMkPos.m_nNode == aEndNode &&
+ rEntry.m_aMkPos.m_nCntnt <= nEndIdx);
bool bEntryEndAfterSelStart = false;
bool bEntryEndBeforeSelEnd = false;
- if (!pEntry->bLocked)
+ if (!rEntry.bOpen)
{
bEntryEndAfterSelStart =
- (pEntry->nPtNode == aStartNode && pEntry->nPtCntnt >= nStartIdx);
+ (rEntry.m_aPtPos.m_nNode == aStartNode &&
+ rEntry.m_aPtPos.m_nCntnt >= nStartIdx);
bEntryEndBeforeSelEnd =
- (pEntry->nPtNode == aEndNode && pEntry->nPtCntnt <= nEndIdx);
+ (rEntry.m_aPtPos.m_nNode == aEndNode &&
+ rEntry.m_aPtPos.m_nCntnt <= nEndIdx);
}
bool bTotallyContained = false;
@@ -696,27 +754,23 @@ void SwFltControlStack::Delete(const SwPaM &rPam)
if (bEntryStartBeforeSelEnd)
{
//move start to new start
- pEntry->nMkNode = aStartNode;
- pEntry->nMkCntnt = nStartIdx;
+ rEntry.m_aMkPos.SetPos(aStartNode, nStartIdx);
}
else
- pEntry->nMkCntnt = pEntry->nMkCntnt - nCntntDiff;
+ rEntry.m_aMkPos.m_nCntnt -= nCntntDiff;
}
if (bEntryEndAfterSelStart)
{
if (bEntryEndBeforeSelEnd)
- {
- pEntry->nPtNode = aStartNode;
- pEntry->nPtCntnt = nStartIdx;
- }
+ rEntry.m_aPtPos.SetPos(aStartNode, nStartIdx);
else
- pEntry->nPtCntnt = pEntry->nPtCntnt - nCntntDiff;
+ rEntry.m_aPtPos.m_nCntnt -= nCntntDiff;
}
- //That's what locked is, end equal to start, and nPtCntnt is invalid
- if (pEntry->bLocked)
- pEntry->nPtNode = pEntry->nMkNode;
+ //That's what Open is, end equal to start, and nPtCntnt is invalid
+ if (rEntry.bOpen)
+ rEntry.m_aPtPos = rEntry.m_aMkPos;
}
}
@@ -1081,7 +1135,7 @@ void SwFltShell::NextPage()
SwFltShell& SwFltShell::AddGraphic( const String& rPicName )
{
// embedded:
- GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter();
+ GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter();
Graphic aGraphic;
// one of: GFF_NOT GFF_BMP GFF_GIF GFF_JPG GFF_PCD GFF_PCX GFF_PNG
// GFF_TIF GFF_XBM GFF_DXF GFF_MET GFF_PCT GFF_SGF GFF_SVM GFF_WMF
@@ -1090,7 +1144,7 @@ SwFltShell& SwFltShell::AddGraphic( const String& rPicName )
URIHelper::SmartRel2Abs(
INetURLObject(GetBaseURL()), rPicName,
URIHelper::GetMaybeFileHdl()) );
- switch (pFilter->ImportGraphic(aGraphic, aDir))
+ switch (rFilter.ImportGraphic(aGraphic, aDir))
{
case GRFILTER_OK:
*this << aGraphic;
diff --git a/sw/source/filter/ww1/w1class.cxx b/sw/source/filter/ww1/w1class.cxx
index f1dd20df5a..91539d33e2 100644
--- a/sw/source/filter/ww1/w1class.cxx
+++ b/sw/source/filter/ww1/w1class.cxx
@@ -66,7 +66,7 @@ Ww1PlainText::Ww1PlainText(Ww1Fib& rWwFib, sal_uLong nFilePos, sal_uLong nCountB
sal_Unicode Ww1PlainText::operator [] ( sal_uLong ulOffset )
{
- DBG_ASSERT( ulOffset<Count(), "Ww1PlainText" );
+ OSL_ENSURE( ulOffset<Count(), "Ww1PlainText" );
sal_Unicode cRet;
sal_Char cRead;
if( rFib.GetStream().Seek( ulFilePos + ulOffset ) == ulFilePos+ulOffset &&
@@ -83,7 +83,7 @@ String Ww1PlainText::GetText( sal_uLong ulOffset, sal_uLong nLen ) const
{
String sRet;
ByteString aStr;
- DBG_ASSERT(ulOffset+nLen<Count(), "Ww1PlainText");
+ OSL_ENSURE(ulOffset+nLen<Count(), "Ww1PlainText");
if( rFib.GetStream().Seek(ulFilePos+ulOffset) == ulFilePos+ulOffset &&
rFib.GetStream().Read( aStr.AllocBuffer( static_cast< xub_StrLen >(nLen) ), nLen ) == nLen )
sRet = String( aStr, RTL_TEXTENCODING_MS_1252 );
@@ -170,7 +170,7 @@ sal_uInt16 Ww1Style::ReadName( sal_uInt8*&p, sal_uInt16& rnCountBytes, sal_uInt1
{
SetName( String( (sal_Char*)p, nCountBytes, RTL_TEXTENCODING_MS_1252 ));
p += nCountBytes;
- DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1Style");
+ OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1Style");
rnCountBytes = rnCountBytes - nCountBytes;
}
return 0;
@@ -188,7 +188,7 @@ sal_uInt16 Ww1Style::ReadChpx( sal_uInt8*&p, sal_uInt16& rnCountBytes )
nCountBytes = sizeof(aChpx);
memcpy( &aChpx, p, nCountBytes );
p += nCountBytes;
- DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1Style");
+ OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1Style");
rnCountBytes = rnCountBytes - nCountBytes;
}
return 0;
@@ -203,7 +203,7 @@ sal_uInt16 Ww1Style::ReadPapx(sal_uInt8*&p, sal_uInt16& rnCountBytes)
{
pPapx = new Ww1SprmPapx(p, nCountBytes);
p += nCountBytes;
- DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1Style");
+ OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1Style");
rnCountBytes = rnCountBytes - nCountBytes;
}
else
@@ -218,7 +218,7 @@ sal_uInt16 Ww1Style::ReadEstcp(sal_uInt8*&p, sal_uInt16& rnCountBytes)
rnCountBytes--;
stcBase = SVBT8ToByte(p);
p++;
- DBG_ASSERT(rnCountBytes>0, "Ww1Style");
+ OSL_ENSURE(rnCountBytes>0, "Ww1Style");
rnCountBytes--;
return 0;
}
@@ -230,7 +230,7 @@ Ww1StyleSheet::Ww1StyleSheet(Ww1Fib& _rFib)
bOK(sal_False)
{
sal_uInt16 cbStshf = rFib.GetFIB().cbStshfGet();
- DBG_ASSERT(cbStshf>=17, "Ww1StyleSheet");
+ OSL_ENSURE(cbStshf>=17, "Ww1StyleSheet");
for (sal_uInt16 stc=0;stc<Count();stc++)
{
aStyles[stc].SetParent(this);
@@ -250,7 +250,7 @@ Ww1StyleSheet::Ww1StyleSheet(Ww1Fib& _rFib)
ReadChpx(p, cbStshf);
ReadPapx(p, cbStshf);
ReadEstcp(p, cbStshf);
- DBG_ASSERT(cbStshf==0, "Ww1StyleSheet");
+ OSL_ENSURE(cbStshf==0, "Ww1StyleSheet");
bOK = cbStshf == 0;
}
delete [] del;
@@ -260,7 +260,7 @@ sal_uInt16 Ww1StyleSheet::ReadNames( sal_uInt8*& p, sal_uInt16& rnCountBytes )
{
sal_uInt16 nCountBytes = SVBT16ToShort(p);
p += sizeof(SVBT16);
- DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
+ OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
rnCountBytes = rnCountBytes - nCountBytes;
nCountBytes = nCountBytes - sizeof(SVBT16);
sal_uInt16 stcp = 0;
@@ -270,7 +270,7 @@ sal_uInt16 Ww1StyleSheet::ReadNames( sal_uInt8*& p, sal_uInt16& rnCountBytes )
aStyles[stc].ReadName(p, nCountBytes, stc);
stcp++;
}
- DBG_ASSERT(nCountBytes==0, "Ww1StyleSheet");
+ OSL_ENSURE(nCountBytes==0, "Ww1StyleSheet");
return 0;
}
@@ -278,7 +278,7 @@ sal_uInt16 Ww1StyleSheet::ReadChpx(sal_uInt8*& p, sal_uInt16& rnCountBytes)
{
sal_uInt16 nCountBytes = SVBT16ToShort(p);
p += sizeof(SVBT16);
- DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
+ OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
rnCountBytes = rnCountBytes - nCountBytes;
nCountBytes = nCountBytes - sizeof(SVBT16);
sal_uInt16 stcp = 0;
@@ -288,7 +288,7 @@ sal_uInt16 Ww1StyleSheet::ReadChpx(sal_uInt8*& p, sal_uInt16& rnCountBytes)
aStyles[stc].ReadChpx(p, nCountBytes);
stcp++;
}
- DBG_ASSERT(nCountBytes == 0, "Ww1StyleSheet");
+ OSL_ENSURE(nCountBytes == 0, "Ww1StyleSheet");
return 0;
}
@@ -296,7 +296,7 @@ sal_uInt16 Ww1StyleSheet::ReadPapx(sal_uInt8*& p, sal_uInt16& rnCountBytes)
{
sal_uInt16 nCountBytes = SVBT16ToShort(p);
p += sizeof(SVBT16);
- DBG_ASSERT(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
+ OSL_ENSURE(rnCountBytes>=nCountBytes, "Ww1StyleSheet");
rnCountBytes = rnCountBytes - nCountBytes;
nCountBytes = nCountBytes - sizeof(SVBT16);
sal_uInt16 stcp = 0;
@@ -306,7 +306,7 @@ sal_uInt16 Ww1StyleSheet::ReadPapx(sal_uInt8*& p, sal_uInt16& rnCountBytes)
aStyles[stc].ReadPapx(p, nCountBytes);
stcp++;
}
- DBG_ASSERT(nCountBytes == 0, "Ww1StyleSheet");
+ OSL_ENSURE(nCountBytes == 0, "Ww1StyleSheet");
return 0;
}
@@ -314,14 +314,14 @@ sal_uInt16 Ww1StyleSheet::ReadEstcp(sal_uInt8*& p, sal_uInt16& rnCountBytes)
{
sal_uInt16 iMac = SVBT16ToShort(p);
p += sizeof(SVBT16);
- DBG_ASSERT(rnCountBytes>=sizeof(SVBT16), "Ww1StyleSheet");
+ OSL_ENSURE(rnCountBytes>=sizeof(SVBT16), "Ww1StyleSheet");
rnCountBytes -= sizeof(SVBT16);
for (sal_uInt16 stcp=0;stcp<iMac;stcp++)
{
sal_uInt16 stc = (stcp - cstcStd) & 255;
aStyles[stc].ReadEstcp(p, rnCountBytes);
}
- DBG_ASSERT(rnCountBytes==0, "Ww1StyleSheet");
+ OSL_ENSURE(rnCountBytes==0, "Ww1StyleSheet");
return 0;
}
@@ -333,13 +333,13 @@ Ww1Fonts::Ww1Fonts(Ww1Fib& rInFib, sal_uLong nFieldFlgs)
if(rFib.GetFIB().cbSttbfffnGet() > 2 ) // ueberhaupt fonts?
{
SVBT16 nCountBytes;
- DBG_ASSERT(rFib.GetFIB().cbSttbfffnGet() > sizeof(nCountBytes), "Ww1Fonts");
+ OSL_ENSURE(rFib.GetFIB().cbSttbfffnGet() > sizeof(nCountBytes), "Ww1Fonts");
if (rFib.GetStream().Seek(rFib.GetFIB().fcSttbfffnGet())
== (sal_uLong)rFib.GetFIB().fcSttbfffnGet())
if (rFib.GetStream().Read(nCountBytes, sizeof(nCountBytes))
== sizeof(nCountBytes)) // Laenge steht hier nochmal
{
- DBG_ASSERT(SVBT16ToShort(nCountBytes)
+ OSL_ENSURE(SVBT16ToShort(nCountBytes)
== rFib.GetFIB().cbSttbfffnGet(), "redundant-size missmatch");
// hoffentlich sind sie immer gleich
W1_FFN* pA = (W1_FFN*)new char[rFib.GetFIB().cbSttbfffnGet()
@@ -421,7 +421,7 @@ Ww1Picture::Ww1Picture(SvStream& rStream, sal_uLong ulFilePos)
if (rStream.Seek(ulFilePos) == (sal_uLong)ulFilePos)
if (rStream.Read(pPic, SVBT32ToUInt32(lcb)) == (sal_uLong)SVBT32ToUInt32(lcb))
{
- DBG_ASSERT(pPic->cbHeaderGet()==sizeof(*pPic)-sizeof(pPic->rgb), "Ww1Picture");
+ OSL_ENSURE(pPic->cbHeaderGet()==sizeof(*pPic)-sizeof(pPic->rgb), "Ww1Picture");
bOK = true;
}
}
@@ -479,7 +479,7 @@ sal_uInt16 Ww1SingleSprm::Size(sal_uInt8* /*pSprm*/)
sal_uInt16 Ww1SingleSprmTab::Size(sal_uInt8* pSprm) // Doc 24/25, Fastsave-Sprm
{
- DBG_ASSERT(nCountBytes==0, "Ww1SingleSprmTab");
+ OSL_ENSURE(nCountBytes==0, "Ww1SingleSprmTab");
sal_uInt16 nRet = sizeof(SVBT8);
sal_uInt16 nSize = SVBT8ToByte(pSprm);
if (nSize != 255)
@@ -490,7 +490,7 @@ sal_uInt16 Ww1SingleSprmTab::Size(sal_uInt8* pSprm) // Doc 24/25, Fastsave-Sprm
sal_uInt16 nIns = SVBT8ToByte(pSprm + 3 + nDel) * 3;
nRet += nDel + nIns;
}
- DBG_ASSERT(nRet <= 354, "Ww1SingleSprmTab");
+ OSL_ENSURE(nRet <= 354, "Ww1SingleSprmTab");
if (nRet > 354)
nRet = 0;
return nRet;
@@ -527,7 +527,7 @@ sal_uInt16 Ww1Sprm::GetSize(sal_uInt8 nId, sal_uInt8* pSprm)
sal_Bool Ww1Sprm::Fill(sal_uInt16 index, sal_uInt8& nId, sal_uInt16& nL, sal_uInt8*& pSprm)
{
- DBG_ASSERT(index < Count(), "Ww1Sprm");
+ OSL_ENSURE(index < Count(), "Ww1Sprm");
pSprm = p + pArr[index];
nId = SVBT8ToByte(pSprm);
pSprm++;
@@ -548,7 +548,7 @@ sal_Bool Ww1Sprm::ReCalc()
while (cbsik > 0)
{
sal_uInt16 iLen = GetSizeBrutto(psik);
- DBG_ASSERT(iLen<=cbsik, "Ww1Sprm");
+ OSL_ENSURE(iLen<=cbsik, "Ww1Sprm");
if (iLen > cbsik)
cbsik = 0; // ignore the rest: we are wrong...
else
@@ -753,7 +753,7 @@ Ww1Plc::Ww1Plc(Ww1Fib& rInFib, sal_uLong ulFilePos, sal_uInt16 nInCountBytes,
bOK = true;
iMac = (nCountBytes -
sizeof(SVBT32)) / (sizeof(SVBT32) + nItemSize);
- DBG_ASSERT(iMac * ((sal_uInt16)sizeof(sal_uLong) + nItemSize) +
+ OSL_ENSURE(iMac * ((sal_uInt16)sizeof(sal_uLong) + nItemSize) +
(sal_uInt16)sizeof(SVBT32) == nCountBytes, "Ww1Plc");
}
}
@@ -776,7 +776,7 @@ void Ww1Plc::Seek(sal_uLong ulSeek, sal_uInt16& nIndex)
sal_uLong Ww1Plc::Where(sal_uInt16 nIndex)
{
sal_uLong ulRet = 0xffffffff;
- DBG_ASSERT(nIndex <= iMac, "index out of bounds");
+ OSL_ENSURE(nIndex <= iMac, "index out of bounds");
if (iMac && nIndex <= iMac)
ulRet = SVBT32ToUInt32(p + sizeof(SVBT32) * nIndex);
return ulRet;
@@ -785,7 +785,7 @@ sal_uLong Ww1Plc::Where(sal_uInt16 nIndex)
sal_uInt8* Ww1Plc::GetData(sal_uInt16 nIndex)
{
sal_uInt8* pRet = NULL;
- DBG_ASSERT(nIndex < iMac, "index out of bounds");
+ OSL_ENSURE(nIndex < iMac, "index out of bounds");
if (nIndex < iMac)
pRet = p + (iMac + 1) * sizeof(SVBT32) +
nIndex * nItemSize; // Pointer auf Inhalts-Array
@@ -804,12 +804,12 @@ Ww1StringList::Ww1StringList( SvStream& rSt, sal_uLong nFc, sal_uInt16 nCb )
if( nCb > 2 ) // ueberhaupt Eintraege ?
{
SVBT16 nCountBytes;
- DBG_ASSERT(nCb > sizeof(nCountBytes), "Ww1StringList");
+ OSL_ENSURE(nCb > sizeof(nCountBytes), "Ww1StringList");
if (rSt.Seek(nFc) == (sal_uLong)nFc)
if (rSt.Read(nCountBytes, sizeof(nCountBytes))
== sizeof(nCountBytes)) // Laenge steht hier nochmal
{
- DBG_ASSERT(SVBT16ToShort(nCountBytes)
+ OSL_ENSURE(SVBT16ToShort(nCountBytes)
== nCb, "redundant-size missmatch");
// hoffentlich sind sie immer gleich
sal_Char* pA = new sal_Char[nCb - sizeof(nCountBytes) + 1];
@@ -924,7 +924,7 @@ long Ww1Bookmarks::Len() const
{
if( nIsEnd )
{
- DBG_ASSERT( sal_False, "Falscher Aufruf (1) von Ww1Bookmarks::Len()" );
+ OSL_ENSURE( sal_False, "Falscher Aufruf (1) von Ww1Bookmarks::Len()" );
return 0;
}
sal_uInt16 nEndIdx = SVBT16ToShort(pPos[0]->GetData(nPlcIdx[0]));
@@ -951,7 +951,7 @@ Ww1Fkp::Ww1Fkp(SvStream& rStream, sal_uLong ulFilePos, sal_uInt16 _nItemSize) :
sal_uLong Ww1Fkp::Where(sal_uInt16 nIndex)
{
sal_uLong lRet = 0xffffffff;
- DBG_ASSERT(nIndex<=Count(), "index out of bounds");
+ OSL_ENSURE(nIndex<=Count(), "index out of bounds");
if (nIndex<=Count())
lRet = SVBT32ToUInt32(aFkp+nIndex*sizeof(SVBT32));
return lRet;
@@ -960,7 +960,7 @@ sal_uLong Ww1Fkp::Where(sal_uInt16 nIndex)
sal_uInt8* Ww1Fkp::GetData(sal_uInt16 nIndex)
{
sal_uInt8* pRet = NULL;
- DBG_ASSERT(nIndex<=Count(), "index out of bounds");
+ OSL_ENSURE(nIndex<=Count(), "index out of bounds");
if (nIndex<=Count())
pRet = aFkp + (Count()+1) * sizeof(SVBT32) +
nIndex * nItemSize; // beginn der strukturen
@@ -970,11 +970,11 @@ sal_uInt8* Ww1Fkp::GetData(sal_uInt16 nIndex)
//////////////////////////////////////////////////////////////// FkpPap
sal_Bool Ww1FkpPap::Fill(sal_uInt16 nIndex, sal_uInt8*& p, sal_uInt16& rnCountBytes)
{
- DBG_ASSERT( nIndex < Count(), "Ww1FkpPap::Fill() Index out of Range" );
+ OSL_ENSURE( nIndex < Count(), "Ww1FkpPap::Fill() Index out of Range" );
sal_uInt16 nOffset = SVBT8ToByte(GetData(nIndex)) * 2;
if (nOffset)
{
- DBG_ASSERT(nOffset>(sal_uInt16)(Count()*sizeof(SVBT32)), "calc error");
+ OSL_ENSURE(nOffset>(sal_uInt16)(Count()*sizeof(SVBT32)), "calc error");
rnCountBytes = SVBT8ToByte(aFkp+nOffset) * 2;
nOffset += sizeof(SVBT8);
if( nOffset + rnCountBytes < 511 ) // SH: Assert schlug 1 zu frueh zu
@@ -983,7 +983,7 @@ sal_Bool Ww1FkpPap::Fill(sal_uInt16 nIndex, sal_uInt8*& p, sal_uInt16& rnCountBy
// genutzt wird, aber so vergessen
// wir keins und sind trotzdem
// auf der sicheren Seite
- DBG_ASSERT(nOffset+rnCountBytes <= 511, "calc error");
+ OSL_ENSURE(nOffset+rnCountBytes <= 511, "calc error");
p = aFkp + nOffset;
}
else
@@ -997,16 +997,16 @@ sal_Bool Ww1FkpPap::Fill(sal_uInt16 nIndex, sal_uInt8*& p, sal_uInt16& rnCountBy
//////////////////////////////////////////////////////////////// FkpChp
sal_Bool Ww1FkpChp::Fill(sal_uInt16 nIndex, W1_CHP& aChp)
{
- DBG_ASSERT( nIndex < Count(), "Ww1FkpChp::Fill() Index out of Range" );
+ OSL_ENSURE( nIndex < Count(), "Ww1FkpChp::Fill() Index out of Range" );
memset(&aChp, 0, sizeof(aChp)); // Default, da verkuerzt gespeichert
sal_uInt16 nOffset = GetData(nIndex)[0] * 2;
if (nOffset)
{
- DBG_ASSERT(nOffset>(sal_uInt16)(Count()*sizeof(SVBT32)), "calc error");
+ OSL_ENSURE(nOffset>(sal_uInt16)(Count()*sizeof(SVBT32)), "calc error");
sal_uInt16 nCountBytes = aFkp[nOffset];
nOffset += sizeof(SVBT8);
- DBG_ASSERT(nCountBytes <= 511-nOffset, "calc error");
- DBG_ASSERT(nCountBytes <= sizeof(aChp), "calc error");
+ OSL_ENSURE(nCountBytes <= 511-nOffset, "calc error");
+ OSL_ENSURE(nCountBytes <= sizeof(aChp), "calc error");
memcpy(&aChp, aFkp+nOffset, nCountBytes);
}
return sal_True;
@@ -1027,7 +1027,7 @@ Ww1Assoc::Ww1Assoc(Ww1Fib& _rFib)
&& rFib.GetStream().Read(pBuffer, cb) == cb)
{
sal_uInt16 j;
- DBG_ASSERT( cb == SVBT16ToShort( *(SVBT16*)pBuffer ), "size missmatch");
+ OSL_ENSURE( cb == SVBT16ToShort( *(SVBT16*)pBuffer ), "size missmatch");
for (i=0,j=sizeof(SVBT16);j<cb && i<Criteria1;i++)
{
pStrTbl[i] = pBuffer+j;
@@ -1040,7 +1040,7 @@ Ww1Assoc::Ww1Assoc(Ww1Fib& _rFib)
String Ww1Assoc::GetStr(sal_uInt16 code)
{
String sRet;
- DBG_ASSERT(code<MaxFields, "out of range");
+ OSL_ENSURE(code<MaxFields, "out of range");
if (pStrTbl[code] != NULL)
for( sal_uInt16 i=0;i<pStrTbl[code][0];i++ )
sRet += String( pStrTbl[code][i+1], RTL_TEXTENCODING_MS_1252 );
@@ -1116,7 +1116,7 @@ sal_Bool Ww1Pap::HasId0(sal_uInt16 nId)
UpdateIdx();
if( !pPap ){
- DBG_ASSERT( sal_False, "Ww1Pap::HasId():: kann kein pPap erzeugen" );
+ OSL_ENSURE( sal_False, "Ww1Pap::HasId():: kann kein pPap erzeugen" );
return sal_False;
}
diff --git a/sw/source/filter/ww1/w1class.hxx b/sw/source/filter/ww1/w1class.hxx
index 4bb72a6d63..87a057bcf9 100644
--- a/sw/source/filter/ww1/w1class.hxx
+++ b/sw/source/filter/ww1/w1class.hxx
@@ -26,7 +26,6 @@
*
************************************************************************/
#include <tools/string.hxx>
-#include <tools/debug.hxx>
// local
#include <w1struct.hxx>
@@ -157,7 +156,7 @@ public:
sal_uLong Where() const { return ulSeek; }
void Seek( sal_uLong ulNew )
{
- DBG_ASSERT(ulNew < ulCountBytes, "Ww1PlainText");
+ OSL_ENSURE(ulNew < ulCountBytes, "Ww1PlainText");
if (ulNew < ulCountBytes)
ulSeek = ulNew;
}
@@ -171,7 +170,7 @@ public:
}
void operator++(int)
{
- DBG_ASSERT(ulSeek+1<ulCountBytes, "Ww1PlainText");
+ OSL_ENSURE(ulSeek+1<ulCountBytes, "Ww1PlainText");
ulSeek++;
}
sal_Bool GetError() { return !bOK; }
@@ -1136,7 +1135,7 @@ public:
if (grpfIhdt & 0x0008) nOddFootL = nextIhdd++;
if (grpfIhdt & 0x0010) nFirstHeadL = nextIhdd++;
if (grpfIhdt & 0x0020) nFirstFootL = nextIhdd++;
- DBG_ASSERT(nextIhdd<=Count(), "Ww1HeaderFooter");
+ OSL_ENSURE(nextIhdd<=Count(), "Ww1HeaderFooter");
}
sal_Bool operator++(int)
{
@@ -1233,13 +1232,13 @@ public:
sal_uLong Where() { return Where(nPlcIndex); }
void operator++(int)
{
- DBG_ASSERT(nPlcIndex+1 <= Count(), "Ww1Fields");
+ OSL_ENSURE(nPlcIndex+1 <= Count(), "Ww1Fields");
nPlcIndex++;
}
void Seek(sal_uLong ulNew) { Ww1PlcFields::Seek(ulNew, nPlcIndex); }
W1_FLD* GetData()
{
- DBG_ASSERT(nPlcIndex < Count(), "Ww1Fields");
+ OSL_ENSURE(nPlcIndex < Count(), "Ww1Fields");
return Ww1PlcFields::GetData(nPlcIndex);
}
sal_uLong GetLength();
@@ -1335,7 +1334,7 @@ public:
}
void operator++(int)
{
- DBG_ASSERT(nPlcIndex+1 <= Count(), "Ww1Footnotes");
+ OSL_ENSURE(nPlcIndex+1 <= Count(), "Ww1Footnotes");
nPlcIndex++;
}
void Start(Ww1Shell&, Ww1Manager&);
@@ -1408,7 +1407,7 @@ public:
void Seek(sal_uLong);
void Push(sal_uLong ulOffsetTmp = 0)
{
- DBG_ASSERT(!Pushed(), "Ww1Pap");
+ OSL_ENSURE(!Pushed(), "Ww1Pap");
nPushedPlcIndex = nPlcIndex;
nPushedFkpIndex = nFkpIndex;
Seek(ulOffsetTmp);
@@ -1422,7 +1421,7 @@ public:
}
void Pop()
{
- DBG_ASSERT(Pushed(), "Ww1Pap");
+ OSL_ENSURE(Pushed(), "Ww1Pap");
ulOffset = 0;
nPlcIndex = nPushedPlcIndex;
nFkpIndex = nPushedFkpIndex;
@@ -1473,7 +1472,7 @@ public:
void Seek(sal_uLong);
void Push(sal_uLong ulOffsetTmp = 0)
{
- DBG_ASSERT(!Pushed(), "Ww1Chp");
+ OSL_ENSURE(!Pushed(), "Ww1Chp");
nPushedPlcIndex = nPlcIndex;
nPushedFkpIndex = nFkpIndex;
Seek(ulOffsetTmp);
@@ -1484,7 +1483,7 @@ public:
sal_Bool Pushed() { return nPushedPlcIndex != 0xffff; }
void Pop()
{
- DBG_ASSERT(Pushed(), "Ww1Chp");
+ OSL_ENSURE(Pushed(), "Ww1Chp");
ulOffset = 0;
nPlcIndex = nPushedPlcIndex;
nFkpIndex = nPushedFkpIndex;
diff --git a/sw/source/filter/ww1/w1filter.cxx b/sw/source/filter/ww1/w1filter.cxx
index 9e07cb4bcc..3960919a9d 100644
--- a/sw/source/filter/ww1/w1filter.cxx
+++ b/sw/source/filter/ww1/w1filter.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -280,7 +280,7 @@ SvxFontItem Ww1Manager::GetFont(sal_uInt16 nFCode)
void Ww1Manager::Push0(Ww1PlainText* _pDoc, sal_uLong ulSeek, Ww1Fields* _pFld)
{
- DBG_ASSERT(!Pushed(), "Ww1Manager");
+ OSL_ENSURE(!Pushed(), "Ww1Manager");
this->pDoc = _pDoc;
pSeek = new sal_uLong;
*pSeek = pDoc->Where();
@@ -295,7 +295,7 @@ void Ww1Manager::Push0(Ww1PlainText* _pDoc, sal_uLong ulSeek, Ww1Fields* _pFld)
void Ww1Manager::Push1(Ww1PlainText* _pDoc, sal_uLong ulSeek, sal_uLong ulSeek2,
Ww1Fields* _pFld)
{
- DBG_ASSERT(!Pushed(), "Ww1Manager");
+ OSL_ENSURE(!Pushed(), "Ww1Manager");
this->pDoc = _pDoc;
pSeek = new sal_uLong;
*pSeek = pDoc->Where();
@@ -308,7 +308,7 @@ void Ww1Manager::Push1(Ww1PlainText* _pDoc, sal_uLong ulSeek, sal_uLong ulSeek2,
void Ww1Manager::Pop()
{
- DBG_ASSERT(Pushed(), "Ww1Manager");
+ OSL_ENSURE(Pushed(), "Ww1Manager");
delete pDoc;
pDoc = &aDoc;
delete pSeek;
@@ -365,10 +365,10 @@ void Ww1Footnotes::Start(Ww1Shell& rOut, Ww1Manager& rMan)
{
if (rMan.Where() >= Where())
{
- DBG_ASSERT(nPlcIndex < Count(), "WwFootnotes");
+ OSL_ENSURE(nPlcIndex < Count(), "WwFootnotes");
sal_Unicode c;
rMan.Fill(c);
- DBG_ASSERT(c==0x02, "Ww1Footnotes");
+ OSL_ENSURE(c==0x02, "Ww1Footnotes");
if (c==0x02)
{
Ww1FtnText* pText = new Ww1FtnText(rMan.GetFib());
@@ -380,7 +380,7 @@ void Ww1Footnotes::Start(Ww1Shell& rOut, Ww1Manager& rMan)
pText->SetCount(count);
// fusznotenkennung sollte das erste byte sein
pText->Out(c);
- DBG_ASSERT(c==0x02, "Ww1Footnotes");
+ OSL_ENSURE(c==0x02, "Ww1Footnotes");
count--; // fuer das eben gelesene kenn-byte
// fusznoten mode beginnen:
rOut.BeginFootnote();
@@ -400,7 +400,7 @@ void Ww1Footnotes::Stop(Ww1Shell& /*rOut*/, Ww1Manager& rMan, sal_Unicode& c)
{
if (bStarted && rMan.Where() > Where())
{
- DBG_ASSERT(nPlcIndex < Count(), "Ww1Footnotes");
+ OSL_ENSURE(nPlcIndex < Count(), "Ww1Footnotes");
c = ' ';
(*this)++;
}
@@ -410,7 +410,7 @@ void Ww1Footnotes::Stop(Ww1Shell& /*rOut*/, Ww1Manager& rMan, sal_Unicode& c)
void Ww1Fields::Start(Ww1Shell& rOut, Ww1Manager& rMan)
{
if (rMan.Where() >= Where()){
- DBG_ASSERT(nPlcIndex < Count(), "Ww1Fields");
+ OSL_ENSURE(nPlcIndex < Count(), "Ww1Fields");
if (GetData()->chGet() == 19)
Out(rOut, rMan);
else
@@ -422,11 +422,11 @@ void Ww1Fields::Stop( Ww1Shell& rOut, Ww1Manager& rMan, sal_Unicode& c)
{
if (rMan.Where() >= Where())
{
- DBG_ASSERT(nPlcIndex < Count(), "Ww1Fields");
+ OSL_ENSURE(nPlcIndex < Count(), "Ww1Fields");
if (GetData()->chGet() != 19)
{
rMan.Fill( c );
- DBG_ASSERT(c==21, "Ww1Fields");
+ OSL_ENSURE(c==21, "Ww1Fields");
(*this)++;
c = ' ';
if (pField)
@@ -554,16 +554,16 @@ void Ww1Fields::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16 nDepth)
String sFormat;
String sDTFormat; // Datum / Zeit-Format
W1_FLD* pData = GetData(); // die an den plc gebunden daten
- DBG_ASSERT(pData->chGet()==19, "Ww1Fields"); // sollte beginn sein
+ OSL_ENSURE(pData->chGet()==19, "Ww1Fields"); // sollte beginn sein
sal_Unicode c;
rMan.Fill( c );
- DBG_ASSERT(c==19, "Ww1Fields"); // sollte auch beginn sein
+ OSL_ENSURE(c==19, "Ww1Fields"); // sollte auch beginn sein
if (pData->chGet()==19 && c == 19)
{
String aStr;
c = rMan.Fill( aStr, GetLength() );
- DBG_ASSERT(Ww1PlainText::IsChar(c), "Ww1Fields");
+ OSL_ENSURE(Ww1PlainText::IsChar(c), "Ww1Fields");
xub_StrLen pos = aStr.Search(' ');
// get type out of text
sType = aStr.Copy( 0, pos );
@@ -583,11 +583,11 @@ void Ww1Fields::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16 nDepth)
{
Out(rOut, rMan, nDepth+1);
rMan.Fill(c);
- DBG_ASSERT(c==21, "Ww1PlainText");
+ OSL_ENSURE(c==21, "Ww1PlainText");
sFormel.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "Ww" ));
sFormel += String::CreateFromInt32( nPlcIndex );
c = rMan.Fill(aStr, GetLength());
- DBG_ASSERT(Ww1PlainText::IsChar(c), "Ww1PlainText");
+ OSL_ENSURE(Ww1PlainText::IsChar(c), "Ww1PlainText");
sFormel += aStr;
}
}
@@ -606,16 +606,16 @@ void Ww1Fields::Out(Ww1Shell& rOut, Ww1Manager& rMan, sal_uInt16 nDepth)
if( pData->chGet() == 20 )
{
rMan.Fill( c );
- DBG_ASSERT(c==20, "Ww1PlainText");
+ OSL_ENSURE(c==20, "Ww1PlainText");
c = rMan.Fill(sErgebnis, GetLength());
if (!Ww1PlainText::IsChar(c))
sErgebnis += c; //~ mdt: sonderzeichenbenhandlung
(*this)++;
pData = GetData();
}
- DBG_ASSERT(pData->chGet()==21, "Ww1PlainText");
+ OSL_ENSURE(pData->chGet()==21, "Ww1PlainText");
sal_Bool bKnown = sal_True;
- DBG_ASSERT(pField==0, "Ww1PlainText");
+ OSL_ENSURE(pField==0, "Ww1PlainText");
if (pField != 0)
{
rOut << *pField;
@@ -817,7 +817,7 @@ oncemore:
{
SwGetExpFieldType* pFieldType =
(SwGetExpFieldType*)rOut.GetSysFldType(RES_GETEXPFLD);
- DBG_ASSERT(pFieldType!=0, "Ww1Fields");
+ OSL_ENSURE(pFieldType!=0, "Ww1Fields");
if (pFieldType != 0)
pField = new SwGetExpField(pFieldType, sFormel,
nsSwGetSetExpType::GSE_STRING, VVF_SYS);
@@ -944,7 +944,7 @@ oncemore:
}
break;
default: // unknown
- DBG_ASSERT(sal_False, "Ww1PlainText");
+ OSL_ENSURE(sal_False, "Ww1PlainText");
// unsupported:
case 1: // unknown
case 2: // possible bookmark
@@ -997,7 +997,7 @@ sal_uLong Ww1Fields::GetLength()
// und ende bedeuten.
sal_uLong ulBeg = Where();
sal_uLong ulEnd = Where(nPlcIndex+1);
- DBG_ASSERT(ulBeg<ulEnd, "Ww1Fields");
+ OSL_ENSURE(ulBeg<ulEnd, "Ww1Fields");
return (ulEnd - ulBeg) - 1;
}
@@ -1060,7 +1060,7 @@ void Ww1Pap::Stop(Ww1Shell& rOut, Ww1Manager& rMan, sal_Unicode&)
Ww1SprmPapx aSprm(pByte, cb);
aSprm.Stop(rOut, rMan);
}else{
- DBG_ASSERT( !nPlcIndex || rMan.IsStopAll(), "Pap-Attribut-Stop verloren" );
+ OSL_ENSURE( !nPlcIndex || rMan.IsStopAll(), "Pap-Attribut-Stop verloren" );
}
}
}
@@ -1097,7 +1097,7 @@ void W1_CHP::Out(Ww1Shell& rOut, Ww1Manager& rMan)
rOut << SvxUnderlineItem(UNDERLINE_NONE, RES_CHRATR_UNDERLINE) <<
SvxWordLineModeItem(sal_False, RES_CHRATR_WORDLINEMODE);
} break;
- default: DBG_ASSERT(sal_False, "Chpx");
+ default: OSL_ENSURE(sal_False, "Chpx");
case 1: {
rOut << SvxUnderlineItem(UNDERLINE_SINGLE, RES_CHRATR_UNDERLINE);
} break;
@@ -1115,7 +1115,7 @@ void W1_CHP::Out(Ww1Shell& rOut, Ww1Manager& rMan)
if (fsIcoGet())
switch(icoGet()) {
- default: DBG_ASSERT(sal_False, "Chpx");
+ default: OSL_ENSURE(sal_False, "Chpx");
case 0: { rOut.EndItem(RES_CHRATR_COLOR); } break;
case 1: { rOut << SvxColorItem(Color(COL_BLACK), RES_CHRATR_COLOR); } break;
case 2: { rOut << SvxColorItem(Color(COL_LIGHTBLUE), RES_CHRATR_COLOR); } break;
@@ -1205,7 +1205,7 @@ void Ww1Chp::Stop(Ww1Shell& rOut, Ww1Manager& rMan, sal_Unicode&)
if (aChpx.fsFtcGet())
rOut.EndItem(RES_CHRATR_FONT);
}else{
- DBG_ASSERT( !nPlcIndex, "Chp-Attribut-Stop verloren" );
+ OSL_ENSURE( !nPlcIndex, "Chp-Attribut-Stop verloren" );
}
}
}
@@ -1387,7 +1387,7 @@ SvxFontItem Ww1Fonts::GetFont(sal_uInt16 nFCode)
}
else
{
- DBG_ASSERT(sal_False, "WW1Fonts::GetFont: Nicht existenter Font !");
+ OSL_ENSURE(sal_False, "WW1Fonts::GetFont: Nicht existenter Font !");
eFamily = FAMILY_SWISS;
aName.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Helv" ));
ePitch = PITCH_VARIABLE;
@@ -1487,13 +1487,13 @@ void Ww1Assoc::Out(Ww1Shell& rOut)
//~ mdt: fehlen: FileNext, Dot, DataDoc, HeaderDoc, Criteria1,
// Criteria2, Criteria3, Criteria4, Criteria5, Criteria6, Criteria7
SwDocShell *pDocShell(rOut.GetDoc().GetDocShell());
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
if (pDocShell) {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+ OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
if (xDocProps.is()) {
xDocProps->setTitle( GetStr(Title) );
xDocProps->setSubject( GetStr(Subject) );
@@ -1793,13 +1793,13 @@ void Ww1Picture::WriteBmp(SvStream& rOut)
p+= sizeof(SVBT16); nSize -= sizeof(SVBT16);
#if OSL_DEBUG_LEVEL > 1
- DBG_ASSERT(x==maxx, "Ww1Picture");
- DBG_ASSERT(y==maxy, "Ww1Picture");
- DBG_ASSERT(planes==1, "Ww1Picture");
- DBG_ASSERT(bitcount==4, "Ww1Picture");
+ OSL_ENSURE(x==maxx, "Ww1Picture");
+ OSL_ENSURE(y==maxy, "Ww1Picture");
+ OSL_ENSURE(planes==1, "Ww1Picture");
+ OSL_ENSURE(bitcount==4, "Ww1Picture");
#endif
- DBG_ASSERT(16*3+padx*maxy/2==nSize, "Ww1Picture");
+ OSL_ENSURE(16*3+padx*maxy/2==nSize, "Ww1Picture");
SVBT32 tmpLong;
SVBT16 tmpShort;
@@ -1842,7 +1842,7 @@ void Ww1Picture::WriteBmp(SvStream& rOut)
nSize -= sizeof(sal_uInt8);
wByte(0);
}
- DBG_ASSERT(padx*maxy/2==nSize, "Ww1Picture");
+ OSL_ENSURE(padx*maxy/2==nSize, "Ww1Picture");
sal_uInt16 j;
#if 1
{
@@ -1888,7 +1888,7 @@ void Ww1Picture::WriteBmp(SvStream& rOut)
}
}
#endif
- DBG_ASSERT(nSize==0, "Ww1Picture");
+ OSL_ENSURE(nSize==0, "Ww1Picture");
#undef wLong
#undef wShort
#undef wByte
@@ -1911,7 +1911,7 @@ void Ww1Picture::Out(Ww1Shell& rOut, Ww1Manager& /*rMan*/)
(sizeof(*pPic)-sizeof(pPic->rgb)));
aOut.Seek(0);
GDIMetaFile aWMF;
- if (ReadWindowMetafile( aOut, aWMF, NULL ) && aWMF.GetActionCount() > 0)
+ if (ReadWindowMetafile( aOut, aWMF, NULL ) && aWMF.GetActionSize() > 0)
{
aWMF.SetPrefMapMode(MapMode(MAP_100TH_MM));
Size aOldSiz(aWMF.GetPrefSize());
@@ -1944,7 +1944,7 @@ void Ww1Picture::Out(Ww1Shell& rOut, Ww1Manager& /*rMan*/)
pGraphic = new Graphic(aBmp);
}
default:
- DBG_ASSERT(pPic->mfp.mmGet() == 97, "Ww1Picture");
+ OSL_ENSURE(pPic->mfp.mmGet() == 97, "Ww1Picture");
}
if (pGraphic)
rOut << *pGraphic;
diff --git a/sw/source/filter/ww8/WW8Sttbf.cxx b/sw/source/filter/ww8/WW8Sttbf.cxx
index c7c2c1b8ae..5325ddaf21 100644
--- a/sw/source/filter/ww8/WW8Sttbf.cxx
+++ b/sw/source/filter/ww8/WW8Sttbf.cxx
@@ -29,26 +29,31 @@
#include <iostream>
#include <dbgoutsw.hxx>
#include "WW8Sttbf.hxx"
+#include "ww8scan.hxx"
#include <cstdio>
+#include <osl/endian.h>
+#include <rtl/ustrbuf.hxx>
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
namespace ww8
{
WW8Struct::WW8Struct(SvStream& rSt, sal_uInt32 nPos, sal_uInt32 nSize)
- : mn_offset(0), mn_size(nSize)
+ : mn_offset(0), mn_size(0)
{
- rSt.Seek(nPos);
-
- mp_data.reset(new sal_uInt8[nSize]);
- rSt.Read(mp_data.get(), nSize);
+ if (checkSeek(rSt, nPos))
+ {
+ mp_data.reset(new sal_uInt8[nSize]);
+ mn_size = rSt.Read(mp_data.get(), nSize);
+ }
+ OSL_ENSURE(mn_size == nSize, "short read in WW8Struct::WW8Struct");
}
WW8Struct::WW8Struct(WW8Struct * pStruct, sal_uInt32 nPos, sal_uInt32 nSize)
- : mp_data(pStruct->mp_data), mn_offset(pStruct->mn_offset + nPos),
- mn_size(nSize)
+ : mp_data(pStruct->mp_data), mn_offset(pStruct->mn_offset + nPos)
+ , mn_size(nSize)
{
}
@@ -75,15 +80,25 @@ namespace ww8
if (nCount > 0)
{
- rtl_uString * pNew = 0;
- rtl_uString_newFromStr_WithLength
- (&pNew, reinterpret_cast<const sal_Unicode *>(&mp_data[mn_offset + nOffset]),
- nCount);
-
- aResult = rtl::OUString(pNew);
+ //clip to available
+ sal_uInt32 nStartOff = mn_offset + nOffset;
+ if (nStartOff >= mn_size)
+ return aResult;
+ sal_uInt32 nAvailable = (mn_size - nStartOff)/sizeof(sal_Unicode);
+ if (nCount > nAvailable)
+ nCount = nAvailable;
+#if defined OSL_LITTLEENDIAN
+ aResult = rtl::OUString(reinterpret_cast<const sal_Unicode *>(
+ mp_data.get() + nStartOff), nCount);
+#else
+ rtl::OUStringBuffer aBuf;
+ for (sal_uInt32 i = 0; i < nCount; ++i)
+ aBuf.append(static_cast<sal_Unicode>(getU16(nStartOff+i*2)));
+ aResult = aBuf.makeStringAndClear();
+#endif
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
char sBuffer[256];
snprintf(sBuffer, sizeof(sBuffer), "offset=\"%" SAL_PRIuUINT32 "\" count=\"%" SAL_PRIuUINT32 "\"",
nOffset, nCount);
@@ -103,13 +118,22 @@ namespace ww8
if (nCount > 0)
{
- ::rtl::OString aOStr(reinterpret_cast<const sal_Char *>(&mp_data[mn_offset + nOffset]),
- nCount);
+ //clip to available
+ sal_uInt32 nStartOff = mn_offset + nOffset;
+ if (nStartOff >= mn_size)
+ return aResult;
+ sal_uInt32 nAvailable = (mn_size - nStartOff);
+ if (nCount > nAvailable)
+ nCount = nAvailable;
+
+ rtl::OString aOStr(reinterpret_cast<const sal_Char *>(
+ mp_data.get() + nStartOff), nCount);
+
::rtl::OUString aOUStr(rtl::OStringToOUString(aOStr, RTL_TEXTENCODING_ASCII_US));
aResult = rtl::OUString(aOUStr);
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
char sBuffer[256];
snprintf(sBuffer, sizeof(sBuffer), "offset=\"%" SAL_PRIuUINT32 "\" count=\"%" SAL_PRIuUINT32 "\"",
nOffset, nCount);
diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index b711e567f4..8455c796bc 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -252,6 +252,9 @@ WidthsPtr WW8TableNodeInfoInner::getWidthsOfRow()
pWidths = WidthsPtr(new Widths);
// number of cell written
sal_uInt32 nBoxes = rTabBoxes.Count();
+ if ( nBoxes > MAXTABLECELLS )
+ nBoxes = MAXTABLECELLS;
+
for (sal_uInt32 n = 0; n < nBoxes; n++)
{
const SwFrmFmt* pBoxFmt = rTabBoxes[ n ]->GetFrmFmt();
@@ -280,6 +283,9 @@ RowSpansPtr WW8TableNodeInfoInner::getRowSpansOfRow()
const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes();
sal_uInt32 nBoxes = rTabBoxes.Count();
+ if (nBoxes > MAXTABLECELLS)
+ nBoxes = MAXTABLECELLS;
+
for (sal_uInt32 n = 0; n < nBoxes; ++n)
{
pResult->push_back(rTabBoxes[n]->getRowSpan());
@@ -362,7 +368,7 @@ WW8TableNodeInfo::~WW8TableNodeInfo()
aIt++;
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
sResult += dbg_out(*mpNode);
#endif
sResult += "</tableNodeInfo>";
@@ -386,7 +392,7 @@ void WW8TableNodeInfo::setEndOfLine(bool bEndOfLine)
WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth);
pInner->setEndOfLine(bEndOfLine);
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<endOfLine depth=\"" << mnDepth << "\">"
<< toString() << "</endOfLine>" << ::std::endl;
#endif
@@ -397,7 +403,7 @@ void WW8TableNodeInfo::setEndOfCell(bool bEndOfCell)
WW8TableNodeInfoInner::Pointer_t pInner = getInnerForDepth(mnDepth);
pInner->setEndOfCell(bEndOfCell);
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<endOfCell depth=\"" << mnDepth << "\">"
<< toString() << "</endOfCell>" << ::std::endl;
#endif
@@ -409,7 +415,7 @@ void WW8TableNodeInfo::setFirstInTable(bool bFirstInTable)
pInner->setFirstInTable(bFirstInTable);
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<firstInTable depth=\"" << mnDepth << "\">"
<< toString() << "</firstInTable>" << ::std::endl;
#endif
@@ -422,7 +428,7 @@ void WW8TableNodeInfo::setVertMerge(bool bVertMerge)
pInner->setVertMerge(bVertMerge);
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<vertMerge depth=\"" << mnDepth << "\">"
<< toString() << "</vertMerge>" << ::std::endl;
#endif
@@ -442,7 +448,7 @@ void WW8TableNodeInfo::setNext(WW8TableNodeInfo * pNext)
{
mpNext = pNext;
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<setnext><from>" << toString() << "</from><to>"
<< pNext->toString() << "</to></setnext>"
<< ::std::endl;
@@ -486,7 +492,7 @@ WW8TableInfo * WW8TableNodeInfo::getParent() const
sal_uInt32 WW8TableNodeInfo::getDepth() const
{
- if (mInners.size() > 0)
+ if (!mInners.empty())
return mInners.begin()->second->getDepth();
return mnDepth;
@@ -551,7 +557,7 @@ const WW8TableNodeInfoInner::Pointer_t WW8TableNodeInfo::getFirstInner() const
{
WW8TableNodeInfoInner::Pointer_t pResult;
- if (mInners.size() > 0)
+ if (!mInners.empty())
pResult = mInners.begin()->second;
return pResult;
@@ -590,7 +596,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable)
{
SwRect aRect = aTableCellInfo.getRect();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
static char sBuffer[1024];
::std::clog << "<CellFrm>" << ::std::endl;
@@ -627,7 +633,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable)
while (!bDone);
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</CellFrm>" << ::std::endl;
#endif
}
@@ -639,7 +645,7 @@ WW8TableInfo::processSwTableByLayout(const SwTable * pTable)
void WW8TableInfo::processSwTable(const SwTable * pTable)
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<processSwTable>" << ::std::endl;
#endif
@@ -650,7 +656,7 @@ void WW8TableInfo::processSwTable(const SwTable * pTable)
{
pPrev = processSwTableByLayout(pTable);
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
WW8TableCellGrid::Pointer_t pCellGrid(getCellGridForTable(pTable));
::std::clog << pCellGrid->toString() << ::std::endl;
#endif
@@ -675,7 +681,7 @@ void WW8TableInfo::processSwTable(const SwTable * pTable)
pPrev->setNextNode(pEndNode);
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</processSwTable>" << ::std::endl;
#endif
}
@@ -686,7 +692,7 @@ WW8TableInfo::processTableLine(const SwTable * pTable,
sal_uInt32 nRow,
sal_uInt32 nDepth, WW8TableNodeInfo * pPrev)
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<processTableLine row=\"" << nRow << "\" depth=\""
<< nDepth << "\">" << ::std::endl;
#endif
@@ -702,7 +708,7 @@ WW8TableInfo::processTableLine(const SwTable * pTable,
pPrev = processTableBox(pTable, pBox, nRow, n, nDepth, n == rBoxes.Count() - 1, pPrev);
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</processTableLine>" << ::std::endl;
#endif
@@ -717,7 +723,7 @@ WW8TableInfo::processTableBoxLines(const SwTableBox * pBox,
sal_uInt32 nCell,
sal_uInt32 nDepth)
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<processTableBoxLines depth=\"" << nDepth
<< "\" row=\"" << nRow << "\" cell=\"" << nCell << "\">" << ::std::endl;
#endif
@@ -757,7 +763,7 @@ WW8TableInfo::processTableBoxLines(const SwTableBox * pBox,
}
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</processTableBoxLines>" << ::std::endl;
#endif
@@ -773,7 +779,7 @@ WW8TableInfo::processTableBox(const SwTable * pTable,
bool bEndOfLine,
WW8TableNodeInfo * pPrev)
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<processTableBox row=\"" << nRow << "\" cell=\"" << nCell
<< "\" depth=\"" << nDepth << "\">" << ::std::endl;
#endif
@@ -852,7 +858,7 @@ WW8TableInfo::processTableBox(const SwTable * pTable,
}
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</processTableBox>" << ::std::endl;
#endif
@@ -903,7 +909,7 @@ WW8TableNodeInfo::Pointer_t WW8TableInfo::insertTableNodeInfo
pNodeInfo->setRect(*pRect);
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << pNodeInfo->toString() << ::std::endl;
#endif
@@ -1047,7 +1053,7 @@ WW8TableNodeInfo * WW8TableInfo::reorderByLayout(const SwTable * pTable)
WW8TableNodeInfo * pPrev = NULL;
WW8TableCellGrid::Pointer_t pCellGrid = getCellGridForTable(pTable);
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << pCellGrid->toString() << ::std::endl;
#endif
@@ -1121,7 +1127,7 @@ void WW8TableCellGrid::insert(const SwRect & rRect,
void WW8TableCellGrid::addShadowCells()
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<addShadowCells>" << ::std::endl;
#endif
@@ -1129,7 +1135,7 @@ void WW8TableCellGrid::addShadowCells()
while (aTopsIt != getRowTopsEnd())
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
long nTop = *aTopsIt;
(void) nTop;
#endif
@@ -1194,7 +1200,7 @@ void WW8TableCellGrid::addShadowCells()
++aTopsIt;
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</addShadowCells>" << ::std::endl;
#endif
}
@@ -1448,7 +1454,7 @@ void WW8TableCellGridRow::insert(const CellInfo & rCellInfo)
{
m_pCellInfos->insert(rCellInfo);
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<gridRowInsert>"
<< rCellInfo.toString()
<< "</gridRowInsert>"
diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx
index 2ba703ab03..3979db3bf2 100644
--- a/sw/source/filter/ww8/WW8TableInfo.hxx
+++ b/sw/source/filter/ww8/WW8TableInfo.hxx
@@ -49,6 +49,8 @@ namespace ww8
{
using namespace ::std;
+const unsigned int MAXTABLECELLS = 63;
+
class WW8TableNodeInfo;
typedef boost::shared_ptr<SwRect> SwRectPtr;
typedef ::std::vector<const SwTableBox *> TableBoxVector;
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 84e58f7ad0..4b08cbfa13 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -173,6 +173,12 @@ public:
/// docx requires footnoteRef/endnoteRef tag at the beginning of each of them
virtual void FootnoteEndnoteRefTag() {};
+ /// for docx footnotePr/endnotePr inside sectPr
+ virtual void SectFootnoteEndnotePr() {};
+
+ /// for docx w:commentReference
+ virtual void WritePostitFieldReference() {};
+
/// Output text (inside a run).
virtual void RunText( const String& rText, rtl_TextEncoding eCharSet ) = 0;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 693549c43a..b978394fb4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -288,7 +288,7 @@ void DocxAttributeOutput::StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pText
m_pSerializer->mark();
// no section break in this paragraph yet; can be set in SectionBreak()
- m_pSectionInfo = NULL;
+ m_pSectionInfo.reset();
m_bParagraphOpened = true;
}
@@ -393,7 +393,7 @@ void DocxAttributeOutput::StartParagraphProperties( const SwTxtNode& rNode )
if ( m_pSectionInfo )
{
m_rExport.SectionProperties( *m_pSectionInfo );
- m_pSectionInfo = NULL;
+ m_pSectionInfo.reset();
}
InitCollectedParagraphProperties();
@@ -514,6 +514,8 @@ void DocxAttributeOutput::StartRun( const SwRedlineData* pRedlineData )
void DocxAttributeOutput::EndRun()
{
+ if ( m_nCloseHyperlinkStatus == Detected )
+ m_nCloseHyperlinkStatus = EndInThisRun;
// Write field starts
for ( std::vector<FieldInfos>::iterator pIt = m_Fields.begin(); pIt != m_Fields.end(); ++pIt )
{
@@ -545,10 +547,16 @@ void DocxAttributeOutput::EndRun()
XFastAttributeListRef xAttrList ( m_pHyperlinkAttrList );
m_pSerializer->startElementNS( XML_w, XML_hyperlink, xAttrList );
+ m_pHyperlinkAttrList = NULL;
+ }
+ if ( m_nCloseHyperlinkStatus == EndInPrevRun)
+ {
+ m_pSerializer->endElementNS( XML_w, XML_hyperlink );
+ m_nCloseHyperlinkStatus = Undetected;
}
// Write the hyperlink and toc fields starts
- for ( std::vector<FieldInfos>::iterator pIt = m_Fields.begin(); pIt != m_Fields.end(); ++pIt )
+ for ( std::vector<FieldInfos>::iterator pIt = m_Fields.begin(); pIt != m_Fields.end(); )
{
// Add the fields starts for hyperlinks, TOCs and index marks
if ( pIt->bOpen && !pIt->pField )
@@ -557,10 +565,11 @@ void DocxAttributeOutput::EndRun()
// Remove the field if no end needs to be written
if ( !pIt->bClose ) {
- m_Fields.erase( pIt );
- --pIt;
+ pIt = m_Fields.erase( pIt );
+ continue;
}
}
+ ++pIt;
}
DoWriteBookmarks( );
@@ -574,17 +583,16 @@ void DocxAttributeOutput::EndRun()
// append the actual run end
m_pSerializer->endElementNS( XML_w, XML_r );
- if ( m_pHyperlinkAttrList )
- {
- m_pSerializer->endElementNS( XML_w, XML_hyperlink );
- m_pHyperlinkAttrList = NULL;
- }
-
while ( m_Fields.begin() != m_Fields.end() )
{
EndField_Impl( m_Fields.front( ) );
m_Fields.erase( m_Fields.begin( ) );
}
+ if ( m_nCloseHyperlinkStatus == EndInThisRun)
+ {
+ m_pSerializer->endElementNS( XML_w, XML_hyperlink );
+ m_nCloseHyperlinkStatus = Undetected;
+ }
// if there is some redlining in the document, output it
EndRedline();
@@ -749,6 +757,15 @@ void DocxAttributeOutput::CmdField_Impl( FieldInfos& rInfos )
for ( xub_StrLen i = 0; i < nNbToken; i++ )
{
String sToken = rInfos.sCmd.GetToken( i, '\t' );
+ if ( rInfos.eType == ww::eCREATEDATE
+ || rInfos.eType == ww::eSAVEDATE
+ || rInfos.eType == ww::ePRINTDATE
+ || rInfos.eType == ww::eDATE
+ || rInfos.eType == ww::eTIME )
+ {
+ sToken.SearchAndReplaceAll( String( RTL_CONSTASCII_USTRINGPARAM("NNNN") ), String( RTL_CONSTASCII_USTRINGPARAM("dddd") ) );
+ sToken.SearchAndReplaceAll( String( RTL_CONSTASCII_USTRINGPARAM("NN") ), String( RTL_CONSTASCII_USTRINGPARAM("ddd") ) );
+ }
// Write the Field command
DoWriteCmd( sToken );
@@ -854,6 +871,9 @@ void DocxAttributeOutput::StartRunProperties()
m_pSerializer->startElementNS( XML_w, XML_rPr, FSEND );
InitCollectedRunProperties();
+
+ OSL_ASSERT( m_postponedGraphic == NULL );
+ m_postponedGraphic = new std::list< PostponedGraphic >;
}
void DocxAttributeOutput::InitCollectedRunProperties()
@@ -958,11 +978,23 @@ void DocxAttributeOutput::EndRunProperties( const SwRedlineData* /*pRedlineData*
// write footnotes/endnotes if we have any
FootnoteEndnoteReference();
+ WritePostponedGraphic();
+
// merge the properties _before_ the run text (strictly speaking, just
// after the start of the run)
m_pSerializer->mergeTopMarks( sax_fastparser::MERGE_MARKS_PREPEND );
}
+void DocxAttributeOutput::WritePostponedGraphic()
+{
+ for( std::list< PostponedGraphic >::const_iterator it = m_postponedGraphic->begin();
+ it != m_postponedGraphic->end();
+ ++it )
+ FlyFrameGraphic( *( it->grfNode ), it->size );
+ delete m_postponedGraphic;
+ m_postponedGraphic = NULL;
+}
+
void DocxAttributeOutput::FootnoteEndnoteRefTag()
{
if( m_footnoteEndnoteRefTag == 0 )
@@ -1004,6 +1036,8 @@ static void impl_WriteRunText( FSHelperPtr pSerializer, sal_Int32 nTextToken,
void DocxAttributeOutput::RunText( const String& rText, rtl_TextEncoding /*eCharSet*/ )
{
+ if ( m_nCloseHyperlinkStatus == Detected )
+ m_nCloseHyperlinkStatus = EndInPrevRun;
OUString aText( rText );
// one text can be split into more <w:t>blah</w:t>'s by line breaks etc.
@@ -1163,8 +1197,8 @@ bool DocxAttributeOutput::StartURL( const String& rUrl, const String& rTarget )
else
{
// Output a hyperlink XML element
-
m_pHyperlinkAttrList = m_pSerializer->createAttrList();
+
if ( !bBookmarkOnly )
{
OUString osUrl( sUrl );
@@ -1191,6 +1225,7 @@ bool DocxAttributeOutput::StartURL( const String& rUrl, const String& rTarget )
bool DocxAttributeOutput::EndURL()
{
+ m_nCloseHyperlinkStatus = Detected;
return true;
}
@@ -1654,6 +1689,35 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
// Write the table properties
m_pSerializer->startElementNS( XML_w, XML_tblPr, FSEND );
+ static const sal_Int32 aOrder[] =
+ {
+ FSNS( XML_w, XML_tblStyle ),
+ FSNS( XML_w, XML_tblpPr ),
+ FSNS( XML_w, XML_tblOverlap ),
+ FSNS( XML_w, XML_bidiVisual ),
+ FSNS( XML_w, XML_tblStyleRowBandSize ),
+ FSNS( XML_w, XML_tblStyleColBandSize ),
+ FSNS( XML_w, XML_tblW ),
+ FSNS( XML_w, XML_jc ),
+ FSNS( XML_w, XML_tblCellSpacing ),
+ FSNS( XML_w, XML_tblInd ),
+ FSNS( XML_w, XML_tblBorders ),
+ FSNS( XML_w, XML_shd ),
+ FSNS( XML_w, XML_tblLayout ),
+ FSNS( XML_w, XML_tblCellMar ),
+ FSNS( XML_w, XML_tblLook ),
+ FSNS( XML_w, XML_tblPrChange )
+ };
+
+ // postpone the output so that we can later []
+ // prepend the properties before the run
+ sal_Int32 len = sizeof ( aOrder ) / sizeof( sal_Int32 );
+ uno::Sequence< sal_Int32 > aSeqOrder( len );
+ for ( sal_Int32 i = 0; i < len; i++ )
+ aSeqOrder[i] = aOrder[i];
+
+ m_pSerializer->mark( aSeqOrder );
+
sal_uInt32 nPageSize = 0;
bool bRelBoxSize = false;
@@ -1710,6 +1774,9 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
FSNS( XML_w, XML_type ), "dxa",
FSEND );
+ // Merge the marks for the ordered elements
+ m_pSerializer->mergeTopMarks( );
+
m_pSerializer->endElementNS( XML_w, XML_tblPr );
// Write the table grid infos
@@ -1823,6 +1890,23 @@ void DocxAttributeOutput::TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer
m_pSerializer->singleElementNS( XML_w, XML_textDirection,
FSNS( XML_w, XML_val ), "tbRl",
FSEND );
+
+ const SwWriteTableRows& aRows = m_pTableWrt->GetRows( );
+ SwWriteTableRow *pRow = aRows[ pTableTextNodeInfoInner->getRow( ) ];
+ SwWriteTableCell *pCell = pRow->GetCells( )[ pTableTextNodeInfoInner->getCell( ) ];
+ switch( pCell->GetVertOri())
+ {
+ case text::VertOrientation::TOP:
+ break;
+ case text::VertOrientation::CENTER:
+ m_pSerializer->singleElementNS( XML_w, XML_vAlign,
+ FSNS( XML_w, XML_val ), "center", FSEND );
+ break;
+ case text::VertOrientation::BOTTOM:
+ m_pSerializer->singleElementNS( XML_w, XML_vAlign,
+ FSNS( XML_w, XML_val ), "bottom", FSEND );
+ break;
+ }
}
void DocxAttributeOutput::TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t /*pNodeInfo*/ )
@@ -2202,7 +2286,14 @@ void DocxAttributeOutput::OutputFlyFrame_Impl( const sw::Frame &rFrame, const Po
const SwNode *pNode = rFrame.GetContent();
const SwGrfNode *pGrfNode = pNode ? pNode->GetGrfNode() : 0;
if ( pGrfNode )
- FlyFrameGraphic( *pGrfNode, rFrame.GetLayoutSize() );
+ {
+ if( m_postponedGraphic == NULL )
+ FlyFrameGraphic( *pGrfNode, rFrame.GetLayoutSize() );
+ else // we are writting out attributes, but w:drawing should not be inside w:rPr,
+ { // so write it out later
+ m_postponedGraphic->push_back( PostponedGraphic( pGrfNode, rFrame.GetLayoutSize()));
+ }
+ }
}
break;
case sw::Frame::eDrawing:
@@ -2367,7 +2458,7 @@ void DocxAttributeOutput::SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectio
{
// postpone the output of this; it has to be done inside the
// paragraph properties, so remember it until then
- m_pSectionInfo = pSectionInfo;
+ m_pSectionInfo.reset( new WW8_SepInfo( *pSectionInfo ));
}
}
else
@@ -3212,9 +3303,34 @@ void DocxAttributeOutput::HiddenField( const SwField& /*rFld*/ )
OSL_TRACE( "TODO DocxAttributeOutput::HiddenField()\n" );
}
-void DocxAttributeOutput::PostitField( const SwField* /* pFld*/ )
+void DocxAttributeOutput::PostitField( const SwField* pFld )
+{
+ assert( dynamic_cast< const SwPostItField* >( pFld ));
+ m_postitFields.push_back( static_cast< const SwPostItField* >( pFld ));
+}
+
+void DocxAttributeOutput::WritePostitFieldReference()
{
- OSL_TRACE( "TODO DocxAttributeOutput::PostitField()\n" );
+ while( m_postitFieldsMaxId < m_postitFields.size())
+ {
+ OString idstr = OString::valueOf( sal_Int32( m_postitFieldsMaxId ));
+ m_pSerializer->singleElementNS( XML_w, XML_commentReference, FSNS( XML_w, XML_id ), idstr.getStr(), FSEND );
+ ++m_postitFieldsMaxId;
+ }
+}
+
+void DocxAttributeOutput::WritePostitFields()
+{
+ for( unsigned int i = 0;
+ i < m_postitFields.size();
+ ++i )
+ {
+ OString idstr = OString::valueOf( sal_Int32( i ));
+// TODO const SwPostItField* f = m_postitFields[ i ];
+ m_pSerializer->startElementNS( XML_w, XML_comment, FSNS( XML_w, XML_id ), idstr.getStr(),
+ /*TODO*/ FSEND );
+ m_pSerializer->endElementNS( XML_w, XML_comment );
+ }
}
bool DocxAttributeOutput::DropdownField( const SwField* pFld )
@@ -3387,6 +3503,8 @@ void DocxAttributeOutput::FootnotesEndnotes( bool bFootnotes )
m_pSerializer->endElementNS( XML_w, XML_p );
m_pSerializer->endElementNS( XML_w, nItem );
+ // if new special ones are added, update also WriteFootnoteEndnotePr()
+
// footnotes/endnotes themselves
for ( FootnotesVector::const_iterator i = rVector.begin(); i != rVector.end(); ++i, ++nIndex )
{
@@ -3409,6 +3527,62 @@ void DocxAttributeOutput::FootnotesEndnotes( bool bFootnotes )
}
+void DocxAttributeOutput::WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr fs, int tag,
+ const SwEndNoteInfo& info, int listtag )
+{
+ fs->startElementNS( XML_w, tag, FSEND );
+ const char* fmt = NULL;
+ switch( info.aFmt.GetNumberingType())
+ {
+ case SVX_NUM_CHARS_UPPER_LETTER_N: // fall through, map to upper letters
+ case SVX_NUM_CHARS_UPPER_LETTER:
+ fmt = "upperLetter";
+ break;
+ case SVX_NUM_CHARS_LOWER_LETTER_N: // fall through, map to lower letters
+ case SVX_NUM_CHARS_LOWER_LETTER:
+ fmt = "lowerLetter";
+ break;
+ case SVX_NUM_ROMAN_UPPER:
+ fmt = "upperRoman";
+ break;
+ case SVX_NUM_ROMAN_LOWER:
+ fmt = "lowerRoman";
+ break;
+ case SVX_NUM_ARABIC:
+ fmt = "decimal";
+ break;
+ case SVX_NUM_NUMBER_NONE:
+ fmt = "none";
+ break;
+ case SVX_NUM_CHAR_SPECIAL:
+ fmt = "bullet";
+ break;
+ case SVX_NUM_PAGEDESC:
+ case SVX_NUM_BITMAP:
+ default:
+ break; // no format
+ }
+ if( fmt != NULL )
+ fs->singleElementNS( XML_w, XML_numFmt, FSNS( XML_w, XML_val ), fmt, FSEND );
+ if( info.nFtnOffset != 0 )
+ fs->singleElementNS( XML_w, XML_numStart, FSNS( XML_w, XML_val ),
+ rtl::OString::valueOf( sal_Int32( info.nFtnOffset + 1 )).getStr(), FSEND );
+ if( listtag != 0 ) // we are writting to settings.xml, write also special footnote/endnote list
+ { // there are currently only two hardcoded ones ( see FootnotesEndnotes())
+ fs->singleElementNS( XML_w, listtag, FSNS( XML_w, XML_id ), "0", FSEND );
+ fs->singleElementNS( XML_w, listtag, FSNS( XML_w, XML_id ), "1", FSEND );
+ }
+ fs->endElementNS( XML_w, tag );
+}
+
+void DocxAttributeOutput::SectFootnoteEndnotePr()
+{
+ if( HasFootnotes())
+ WriteFootnoteEndnotePr( m_pSerializer, XML_footnotePr, m_rExport.pDoc->GetFtnInfo(), 0 );
+ if( HasEndnotes())
+ WriteFootnoteEndnotePr( m_pSerializer, XML_endnotePr, m_rExport.pDoc->GetEndNoteInfo(), 0 );
+}
+
void DocxAttributeOutput::ParaLineSpacing_Impl( short nSpace, short nMulti )
{
if ( !m_pParagraphSpacingAttrList )
@@ -4118,7 +4292,10 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
m_nTableDepth( 0 ),
m_bParagraphOpened( false ),
m_nColBreakStatus( COLBRK_NONE ),
- m_pParentFrame( NULL )
+ m_pParentFrame( NULL ),
+ m_nCloseHyperlinkStatus( Undetected ),
+ m_postponedGraphic( NULL ),
+ m_postitFieldsMaxId( 0 )
{
}
@@ -4144,14 +4321,19 @@ DocxExport& DocxAttributeOutput::GetExport()
return m_rExport;
}
-bool DocxAttributeOutput::HasFootnotes()
+bool DocxAttributeOutput::HasFootnotes() const
{
return !m_pFootnotesList->isEmpty();
}
-bool DocxAttributeOutput::HasEndnotes()
+bool DocxAttributeOutput::HasEndnotes() const
{
return !m_pEndnotesList->isEmpty();
}
+bool DocxAttributeOutput::HasPostitFields() const
+{
+ return !m_postitFields.empty();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 0875b46a99..cc67549de3 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -41,6 +41,7 @@
#include <fldbas.hxx>
#include <vector>
+#include <boost/scoped_ptr.hpp>
class SwGrfNode;
class SdrObject;
@@ -102,6 +103,10 @@ public:
virtual void FootnoteEndnoteRefTag();
+ virtual void SectFootnoteEndnotePr();
+
+ virtual void WritePostitFieldReference();
+
/// Output text (inside a run).
virtual void RunText( const String& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 );
@@ -522,6 +527,7 @@ protected:
private:
void DoWriteBookmarks( );
+ void WritePostponedGraphic();
void StartField_Impl( FieldInfos& rInfos, sal_Bool bWriteRun = sal_False );
void DoWriteCmd( String& rCmd );
@@ -539,7 +545,7 @@ private:
::docx::FootnotesList *m_pEndnotesList;
int m_footnoteEndnoteRefTag;
- const WW8_SepInfo *m_pSectionInfo;
+ boost::scoped_ptr< const WW8_SepInfo > m_pSectionInfo;
/// Redline data to remember in the text run.
const SwRedlineData *m_pRedlineData;
@@ -578,6 +584,25 @@ private:
DocxColBreakStatus m_nColBreakStatus;
const sw::Frame *m_pParentFrame;
+ // close of hyperlink needed
+ enum HyperLinkCloseState
+ {
+ Undetected = 0,
+ Detected,
+ EndInPrevRun,
+ EndInThisRun
+ };
+ HyperLinkCloseState m_nCloseHyperlinkStatus;
+
+ struct PostponedGraphic
+ {
+ PostponedGraphic( const SwGrfNode* n, Size s ) : grfNode( n ), size( s ) {};
+ const SwGrfNode* grfNode;
+ Size size;
+ };
+ std::list< PostponedGraphic >* m_postponedGraphic;
+ std::vector< const SwPostItField* > m_postitFields;
+ unsigned int m_postitFieldsMaxId;
public:
DocxAttributeOutput( DocxExport &rExport, ::sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML );
@@ -595,13 +620,19 @@ public:
::sax_fastparser::FSHelperPtr GetSerializer( ) { return m_pSerializer; }
/// Do we have any footnotes?
- bool HasFootnotes();
+ bool HasFootnotes() const;
/// Do we have any endnotes?
- bool HasEndnotes();
+ bool HasEndnotes() const;
/// Output the content of the footnotes.xml resp. endnotes.xml
void FootnotesEndnotes( bool bFootnotes );
+
+ /// writes the footnotePr/endnotePr (depending on tag) section
+ void WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr fs, int tag, const SwEndNoteInfo& info, int listtag );
+
+ bool HasPostitFields() const;
+ void WritePostitFields();
};
#endif // _DOCXATTRIBUTEOUTPUT_HXX_
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 33312dab76..dd77d7bbcc 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -52,6 +52,7 @@
#include <fmtpdsc.hxx>
#include <frmfmt.hxx>
#include <section.hxx>
+#include <ftninfo.hxx>
#include <docary.hxx>
#include <numrule.hxx>
@@ -338,6 +339,8 @@ void DocxExport::ExportDocument_Impl()
WriteFootnotesEndnotes();
+ WritePostitFields();
+
WriteNumbering();
WriteFonts();
@@ -515,6 +518,26 @@ void DocxExport::WriteFootnotesEndnotes()
}
}
+void DocxExport::WritePostitFields()
+{
+ if ( m_pAttrOutput->HasPostitFields() )
+ {
+ m_pFilter->addRelation( m_pDocumentFS->getOutputStream(),
+ S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" ),
+ S( "comments.xml" ) );
+
+ ::sax_fastparser::FSHelperPtr pPostitFS =
+ m_pFilter->openFragmentStreamWithSerializer( S( "word/comments.xml" ),
+ S( "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml" ) );
+
+ pPostitFS->startElementNS( XML_w, XML_comments, MainXmlNamespaces( pPostitFS ));
+ m_pAttrOutput->SetSerializer( pPostitFS );
+ m_pAttrOutput->WritePostitFields();
+ m_pAttrOutput->SetSerializer( m_pDocumentFS );
+ pPostitFS->endElementNS( XML_w, XML_comments );
+ }
+}
+
void DocxExport::WriteNumbering()
{
if ( !pUsedNumTbl )
@@ -649,8 +672,9 @@ void DocxExport::WriteProperties( )
void DocxExport::WriteSettings()
{
- if( !settings.hasData())
+ if( !settings.hasData() && !m_pAttrOutput->HasFootnotes() && !m_pAttrOutput->HasEndnotes())
return;
+
m_pFilter->addRelation( m_pDocumentFS->getOutputStream(),
S( "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" ),
S( "settings.xml" ) );
@@ -666,6 +690,11 @@ void DocxExport::WriteSettings()
if( settings.evenAndOddHeaders )
pFS->singleElementNS( XML_w, XML_evenAndOddHeaders, FSEND );
+ if( m_pAttrOutput->HasFootnotes())
+ m_pAttrOutput->WriteFootnoteEndnotePr( pFS, XML_footnotePr, pDoc->GetFtnInfo(), XML_footnote );
+ if( m_pAttrOutput->HasEndnotes())
+ m_pAttrOutput->WriteFootnoteEndnotePr( pFS, XML_endnotePr, pDoc->GetEndNoteInfo(), XML_endnote );
+
pFS->endElementNS( XML_w, XML_settings );
}
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index ee84dcd33b..faed1e0cf7 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -190,6 +190,9 @@ private:
/// Write footnotes.xml and endnotes.xml.
void WriteFootnotesEndnotes();
+ /// Write comments.xml
+ void WritePostitFields();
+
/// Write the numbering table.
virtual void WriteNumbering();
diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx
index b784e8404b..38faf1c410 100644
--- a/sw/source/filter/ww8/docxexportfilter.cxx
+++ b/sw/source/filter/ww8/docxexportfilter.cxx
@@ -123,15 +123,6 @@ uno::Reference< uno::XInterface > SAL_CALL DocxExport_createInstance(const uno::
extern "C"
{
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
-// ------------------------
-// - component_getFactory -
-// ------------------------
-
::cppu::ImplementationEntry entries [] =
{
{
@@ -152,7 +143,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const
{ 0, 0, 0, 0, 0, 0 }
};
-SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey )
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL msword_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* pRegistryKey )
{
return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, entries );
}
diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx
index 55de32d362..550e22f61b 100644
--- a/sw/source/filter/ww8/escher.hxx
+++ b/sw/source/filter/ww8/escher.hxx
@@ -36,7 +36,6 @@ class SwFrmFmt;
// #i30669#
class SwFmtHoriOrient;
class SwFmtVertOrient;
-// <--
class WinwordAnchoring : public EscherExClientRecord_Base
{
@@ -140,7 +139,7 @@ private:
class SwEscherEx : public SwBasicEscherEx
{
private:
- SvULongs aFollowShpIds;
+ std::vector<sal_uLong> aFollowShpIds;
EscherExHostAppData aHostData;
WinwordAnchoring aWinwordAnchoring;
WW8_WrPlcTxtBoxes *pTxtBxs;
diff --git a/sw/source/filter/ww8/hash_wrap.hxx b/sw/source/filter/ww8/hash_wrap.hxx
index 348d2efabe..52be41ad66 100644
--- a/sw/source/filter/ww8/hash_wrap.hxx
+++ b/sw/source/filter/ww8/hash_wrap.hxx
@@ -32,7 +32,6 @@
#define WW_HASH_WRAP_HXX
#include <boost/unordered_set.hpp>
-#include <tools/debug.hxx>
//simple wrapper around boost::unordered_set to behave like sorted array
namespace ww
diff --git a/sw/source/filter/ww8/needed_cast.hxx b/sw/source/filter/ww8/needed_cast.hxx
index 5dc419704a..462e6d0c89 100644
--- a/sw/source/filter/ww8/needed_cast.hxx
+++ b/sw/source/filter/ww8/needed_cast.hxx
@@ -29,7 +29,6 @@
#ifndef WW_NEEDED_CAST_HXX
#define WW_NEEDED_CAST_HXX
-#include <tools/debug.hxx>
#include "staticassert.hxx"
namespace ww
@@ -41,7 +40,7 @@ namespace ww
template<typename Ret> Ret checking_cast(Ret in, Ret)
{
- DBG_ASSERT( false, "UnnecessaryCast" );
+ OSL_ENSURE( false, "UnnecessaryCast" );
return in;
}
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 93412a25a8..b451bd9e5b 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -92,6 +92,7 @@
#include <svx/fmglob.hxx>
#include <svx/svdouno.hxx>
#include <filter/msfilter/msoleexp.hxx>
+#include <svtools/miscopt.hxx>
#include <docufld.hxx>
#include <flddropdown.hxx>
@@ -926,6 +927,19 @@ void RtfAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pT
TableDefinition(pTableTextNodeInfoInner);
+ SvtMiscOptions aMiscOptions;
+ if (aMiscOptions.IsExperimentalMode())
+ {
+ m_aTables.push_back(m_aRowDefs.toString());
+ // Emit row properties at the start of the row as well for non-nested
+ // tables, to support old readers.
+ if ( nCurrentDepth <= 1 )
+ m_rExport.Strm() << m_aRowDefs.makeStringAndClear();
+ m_aRowDefs.setLength(0);
+ return;
+ }
+ else
+ {
if (!m_bLastTable)
m_aTables.push_back(m_aRowDefs.makeStringAndClear());
@@ -933,6 +947,7 @@ void RtfAttributeOutput::StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pT
if ( nCurrentDepth > 1 )
return;
m_rExport.Strm() << m_aRowDefs.makeStringAndClear();
+ }
}
void RtfAttributeOutput::StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t /*pTableTextNodeInfoInner*/ )
@@ -980,7 +995,7 @@ void RtfAttributeOutput::EndTableRow( )
m_aAfterRuns.append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_NESTTABLEPROPRS);
if (m_aRowDefs.getLength() > 0)
m_aAfterRuns.append(m_aRowDefs.makeStringAndClear());
- else if (m_aTables.size() > 0)
+ else if (!m_aTables.empty())
{
m_aAfterRuns.append(m_aTables.back());
m_aTables.pop_back();
@@ -989,7 +1004,7 @@ void RtfAttributeOutput::EndTableRow( )
}
else
{
- if (m_aTables.size() > 0)
+ if (!m_aTables.empty())
{
m_aAfterRuns.append(m_aTables.back());
m_aTables.pop_back();
@@ -1351,6 +1366,7 @@ void RtfAttributeOutput::NumberingLevel( sal_uInt8 nLevel,
case SVX_NUM_BITMAP:
case SVX_NUM_CHAR_SPECIAL: nVal = 23; break;
+ case SVX_NUM_NUMBER_NONE: nVal = 255; break;
}
m_rExport.Strm() << OOO_STRING_SVTOOLS_RTF_LEVELNFC;
m_rExport.OutULong( nVal );
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 511b4b110a..9ff330a0f5 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -491,7 +491,7 @@ void RtfExport::WritePageDescTable()
void RtfExport::ExportDocument_Impl()
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
// MSWordExportBase::WriteText and others write debug messages to std::clog
// which is not interesting while debugging RtfExport
std::ostringstream aOss;
@@ -698,7 +698,7 @@ void RtfExport::ExportDocument_Impl()
Strm() << '}';
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
std::clog.rdbuf(pOldBuf);
#endif
}
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index ec3fc760a9..a5410bdc61 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -441,13 +441,6 @@ void RtfSdrExport::AddRectangleDimensions( rtl::OStringBuffer& rBuffer, const Re
rBuffer.append(OOO_STRING_SVTOOLS_RTF_SHPBOTTOM).append(rRectangle.Bottom());
}
-void RtfSdrExport::AddShapeAttribute( sal_Int32 /*nAttribute*/, const rtl::OString& /*rValue*/ )
-{
- OSL_TRACE("%s", OSL_THIS_FUNC);
-
- /* noop */
-}
-
extern const char* pShapeTypes[];
void lcl_AppendSP( ::rtl::OStringBuffer& rRunText, const char cName[], const ::rtl::OString& rValue)
diff --git a/sw/source/filter/ww8/rtfsdrexport.hxx b/sw/source/filter/ww8/rtfsdrexport.hxx
index f461357e5c..5834a23856 100644
--- a/sw/source/filter/ww8/rtfsdrexport.hxx
+++ b/sw/source/filter/ww8/rtfsdrexport.hxx
@@ -72,12 +72,6 @@ public:
sal_uInt32 AddSdrObject( const SdrObject& rObj );
protected:
- /// Add an attribute to the generated shape element.
- ///
- /// This should be called from within StartShape() to ensure that the
- /// added attribute is preserved.
- void AddShapeAttribute( sal_Int32 nAttribute, const rtl::OString& sValue );
-
/// Start the shape for which we just collected the information.
///
/// Returns the element's tag number, -1 means we wrote nothing.
diff --git a/sw/source/filter/ww8/sortedarray.hxx b/sw/source/filter/ww8/sortedarray.hxx
index 6fccf664c1..f76646c1fa 100644
--- a/sw/source/filter/ww8/sortedarray.hxx
+++ b/sw/source/filter/ww8/sortedarray.hxx
@@ -30,7 +30,6 @@
#define WW_SORTEDARRAY_HXX
#include <algorithm>
-#include <tools/debug.hxx>
//simple template that manages a static [] array by sorting at construction
diff --git a/sw/source/filter/ww8/styles.cxx b/sw/source/filter/ww8/styles.cxx
index 30b2839c19..ff11be68c0 100644
--- a/sw/source/filter/ww8/styles.cxx
+++ b/sw/source/filter/ww8/styles.cxx
@@ -35,7 +35,6 @@
#include <algorithm> //std::find_if
#include <tools/string.hxx> //do we have to...
-#include <tools/debug.hxx>
#include "staticassert.hxx" //StaticAssert
namespace
@@ -147,7 +146,7 @@ namespace
"Plain Text"
};
- DBG_ASSERT( (SAL_N_ELEMENTS(stiName)) == ww::stiMax, "WrongSizeOfArray" );
+ OSL_ENSURE( (SAL_N_ELEMENTS(stiName)) == ww::stiMax, "WrongSizeOfArray" );
return stiName;
}
diff --git a/sw/source/filter/ww8/types.hxx b/sw/source/filter/ww8/types.hxx
index af9df20692..43fc7f9707 100644
--- a/sw/source/filter/ww8/types.hxx
+++ b/sw/source/filter/ww8/types.hxx
@@ -31,12 +31,6 @@
#include <vector>
-//if part of OOo
-#include "typessw.hxx"
-//else
-//include standalonetypes.hxx
-//endif
-
namespace ww
{
typedef std::vector<sal_uInt8> bytes;
diff --git a/sw/source/filter/ww8/typessw.hxx b/sw/source/filter/ww8/typessw.hxx
deleted file mode 100644
index 0c35a3b003..0000000000
--- a/sw/source/filter/ww8/typessw.hxx
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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 WW_TYPESSW
-#define WW_TYPESSW
-
-#include <sal/types.h>
-
-namespace ww
-{
- typedef sal_Int8 sal_Int8;
- typedef sal_Int16 sal_Int16;
- typedef sal_Int32 sal_Int32;
- typedef sal_uInt8 sal_uInt8;
- typedef sal_uInt16 sal_uInt16;
- typedef sal_uInt32 sal_uInt32;
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index 61534becd1..a4edabc6b4 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -112,10 +112,8 @@ namespace
}
return bResult;
- // <--
}
};
- // <--
bool IsValidSlotWhich(sal_uInt16 nSlotId, sal_uInt16 nWhichId)
{
@@ -195,7 +193,6 @@ namespace sw
}
maLayoutSize = aRect.GetSize();
}
- // <--
switch (rNd.GetNodeType())
{
case ND_GRFNODE:
@@ -210,7 +207,6 @@ namespace sw
meWriterType = eTxtBox;
// #i43447# - Size equals layout size for text boxes
maSize = maLayoutSize;
- // <--
break;
}
mpStartFrameContent = &rNd;
@@ -312,14 +308,14 @@ namespace sw
{
if (mxIPRef.is())
{
- DBG_ASSERT( !mrPers.GetEmbeddedObjectContainer().HasEmbeddedObject( mxIPRef ), "Object in adaptor is inserted?!" );
+ OSL_ENSURE( !mrPers.GetEmbeddedObjectContainer().HasEmbeddedObject( mxIPRef ), "Object in adaptor is inserted?!" );
try
{
uno::Reference < com::sun::star::util::XCloseable > xClose( mxIPRef, uno::UNO_QUERY );
if ( xClose.is() )
xClose->close(sal_True);
}
- catch ( com::sun::star::util::CloseVetoException& )
+ catch ( const com::sun::star::util::CloseVetoException& )
{
}
@@ -683,7 +679,7 @@ namespace sw
{
const SwFltRedline *pTest = static_cast<const SwFltRedline *>
(pEntry->pAttr);
- return (pEntry->bLocked && (pTest->eType == meType));
+ return (pEntry->bOpen && (pTest->eType == meType));
}
};
@@ -700,17 +696,14 @@ namespace sw
return false;
}
-
-
void RedlineStack::closeall(const SwPosition& rPos)
{
- std::for_each(maStack.begin(), maStack.end(), CloseIfOpen(rPos));
+ std::for_each(maStack.begin(), maStack.end(), SetEndIfOpen(rPos));
}
-
void SetInDocAndDelete::operator()(SwFltStackEntry *pEntry)
{
- SwPaM aRegion(pEntry->nMkNode);
+ SwPaM aRegion(pEntry->m_aMkPos.m_nNode);
if (
pEntry->MakeRegion(&mrDoc, aRegion, true) &&
(*aRegion.GetPoint() != *aRegion.GetMark())
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index 944bf62110..e0cf390376 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -467,13 +467,6 @@ namespace sw
msSecondary = GetFontToken(rFamilyName, 1);
}
- bool FontMapExport::HasDistinctSecondary() const
- {
- if (msSecondary.Len() && msSecondary != msPrimary)
- return true;
- return false;
- }
-
bool ItemSort::operator()(sal_uInt16 nA, sal_uInt16 nB) const
{
/*
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 7d1248ae62..9bb3eaed8e 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -33,7 +33,6 @@
#include <hintids.hxx>
-#define _SVSTDARR_ULONGSSORT
#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
#include <vcl/cvtgrf.hxx>
@@ -101,6 +100,16 @@
#include "escher.hxx"
#include <ndtxt.hxx>
#include "WW8FFData.hxx"
+#include <com/sun/star/drawing/XShape.hpp>
+#include <com/sun/star/beans/XPropertyContainer.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/form/XFormComponent.hpp>
+#include <comphelper/processfactory.hxx>
+#include "docsh.hxx"
+#include <oox/ole/olehelper.hxx>
+#include <comphelper/componentcontext.hxx>
+#include <fstream>
using ::editeng::SvxBorderLine;
using namespace com::sun::star;
@@ -108,6 +117,53 @@ using namespace sw::util;
using namespace sw::types;
using namespace nsFieldFlags;
+namespace
+{
+ /// Get the Z ordering number for a DrawObj in a WW8Export.
+ /// @param rWrt The containing WW8Export.
+ /// @param pObj pointer to the drawing object.
+ /// @returns The ordering number.
+ static sal_uLong lcl_getSdrOrderNumber(const WW8Export& rWrt, DrawObj *pObj)
+ {
+ return rWrt.GetSdrOrdNum(pObj->maCntnt.GetFrmFmt());
+ };
+
+ /// A function object to act as a predicate comparing the ordering numbers
+ /// of two drawing obejcts in a WW8Export.
+ class CompareDrawObjs
+ {
+ private:
+ const WW8Export& wrt;
+
+ public:
+ CompareDrawObjs(const WW8Export& rWrt) : wrt(rWrt) {};
+ bool operator()(DrawObj *a, DrawObj *b) const
+ {
+ sal_uLong aSort = ::lcl_getSdrOrderNumber(wrt, a);
+ sal_uLong bSort = ::lcl_getSdrOrderNumber(wrt, b);
+ return aSort < bSort;
+ }
+ };
+
+ /// Make a z-order sorted copy of a collection of DrawObj objects.
+ /// @param rWrt The containing WW8Export.
+ /// @param rSrcArr The source array.
+ /// @param rDstArr The destination array.
+ static void lcl_makeZOrderArray(const WW8Export& rWrt,
+ std::vector<DrawObj> &rSrcArr,
+ std::vector<DrawObj*> &rDstArr)
+ {
+ rDstArr.clear();
+ rDstArr.reserve(rSrcArr.size());
+ for(size_t i = 0; i < rSrcArr.size(); ++i)
+ {
+ rDstArr.push_back( &rSrcArr[i] );
+ }
+ std::sort(rDstArr.begin(), rDstArr.end(), ::CompareDrawObjs(rWrt));
+ }
+
+}
+
// get a part fix for this type of element
bool WW8Export::MiserableFormFieldExportHack(const SwFrmFmt& rFrmFmt)
{
@@ -170,14 +226,12 @@ void WW8Export::DoComboBox(uno::Reference<beans::XPropertySet> xPropSet)
try
{
uno::Any aTmp = xPropSet->getPropertyValue(C2U("HelpText"));
- // <--
const rtl::OUString *pStr = (const rtl::OUString *)aTmp.getValue();
if (pStr)
sHelp = *pStr;
}
- catch( uno::Exception& )
+ catch( const uno::Exception& )
{}
- // <--
}
rtl::OUString sToolTip;
@@ -486,7 +540,6 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
// Most positions are converted, if layout information exists.
const bool bPosConverted =
WinwordAnchoring::ConvertPosition( rHOr, rVOr, rFmt );
- // <--
Point aObjPos;
if (RES_FLYFRMFMT == rFmt.Which())
@@ -504,7 +557,6 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
const SwRect aSizeRect(rFmt.FindLayoutRect());
if ( aSizeRect.Width() > aLayRect.Width() )
aLayRect.Width( aSizeRect.Width() );
- // <--
aRect = aLayRect.SVRect();
}
@@ -542,7 +594,6 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const
aObjPos.X() = rHOr.GetPos();
aRect.SetPos( aObjPos );
}
- // <--
sal_Int32 nThick = aIter->mnThick;
@@ -1542,7 +1593,7 @@ sal_Int32 SwBasicEscherEx::WriteOLEFlyFrame(const SwFrmFmt& rFmt, sal_uInt32 nSh
aRect.Height = aSize.Height;
bRectIsSet = sal_True;
}
- catch( uno::Exception& )
+ catch( const uno::Exception& )
{}
}
@@ -2090,7 +2141,6 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri,
{
return false;
}
- // <--
bool bConverted( false );
@@ -2115,7 +2165,6 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri,
bConvDueToAnchoredAtColBreakPara = true;
}
}
- // <--
// convert horizontal position, if needed
{
@@ -2178,7 +2227,6 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri,
OSL_FAIL( "<WinwordAnchoring::ConvertPosition(..)> - unknown horizontal relation" );
}
}
- // <--
if ( eHoriConv != NO_CONV )
{
_iorHoriOri.SetHoriOrient( text::HoriOrientation::NONE );
@@ -2196,7 +2244,6 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri,
{
_iorHoriOri.SetRelationOrient( text::RelOrientation::PAGE_PRINT_AREA );
}
- // <--
}
else if ( eHoriConv == CONV2COL )
{
@@ -2308,7 +2355,6 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri,
{
_iorVertOri.SetRelationOrient( text::RelOrientation::PAGE_PRINT_AREA );
}
- // <--
}
else if ( eVertConv == CONV2PARA )
{
@@ -2678,25 +2724,12 @@ void SwEscherEx::WriteOCXControl( const SwFrmFmt& rFmt, sal_uInt32 nShapeId )
void SwEscherEx::MakeZOrderArrAndFollowIds(
std::vector<DrawObj>& rSrcArr, std::vector<DrawObj*>&rDstArr)
{
- sal_uInt16 n, nCnt = static_cast< sal_uInt16 >(rSrcArr.size());
- SvULongsSort aSort( 255 < nCnt ? 255 : nCnt, 255 );
- rDstArr.clear();
- rDstArr.reserve(nCnt);
- for (n = 0; n < nCnt; ++n)
- {
- const SwFrmFmt &rFmt = rSrcArr[n].maCntnt.GetFrmFmt();
- sal_uLong nOrdNum = rWrt.GetSdrOrdNum(rFmt);
- sal_uInt16 nPos;
- //returns what will be the index in rDstArr of p as nPos
- aSort.Insert(nOrdNum, nPos);
- DrawObj &rObj = rSrcArr[n];
- rDstArr.insert(rDstArr.begin() + nPos, &rObj);
- }
+ ::lcl_makeZOrderArray(rWrt, rSrcArr, rDstArr);
- if (aFollowShpIds.Count())
- aFollowShpIds.Remove(0, aFollowShpIds.Count());
+ //Now set up the follow IDs
+ aFollowShpIds.clear();
- for (n = 0; n < nCnt; ++n)
+ for (size_t n = 0; n < rDstArr.size(); ++n)
{
const SwFrmFmt &rFmt = rDstArr[n]->maCntnt.GetFrmFmt();
bool bNeedsShapeId = false;
@@ -2710,7 +2743,7 @@ void SwEscherEx::MakeZOrderArrAndFollowIds(
sal_uLong nShapeId = bNeedsShapeId ? GenerateShapeId() : 0;
- aFollowShpIds.Insert(nShapeId, n);
+ aFollowShpIds.push_back(nShapeId);
}
}
@@ -2745,6 +2778,34 @@ sal_uInt32 SwEscherEx::QueryTextID(
return nId;
}
+uno::Reference< uno::XComponentContext >
+lcl_getUnoCtx()
+{
+ comphelper::ComponentContext aCtx( ::comphelper::getProcessServiceFactory() );
+ return aCtx.getUNOContext();
+}
+
+
+SwMSConvertControls::SwMSConvertControls( SfxObjectShell *pDSh,SwPaM *pP ) : SvxMSConvertOCXControls( pDSh,pP ), maFormCtrlHelper( pDocSh->GetMedium()->GetInputStream(), lcl_getUnoCtx(), pDocSh->GetModel() )
+{
+}
+
+// in transitioning away old filter for ole/ocx controls, ReadOCXStream has been made pure virtual in
+// filter/source/msocximex.cxx, so.. we need an implementation here
+sal_Bool SwMSConvertControls::ReadOCXStream( SotStorageRef& rSrc1,
+ com::sun::star::uno::Reference< com::sun::star::drawing::XShape > *pShapeRef,
+ sal_Bool bFloatingCtrl )
+{
+ uno::Reference< form::XFormComponent > xFComp;
+ sal_Bool bRes = maFormCtrlHelper.importFormControlFromObjPool( xFComp, rtl::OUString( rSrc1->GetName() ) );
+ if ( bRes && xFComp.is() )
+ {
+ com::sun::star::awt::Size aSz; // not used in import
+ bRes = InsertControl( xFComp, aSz,pShapeRef,bFloatingCtrl);
+ }
+ return bRes;
+}
+
bool SwMSConvertControls::ExportControl(WW8Export &rWW8Wrt, const SdrObject *pObj)
{
if (!rWW8Wrt.bWrtWW8)
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 02659bf4a4..8dcd8b8f0c 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -161,8 +161,6 @@ ww::eField lcl_getFieldId( const IFieldmark* pFieldmark ) {
}
}
-/* */
-
MSWordAttrIter::MSWordAttrIter( MSWordExportBase& rExport )
: pOld( rExport.pChpIter ), m_rExport( rExport )
{
@@ -443,9 +441,7 @@ void SwWW8AttrIter::OutAttr( xub_StrLen nSwPos, bool bRuby )
: nSwPos == *pHt->GetStart() )
{
sal_uInt16 nWhich = pHt->GetAttr().Which();
- if (nWhich == nFontId)
- pFont = &(item_cast<SvxFontItem>(pHt->GetAttr()));
- else if( nWhich == RES_TXTATR_AUTOFMT )
+ if (nWhich == RES_TXTATR_AUTOFMT)
{
const SwFmtAutoFmt& rAutoFmt = static_cast<const SwFmtAutoFmt&>(pHt->GetAttr());
const boost::shared_ptr<SfxItemSet> pSet = rAutoFmt.GetStyleHandle();
@@ -1568,7 +1564,7 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rS
if ( pTextNodeInfo.get() != NULL )
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << pTextNodeInfo->toString() << ::std::endl;
#endif
@@ -1751,7 +1747,7 @@ void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nA
void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<OutWW8_SwTxtNode>" << ::std::endl;
#endif
@@ -1808,7 +1804,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
String aStr( rNode.GetTxt() );
xub_StrLen nAktPos = 0;
- xub_StrLen nEnd = aStr.Len();
+ xub_StrLen const nEnd = aStr.Len();
bool bRedlineAtEnd = false;
int nOpenAttrWithRange = 0;
@@ -1952,6 +1948,15 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
if ( aAttrIter.IsDropCap( nNextAttr ) )
AttrOutput().FormatDrop( rNode, aAttrIter.GetSwFmtDrop(), nStyle, pTextNodeInfo, pTextNodeInfoInner );
+ if (0 != nEnd)
+ {
+ // Output the character attributes
+ // #i51277# do this before writing flys at end of paragraph
+ AttrOutput().StartRunProperties();
+ aAttrIter.OutAttr( nAktPos );
+ AttrOutput().EndRunProperties( pRedlineData );
+ }
+
// At the end of line, output the attributes until the CR.
// Exception: footnotes at the end of line
if ( nNextAttr == nEnd )
@@ -1977,10 +1982,15 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
}
}
- // Output the character attributes
- AttrOutput().StartRunProperties();
- aAttrIter.OutAttr( nAktPos ); // nAktPos - 1 ??
- AttrOutput().EndRunProperties( pRedlineData );
+ if (0 == nEnd)
+ {
+ // Output the character attributes
+ // do it after WriteCR for an empty paragraph (otherwise
+ // WW8_WrFkp::Append throws SPRMs away...)
+ AttrOutput().StartRunProperties();
+ aAttrIter.OutAttr( nAktPos );
+ AttrOutput().EndRunProperties( pRedlineData );
+ }
// Exception: footnotes at the end of line
if ( nNextAttr == nEnd )
@@ -2020,6 +2030,8 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
}
}
+ AttrOutput().WritePostitFieldReference();
+
AttrOutput().EndRun();
nAktPos = nNextAttr;
@@ -2037,7 +2049,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
if ( pTextNodeInfo.get() != NULL )
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << pTextNodeInfo->toString() << ::std::endl;
#endif
@@ -2112,7 +2124,6 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
{
aLR.SetTxtLeft( aLR.GetTxtLeft() + pFmt->GetAbsLSpace() );
}
- // <--
if( rNode.IsNumbered() && rNode.IsCountedInList() )
{
@@ -2125,7 +2136,6 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
else
aLR.SetTxtFirstLineOfst(GetWordFirstLineOffset(*pFmt));
}
- // <--
// correct fix for issue i94187
if (SFX_ITEM_SET !=
@@ -2227,7 +2237,6 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
// put back the new item
pTmpSet->Put( aLRSpace );
}
- // <--
// assure that numbering rule is in <pTmpSet>
if (SFX_ITEM_SET != pTmpSet->GetItemState(RES_PARATR_NUMRULE, false) )
@@ -2318,7 +2327,6 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
}
}
}
- // <--
const SfxItemSet* pNewSet = pTmpSet ? pTmpSet : rNode.GetpSwAttrSet();
if( pNewSet )
@@ -2343,7 +2351,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
AttrOutput().EndParagraph( pTextNodeInfoInner );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</OutWW8_SwTxtNode>" << ::std::endl;
#endif
}
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index c54ca775eb..eea0cb2115 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -109,7 +109,6 @@ sal_uInt16 MSWordExportBase::GetId( const SwNumRule& rNumRule )
SwNumRule* pR = (SwNumRule*)pDoc->GetOutlineNumRule();
pUsedNumTbl->Insert( pR, pUsedNumTbl->Count() );
}
- // <--
}
SwNumRule* p = (SwNumRule*)&rNumRule;
sal_uInt16 nRet = pUsedNumTbl->GetPos(p);
@@ -124,7 +123,6 @@ sal_uInt16 MSWordExportBase::GetId( const SwNumRule& rNumRule )
nRet = (*aResult).second;
}
} while ( aResult != aRuleDuplicates.end() );
- // <--
return nRet;
}
@@ -222,8 +220,15 @@ void WW8AttributeOutput::NumberingLevel( sal_uInt8 /*nLevel*/,
sal_uInt8 nAlign;
switch ( eAdjust )
{
- case SVX_ADJUST_CENTER: nAlign = 1; break;
- default: nAlign = 0; break;
+ case SVX_ADJUST_CENTER:
+ nAlign = 1;
+ break;
+ case SVX_ADJUST_RIGHT:
+ nAlign = 2;
+ break;
+ default:
+ nAlign = 0;
+ break;
}
*m_rWW8Export.pTableStrm << nAlign;
@@ -355,7 +360,6 @@ void MSWordExportBase::AbstractNumberingDefinitions()
}
}
}
- // <--
// Build the NumString for this Level
String sNumStr;
@@ -393,7 +397,6 @@ void MSWordExportBase::AbstractNumberingDefinitions()
rFmt.GetCharTextDistance() == 0 )
? 2 : 0; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
}
- // <--
}
else
{
@@ -403,7 +406,6 @@ void MSWordExportBase::AbstractNumberingDefinitions()
// the numbering string has to be restrict
// to the level currently working on.
sNumStr = rRule.MakeNumString(aNumVector, false, true, nLvl);
- // <--
// now search the nums in the string
for( sal_uInt8 i = 0; i <= nLvl; ++i )
@@ -427,7 +429,6 @@ void MSWordExportBase::AbstractNumberingDefinitions()
rFmt.GetCharTextDistance() == 0 )
? 2 : 0; // ixchFollow: 0 - tab, 1 - blank, 2 - nothing
}
- // <--
}
if( rFmt.GetPrefix().Len() )
@@ -629,7 +630,6 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh,
if (GetWordFirstLineOffset(rFmt) < 0)
nb |= 0x8; // number will be displayed using a hanging indent
}
- // <--
ByteToSVBT8(nb, rAnlv.aBits1);
if (1 < rCharLen)
@@ -691,7 +691,6 @@ void WW8Export::BuildAnlvBulletBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh,
ShortToSVBT16( 0, rAnlv.dxaIndent );
ShortToSVBT16( 0, rAnlv.dxaSpace );
}
- // <--
}
void MSWordExportBase::SubstituteBullet( String& rNumStr,
@@ -830,7 +829,6 @@ void WW8Export::BuildAnlvBase(WW8_ANLV& rAnlv, sal_uInt8*& rpCh,
ShortToSVBT16( 0, rAnlv.dxaIndent );
ShortToSVBT16( 0, rAnlv.dxaSpace );
}
- // <--
}
void WW8Export::Out_NumRuleAnld( const SwNumRule& rRul, const SwNumFmt& rFmt,
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 947b438e34..d297a9c0c5 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1521,6 +1521,8 @@ void MSWordExportBase::SectionProperties( const WW8_SepInfo& rSepInfo, WW8_PdAtt
AttrOutput().StartSection();
+ AttrOutput().SectFootnoteEndnotePr();
+
// forms
AttrOutput().SectionFormProtection( rSepInfo.IsProtected() );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 6cd10cb3c5..f657ad00fe 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -267,7 +267,7 @@ static void WriteDop( WW8Export& rWrt )
rDop.cLines = rDStat.nPara;
SwDocShell *pDocShell(rWrt.pDoc->GetDocShell());
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
uno::Reference<document::XDocumentProperties> xDocProps;
uno::Reference<beans::XPropertySet> xProps;
if (pDocShell) {
@@ -278,7 +278,7 @@ static void WriteDop( WW8Export& rWrt )
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
xModelComp, uno::UNO_QUERY_THROW);
xDocProps = xDPS->getDocumentProperties();
- DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+ OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
rDop.lKeyProtDoc = pDocShell->GetModifyPasswordHash();
}
@@ -1699,7 +1699,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt,
xub_StrLen nLen, bool bUnicode, rtl_TextEncoding eChrSet)
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<OutSwString>" << ::std::endl;
#endif
@@ -1712,7 +1712,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt,
{
String sOut( rStr.Copy( nStt, nLen ) );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << ::rtl::OUStringToOString(sOut, RTL_TEXTENCODING_ASCII_US).getStr() << ::std::endl;
#endif
@@ -1723,7 +1723,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt,
}
else
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << ::rtl::OUStringToOString(rStr, RTL_TEXTENCODING_ASCII_US).getStr() << ::std::endl;
#endif
@@ -1734,7 +1734,7 @@ void WW8Export::OutSwString(const String& rStr, xub_StrLen nStt,
}
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</OutSwString>" << ::std::endl;
#endif
}
@@ -2139,6 +2139,8 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
pTableTextNodeInfoInner->getTableBoxesOfRow();
// number of cell written
sal_uInt32 nBoxes = pTableBoxes->size();
+ if (nBoxes > ww8::MAXTABLECELLS)
+ nBoxes = ww8::MAXTABLECELLS;
// sprm header
m_rWW8Export.InsUInt16( NS_sprm::LN_TDefTable );
@@ -2204,7 +2206,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
ww8::TableBoxVector::const_iterator aIt;
ww8::TableBoxVector::const_iterator aItEnd = pTableBoxes->end();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
size_t nRowSpans = pRowSpans->size();
size_t nTableBoxes = pTableBoxes->size();
(void) nRowSpans;
@@ -2213,7 +2215,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
for( aIt = pTableBoxes->begin(); aIt != aItEnd; ++aIt, ++aItRowSpans)
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
sal_uInt16 npOCount = m_rWW8Export.pO->Count();
#endif
@@ -2241,7 +2243,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
else
m_rWW8Export.Out_SwFmtTableBox( *m_rWW8Export.pO, NULL); // 8/16 Byte
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<tclength>" << m_rWW8Export.pO->Count() - npOCount << "</tclength>"
<< ::std::endl;
#endif
@@ -2434,7 +2436,7 @@ void WW8Export::SectionBreaksAndFrames( const SwTxtNode& rNode )
OutWW6FlyFrmsInCntnt( rNode );
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
struct SwNodeHash
{
size_t operator()(SwNode * pNode) const { return reinterpret_cast<size_t>(pNode); }
@@ -2528,14 +2530,14 @@ void MSWordExportBase::WriteText()
::SetProgressState( nPos, pCurPam->GetDoc()->GetDocShell() );
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</WriteText>" << ::std::endl;
#endif
}
void WW8Export::WriteMainText()
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<WriteMainText>" << ::std::endl;
#endif
@@ -2560,7 +2562,7 @@ void WW8Export::WriteMainText()
if( pLastNd )
nLastFmtId = GetId( (SwTxtFmtColl&)pLastNd->GetAnyFmtColl() );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</WriteMainText>" << ::std::endl;
#endif
}
@@ -2713,7 +2715,6 @@ void WW8Export::WriteFkpPlcUsw()
(pDoc->getExternalData(::sw::STTBF_ASSOC).get());
if ( pSttbfAssoc ) // #i106057#
- // <--
{
::std::vector<String> aStrings;
@@ -2737,7 +2738,6 @@ void WW8Export::WriteFkpPlcUsw()
(pDoc->getExternalData(::sw::FIB).get());
if ( pFibData )
- // <--
{
pFib->fReadOnlyRecommended =
pFibData->getReadOnlyRecommended() ? 1 : 0;
@@ -2875,10 +2875,10 @@ namespace
rIn.Seek(0);
sal_uInt8 in[WW_BLOCKSIZE];
- for (sal_uLong nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock)
+ for (sal_Size nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock)
{
- sal_uLong nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI;
- rIn.Read(in, nBS);
+ sal_Size nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI;
+ nBS = rIn.Read(in, nBS);
rCtx.InitCipher(nBlock);
rCtx.Encode(in, nBS, in, nBS);
rOut.Write(in, nBS);
@@ -3272,14 +3272,14 @@ void WW8Export::PrepareStorage()
xStor->Write( pData, nLen );
SwDocShell* pDocShell = pDoc->GetDocShell ();
- DBG_ASSERT(pDocShell, "no SwDocShell");
+ OSL_ENSURE(pDocShell, "no SwDocShell");
if (pDocShell) {
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
pDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+ OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
if (xDocProps.is())
{
@@ -3344,7 +3344,7 @@ sal_uLong SwWW8Writer::Write( SwPaM& rPaM, SfxMedium& rMed,
MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam )
: aMainStg(sMainStream), pISet(0), pUsedNumTbl(0), mpTopNodeOfHdFtPage(0),
- pBmpPal(0), pKeyMap(0), pOLEExp(0), pOCXExp(0), pOleMap(0),
+ pBmpPal(0), pOLEExp(0), pOCXExp(0), pOleMap(0),
mpTableInfo(new ww8::WW8TableInfo()), nUniqueList(0),
mnHdFtIndex(0), pAktPageDesc(0), pPapPlc(0), pChpPlc(0), pChpIter(0),
pStyles( NULL ),
@@ -3360,8 +3360,6 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM
MSWordExportBase::~MSWordExportBase()
{
delete pBmpPal;
- if (pKeyMap)
- delete[] (NfKeywordTable*)pKeyMap;
delete pOLEExp;
delete pOCXExp;
delete pOleMap;
@@ -3512,15 +3510,16 @@ void WW8Export::RestoreMacroCmds()
pStream->Seek(0);
sal_uInt8 *pBuffer = new sal_uInt8[pFib->lcbCmds];
- pStream->Read(pBuffer, pFib->lcbCmds);
- pTableStrm->Write(pBuffer, pFib->lcbCmds);
+ bool bReadOk = checkRead(*pStream, pBuffer, pFib->lcbCmds);
+ if (bReadOk)
+ pTableStrm->Write(pBuffer, pFib->lcbCmds);
delete[] pBuffer;
}
delete pStream;
}
- catch ( uno::Exception& )
+ catch ( const uno::Exception& )
{
}
@@ -3703,7 +3702,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer
SVBT16 nStyle;
ShortToSVBT16( m_rWW8Export.nStyleBeforeFly, nStyle );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<OutWW8_TableNodeInfoInner>" << pNodeInfoInner->toString();
#endif
@@ -3735,7 +3734,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer
if (pNodeInfoInner->isEndOfCell())
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<endOfCell/>" << ::std::endl;
#endif
m_rWW8Export.WriteCR(pNodeInfoInner);
@@ -3772,7 +3771,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer
if (pNodeInfoInner->isEndOfLine())
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "<endOfLine/>" << ::std::endl;
#endif
TableRowEnd(pNodeInfoInner->getDepth());
@@ -3785,7 +3784,7 @@ void WW8AttributeOutput::TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer
m_rWW8Export.pO->Remove( 0, m_rWW8Export.pO->Count() ); // leeren
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</OutWW8_TableNodeInfoInner>" << ::std::endl;
#endif
}
@@ -3798,7 +3797,7 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode)
if (pNodeInfo.get() != NULL)
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << pNodeInfo->toString() << ::std::endl;
#endif
@@ -3813,14 +3812,14 @@ void MSWordExportBase::OutputStartNode( const SwStartNode & rNode)
++aIt;
}
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</OutWW8_SwStartNode>" << ::std::endl;
#endif
}
void MSWordExportBase::OutputEndNode( const SwEndNode &rNode )
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
// whoever has need of the missing function should go and implement it!
// This piece of code always breaks builds...
// ::std::clog << "<OutWW8_SwEndNode>" << dbg_out(&rNode) << ::std::endl;
@@ -3830,7 +3829,7 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode )
if (pNodeInfo.get() != NULL)
{
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << pNodeInfo->toString() << ::std::endl;
#endif
@@ -3844,9 +3843,40 @@ void MSWordExportBase::OutputEndNode( const SwEndNode &rNode )
++aIt;
}
}
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
::std::clog << "</OutWW8_SwEndNode>" << ::std::endl;
#endif
}
+const NfKeywordTable & MSWordExportBase::GetNfKeywordTable()
+{
+ if (pKeyMap.get() == NULL)
+ {
+ pKeyMap.reset(new NfKeywordTable);
+ NfKeywordTable & rKeywordTable = *pKeyMap;
+ rKeywordTable[NF_KEY_D] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("d"));
+ rKeywordTable[NF_KEY_DD] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dd"));
+ rKeywordTable[NF_KEY_DDD] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ddd"));
+ rKeywordTable[NF_KEY_DDDD] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dddd"));
+ rKeywordTable[NF_KEY_M] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("M"));
+ rKeywordTable[NF_KEY_MM] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MM"));
+ rKeywordTable[NF_KEY_MMM] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MMM"));
+ rKeywordTable[NF_KEY_MMMM] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MMMM"));
+ rKeywordTable[NF_KEY_NN] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ddd"));
+ rKeywordTable[NF_KEY_NNN] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dddd"));
+ rKeywordTable[NF_KEY_NNNN] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dddd"));
+ rKeywordTable[NF_KEY_YY] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("yy"));
+ rKeywordTable[NF_KEY_YYYY] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("yyyy"));
+ rKeywordTable[NF_KEY_H] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("H"));
+ rKeywordTable[NF_KEY_HH] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HH"));
+ rKeywordTable[NF_KEY_MI] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("m"));
+ rKeywordTable[NF_KEY_MMI] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("mm"));
+ rKeywordTable[NF_KEY_S] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("s"));
+ rKeywordTable[NF_KEY_SS] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ss"));
+ rKeywordTable[NF_KEY_AMPM] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AM/PM"));
+ }
+
+ return *pKeyMap;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 417d0e0505..c3cbd0915c 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -470,7 +470,7 @@ public:
WW8_WrtBookmarks* pBkmks;
WW8_WrtRedlineAuthor* pRedlAuthors;
BitmapPalette* pBmpPal;
- void* pKeyMap;
+ boost::shared_ptr<NfKeywordTable> pKeyMap;
SvxMSExportOLEObjects* pOLEExp;
SwMSConvertControls* pOCXExp;
WW8OleMaps* pOleMap;
@@ -527,7 +527,6 @@ public:
SwEscherEx* pEscher; // escher export class
// #i43447# - removed
// SwTwips nFlyWidth, nFlyHeight; // Fuer Anpassung Graphic
- // <--
sal_uInt8 nTxtTyp;
@@ -832,6 +831,8 @@ protected:
bool GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, xub_StrLen nEnd,
IMarkVector& rArr );
+ const NfKeywordTable & GetNfKeywordTable();
+
public:
MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam );
virtual ~MSWordExportBase();
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 9da0accd78..fa040bc4b3 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -176,21 +176,21 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet,
pGraphicStream =
::utl::UcbStreamHelper::CreateStream( aCnt.GetGraphicStream( xPersist->getEntryName() ) );
}
- catch( uno::Exception& )
+ catch( const uno::Exception& )
{}
- DBG_ASSERT( pGraphicStream && !pGraphicStream->GetError(), "No graphic stream available!" );
+ OSL_ENSURE( pGraphicStream && !pGraphicStream->GetError(), "No graphic stream available!" );
if ( pGraphicStream && !pGraphicStream->GetError() )
{
Graphic aGr1;
- GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
- if( pGF->ImportGraphic( aGr1, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
+ if( rGF.ImportGraphic( aGr1, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
{
Graphic aGr2;
delete pGraphicStream;
pGraphicStream =
::utl::UcbStreamHelper::CreateStream( aCnt.GetGraphicStream( pRet->GetObjRef() ) );
- if( pGF->ImportGraphic( aGr2, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
+ if( rGF.ImportGraphic( aGr2, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
{
if ( aGr1 == aGr2 )
bGraphicNeeded = false;
@@ -427,7 +427,6 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
OutputField( 0, ww::eINCLUDEPICTURE, sStr,
WRITEFIELD_START | WRITEFIELD_CMD_START | WRITEFIELD_CMD_END );
}
- // <--
WriteChar( (char)1 ); // Grafik-Sonderzeichen in Haupttext einfuegen
@@ -499,7 +498,6 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
if ( !rFrame.IsInline() &&
( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !IsInTable() )) ||
(eAn == FLY_AT_PAGE)) )
- // <--
{
WriteChar( (char)0x0d ); // umgebenden Rahmen mit CR abschliessen
@@ -520,7 +518,6 @@ void WW8Export::OutGrf(const sw::Frame &rFrame)
{
OutputField( 0, ww::eINCLUDEPICTURE, String(), WRITEFIELD_CLOSE );
}
- // <--
}
GraphicDetails& GraphicDetails::operator=(const GraphicDetails &rOther)
@@ -774,12 +771,12 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem)
comphelper::EmbeddedObjectContainer aCnt( pOleNd->GetDoc()->GetDocStorage() );
SvStream* pGraphicStream = ::utl::UcbStreamHelper::CreateStream( aCnt.GetGraphicStream( rObj ) );
- DBG_ASSERT( pGraphicStream && !pGraphicStream->GetError(), "No graphic stream available!" );
+ OSL_ENSURE( pGraphicStream && !pGraphicStream->GetError(), "No graphic stream available!" );
if ( pGraphicStream && !pGraphicStream->GetError() )
{
Graphic aGr;
- GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
- if( pGF->ImportGraphic( aGr, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
+ if( rGF.ImportGraphic( aGr, aEmptyStr, *pGraphicStream, GRFILTER_FORMAT_DONTKNOW ) == GRFILTER_OK )
{
//TODO/LATER: do we really want to use GDIMetafile?!
GDIMetaFile aMtf;
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 6e61641721..10871a831d 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -150,7 +150,7 @@ using namespace nsSwDocInfoSubType;
* gepflegt werden: rtf\rtfatr.cxx, sw6\sw6atr.cxx, w4w\w4watr.cxx
*/
-#if !defined(MSC) && !defined(UNX) && !defined(PPC) && !defined(__MINGW32__) && !defined(OS2)
+#if !defined(MSC) && !defined(UNX) && !defined(PPC) && !defined(__MINGW32__)
#define ATTRFNTAB_SIZE 130
#if ATTRFNTAB_SIZE != POOLATTR_END - POOLATTR_BEGIN
@@ -438,10 +438,19 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
//section.
bool bBreakSet = false;
+ const SwPageDesc * pPageDesc = rNd.FindPageDesc(sal_False);
+
+ if (pAktPageDesc != pPageDesc)
+ {
+ bBreakSet = true;
+ bNewPageDesc = true;
+ pAktPageDesc = pPageDesc;
+ }
+
if ( pSet && pSet->Count() )
{
- if ( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem )
- && ( (SwFmtPageDesc*)pItem )->KnowsPageDesc() )
+ if ( SFX_ITEM_SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem ) &&
+ dynamic_cast<const SwFmtPageDesc*>(pItem)->GetRegisteredIn() != NULL)
{
bBreakSet = true;
bNewPageDesc = true;
@@ -470,7 +479,6 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
}
}
}
- // <--
bBreakSet = true;
@@ -494,7 +502,6 @@ void MSWordExportBase::OutputSectionBreaks( const SfxItemSet *pSet, const SwNode
{
bNewPageDesc = SetAktPageDescFromNode( rNd );
}
- // <--
}
if ( !bNewPageDesc )
AttrOutput().OutputItem( *pItem );
@@ -738,7 +745,6 @@ bool WW8Export::DisallowInheritingOutlineNumbering(const SwFmt &rFmt)
return bRet;
}
-// <--
void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpFmt, bool bFlyFmt )
{
@@ -797,7 +803,6 @@ void MSWordExportBase::OutputFormat( const SwFmt& rFmt, bool bPapFmt, bool bChpF
com::sun::star::i18n::ScriptType::LATIN, mbExportModeRTF);
bCallOutSet = false;
}
- // <--
}
}
break;
@@ -1823,7 +1828,7 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
if ( bHandleBookmark )
{
- // retrieve reference destionation - the name of the bookmark
+ // retrieve reference destination - the name of the bookmark
String aLinkStr;
const sal_uInt16 nSubType = pFld->GetSubType();
const SwGetRefField& rRFld = *(static_cast<const SwGetRefField*>(pFld));
@@ -1844,7 +1849,6 @@ void WW8Export::OutputField( const SwField* pFld, ww::eField eFldType,
// insert hyperlink character including attributes and data.
InsertSpecialChar( *this, 0x01, &aLinkStr );
}
- // <--
}
if (WRITEFIELD_CMD_END & nMode)
{
@@ -2339,18 +2343,13 @@ bool MSWordExportBase::GetNumberFmt(const SwField& rFld, String& rStr)
const SvNumberformat* pNumFmt = pNFmtr->GetEntry( nFmtIdx );
if( pNumFmt )
{
- LocaleDataWrapper aLocDat( pNFmtr->GetServiceManager(),
- MsLangId::convertLanguageToLocale( LANGUAGE_ENGLISH_US ) );
+ sal_uInt16 nLng = rFld.GetLanguage();
+ LocaleDataWrapper aLocDat(pNFmtr->GetServiceManager(),
+ MsLangId::convertLanguageToLocale(nLng));
- if( !pKeyMap )
- {
- pKeyMap = new NfKeywordTable;
- NfKeywordTable& rKeyMap = *(NfKeywordTable*)pKeyMap;
- pNFmtr->FillKeywordTable( rKeyMap, LANGUAGE_ENGLISH_US );
- }
-
- String sFmt(pNumFmt->GetMappedFormatstring(*(NfKeywordTable*)pKeyMap,
+ String sFmt(pNumFmt->GetMappedFormatstring(GetNfKeywordTable(),
aLocDat));
+
if (sFmt.Len())
{
sw::ms::SwapQuotesInField(sFmt);
@@ -3610,7 +3609,6 @@ void AttributeOutputBase::FormatBreak( const SvxFmtBreakItem& rBreak )
{
bCheckForFollowPageDesc = true;
}
- // <--
break;
default:
@@ -3631,7 +3629,6 @@ void AttributeOutputBase::FormatBreak( const SvxFmtBreakItem& rBreak )
{
SectionBreak( nC );
}
- // <--
}
}
}
@@ -4971,7 +4968,6 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops )
ParaTabStopDelAdd( m_rWW8Export, aTabs, 0, rTabStops, 0 );
return;
}
- // <--
// StyleDef -> "einfach" eintragen || keine Style-Attrs -> dito
const SvxTabStopItem* pStyleTabs = 0;
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 3ee02ae852..492a5d3be4 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -98,7 +98,7 @@
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <editeng/editobj.hxx>
-
+#include <boost/scoped_ptr.hpp>
#include <math.h>
using ::editeng::SvxBorderLine;
@@ -182,7 +182,11 @@ bool SwWW8ImplReader::ReadGrafStart(void* pData, short nDataSiz,
pStrm->SeekRel(SVBT16ToShort(pHd->cb) - sizeof(WW8_DPHEAD));
return false;
}
- pStrm->Read(pData, nDataSiz);
+
+ bool bCouldRead = checkRead(*pStrm, pData, nDataSiz);
+ OSL_ENSURE(bCouldRead, "Short Graphic header");
+ if (!bCouldRead)
+ return false;
RndStdIds eAnchor = (SVBT8ToByte(pDo->by) < 2) ? FLY_AT_PAGE : FLY_AT_PARA;
rSet.Put(SwFmtAnchor(eAnchor));
@@ -443,20 +447,24 @@ SdrObject* SwWW8ImplReader::ReadPolyLine( WW8_DPHEAD* pHd, const WW8_DO* pDo,
return 0;
sal_uInt16 nCount = SVBT16ToShort( aPoly.aBits1 ) >> 1 & 0x7fff;
- SVBT16 *pP = new SVBT16[nCount * 2];
- pStrm->Read( pP, nCount * 4 ); // Punkte einlesen
+ boost::scoped_array<SVBT16> xP(new SVBT16[nCount * 2]);
+
+ bool bCouldRead = checkRead(*pStrm, xP.get(), nCount * 4); // Punkte einlesen
+ OSL_ENSURE(bCouldRead, "Short PolyLine header");
+ if (!bCouldRead)
+ return 0;
+
Polygon aP( nCount );
Point aPt;
- sal_uInt16 i;
-
- for( i=0; i<nCount; i++ ){
- aPt.X() = SVBT16ToShort( pP[i << 1] ) + nDrawXOfs2
+ for (sal_uInt16 i=0; i<nCount; ++i)
+ {
+ aPt.X() = SVBT16ToShort( xP[i << 1] ) + nDrawXOfs2
+ (sal_Int16)SVBT16ToShort( pHd->xa );
- aPt.Y() = SVBT16ToShort( pP[( i << 1 ) + 1] ) + nDrawYOfs2
+ aPt.Y() = SVBT16ToShort( xP[( i << 1 ) + 1] ) + nDrawYOfs2
+ (sal_Int16)SVBT16ToShort( pHd->ya );
aP[i] = aPt;
}
- delete[] pP;
+ xP.reset();
SdrObject* pObj = new SdrPathObj(( SVBT16ToShort( aPoly.aBits1 ) & 0x1 ) ? OBJ_POLY : OBJ_PLIN, ::basegfx::B2DPolyPolygon(aP.getB2DPolygon()));
SetStdAttr( rSet, aPoly.aLnt, aPoly.aShd );
@@ -627,7 +635,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(long nStartCp, long nEndCp,
std::deque<Chunk> aChunks;
//Here store stack location
- sal_uInt16 nCurrentCount = static_cast< sal_uInt16 >(pCtrlStck->Count());
+ size_t nCurrentCount = pCtrlStck->size();
while (nStart < nEndCp)
{
//nStart is the beginning of the attributes for this range, and
@@ -685,13 +693,13 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(long nStartCp, long nEndCp,
{
if (bStartAttr)
{
- sal_uInt16 nCount = static_cast< sal_uInt16 >(pCtrlStck->Count());
+ size_t nCount = pCtrlStck->size();
if (maFieldStack.empty() && Read_Field(&aRes))
{
String sURL;
- for (sal_uInt16 nI = static_cast< sal_uInt16 >(pCtrlStck->Count()); nI > nCount; --nI)
+ for (size_t nI = pCtrlStck->size(); nI > nCount; --nI)
{
- const SfxPoolItem *pItem = ((*pCtrlStck)[nI-1])->pAttr;
+ const SfxPoolItem *pItem = ((*pCtrlStck)[nI-1]).pAttr;
sal_uInt16 nWhich = pItem->Which();
if (nWhich == RES_TXTATR_INETFMT)
{
@@ -723,11 +731,11 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(long nStartCp, long nEndCp,
//Here read current properties and convert them into pS
//and put those attrs into the draw box if they can be converted
//to draw attributes
- if (pCtrlStck->Count() - nCurrentCount)
+ if (pCtrlStck->size() - nCurrentCount)
{
- for (sal_uInt16 i = nCurrentCount; i < pCtrlStck->Count(); i++)
+ for (size_t i = nCurrentCount; i < pCtrlStck->size(); ++i)
{
- const SfxPoolItem *pItem = ((*pCtrlStck)[i])->pAttr;
+ const SfxPoolItem *pItem = ((*pCtrlStck)[i]).pAttr;
sal_uInt16 nWhich = pItem->Which();
if( nWhich < RES_FLTRATTR_BEGIN ||
nWhich >= RES_FLTRATTR_END )
@@ -764,7 +772,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(long nStartCp, long nEndCp,
//pop off as far as recorded location just in case there were some left
//unclosed
- for (sal_uInt16 nI = static_cast< sal_uInt16 >(pCtrlStck->Count()); nI > nCurrentCount; --nI)
+ for (size_t nI = pCtrlStck->size(); nI > nCurrentCount; --nI)
pCtrlStck->DeleteAndDestroy(nI-1);
typedef std::deque<Chunk>::iterator myIter;
@@ -831,7 +839,7 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp,
bool bReusable = (0 != SVBT16ToShort( ((WW8_TXBXS*)pT0)->fReusable ));
while( bReusable )
{
- (*pT)++;
+ pT->advance();
if( !pT->Get( rStartCp, pT0 ) )
{
OSL_ENSURE( !this, "+Wo ist der Grafik-Text (2-a) ?" );
@@ -840,7 +848,7 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp,
bReusable = (0 != SVBT16ToShort( ((WW8_TXBXS*)pT0)->fReusable ));
}
}
- (*pT)++;
+ pT->advance();
if( !pT->Get( rEndCp, pT0 ) )
{
OSL_ENSURE( !this, "+Wo ist der Grafik-Text (3) ?" );
@@ -868,7 +876,8 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp,
return false;
}
// ggfs. entsprechende Anzahl Eintraege weitergehen
- for(sal_uInt16 iSequence = 0; iSequence < nSequence; iSequence++) (*pT)++;
+ for (sal_uInt16 iSequence = 0; iSequence < nSequence; ++iSequence)
+ pT->advance();
// dann die tatsaechlichen Start und Ende ermitteln
if( (!pT->Get( rStartCp, pT0 ))
|| ( nMinStartCp > rStartCp ) )
@@ -880,9 +889,8 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp,
rEndCp = rStartCp; // kein Error: leerer String!
else
{
- (*pT)++;
- if( (!pT->Get( rEndCp, pT0 ))
- || ( nMaxEndCp < rEndCp-1 ) )
+ pT->advance();
+ if ( (!pT->Get(rEndCp, pT0)) || (nMaxEndCp < rEndCp-1) )
{
OSL_ENSURE( !this, "+Wo ist der Grafik-Text (6) ?" );
return false;
@@ -1248,10 +1256,15 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox( WW8_DPHEAD* pHd, const WW8_DO* pDo,
return 0;
sal_uInt16 nCount = SVBT16ToShort( aCallB.dpPolyLine.aBits1 ) >> 1 & 0x7fff;
- SVBT16 *pP = new SVBT16[nCount * 2];
- pStrm->Read( pP, nCount * 4 ); // Punkte einlesen
+ boost::scoped_array<SVBT16> xP(new SVBT16[nCount * 2]);
+
+ bool bCouldRead = checkRead(*pStrm, xP.get(), nCount * 4); // Punkte einlesen
+ OSL_ENSURE(bCouldRead, "Short CaptionBox header");
+ if (!bCouldRead)
+ return 0;
+
sal_uInt8 nTyp = (sal_uInt8)nCount - 1;
- if( nTyp == 1 && SVBT16ToShort( pP[0] ) == SVBT16ToShort( pP[2] ) )
+ if( nTyp == 1 && SVBT16ToShort( xP[0] ) == SVBT16ToShort( xP[2] ) )
nTyp = 0;
Point aP0( (sal_Int16)SVBT16ToShort( pHd->xa ) +
@@ -1263,11 +1276,11 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox( WW8_DPHEAD* pHd, const WW8_DO* pDo,
aP1.Y() += (sal_Int16)SVBT16ToShort( aCallB.dpheadTxbx.dya );
Point aP2( (sal_Int16)SVBT16ToShort( pHd->xa )
+ (sal_Int16)SVBT16ToShort( aCallB.dpheadPolyLine.xa )
- + nDrawXOfs2 + (sal_Int16)SVBT16ToShort( pP[0] ),
+ + nDrawXOfs2 + (sal_Int16)SVBT16ToShort( xP[0] ),
(sal_Int16)SVBT16ToShort( pHd->ya )
+ (sal_Int16)SVBT16ToShort( aCallB.dpheadPolyLine.ya )
- + nDrawYOfs2 + (sal_Int16)SVBT16ToShort( pP[1] ) );
- delete[] pP;
+ + nDrawYOfs2 + (sal_Int16)SVBT16ToShort( xP[1] ) );
+ xP.reset();
SdrCaptionObj* pObj = new SdrCaptionObj( Rectangle( aP0, aP1 ), aP2 );
pObj->SetModel( pDrawModel );
@@ -1334,7 +1347,13 @@ SdrObject* SwWW8ImplReader::ReadGrafPrimitive( short& rLeft, const WW8_DO* pDo,
//into an object hierarachy with a little effort.
SdrObject *pRet=0;
WW8_DPHEAD aHd; // Lese Draw-Primitive-Header
- pStrm->Read(&aHd, sizeof(WW8_DPHEAD));
+ bool bCouldRead = checkRead(*pStrm, &aHd, sizeof(WW8_DPHEAD));
+ OSL_ENSURE(bCouldRead, "Graphic Primitive header short read" );
+ if (!bCouldRead)
+ {
+ rLeft=0;
+ return pRet;
+ }
if( rLeft >= SVBT16ToShort(aHd.cb) ) // Vorsichtsmassmahme
{
@@ -1394,9 +1413,18 @@ void SwWW8ImplReader::ReadGrafLayer1( WW8PLCFspecial* pPF, long nGrafAnchorCp )
OSL_ENSURE( !this, "+Wo ist die Grafik (3) ?" );
return;
}
+
+ bool bCouldSeek = checkSeek(*pStrm, SVBT32ToUInt32(pF->fc));
+ OSL_ENSURE(bCouldSeek, "Invalid Graphic offset");
+ if (!bCouldSeek)
+ return;
+
+ // Lese Draw-Header
WW8_DO aDo;
- pStrm->Seek( SVBT32ToUInt32( pF->fc ) ); // Lese Draw-Header
- pStrm->Read( &aDo, sizeof( WW8_DO ) );
+ bool bCouldRead = checkRead(*pStrm, &aDo, sizeof(WW8_DO));
+ OSL_ENSURE(bCouldRead, "Short Graphic header");
+ if (!bCouldRead)
+ return;
short nLeft = SVBT16ToShort( aDo.cb ) - sizeof( WW8_DO );
while (nLeft > static_cast<short>(sizeof(WW8_DPHEAD)))
@@ -1985,7 +2013,6 @@ void SwWW8ImplReader::MapWrapIntoFlyFmt(SvxMSDffImportRec* pRecord,
// #i47277# - contour is already in unit of the
// graphic prefered unit. Thus, call method <SetContour(..)>
pNd->SetContour(&aPoly);
- // <--
}
}
}
@@ -2186,7 +2213,6 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
// - inside -> text::HoriOrientation::LEFT and outside -> text::HoriOrientation::RIGHT
text::HoriOrientation::LEFT, // inside
text::HoriOrientation::RIGHT // outside
- // <--
};
@@ -2253,7 +2279,6 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
pFSPA->nXaLeft = 0;
pFSPA->nXaRight = nWidth;
}
- // <--
// #i24255# - position of floating screen objects in
// R2L layout are given in L2R layout, thus convert them of all
@@ -2269,7 +2294,6 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
pFSPA->nXaRight = pFSPA->nXaLeft + nWidth;
}
}
- // <--
// if the object is anchored inside a table cell, is horizontal aligned
// at frame|character and has wrap through, but its attribute
@@ -2282,7 +2306,6 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
{
eHoriRel = text::RelOrientation::PAGE_PRINT_AREA;
}
- // <--
SwFmtHoriOrient aHoriOri(MakeSafePositioningValue(pFSPA->nXaLeft),
eHoriOri, eHoriRel);
@@ -2361,7 +2384,6 @@ bool SwWW8ImplReader::IsObjectLayoutInTableCell( const sal_uInt32 nLayoutInTable
nLayoutInTableCell & 0x80008000 ||
( nLayoutInTableCell & 0x02000000 &&
!(nLayoutInTableCell & 0x80000000 ) ) )
- // <--
{
bIsObjectLayoutInTableCell = true;
}
@@ -2380,7 +2402,6 @@ bool SwWW8ImplReader::IsObjectLayoutInTableCell( const sal_uInt32 nLayoutInTable
return bIsObjectLayoutInTableCell;
}
-// <--
SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
{
@@ -2564,7 +2585,6 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
const bool bLayoutInTableCell =
nInTable && IsObjectLayoutInTableCell( pRecord->nLayoutInTableCell );
- // <--
// #i18732# - Switch on 'follow text flow', if object is laid out
// inside table cell and its wrapping isn't 'SURROUND_THROUGH'
@@ -2635,7 +2655,6 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
// pass information, if object is in page header|footer to method.
pWWZOrder->InsertEscherObject( pObject, pF->nSpId,
bIsHeader || bIsFooter );
- // <--
}
else
{
@@ -2671,7 +2690,6 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
{
static_cast<SwDrawFrmFmt*>(pRetFrmFmt)->PosAttrSet();
}
- // <--
if (!IsInlineEscherHack())
MapWrapIntoFlyFmt(pRecord, pRetFrmFmt);
@@ -2972,7 +2990,6 @@ SwFlyFrmFmt* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObject,
// One of the two conditions have to be true to insert the graphic
// as a linked graphic -
if (GRAPHIC_NONE == eType || CanUseRemoteLink(aGrfName))
- // <--
{
pRetFrmFmt = rDoc.Insert(*pPaM, aGrfName, aEmptyStr, 0,
&rFlySet, &aGrSet, NULL);
@@ -3026,7 +3043,6 @@ SwFlyFrmFmt* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObject,
// pass information, if object is in page header|footer to method.
pWWZOrder->InsertEscherObject( rpOurNewObject, pF->nSpId,
bIsHeader || bIsFooter );
- // <--
}
}
return pRetFrmFmt;
@@ -3069,12 +3085,12 @@ void SwWW8FltAnchorStack::AddAnchor(const SwPosition& rPos, SwFrmFmt *pFmt)
void SwWW8FltAnchorStack::Flush()
{
- sal_uInt16 nCnt = static_cast< sal_uInt16 >(Count());
- for (sal_uInt16 i=0; i < nCnt; ++i)
+ size_t nCnt = size();
+ for (size_t i=0; i < nCnt; ++i)
{
- SwFltStackEntry *pEntry = (*this)[i];
- SwPosition aDummy(pEntry->nMkNode);
- SetAttrInDoc(aDummy,pEntry);
+ SwFltStackEntry &rEntry = (*this)[i];
+ SwPosition aDummy(rEntry.m_aMkPos.m_nNode);
+ SetAttrInDoc(aDummy, rEntry);
DeleteAndDestroy(i--);
--nCnt;
}
diff --git a/sw/source/filter/ww8/ww8graf.hxx b/sw/source/filter/ww8/ww8graf.hxx
index 6af8c30010..d24b014843 100644
--- a/sw/source/filter/ww8/ww8graf.hxx
+++ b/sw/source/filter/ww8/ww8graf.hxx
@@ -45,7 +45,6 @@ struct EscherShape
mnNoInlines(0),
mbInHeaderFooter( _bInHeaderFooter )
{}
- // <--
};
class wwZOrderer
@@ -58,7 +57,6 @@ private:
//No of objects in doc before starting (always 0 unless using file->insert
//and probably 0 then as well
std::vector<EscherShape> maEscherLayer;
- // <--
typedef std::vector<EscherShape>::iterator myeiter;
std::vector<short> maDrawHeight;
@@ -79,7 +77,6 @@ private:
// that object is in header or footer
sal_uLong GetEscherObjectPos( sal_uLong nSpId,
const bool _bInHeaderFooter );
- // <--
sal_uLong GetDrawingObjectPos(short nWwHeight);
bool InsertObject(SdrObject *pObject, sal_uLong nPos);
public:
@@ -95,7 +92,6 @@ public:
void InsertEscherObject( SdrObject* pObject,
sal_uLong nSpId,
const bool _bInHeaderFooter );
- // <--
void InsideEscher(sal_uLong nIndex);
void OutsideEscher();
};
diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx
index 4a3ea590b4..637bfe071a 100644
--- a/sw/source/filter/ww8/ww8graf2.cxx
+++ b/sw/source/filter/ww8/ww8graf2.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -86,7 +86,6 @@ void wwZOrderer::InsertEscherObject( SdrObject* pObject,
const bool _bInHeaderFooter )
{
sal_uLong nInsertPos = GetEscherObjectPos( nSpId, _bInHeaderFooter );
-// <--
InsertObject(pObject, nInsertPos + mnNoInitialObjects + mnInlines);
}
@@ -151,7 +150,6 @@ sal_uLong wwZOrderer::GetEscherObjectPos( sal_uLong nSpId,
++aIter;
}
}
- // <--
while (aIter != aEnd)
{
// insert object in page header|footer
@@ -160,7 +158,6 @@ sal_uLong wwZOrderer::GetEscherObjectPos( sal_uLong nSpId,
{
break;
}
- // <--
if ( aIter->mnEscherShapeOrder > nFound )
break;
nRet += aIter->mnNoInlines+1;
@@ -169,7 +166,6 @@ sal_uLong wwZOrderer::GetEscherObjectPos( sal_uLong nSpId,
maEscherLayer.insert(aIter, EscherShape( nFound, _bInHeaderFooter ) );
return nRet;
}
-// <--
// InsertObj() fuegt das Objekt in die Sw-Page ein und merkt sich die Z-Pos in
// einem VarArr
@@ -256,7 +252,7 @@ extern void WW8PicShadowToReal( WW8_PIC_SHADOW* pPicS, WW8_PIC* pPic );
bool SwWW8ImplReader::GetPictGrafFromStream(Graphic& rGraphic, SvStream& rSrc)
{
- return 0 == GraphicFilter::GetGraphicFilter()->ImportGraphic(rGraphic, aEmptyStr, rSrc,
+ return 0 == GraphicFilter::GetGraphicFilter().ImportGraphic(rGraphic, aEmptyStr, rSrc,
GRFILTER_FORMAT_DONTKNOW);
}
@@ -286,7 +282,7 @@ bool SwWW8ImplReader::ReadGrafFile(String& rFileName, Graphic*& rpGraphic,
pSt->Seek( nPosFc );
bool bOk = ReadWindowMetafile( *pSt, aWMF, NULL ) ? true : false;
- if (!bOk || pSt->GetError() || !aWMF.GetActionCount())
+ if (!bOk || pSt->GetError() || !aWMF.GetActionSize())
return false;
if (pWwFib->envr != 1) // !MAC als Creator
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 880384b426..9932661f90 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -143,7 +143,7 @@
#include <breakit.hxx>
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
#include <iostream>
#include <dbgoutsw.hxx>
#endif
@@ -234,7 +234,7 @@ bool BasicProjImportHelper::import( const uno::Sequence< beans::NamedValue >& aA
uno::Reference< document::XFilter > xFilter( xImporter, uno::UNO_QUERY_THROW );
bRet = xFilter->filter( aMediaDesc.getAsConstPropertyValueList() );
}
- catch( uno::Exception& )
+ catch( const uno::Exception& )
{
bRet = false;
}
@@ -253,7 +253,7 @@ rtl::OUString BasicProjImportHelper::getProjectName()
sProjName = xVBA->getProjectName();
}
- catch( uno::Exception& )
+ catch( const uno::Exception& )
{
}
}
@@ -340,7 +340,7 @@ SwMSDffManager::SwMSDffManager( SwWW8ImplReader& rRdr )
: SvxMSDffManager(*rRdr.pTableStream, rRdr.GetBaseURL(), rRdr.pWwFib->fcDggInfo,
rRdr.pDataStream, 0, 0, COL_WHITE, 12, rRdr.pStrm,
rRdr.maTracer.GetTrace()),
- rReader(rRdr), pFallbackStream(0), pOldEscherBlipCache(0)
+ rReader(rRdr), pFallbackStream(0)
{
SetSvxMSDffSettings( GetSvxMSDffSettings() );
nSvxMSDffOLEConvFlags = SwMSDffManager::GetFilterFlags();
@@ -385,7 +385,6 @@ SdrObject* SwMSDffManager::ImportOLE( long nOLEId,
{
return 0L;
}
- // <--
SdrObject* pRet = 0;
String sStorageName;
@@ -414,19 +413,19 @@ SdrObject* SwMSDffManager::ImportOLE( long nOLEId,
void SwMSDffManager::DisableFallbackStream()
{
- OSL_ENSURE(!pFallbackStream || !pOldEscherBlipCache,
+ OSL_ENSURE(!pFallbackStream,
"if you're recursive, you're broken");
pFallbackStream = pStData2;
- pOldEscherBlipCache = pEscherBlipCache;
- pEscherBlipCache = 0;
+ aOldEscherBlipCache = aEscherBlipCache;
+ aEscherBlipCache.clear();
pStData2 = 0;
}
void SwMSDffManager::EnableFallbackStream()
{
pStData2 = pFallbackStream;
- pEscherBlipCache = pOldEscherBlipCache;
- pOldEscherBlipCache = 0;
+ aEscherBlipCache = aOldEscherBlipCache;
+ aOldEscherBlipCache.clear();
pFallbackStream = 0;
}
@@ -983,19 +982,20 @@ void SwWW8FltControlStack::NewAttr(const SwPosition& rPos,
SwFltControlStack::NewAttr(rPos, rAttr);
}
-void SwWW8FltControlStack::SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId,
+SwFltStackEntry* SwWW8FltControlStack::SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId,
sal_Bool bTstEnde, long nHand, sal_Bool )
{
+ SwFltStackEntry *pRet = NULL;
//Doing a textbox, and using the control stack only as a temporary
//collection point for properties which will are not to be set into
//the real document
if (rReader.pPlcxMan && rReader.pPlcxMan->GetDoingDrawTextBox())
{
- sal_uInt16 nCnt = static_cast< sal_uInt16 >(Count());
- for (sal_uInt16 i=0; i < nCnt; ++i)
+ size_t nCnt = size();
+ for (size_t i=0; i < nCnt; ++i)
{
- SwFltStackEntry* pEntry = (*this)[i];
- if (nAttrId == pEntry->pAttr->Which())
+ SwFltStackEntry& rEntry = (*this)[i];
+ if (nAttrId == rEntry.pAttr->Which())
{
DeleteAndDestroy(i--);
--nCnt;
@@ -1003,7 +1003,8 @@ void SwWW8FltControlStack::SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId,
}
}
else //Normal case, set the attribute into the document
- SwFltControlStack::SetAttr(rPos, nAttrId, bTstEnde, nHand);
+ pRet = SwFltControlStack::SetAttr(rPos, nAttrId, bTstEnde, nHand);
+ return pRet;
}
long GetListFirstLineIndent(const SwNumFmt &rFmt)
@@ -1067,7 +1068,6 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR,
}
}
}
-// <--
const SwNumFmt* SwWW8FltControlStack::GetNumFmtFromStack(const SwPosition &rPos,
const SwTxtNode &rTxtNode)
@@ -1088,9 +1088,9 @@ const SwNumFmt* SwWW8FltControlStack::GetNumFmtFromStack(const SwPosition &rPos,
}
void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
- SwFltStackEntry* pEntry)
+ SwFltStackEntry& rEntry)
{
- switch( pEntry->pAttr->Which() )
+ switch (rEntry.pAttr->Which())
{
case RES_LR_SPACE:
{
@@ -1103,9 +1103,9 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
*/
using namespace sw::util;
SwPaM aRegion(rTmpPos);
- if (pEntry->MakeRegion(pDoc, aRegion, false))
+ if (rEntry.MakeRegion(pDoc, aRegion, false))
{
- SvxLRSpaceItem aNewLR( *(SvxLRSpaceItem*)pEntry->pAttr );
+ SvxLRSpaceItem aNewLR( *(SvxLRSpaceItem*)rEntry.pAttr );
sal_uLong nStart = aRegion.Start()->nNode.GetIndex();
sal_uLong nEnd = aRegion.End()->nNode.GetIndex();
for(; nStart <= nEnd; ++nStart)
@@ -1141,7 +1141,6 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
SyncIndentWithList( aNewLR, *pNum,
bFirstLineIndentSet,
bLeftIndentSet );
- // <--
}
if (aNewLR == aOldLR)
@@ -1160,7 +1159,7 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
case RES_TXTATR_INETFMT:
{
SwPaM aRegion(rTmpPos);
- if (pEntry->MakeRegion(pDoc, aRegion, false))
+ if (rEntry.MakeRegion(pDoc, aRegion, false))
{
SwFrmFmt *pFrm;
//If we have just one single inline graphic then
@@ -1169,7 +1168,7 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
if (0 != (pFrm = rReader.ContainsSingleInlineGraphic(aRegion)))
{
const SwFmtINetFmt *pAttr = (const SwFmtINetFmt *)
- pEntry->pAttr;
+ rEntry.pAttr;
SwFmtURL aURL;
aURL.SetURL(pAttr->GetValue(), false);
aURL.SetTargetFrameName(pAttr->GetTargetFrame());
@@ -1177,13 +1176,13 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
}
else
{
- pDoc->InsertPoolItem(aRegion, *pEntry->pAttr, 0);
+ pDoc->InsertPoolItem(aRegion, *rEntry.pAttr, 0);
}
}
}
break;
default:
- SwFltControlStack::SetAttrInDoc(rTmpPos, pEntry);
+ SwFltControlStack::SetAttrInDoc(rTmpPos, rEntry);
break;
}
}
@@ -1210,7 +1209,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFmtAttr(const SwPosition& rPos,
SfxItemState eState = SFX_ITEM_DEFAULT;
if (const SfxItemSet *pSet = pNd->GetpSwAttrSet())
eState = pSet->GetItemState(RES_LR_SPACE, false);
- if (eState != SFX_ITEM_SET && !rReader.vColl.empty() && rReader.nAktColl < rReader.vColl.size())
+ if (eState != SFX_ITEM_SET && rReader.nAktColl < rReader.vColl.size())
pItem = &(rReader.vColl[rReader.nAktColl].maWordLR);
}
@@ -1236,24 +1235,28 @@ const SfxPoolItem* SwWW8FltControlStack::GetFmtAttr(const SwPosition& rPos,
const SfxPoolItem* SwWW8FltControlStack::GetStackAttr(const SwPosition& rPos,
sal_uInt16 nWhich)
{
- SwNodeIndex aNode( rPos.nNode, -1 );
- sal_uInt16 nIdx = rPos.nContent.GetIndex();
+ SwFltPosition aFltPos(rPos);
- sal_uInt16 nSize = static_cast< sal_uInt16 >(Count());
+ size_t nSize = size();
while (nSize)
{
- const SwFltStackEntry* pEntry = (*this)[ --nSize ];
- if (pEntry->pAttr->Which() == nWhich)
+ const SwFltStackEntry& rEntry = (*this)[ --nSize ];
+ if (rEntry.pAttr->Which() == nWhich)
{
- if ( (pEntry->bLocked) || (
- (pEntry->nMkNode <= aNode) && (pEntry->nPtNode >= aNode) &&
- (pEntry->nMkCntnt <= nIdx) && (pEntry->nPtCntnt > nIdx) ) )
+ if ( (rEntry.bOpen) ||
+ (
+ (rEntry.m_aMkPos.m_nNode <= aFltPos.m_nNode) &&
+ (rEntry.m_aPtPos.m_nNode >= aFltPos.m_nNode) &&
+ (rEntry.m_aMkPos.m_nCntnt <= aFltPos.m_nCntnt) &&
+ (rEntry.m_aPtPos.m_nCntnt > aFltPos.m_nCntnt)
+ )
+ )
/*
* e.g. half-open range [0-3) so asking for properties at 3
* means props that end at 3 are not included
*/
{
- return (const SfxPoolItem*)pEntry->pAttr;
+ return rEntry.pAttr;
}
}
}
@@ -1282,9 +1285,9 @@ bool SwWW8FltRefStack::IsFtnEdnBkmField(const SwFmtFld& rFmtFld, sal_uInt16& rBk
}
void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& rTmpPos,
- SwFltStackEntry* pEntry)
+ SwFltStackEntry& rEntry)
{
- switch( pEntry->pAttr->Which() )
+ switch (rEntry.pAttr->Which())
{
/*
Look up these in our lists of bookmarks that were changed to
@@ -1293,14 +1296,14 @@ void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& rTmpPos,
*/
case RES_TXTATR_FIELD:
{
- SwNodeIndex aIdx(pEntry->nMkNode, 1);
- SwPaM aPaM(aIdx, pEntry->nMkCntnt);
+ SwNodeIndex aIdx(rEntry.m_aMkPos.m_nNode, 1);
+ SwPaM aPaM(aIdx, rEntry.m_aMkPos.m_nCntnt);
- SwFmtFld& rFmtFld = *(SwFmtFld*)pEntry->pAttr;
+ SwFmtFld& rFmtFld = *(SwFmtFld*)rEntry.pAttr;
SwField* pFld = rFmtFld.GetFld();
// <NOT> got lost from revision 1.128 to 1.129
- if (!RefToVar(pFld,pEntry))
+ if (!RefToVar(pFld, rEntry))
{
sal_uInt16 nBkmNo;
if( IsFtnEdnBkmField(rFmtFld, nBkmNo) )
@@ -1327,17 +1330,17 @@ void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& rTmpPos,
}
}
- pDoc->InsertPoolItem(aPaM, *pEntry->pAttr, 0);
+ pDoc->InsertPoolItem(aPaM, *rEntry.pAttr, 0);
MoveAttrs(*aPaM.GetPoint());
}
break;
case RES_FLTR_TOX:
- SwFltEndStack::SetAttrInDoc(rTmpPos, pEntry);
+ SwFltEndStack::SetAttrInDoc(rTmpPos, rEntry);
break;
default:
case RES_FLTR_BOOKMARK:
OSL_ENSURE(!this, "EndStck used with non field, not what we want");
- SwFltEndStack::SetAttrInDoc(rTmpPos, pEntry);
+ SwFltEndStack::SetAttrInDoc(rTmpPos, rEntry);
break;
}
}
@@ -1360,11 +1363,21 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
return;
}
- short i;
- const sal_uInt8* pDel = pData + 1; // Del - Array
- sal_uInt8 nDel = pData[0];
+ sal_uInt8 nDel = (nLen > 0) ? pData[0] : 0;
+ const sal_uInt8* pDel = pData + 1; // Del - Array
+
+ sal_uInt8 nIns = (nLen > nDel*2+1) ? pData[nDel*2+1] : 0;
const sal_uInt8* pIns = pData + 2*nDel + 2; // Ins - Array
- sal_uInt8 nIns = pData[nDel*2+1];
+
+ short nRequiredLength = 2 + 2*nDel + 2*nIns + 1*nIns;
+ if (nRequiredLength > nLen)
+ {
+ //would require more data than available to describe!, discard invalid
+ //record
+ nIns = 0;
+ nDel = 0;
+ }
+
WW8_TBD* pTyp = (WW8_TBD*)(pData + 2*nDel + 2*nIns + 2);// Typ - Array
SvxTabStopItem aAttr(0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP);
@@ -1396,7 +1409,6 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
aAttr = *((const SvxTabStopItem*)pTabs);
else
{
-
sal_uInt16 nOldTabBase = nTabBase;
// If based on another
if (nTabBase < vColl.size())
@@ -1412,7 +1424,7 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
// current one (prevent loop)
aLoopWatch.insert(reinterpret_cast<size_t>(pSty));
if (nTabBase < vColl.size())
- pSty = (const SwTxtFmtColl*)vColl[nTabBase].pFmt;
+ pSty = (const SwTxtFmtColl*)vColl[nTabBase].pFmt;
//TODO figure out the else branch
if (aLoopWatch.find(reinterpret_cast<size_t>(pSty)) !=
@@ -1425,14 +1437,14 @@ void SwWW8ImplReader::Read_Tab(sal_uInt16 , const sal_uInt8* pData, short nLen)
}
SvxTabStop aTabStop;
- for (i=0; i < nDel; ++i)
+ for (short i=0; i < nDel; ++i)
{
sal_uInt16 nPos = aAttr.GetPos(SVBT16ToShort(pDel + i*2));
if( nPos != SVX_TAB_NOTFOUND )
aAttr.Remove( nPos, 1 );
}
- for (i=0; i < nIns; ++i)
+ for (short i=0; i < nIns; ++i)
{
short nPos = SVBT16ToShort(pIns + i*2);
aTabStop.GetTabPos() = nPos;
@@ -1511,7 +1523,7 @@ void SwWW8ImplReader::ImportDop()
mpDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocuProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocuProps.is(), "DocumentProperties is null");
+ OSL_ENSURE(xDocuProps.is(), "DocumentProperties is null");
if (xDocuProps.is())
{
DateTime aLastPrinted(
@@ -1894,7 +1906,6 @@ void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(long nStart, long nLen,
{
pFrmObj->SetOrdNum( 0L );
}
- // <--
MoveInsideFly(pFrame);
const SwNodeIndex* pHackIdx = pFrame->GetCntnt().GetCntntIdx();
@@ -2624,28 +2635,42 @@ sal_Unicode SwWW8ImplReader::TranslateToHindiNumbers(sal_Unicode nChar)
// Returnwert: true for no Sonderzeichen
bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
{
- // Unicode-Flag neu setzen und notfalls File-Pos korrigieren
- // merke: Seek kostet nicht viel, da inline geprueft wird,
- // ob die korrekte FilePos nicht schon erreicht ist.
- xub_StrLen nLen;
- if (nEnd - rPos <= (STRING_MAXLEN-1))
- nLen = writer_cast<xub_StrLen>(nEnd - rPos);
- else
- nLen = STRING_MAXLEN-1;
- OSL_ENSURE(nLen, "String is 0");
- if (!nLen)
+ sal_Size nRequestedStrLen = nEnd - rPos;
+
+ OSL_ENSURE(nRequestedStrLen, "String is 0");
+ if (!nRequestedStrLen)
return true;
sal_Size nRequestedPos = pSBase->WW8Cp2Fc(nCpOfs+rPos, &bIsUnicode);
- sal_Size nSeekedPos = pStrm->Seek(nRequestedPos);
- OSL_ENSURE(nRequestedPos == nSeekedPos, "Document claimed to have more text than available");
- if (nRequestedPos != nSeekedPos)
+ bool bValidPos = checkSeek(*pStrm, nRequestedPos);
+ OSL_ENSURE(bValidPos, "Document claimed to have more text than available");
+ if (!bValidPos)
{
//Swallow missing range, e.g. #i95550#
- rPos+=nLen;
+ rPos+=nRequestedStrLen;
return true;
}
+ sal_Size nAvailableStrLen = pStrm->remainingSize() / (bIsUnicode ? 2 : 1);
+ OSL_ENSURE(nAvailableStrLen, "Document claimed to have more text than available");
+ if (!nAvailableStrLen)
+ {
+ //Swallow missing range, e.g. #i95550#
+ rPos+=nRequestedStrLen;
+ return true;
+ }
+
+ sal_Size nValidStrLen = std::min(nRequestedStrLen, nAvailableStrLen);
+
+ // Unicode-Flag neu setzen und notfalls File-Pos korrigieren
+ // merke: Seek kostet nicht viel, da inline geprueft wird,
+ // ob die korrekte FilePos nicht schon erreicht ist.
+ xub_StrLen nStrLen;
+ if (nValidStrLen <= (STRING_MAXLEN-1))
+ nStrLen = writer_cast<xub_StrLen>(nValidStrLen);
+ else
+ nStrLen = STRING_MAXLEN-1;
+
const CharSet eSrcCharSet = bVer67 ? GetCurrentCharSet() :
RTL_TEXTENCODING_MS_1252;
const CharSet eSrcCJKCharSet = bVer67 ? GetCurrentCJKCharSet() :
@@ -2654,7 +2679,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
// (re)alloc UniString data
String sPlainCharsBuf;
- sal_Unicode* pBuffer = sPlainCharsBuf.AllocBuffer( nLen );
+ sal_Unicode* pBuffer = sPlainCharsBuf.AllocBuffer(nStrLen);
sal_Unicode* pWork = pBuffer;
sal_Char* p8Bits = NULL;
@@ -2664,7 +2689,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
hConverter = rtl_createTextToUnicodeConverter(eSrcCharSet);
if (!bIsUnicode)
- p8Bits = new sal_Char[nLen];
+ p8Bits = new sal_Char[nStrLen];
// read the stream data
sal_uInt8 nBCode = 0;
@@ -2676,7 +2701,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
if (pItem != NULL)
nCTLLang = dynamic_cast<const SvxLanguageItem *>(pItem)->GetLanguage();
- for( nL2 = 0; nL2 < nLen; ++nL2, ++pWork )
+ for( nL2 = 0; nL2 < nStrLen; ++nL2, ++pWork )
{
if (bIsUnicode)
*pStrm >> nUCode; // unicode --> read 2 bytes
@@ -2731,9 +2756,9 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
xub_StrLen nEndUsed = nL2;
if (!bIsUnicode)
- nEndUsed = Custom8BitToUnicode(hConverter, p8Bits, nL2, pBuffer, nLen);
+ nEndUsed = Custom8BitToUnicode(hConverter, p8Bits, nL2, pBuffer, nStrLen);
- for( xub_StrLen nI = 0; nI < nLen; ++nI, ++pBuffer )
+ for( xub_StrLen nI = 0; nI < nStrLen; ++nI, ++pBuffer )
if (m_bRegardHindiDigits && bBidi && LangUsesHindiNumbers(nCTLLang))
*pBuffer = TranslateToHindiNumbers(*pBuffer);
@@ -2748,7 +2773,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
if (hConverter)
rtl_destroyTextToUnicodeConverter(hConverter);
delete [] p8Bits;
- return nL2 >= nLen;
+ return nL2 >= nStrLen;
}
#define MSASCII SAL_MAX_INT16
@@ -2891,7 +2916,7 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const String& rAddString)
if (!rAddString.Len())
return;
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
{
rtl::OString sText(rtl::OUStringToOString(rAddString, RTL_TEXTENCODING_UTF8));
::std::clog <<
@@ -2899,7 +2924,14 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const String& rAddString)
<< ::std::endl;
}
#endif
- const SwTxtNode* pNd = pPaM->GetCntntNode()->GetTxtNode();
+
+ const SwCntntNode *pCntNd = pPaM->GetCntntNode();
+ const SwTxtNode* pNd = pCntNd ? pCntNd->GetTxtNode() : NULL;
+
+ OSL_ENSURE(pNd, "What the hell, where's my text node");
+
+ if (!pNd)
+ return;
if ((pNd->GetTxt().Len() + rAddString.Len()) < STRING_MAXLEN-1)
{
@@ -3011,10 +3043,12 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
// Unicode-Flag neu setzen und notfalls File-Pos korrigieren
// merke: Seek kostet nicht viel, da inline geprueft wird,
// ob die korrekte FilePos nicht schon erreicht ist.
- pStrm->Seek( pSBase->WW8Cp2Fc(nCpOfs+nPosCp, &bIsUnicode) );
+ sal_Size nRequestedPos = pSBase->WW8Cp2Fc(nCpOfs+nPosCp, &bIsUnicode);
+ if (!checkSeek(*pStrm, nRequestedPos))
+ return false;
- sal_uInt8 nBCode;
- sal_uInt16 nWCharVal;
+ sal_uInt8 nBCode(0);
+ sal_uInt16 nWCharVal(0);
if( bIsUnicode )
*pStrm >> nWCharVal; // unicode --> read 2 bytes
else
@@ -3540,11 +3574,10 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType)
// #i43118# - refine condition: the anchor
// control stack has to have entries, otherwise it's not needed
// to insert a text node.
- if ( !bStartLine && pAnchorStck->Count() > 0 )
+ if (!bStartLine && !pAnchorStck->empty())
{
AppendTxtNode(*pPaM->GetPoint());
}
- // <--
rDoc.InsertPoolItem(*pPaM,
SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK), 0);
bFirstParaOfPage = true;//xushanchuan add for issue106569
@@ -3580,6 +3613,7 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SvStorage* pStorage,
pDataStream(0),
rDoc(rD),
maSectionManager(*this),
+ m_aExtraneousParas(rD),
maInsertedTables(rD),
maSectionNameGenerator(rD,CREATE_CONST_ASC("WW")),
maGrfNameGenerator(bNewDoc,String('G')),
@@ -4067,6 +4101,21 @@ void wwSectionManager::InsertSegments()
}
}
+void wwExtraneousParas::delete_all_from_doc()
+{
+ typedef std::vector<SwTxtNode*>::iterator myParaIter;
+ myParaIter aEnd = m_aTxtNodes.end();
+ for (myParaIter aI = m_aTxtNodes.begin(); aI != aEnd; ++aI)
+ {
+ SwTxtNode *pTxtNode = *aI;
+ SwNodeIndex aIdx(*pTxtNode);
+ SwPosition aPos(aIdx);
+ SwPaM aTest(aPos);
+ m_rDoc.DelFullPara(aTest);
+ }
+ m_aTxtNodes.clear();
+}
+
void SwWW8ImplReader::StoreMacroCmds()
{
if (pWwFib->lcbCmds)
@@ -4087,12 +4136,12 @@ void SwWW8ImplReader::StoreMacroCmds()
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( xStream );
sal_uInt8 *pBuffer = new sal_uInt8[pWwFib->lcbCmds];
- pTableStream->Read(pBuffer, pWwFib->lcbCmds);
+ pWwFib->lcbCmds = pTableStream->Read(pBuffer, pWwFib->lcbCmds);
pStream->Write(pBuffer, pWwFib->lcbCmds);
delete[] pBuffer;
delete pStream;
}
- catch ( uno::Exception& )
+ catch ( const uno::Exception& )
{
}
}
@@ -4113,10 +4162,10 @@ void SwWW8ImplReader::ReadDocVars()
mpDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+ OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
uno::Reference<beans::XPropertyContainer> xUserDefinedProps =
xDocProps->getUserDefinedProperties();
- DBG_ASSERT(xUserDefinedProps.is(), "UserDefinedProperties is null");
+ OSL_ENSURE(xUserDefinedProps.is(), "UserDefinedProperties is null");
for(size_t i=0; i<aDocVarStrings.size(); i++)
{
@@ -4128,7 +4177,7 @@ void SwWW8ImplReader::ReadDocVars()
xUserDefinedProps->addProperty( name,
beans::PropertyAttribute::REMOVEABLE,
aValue );
- } catch (uno::Exception &) {
+ } catch (const uno::Exception &) {
// ignore
}
}
@@ -4147,7 +4196,7 @@ void SwWW8ImplReader::ReadDocInfo()
mpDocShell->GetModel(), uno::UNO_QUERY_THROW);
uno::Reference<document::XDocumentProperties> xDocProps(
xDPS->getDocumentProperties());
- DBG_ASSERT(xDocProps.is(), "DocumentProperties is null");
+ OSL_ENSURE(xDocProps.is(), "DocumentProperties is null");
if (xDocProps.is()) {
if ( pWwFib->fDot )
@@ -4216,7 +4265,7 @@ void lcl_createTemplateToProjectEntry( const uno::Reference< container::XNameCon
xPrjNameCache->insertByName( templateName, uno::makeAny( sVBAProjName ) );
}
}
- catch( uno::Exception& )
+ catch( const uno::Exception& )
{
}
}
@@ -4408,7 +4457,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
pWwFib->lcbSttbFnm, bVer67 ? 2 : 0, eStructCharSet,
aLinkStrings, &aStringIds);
- for (size_t i=0; i < aLinkStrings.size(); ++i)
+ for (size_t i=0; i < aLinkStrings.size() && i < aStringIds.size(); ++i)
{
ww::bytes stringId = aStringIds[i];
WW8_STRINGID *stringIdStruct = (WW8_STRINGID*)(&stringId[0]);
@@ -4521,7 +4570,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
// loop for each glossary entry and add dummy section node
if (pGloss)
{
- WW8PLCF aPlc(pTableStream, pWwFib->fcPlcfglsy, pWwFib->lcbPlcfglsy, 0);
+ WW8PLCF aPlc(*pTableStream, pWwFib->fcPlcfglsy, pWwFib->lcbPlcfglsy, 0);
WW8_CP nStart, nEnd;
void* pDummy;
@@ -4694,6 +4743,11 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
DeleteAnchorStk();
DeleteRefStks();
+ //remove extra paragraphs after attribute ctrl
+ //stacks etc. are destroyed, and before fields
+ //are updated
+ m_aExtraneousParas.delete_all_from_doc();
+
UpdateFields();
// delete the pam before the call for hide all redlines (Bug 73683)
@@ -4775,7 +4829,7 @@ namespace
for (sal_Size nI = 0, nBlock = 0; nI < nLen; nI += WW_BLOCKSIZE, ++nBlock)
{
sal_Size nBS = (nLen - nI > WW_BLOCKSIZE) ? WW_BLOCKSIZE : nLen - nI;
- rIn.Read(in, nBS);
+ nBS = rIn.Read(in, nBS);
rCtx.InitCipher(nBlock);
rCtx.Decode(in, nBS, in, nBS);
rOut.Write(in, nBS);
@@ -4784,19 +4838,19 @@ namespace
void DecryptXOR(msfilter::MSCodec_XorWord95 &rCtx, SvStream &rIn, SvStream &rOut)
{
- sal_uLong nSt = rIn.Tell();
+ sal_Size nSt = rIn.Tell();
rIn.Seek(STREAM_SEEK_TO_END);
- sal_uLong nLen = rIn.Tell();
+ sal_Size nLen = rIn.Tell();
rIn.Seek(nSt);
rCtx.InitCipher();
rCtx.Skip(nSt);
sal_uInt8 in[0x4096];
- for (sal_uLong nI = nSt; nI < nLen; nI += 0x4096)
+ for (sal_Size nI = nSt; nI < nLen; nI += 0x4096)
{
- sal_uLong nBS = (nLen - nI > 0x4096 ) ? 0x4096 : nLen - nI;
- rIn.Read(in, nBS);
+ sal_Size nBS = (nLen - nI > 0x4096 ) ? 0x4096 : nLen - nI;
+ nBS = rIn.Read(in, nBS);
rCtx.Decode(in, nBS);
rOut.Write(in, nBS);
}
@@ -4832,7 +4886,7 @@ namespace
aPassw = pRequest->getPassword();
}
}
- catch( uno::Exception& )
+ catch( const uno::Exception& )
{
}
}
@@ -4851,23 +4905,24 @@ namespace
{
String sUniPassword = QueryPasswordForMedium( rMedium );
- ByteString sPassword(sUniPassword, WW8Fib::GetFIBCharset( pWwFib->chseTables ) );
+ rtl::OString sPassword(rtl::OUStringToOString(sUniPassword,
+ WW8Fib::GetFIBCharset(pWwFib->chseTables)));
- xub_StrLen nLen = sPassword.Len();
+ sal_Int32 nLen = sPassword.getLength();
if( nLen <= 15 )
{
sal_uInt8 pPassword[16];
- memset( pPassword, 0, sizeof( pPassword ) );
-
- for (xub_StrLen nChar = 0; nChar < sPassword.Len(); ++nChar )
- pPassword[nChar] = sPassword.GetChar(nChar);
+ memcpy(pPassword, sPassword.getStr(), nLen);
+ memset(pPassword+nLen, 0, sizeof(pPassword)-nLen);
rCodec.InitKey( pPassword );
aEncryptionData = rCodec.GetEncryptionData();
- // the export supports RC4 algorithm only, so we have to generate the related EncryptionData as well,
- // so that Save can export the document without asking for a password;
- // as result there will be EncryptionData for both algorithms in the MediaDescriptor
+ // the export supports RC4 algorithm only, so we have to
+ // generate the related EncryptionData as well, so that Save
+ // can export the document without asking for a password;
+ // as result there will be EncryptionData for both algorithms
+ // in the MediaDescriptor
::msfilter::MSCodec_Std97 aCodec97;
// Generate random number with a seed of time as salt.
@@ -5001,7 +5056,7 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGlos
size_t nUnencryptedHdr =
(8 == pWwFib->nVersion) ? 0x44 : 0x34;
sal_uInt8 *pIn = new sal_uInt8[nUnencryptedHdr];
- pStrm->Read(pIn, nUnencryptedHdr);
+ nUnencryptedHdr = pStrm->Read(pIn, nUnencryptedHdr);
aDecryptMain.Write(pIn, nUnencryptedHdr);
delete [] pIn;
@@ -5032,17 +5087,20 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGlos
break;
case RC4:
{
- msfilter::MSCodec_Std97 aCtx;
-
sal_uInt8 aDocId[ 16 ];
- pTableStream->Read(aDocId, 16);
sal_uInt8 aSaltData[ 16 ];
- pTableStream->Read(aSaltData, 16);
sal_uInt8 aSaltHash[ 16 ];
- pTableStream->Read(aSaltHash, 16);
+ bool bCouldReadHeaders =
+ checkRead(*pTableStream, aDocId, 16) &&
+ checkRead(*pTableStream, aSaltData, 16) &&
+ checkRead(*pTableStream, aSaltHash, 16);
+
+ msfilter::MSCodec_Std97 aCtx;
// if initialization has failed the EncryptionData should be empty
- uno::Sequence< beans::NamedValue > aEncryptionData = InitStd97Codec( aCtx, aDocId, *pMedium );
+ uno::Sequence< beans::NamedValue > aEncryptionData;
+ if (bCouldReadHeaders)
+ aEncryptionData = InitStd97Codec( aCtx, aDocId, *pMedium );
if ( aEncryptionData.getLength() && aCtx.VerifyKey( aSaltData, aSaltHash ) )
{
nErrRet = 0;
@@ -5050,9 +5108,9 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(SwPaM& rPaM ,WW8Glossary *pGlos
pTempMain = MakeTemp(aDecryptMain);
pStrm->Seek(0);
- const sal_Size nUnencryptedHdr = 0x44;
+ sal_Size nUnencryptedHdr = 0x44;
sal_uInt8 *pIn = new sal_uInt8[nUnencryptedHdr];
- pStrm->Read(pIn, nUnencryptedHdr);
+ nUnencryptedHdr = pStrm->Read(pIn, nUnencryptedHdr);
DecryptRC4(aCtx, *pStrm, aDecryptMain);
@@ -5129,7 +5187,6 @@ void SwWW8ImplReader::SetOutLineStyles()
// But at the end of the method <mpChosenOutlineNumRule> has to be set to
// <rDoc.GetOutlineNumRule()>, because <aOutlineRule> will be destroyed.
mpChosenOutlineNumRule = &aOutlineRule;
- // <--
sw::ParaStyles aOutLined(sw::util::GetParaStyles(rDoc));
// #i98791# - sorting algorithm adjusted
@@ -5146,7 +5203,6 @@ void SwWW8ImplReader::SetOutLineStyles()
// #i70748# - backward iteration needed due to the outline level attribute
sw::ParaStyles::reverse_iterator aEnd = aOutLined.rend();
for ( sw::ParaStyles::reverse_iterator aIter = aOutLined.rbegin(); aIter < aEnd; ++aIter)
- // <--
{
if ((*aIter)->IsAssignedToListLevelOfOutlineStyle())
nFlagsStyleOutlLevel |= 1 << (*aIter)->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei
@@ -5199,7 +5255,6 @@ void SwWW8ImplReader::SetOutLineStyles()
mpChosenOutlineNumRule = 0; //TODO make sure this is what we want
}
}
- // <--
OSL_ENSURE(mpChosenOutlineNumRule, "Impossible");
if (mpChosenOutlineNumRule)
@@ -5210,7 +5265,6 @@ void SwWW8ImplReader::SetOutLineStyles()
// #i70748# - backward iteration needed due to the outline level attribute
sw::ParaStyles::reverse_iterator aEnd = aOutLined.rend();
for ( sw::ParaStyles::reverse_iterator aIter = aOutLined.rbegin(); aIter < aEnd; ++aIter)
- // <--
{
if((*aIter)->IsAssignedToListLevelOfOutlineStyle())
(*aIter)->DeleteAssignmentToListLevelOfOutlineStyle(); //<-end
@@ -5294,7 +5348,6 @@ void SwWW8ImplReader::SetOutLineStyles()
{
mpChosenOutlineNumRule = rDoc.GetOutlineNumRule();
}
- // <--
}
const String* SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx)
@@ -5609,7 +5662,6 @@ sal_Bool SwMSDffManager::GetOLEStorageName(long nOLEId, String& rStorageName,
rReader.pPlcxMan->RestoreAllPLCFx( aSave );
}
- // <--
}
rReader.pStrm->Seek( nOldPos );
}
@@ -5647,7 +5699,6 @@ bool SwWW8ImplReader::InEqualOrHigherApo(int nLvl) const
{
return false;
}
- // <--
mycApoIter aIter = std::find(maApos.begin() + nLvl, maApos.end(), true);
if (aIter != maApos.end())
return true;
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 8a803db3e5..5a941ba52c 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -55,6 +55,9 @@
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
#include <editeng/lrspitem.hxx>
+#include <oox/ole/olehelper.hxx>
+
+#include <boost/noncopyable.hpp>
class SwDoc;
class SwPaM;
@@ -366,7 +369,7 @@ private:
const SwTxtNode &rTxtNode);
protected:
virtual void SetAttrInDoc(const SwPosition& rTmpPos,
- SwFltStackEntry* pEntry);
+ SwFltStackEntry& rEntry);
public:
SwWW8FltControlStack(SwDoc* pDo, sal_uLong nFieldFl, SwWW8ImplReader& rReader_ )
@@ -376,7 +379,7 @@ public:
void NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr);
- virtual void SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId=0, sal_Bool bTstEnde=sal_True, long nHand=LONG_MAX, sal_Bool consumedByField=sal_False);
+ virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId=0, sal_Bool bTstEnde=sal_True, long nHand=LONG_MAX, sal_Bool consumedByField=sal_False);
void SetToggleAttr(sal_uInt8 nId, bool bOn)
{
@@ -456,9 +459,9 @@ public:
//an additional pseudo bookmark
std::map<String, String, ltstr> aFieldVarNames;
protected:
- SwFltStackEntry *RefToVar(const SwField* pFld,SwFltStackEntry *pEntry);
+ SwFltStackEntry *RefToVar(const SwField* pFld,SwFltStackEntry& rEntry);
virtual void SetAttrInDoc(const SwPosition& rTmpPos,
- SwFltStackEntry* pEntry);
+ SwFltStackEntry& rEntry);
private:
//No copying
SwWW8FltRefStack(const SwWW8FltRefStack&);
@@ -670,8 +673,7 @@ public:
class SwMSConvertControls: public SvxMSConvertOCXControls
{
public:
- SwMSConvertControls( SfxObjectShell *pDSh,SwPaM *pP ) :
- SvxMSConvertOCXControls( pDSh,pP ) {}
+ SwMSConvertControls( SfxObjectShell *pDSh,SwPaM *pP );
virtual sal_Bool InsertFormula( WW8FormulaControl &rFormula);
virtual sal_Bool InsertControl(const com::sun::star::uno::Reference<
com::sun::star::form::XFormComponent >& rFComp,
@@ -679,6 +681,12 @@ public:
com::sun::star::uno::Reference <
com::sun::star::drawing::XShape > *pShape,sal_Bool bFloatingCtrl);
bool ExportControl(WW8Export &rWrt, const SdrObject *pObj);
+ virtual sal_Bool ReadOCXStream( SotStorageRef& rSrc1,
+ com::sun::star::uno::Reference<
+ com::sun::star::drawing::XShape > *pShapeRef=0,
+ sal_Bool bFloatingCtrl=false );
+private:
+ ::oox::ole::OleFormCtrlImportHelper maFormCtrlHelper;
};
class SwMSDffManager : public SvxMSDffManager
@@ -686,7 +694,7 @@ class SwMSDffManager : public SvxMSDffManager
private:
SwWW8ImplReader& rReader;
SvStream *pFallbackStream;
- List *pOldEscherBlipCache;
+ std::map<sal_uInt32,ByteString> aOldEscherBlipCache;
virtual sal_Bool GetOLEStorageName( long nOLEId, String& rStorageName,
SvStorageRef& rSrcStorage, com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& rDestStorage ) const;
@@ -699,7 +707,6 @@ private:
const Rectangle& rVisArea,
const int _nCalledByGroup,
sal_Int64 nAspect ) const;
- // <--
//No copying
SwMSDffManager(const SwMSDffManager&);
@@ -834,6 +841,33 @@ public:
sal_uInt32 GetTextAreaWidth() const;
};
+//Various writer elements like frames start off containing a blank paragraph,
+//sometimes this paragraph turns out to be extraneous, e.g. the frame should
+//only contain a table with no trailing paragraph.
+//
+//We want to remove these extra paragraphs, but removing them during the parse
+//is problematic, because we don't want to remove any paragraphs that are still
+//addressed by property entries in a SwFltControlStack which have not yet been
+//committed to the document.
+//
+//Safest thing is to not delete SwTxtNodes from a document during import, and
+//remove these extraneous paragraphs at the end after all SwFltControlStack are
+//destroyed.
+class wwExtraneousParas : private ::boost::noncopyable
+{
+private:
+ /*
+ A vector of SwTxtNodes to erase from a document after import is complete
+ */
+ std::vector<SwTxtNode*> m_aTxtNodes;
+ SwDoc& m_rDoc;
+public:
+ wwExtraneousParas(SwDoc &rDoc) : m_rDoc(rDoc) {}
+ ~wwExtraneousParas() { delete_all_from_doc(); }
+ void push_back(SwTxtNode *pTxtNode) { m_aTxtNodes.push_back(pTxtNode); }
+ void delete_all_from_doc();
+};
+
class wwFrameNamer
{
private:
@@ -1002,6 +1036,13 @@ private:
wwSectionManager maSectionManager;
/*
+ A vector of surplus-to-requirements paragraph in the final document,
+ that exist because of quirks of the SwDoc document model and/or API,
+ which need to be removed.
+ */
+ wwExtraneousParas m_aExtraneousParas;
+
+ /*
A map of of tables to their follow nodes for use in inserting tables into
already existing document, i.e. insert file
*/
@@ -1277,7 +1318,6 @@ private:
void NewAttr( const SfxPoolItem& rAttr,
const bool bFirstLineOfStSet = false,
const bool bLeftIndentSet = false );
- // <--
bool GetFontParams(sal_uInt16, FontFamily&, String&, FontPitch&,
rtl_TextEncoding&);
@@ -1530,7 +1570,6 @@ private:
// #i84783#
// determine object attribute "Layout in Table Cell"
bool IsObjectLayoutInTableCell( const sal_uInt32 nLayoutInTableCell ) const;
- // <--
bool ReadGlobalTemplateSettings( const rtl::OUString& sCreatedFrom, const com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xPrjNameMap );
//No copying
SwWW8ImplReader(const SwWW8ImplReader &);
@@ -1741,7 +1780,6 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR,
const SwNumFmt &rFmt,
const bool bFirstLineOfStSet,
const bool bLeftIndentSet );
-// <--
long GetListFirstLineIndent(const SwNumFmt &rFmt);
String BookmarkToWriter(const String &rBookmark);
bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth,
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 0e0b46df04..3fa6a245f2 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -132,6 +132,11 @@ struct WW8TabBandDesc
bool bExist[MAX_COL]; // Existiert diese Zelle ?
sal_uInt8 nTransCell[MAX_COL + 2]; // UEbersetzung WW-Index -> SW-Index
+ sal_uInt8 transCell(sal_uInt8 nWwCol) const
+ {
+ return nWwCol < SAL_N_ELEMENTS(nTransCell) ? nTransCell[nWwCol] : 0xFF;
+ }
+
WW8TabBandDesc();
WW8TabBandDesc(WW8TabBandDesc& rBand); // tief kopieren
~WW8TabBandDesc();
@@ -595,7 +600,6 @@ ApoTestResults SwWW8ImplReader::TestApo(int nCellLevel, bool bTableRowEnd,
pTableDesc->GetAktCol() == 0 &&
( !pTableDesc->IsValidCell( pTableDesc->GetAktCol() ) ||
pTableDesc->InFirstParaInCell() );
- // <--
}
}
}
@@ -784,7 +788,6 @@ SwNumRule* SwWW8ImplReader::GetStyRule()
// #i86652#
sal_uInt16 nRul = rDoc.MakeNumRule( aName, 0, sal_False,
SvxNumberFormat::LABEL_ALIGNMENT );
- // <--
pStyles->pStyRule = rDoc.GetNumRuleTbl()[nRul];
// Auto == false-> Nummerierungsvorlage
pStyles->pStyRule->SetAutoRule(false);
@@ -1007,7 +1010,6 @@ void SwWW8ImplReader::StartAnl(const sal_uInt8* pSprm13)
pNumRule = rDoc.GetNumRuleTbl()[
rDoc.MakeNumRule( sNumRule, 0, sal_False,
SvxNumberFormat::LABEL_ALIGNMENT ) ];
- // <--
}
if (pTableDesc)
{
@@ -2658,7 +2660,6 @@ void WW8TabDesc::MergeCells()
else
break;
pActMGroup->nGroupWidth = nSizCell;
- // <--
// locked previously created merge groups,
// after determining the size for the new merge group.
@@ -2671,7 +2672,6 @@ void WW8TabDesc::MergeCells()
{
(*pMergeGroups)[ nMGrIdx ]->bGroupLocked = true;
}
- // <--
// 3. und in Gruppen-Array eintragen
pMergeGroups->Insert(pActMGroup, pMergeGroups->Count());
@@ -2843,7 +2843,9 @@ bool WW8TabDesc::FindMergeGroup(short nX1, short nWidth, bool bExact,
bool WW8TabDesc::IsValidCell(short nCol) const
{
- return pActBand->bExist[nCol] && (sal_uInt16)nAktRow < pTabLines->Count();
+ return (static_cast<size_t>(nCol) < SAL_N_ELEMENTS(pActBand->bExist)) &&
+ pActBand->bExist[nCol] &&
+ (sal_uInt16)nAktRow < pTabLines->Count();
}
bool WW8TabDesc::InFirstParaInCell() const
@@ -2885,7 +2887,7 @@ bool WW8TabDesc::SetPamInCell(short nWwCol, bool bPam)
{
OSL_ENSURE( pActBand, "pActBand ist 0" );
- sal_uInt16 nCol = pActBand->nTransCell[nWwCol];
+ sal_uInt16 nCol = pActBand->transCell(nWwCol);
if ((sal_uInt16)nAktRow >= pTabLines->Count())
{
@@ -3336,7 +3338,6 @@ SwTableBox* WW8TabDesc::UpdateTableMergeGroup( WW8_TCell& rCell,
rCell.bMerged ||
rCell.bVertMerge ||
rCell.bVertRestart ) )
- // <--
{
// passende Merge-Gruppe ermitteln
WW8SelBoxInfo* pTheMergeGroup = 0;
@@ -3416,7 +3417,6 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp)
// only at-character, if absolute position object attributes are available.
// Thus, default anchor type is as-character anchored.
RndStdIds eAnchor( FLY_AS_CHAR );
- // <--
if ( nInTable )
{
WW8_TablePos* pNestedTabPos( 0L );
@@ -3449,7 +3449,6 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp)
}
}
}
- // <--
pTableDesc = new WW8TabDesc( this, nStartCp );
@@ -3477,7 +3476,6 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp)
pTableDesc->pParentPos, &aItemSet);
OSL_ENSURE( pTableDesc->pFlyFmt->GetAnchor().GetAnchorId() == eAnchor,
"Not the anchor type requested!" );
- // <--
MoveInsideFly(pTableDesc->pFlyFmt);
}
pTableDesc->CreateSwTable();
@@ -3501,11 +3499,9 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp)
pTableDesc->pFlyFmt->SetFmtAttr(aHori);
pTableDesc->pFlyFmt->SetFmtAttr( SwFmtSurround( SURROUND_NONE ) );
}
- // <--
// #i33818# - The nested table doesn't have to leave
// the table cell. Thus, the Writer fly frame has to follow the text flow.
pTableDesc->pFlyFmt->SetFmtAttr( SwFmtFollowTextFlow( sal_True ) );
- // <--
}
else
pTableDesc->SetSizePosition(0);
@@ -3517,7 +3513,6 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp)
// #i33818#
delete pTableWFlyPara;
delete pTableSFlyPara;
- // <--
bool bSuccess = (0 != pTableDesc);
if (bSuccess)
@@ -3528,45 +3523,6 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp)
return bSuccess;
}
-bool lcl_PamContainsFly(SwPaM & rPam)
-{
- bool bResult = false;
- SwNodeRange aRg( rPam.Start()->nNode, rPam.End()->nNode );
- SwDoc * pDoc = rPam.GetDoc();
-
- sal_uInt16 n = 0;
- SwSpzFrmFmts * pSpzFmts = pDoc->GetSpzFrmFmts();
- sal_uInt16 nCount = pSpzFmts->Count();
- while (!bResult && n < nCount)
- {
- SwFrmFmt* pFly = (*pSpzFmts)[n];
- const SwFmtAnchor* pAnchor = &pFly->GetAnchor();
-
- switch (pAnchor->GetAnchorId())
- {
- case FLY_AT_PARA:
- case FLY_AT_CHAR:
- {
- const SwPosition* pAPos = pAnchor->GetCntntAnchor();
-
- if (pAPos != NULL &&
- aRg.aStart <= pAPos->nNode &&
- pAPos->nNode <= aRg.aEnd)
- {
- bResult = true;
- }
- }
- break;
- default:
- break;
- }
-
- ++n;
- }
-
- return bResult;
-}
-
void SwWW8ImplReader::TabCellEnd()
{
if (nInTable && pTableDesc)
@@ -3731,14 +3687,13 @@ void WW8RStyle::ImportSprms(sal_Size nPosFc, short nLen, bool bPap)
if (!nLen)
return;
- sal_uInt8 *pSprms = new sal_uInt8[nLen];
-
- pStStrm->Seek(nPosFc);
- pStStrm->Read(pSprms, nLen);
-
- ImportSprms(pSprms, nLen, bPap);
-
- delete[] pSprms;
+ if (checkSeek(*pStStrm, nPosFc))
+ {
+ sal_uInt8 *pSprms = new sal_uInt8[nLen];
+ nLen = pStStrm->Read(pSprms, nLen);
+ ImportSprms(pSprms, nLen, bPap);
+ delete[] pSprms;
+ }
}
static inline short WW8SkipOdd(SvStream* pSt )
@@ -3746,8 +3701,7 @@ static inline short WW8SkipOdd(SvStream* pSt )
if ( pSt->Tell() & 0x1 )
{
sal_uInt8 c;
- pSt->Read( &c, 1 );
- return 1;
+ return pSt->Read( &c, 1 );
}
return 0;
}
@@ -3757,16 +3711,13 @@ static inline short WW8SkipEven(SvStream* pSt )
if (!(pSt->Tell() & 0x1))
{
sal_uInt8 c;
- pSt->Read( &c, 1 );
- return 1;
+ return pSt->Read( &c, 1 );
}
return 0;
}
short WW8RStyle::ImportUPX(short nLen, bool bPAP, bool bOdd)
{
- sal_Int16 cbUPX;
-
if( 0 < nLen ) // Empty ?
{
if (bOdd)
@@ -3774,6 +3725,7 @@ short WW8RStyle::ImportUPX(short nLen, bool bPAP, bool bOdd)
else
nLen = nLen - WW8SkipOdd( pStStrm );
+ sal_Int16 cbUPX(0);
*pStStrm >> cbUPX;
nLen-=2;
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index c2e267078e..f715359023 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -351,6 +351,8 @@ struct WW8LST // nur DIE Eintraege, die WIR benoetigen!
// true if the list should start numbering over
}; // at the beginning of each section
+const sal_uInt32 cbLSTF=28;
+
struct WW8LFO // nur DIE Eintraege, die WIR benoetigen!
{
SwNumRule* pNumRule; // Parent NumRule
@@ -496,7 +498,7 @@ WW8LSTInfo* WW8ListManager::GetLSTByListId( sal_uInt32 nIdLst ) const
void lcl_CopyGreaterEight(String &rDest, String &rSrc,
xub_StrLen nStart, xub_StrLen nLen = STRING_LEN)
{
- if (nLen == STRING_LEN)
+ if (nLen > rSrc.Len() || nLen == STRING_LEN)
nLen = rSrc.Len();
for (xub_StrLen nI = nStart; nI < nLen; ++nI)
{
@@ -653,7 +655,6 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
}
}
}
- // <--
}
//
// 3. ggfs. CHPx einlesen und
@@ -683,14 +684,15 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
// spezielle ItemSet relevant ist - und nicht ein Stack oder Style!
sal_uInt16 nOldFlags1 = rReader.GetToggleAttrFlags();
sal_uInt16 nOldFlags2 = rReader.GetToggleBiDiAttrFlags();
- short nLen = aLVL.nLenGrpprlChpx;
- sal_uInt8* pSprms1 = &aGrpprlChpx[0];
- while (0 < nLen)
+
+ WW8SprmIter aSprmIter(&aGrpprlChpx[0], aLVL.nLenGrpprlChpx,
+ maSprmParser);
+ while (const sal_uInt8* pSprm = aSprmIter.GetSprms())
{
- sal_uInt16 nL1 = rReader.ImportSprm( pSprms1 );
- nLen = nLen - nL1;
- pSprms1 += nL1;
+ rReader.ImportSprm(pSprm);
+ aSprmIter.advance();
}
+
// Reader-ItemSet-Pointer und Reader-Style zuruecksetzen
rReader.SetAktItemSet( 0 );
rReader.SetNAktColl( nOldColl );
@@ -784,7 +786,6 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
++aIter;
}
}
- // <--
sal_uInt8 nUpperLevel = 0; // akt. Anzeigetiefe fuer den Writer
for(nLevelB = 0; nLevelB < nMaxLevel; ++nLevelB)
@@ -1045,7 +1046,6 @@ SwNumRule* WW8ListManager::CreateNextRule(bool bSimple)
sal_uInt16 nRul =
rDoc.MakeNumRule( rDoc.GetUniqueNumRuleName(&sPrefix), 0, sal_False,
SvxNumberFormat::LABEL_ALIGNMENT );
- // <--
SwNumRule* pMyNumRule = rDoc.GetNumRuleTbl()[nRul];
pMyNumRule->SetAutoRule(false);
pMyNumRule->SetContinusNum(bSimple);
@@ -1062,194 +1062,195 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
// LST und LFO gibts erst ab WW8
if( ( 8 > rFib.nVersion )
|| ( rFib.fcPlcfLst == rFib.fcPlfLfo )
- || ( !rFib.lcbPlcfLst )
- || ( !rFib.lcbPlfLfo ) ) return; // offensichtlich keine Listen da
+ || ( rFib.lcbPlcfLst < 2 )
+ || ( rFib.lcbPlfLfo < 2) ) return; // offensichtlich keine Listen da
// Arrays anlegen
pLFOInfos = new WW8LFOInfos;
bool bLVLOk = true;
- sal_uInt8 aBits1;
nLastLFOPosition = USHRT_MAX;
long nOriginalPos = rSt.Tell();
//
// 1. PLCF LST auslesen und die Listen Vorlagen im Writer anlegen
//
- rSt.Seek( rFib.fcPlcfLst );
- sal_uInt16 nListCount;
+ bool bOk = checkSeek(rSt, rFib.fcPlcfLst);
+
+ if (!bOk)
+ return;
+
+ sal_uInt32 nRemainingPlcfLst = rFib.lcbPlcfLst;
+
+ sal_uInt16 nListCount(0);
rSt >> nListCount;
- bool bOk = 0 < nListCount;
- if( bOk )
+ nRemainingPlcfLst -= 2;
+ bOk = nListCount > 0;
+
+ if (!bOk)
+ return;
+
+ //
+ // 1.1 alle LST einlesen
+ //
+ for (sal_uInt16 nList=0; nList < nListCount; ++nList)
{
+ if (nRemainingPlcfLst < cbLSTF)
+ break;
+
WW8LST aLST;
+ memset(&aLST, 0, sizeof( aLST ));
+
//
- // 1.1 alle LST einlesen
+ // 1.1.1 Daten einlesen
//
- for (sal_uInt16 nList=0; nList < nListCount; ++nList)
- {
- bOk = false;
- memset(&aLST, 0, sizeof( aLST ));
- sal_uInt16 nLevel;
- //
- // 1.1.1 Daten einlesen
- //
- rSt >> aLST.nIdLst;
- rSt >> aLST.nTplC;
- for (nLevel = 0; nLevel < nMaxLevel; ++nLevel)
- rSt >> aLST.aIdSty[ nLevel ];
+ rSt >> aLST.nIdLst;
+ rSt >> aLST.nTplC;
+ for (sal_uInt16 nLevel = 0; nLevel < nMaxLevel; ++nLevel)
+ rSt >> aLST.aIdSty[ nLevel ];
+ sal_uInt8 aBits1(0);
+ rSt >> aBits1;
- rSt >> aBits1;
+ rSt.SeekRel( 1 );
- rSt.SeekRel( 1 );
+ if( aBits1 & 0x01 )
+ aLST.bSimpleList = true;
+ if( aBits1 & 0x02 )
+ aLST.bRestartHdn = true;
- if (rSt.GetError())
- break;
+ // 1.1.2 new NumRule inserted in Doc and WW8LSTInfo marked
- if( aBits1 & 0x01 )
- aLST.bSimpleList = true;
- if( aBits1 & 0x02 )
- aLST.bRestartHdn = true;
-
- // 1.1.2 new NumRule inserted in Doc and WW8LSTInfo marked
+ /*
+ #i1869#
+ In word 2000 microsoft got rid of creating new "simple lists" with
+ only 1 level, all new lists are created with 9 levels. To hack it
+ so that the list types formerly known as simple lists still have
+ their own tab page to themselves one of the reserved bits is used
+ to show that a given list is to be in the simple list tabpage.
+ This has now nothing to do with the actual number of list level a
+ list has, only how many will be shown in the user interface.
+
+ i.e. create a simple list in 2000 and open it in 97 and 97 will
+ claim (correctly) that it is an outline list. We can set our
+ continous flag in these lists to store this information.
+ */
+ SwNumRule* pMyNumRule = CreateNextRule(
+ aLST.bSimpleList || (aBits1 & 0x10));
- /*
- #i1869#
- In word 2000 microsoft got rid of creating new "simple lists" with
- only 1 level, all new lists are created with 9 levels. To hack it
- so that the list types formerly known as simple lists still have
- their own tab page to themselves one of the reserved bits is used
- to show that a given list is to be in the simple list tabpage.
- This has now nothing to do with the actual number of list level a
- list has, only how many will be shown in the user interface.
-
- i.e. create a simple list in 2000 and open it in 97 and 97 will
- claim (correctly) that it is an outline list. We can set our
- continous flag in these lists to store this information.
- */
- SwNumRule* pMyNumRule = CreateNextRule(
- aLST.bSimpleList || (aBits1 & 0x10));
+ WW8LSTInfo* pLSTInfo = new WW8LSTInfo(pMyNumRule, aLST);
+ maLSTInfos.push_back(pLSTInfo);
- WW8LSTInfo* pLSTInfo = new WW8LSTInfo(pMyNumRule, aLST);
- maLSTInfos.push_back(pLSTInfo);
- bOk = true;
- }
+ nRemainingPlcfLst -= cbLSTF;
}
- if( bOk )
+ //
+ // 1.2 alle LVL aller aLST einlesen
+ //
+ sal_uInt16 nLSTInfos = static_cast< sal_uInt16 >(maLSTInfos.size());
+ for (sal_uInt16 nList = 0; nList < nLSTInfos; ++nList)
{
+ WW8LSTInfo* pListInfo = maLSTInfos[nList];
+ if( !pListInfo || !pListInfo->pNumRule ) break;
+ SwNumRule& rMyNumRule = *pListInfo->pNumRule;
//
- // 1.2 alle LVL aller aLST einlesen
+ // 1.2.1 betreffende(n) LVL(s) fuer diese aLST einlesen
//
- sal_uInt8 nLevel;
- sal_uInt16 nLSTInfos = static_cast< sal_uInt16 >(maLSTInfos.size());
- for (sal_uInt16 nList = 0; nList < nLSTInfos; ++nList)
+ sal_uInt16 nLvlCount = static_cast< sal_uInt16 >(pListInfo->bSimpleList ? nMinLevel : nMaxLevel);
+ std::deque<bool> aNotReallyThere;
+ aNotReallyThere.resize(nMaxLevel);
+ pListInfo->maParaSprms.resize(nMaxLevel);
+ for (sal_uInt8 nLevel = 0; nLevel < nLvlCount; ++nLevel)
{
- bOk = false;
- WW8LSTInfo* pListInfo = maLSTInfos[nList];
- if( !pListInfo || !pListInfo->pNumRule ) break;
- SwNumRule& rMyNumRule = *pListInfo->pNumRule;
- //
- // 1.2.1 betreffende(n) LVL(s) fuer diese aLST einlesen
- //
- sal_uInt16 nLvlCount = static_cast< sal_uInt16 >(pListInfo->bSimpleList ? nMinLevel : nMaxLevel);
- std::deque<bool> aNotReallyThere;
- aNotReallyThere.resize(nMaxLevel);
- pListInfo->maParaSprms.resize(nMaxLevel);
- for (nLevel = 0; nLevel < nLvlCount; ++nLevel)
- {
- SwNumFmt aNumFmt( rMyNumRule.Get( nLevel ) );
- // LVLF einlesen
- bLVLOk = ReadLVL( aNumFmt, pListInfo->aItemSet[nLevel],
- pListInfo->aIdSty[nLevel], true, aNotReallyThere, nLevel,
- pListInfo->maParaSprms[nLevel]);
- if( !bLVLOk )
- break;
- // und in die rMyNumRule aufnehmen
- rMyNumRule.Set( nLevel, aNumFmt );
- }
+ SwNumFmt aNumFmt( rMyNumRule.Get( nLevel ) );
+ // LVLF einlesen
+ bLVLOk = ReadLVL( aNumFmt, pListInfo->aItemSet[nLevel],
+ pListInfo->aIdSty[nLevel], true, aNotReallyThere, nLevel,
+ pListInfo->maParaSprms[nLevel]);
if( !bLVLOk )
break;
- //
- // 1.2.2 die ItemPools mit den CHPx Einstellungen der verschiedenen
- // Level miteinander vergleichen und ggfs. Style(s) erzeugen
- //
+ // und in die rMyNumRule aufnehmen
+ rMyNumRule.Set( nLevel, aNumFmt );
+ }
+ if( !bLVLOk )
+ break;
+ //
+ // 1.2.2 die ItemPools mit den CHPx Einstellungen der verschiedenen
+ // Level miteinander vergleichen und ggfs. Style(s) erzeugen
+ //
+ for (sal_uInt8 nLevel = 0; nLevel < nLvlCount; ++nLevel)
+ {
bool bDummy;
- for (nLevel = 0; nLevel < nLvlCount; ++nLevel)
- {
- AdjustLVL( nLevel, rMyNumRule, pListInfo->aItemSet,
- pListInfo->aCharFmt, bDummy );
- }
- //
- // 1.2.3 ItemPools leeren und loeschen
- //
- for (nLevel = 0; nLevel < nLvlCount; ++nLevel)
- delete pListInfo->aItemSet[ nLevel ];
- bOk = true;
+ AdjustLVL( nLevel, rMyNumRule, pListInfo->aItemSet,
+ pListInfo->aCharFmt, bDummy );
}
- }
- if( !bOk )
- {
- // Fehler aufgetreten - LSTInfos abraeumen !!!
-
- ;
+ //
+ // 1.2.3 ItemPools leeren und loeschen
+ //
+ for (sal_uInt8 nLevel = 0; nLevel < nLvlCount; ++nLevel)
+ delete pListInfo->aItemSet[ nLevel ];
}
//
// 2. PLF LFO auslesen und speichern
//
- long nLfoCount(0);
- if (bOk)
- {
- rSt.Seek(rFib.fcPlfLfo);
- rSt >> nLfoCount;
- if (0 >= nLfoCount)
- bOk = false;
- }
+ bOk = checkSeek(rSt, rFib.fcPlfLfo);
+
+ if (!bOk)
+ return;
- if(bOk)
+ sal_Int32 nLfoCount(0);
+ rSt >> nLfoCount;
+ bOk = nLfoCount > 0;
+
+ if (!bOk)
+ return;
+
+ //
+ // 2.1 alle LFO einlesen
+ //
+ for (sal_uInt16 nLfo = 0; nLfo < nLfoCount; ++nLfo)
{
+ bOk = false;
+
+ if (rSt.IsEof())
+ break;
+
WW8LFO aLFO;
- //
- // 2.1 alle LFO einlesen
- //
- for (sal_uInt16 nLfo = 0; nLfo < nLfoCount; ++nLfo)
- {
- bOk = false;
- memset(&aLFO, 0, sizeof( aLFO ));
- rSt >> aLFO.nIdLst;
- rSt.SeekRel( 8 );
- rSt >> aLFO.nLfoLvl;
- rSt.SeekRel( 3 );
- // soviele Overrides existieren
- if ((nMaxLevel < aLFO.nLfoLvl) || rSt.GetError())
- break;
+ memset(&aLFO, 0, sizeof( aLFO ));
+
+ rSt >> aLFO.nIdLst;
+ rSt.SeekRel( 8 );
+ rSt >> aLFO.nLfoLvl;
+ rSt.SeekRel( 3 );
+ // soviele Overrides existieren
+ if ((nMaxLevel < aLFO.nLfoLvl) || rSt.GetError())
+ break;
- // die Parent NumRule der entsprechenden Liste ermitteln
- WW8LSTInfo* pParentListInfo = GetLSTByListId(aLFO.nIdLst);
- if (pParentListInfo)
- {
- // hier, im ersten Schritt, erst mal diese NumRule festhalten
- aLFO.pNumRule = pParentListInfo->pNumRule;
+ // die Parent NumRule der entsprechenden Liste ermitteln
+ WW8LSTInfo* pParentListInfo = GetLSTByListId(aLFO.nIdLst);
+ if (pParentListInfo)
+ {
+ // hier, im ersten Schritt, erst mal diese NumRule festhalten
+ aLFO.pNumRule = pParentListInfo->pNumRule;
- // hat die Liste mehrere Level ?
- aLFO.bSimpleList = pParentListInfo->bSimpleList;
- }
- // und rein ins Merk-Array mit dem Teil
- WW8LFOInfo* pLFOInfo = new WW8LFOInfo(aLFO);
- if (pParentListInfo)
- {
- //Copy the basic paragraph properties for each level from the
- //original list into the list format override levels.
- int nMaxSize = pParentListInfo->maParaSprms.size();
- pLFOInfo->maParaSprms.resize(nMaxSize);
- for (int i = 0; i < nMaxSize; ++i)
- pLFOInfo->maParaSprms[i] = pParentListInfo->maParaSprms[i];
- }
- pLFOInfos->Insert(pLFOInfo, pLFOInfos->Count());
- bOk = true;
+ // hat die Liste mehrere Level ?
+ aLFO.bSimpleList = pParentListInfo->bSimpleList;
}
+ // und rein ins Merk-Array mit dem Teil
+ WW8LFOInfo* pLFOInfo = new WW8LFOInfo(aLFO);
+ if (pParentListInfo)
+ {
+ //Copy the basic paragraph properties for each level from the
+ //original list into the list format override levels.
+ int nMaxSize = pParentListInfo->maParaSprms.size();
+ pLFOInfo->maParaSprms.resize(nMaxSize);
+ for (int i = 0; i < nMaxSize; ++i)
+ pLFOInfo->maParaSprms[i] = pParentListInfo->maParaSprms[i];
+ }
+ pLFOInfos->Insert(pLFOInfo, pLFOInfos->Count());
+ bOk = true;
}
+
if( bOk )
{
//
@@ -1316,13 +1317,15 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
sal_uInt32 nTest;
rSt >> nTest;
do
+ {
+ nTest = 0;
rSt >> nTest;
+ }
while (nTest == 0xFFFFFFFF);
rSt.SeekRel(-4);
std::deque<bool> aNotReallyThere(WW8ListManager::nMaxLevel);
- sal_uInt8 nLevel = 0;
- for (nLevel = 0; nLevel < pLFOInfo->nLfoLvl; ++nLevel)
+ for (sal_uInt8 nLevel = 0; nLevel < pLFOInfo->nLfoLvl; ++nLevel)
{
WW8LFOLVL aLFOLVL;
bLVLOk = false;
@@ -1331,6 +1334,7 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
// 2.2.2.1 den LFOLVL einlesen
//
rSt >> aLFOLVL.nStartAt;
+ sal_uInt8 aBits1(0);
rSt >> aBits1;
rSt.SeekRel( 3 );
if (rSt.GetError())
@@ -1392,7 +1396,7 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
//
sal_uInt16 aFlagsNewCharFmt = 0;
bool bNewCharFmtCreated = false;
- for (nLevel = 0; nLevel < pLFOInfo->nLfoLvl; ++nLevel)
+ for (sal_uInt8 nLevel = 0; nLevel < pLFOInfo->nLfoLvl; ++nLevel)
{
AdjustLVL( nLevel, *pLFOInfo->pNumRule, aItemSet, aCharFmt,
bNewCharFmtCreated, sPrefix );
@@ -1402,17 +1406,12 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_)
//
// 2.2.4 ItemPools leeren und loeschen
//
- for (nLevel = 0; nLevel < pLFOInfo->nLfoLvl; ++nLevel)
+ for (sal_uInt8 nLevel = 0; nLevel < pLFOInfo->nLfoLvl; ++nLevel)
delete aItemSet[ nLevel ];
bOk = true;
}
}
}
- if( !bOk )
- {
- // Fehler aufgetreten - LSTInfos und LFOInfos abraeumen !!!
- ;
- }
// und schon sind wir fertig!
rSt.Seek( nOriginalPos );
}
@@ -1619,7 +1618,6 @@ bool SwWW8ImplReader::SetTxtFmtCollAndListLevel(const SwPaM& rRg,
{
return bRes;
}
- // <--
SwNumRule * pNumRule = pTxtNode->GetNumRule(); // #i27610#
@@ -1664,7 +1662,6 @@ void UseListIndent(SwWW8StyInf &rStyle, const SwNumFmt &rFmt)
rStyle.pFmt->SetFmtAttr(aLR);
rStyle.bListReleventIndentSet = true;
}
- // <--
}
void SetStyleIndent(SwWW8StyInf &rStyle, const SwNumFmt &rFmt)
@@ -1805,7 +1802,6 @@ void SwWW8ImplReader::RegisterNumFmtOnTxtNode(sal_uInt16 nActLFO,
// correct condition according to the above given comment.
if ( pTxtNd->GetNumRule() == rDoc.GetOutlineNumRule() &&
pRule == mpChosenOutlineNumRule )
- // <--
{
bUnchangedOutlineNumbering = true;
}
@@ -1831,7 +1827,6 @@ void SwWW8ImplReader::RegisterNumFmtOnTxtNode(sal_uInt16 nActLFO,
{
pTxtNd->SetCountedInList( true );
}
- // <--
// #i99822#
// Direct application of the list level formatting no longer
@@ -1887,7 +1882,6 @@ void SwWW8ImplReader::RegisterNumFmtOnTxtNode(sal_uInt16 nActLFO,
pCtrlStck->SetAttr(*pPaM->GetPoint(), RES_LR_SPACE);
}
}
- // <--
}
}
}
@@ -2011,7 +2005,6 @@ void SwWW8ImplReader::Read_LFOPosition(sal_uInt16, const sal_uInt8* pData,
pTxtNode->SetAttr(
SwNumRuleItem( rDoc.GetOutlineNumRule()->GetName() ) );
}
- // <--
}
pCtrlStck->NewAttr(*pPaM->GetPoint(), SvxLRSpaceItem(RES_LR_SPACE));
@@ -2453,7 +2446,15 @@ sal_Bool WW8FormulaListBox::Import(const uno::Reference <
aTmp <<= aListSource;
xPropSet->setPropertyValue(C2U("StringItemList"), aTmp );
- aTmp <<= aListSource[0];
+ if (fDropdownIndex < nLen)
+ {
+ aTmp <<= aListSource[fDropdownIndex];
+ }
+ else
+ {
+ aTmp <<= aListSource[0];
+ }
+
xPropSet->setPropertyValue(C2U("DefaultText"), aTmp );
rSz = rRdr.MiserableDropDownFormHack(maListEntries[0], xPropSet);
@@ -2564,7 +2565,7 @@ sal_Bool SwMSConvertControls::InsertControl(
uno::Reference< drawing::XShape > xShape =
uno::Reference< drawing::XShape >(xCreate, uno::UNO_QUERY);
- DBG_ASSERT(xShape.is(), "XShape nicht erhalten");
+ OSL_ENSURE(xShape.is(), "XShape nicht erhalten");
xShape->setSize(rSize);
uno::Reference< beans::XPropertySet > xShapePropSet(
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index b13871e4de..c99d48d955 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -168,7 +168,7 @@ static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp,
}
bool bOk = ReadWindowMetafile( *pSt, rWMF, NULL ) ? true : false; // WMF lesen
// *pSt >> aWMF geht nicht ohne placable Header
- if (!bOk || pSt->GetError() || rWMF.GetActionCount() == 0)
+ if (!bOk || pSt->GetError() || rWMF.GetActionSize() == 0)
{
OSL_ENSURE( !pSt, "+OLE: Konnte Metafile nicht lesen" );
return false;
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 50f27196ff..759293dda2 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -594,7 +594,6 @@ String GetWordDefaultDateStringAsUS(SvNumberFormatter* pFormatter, sal_uInt16 nL
{
sParams.SearchAndReplace(CREATE_CONST_ASC("YY"), CREATE_CONST_ASC("YYYY"));
}
- // <--
return sParams;
}
@@ -774,21 +773,24 @@ sal_uInt16 SwWW8ImplReader::End_Field()
// Store it now!
uno::Reference< embed::XStorage > xDocStg = GetDoc().GetDocStorage();
- uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OLELinks")), embed::ElementModes::WRITE );
- SotStorageRef xObjDst = SotStorage::OpenOLEStorage( xOleStg, sOleId );
-
- if ( xObjDst.Is() )
+ if (xDocStg.is())
{
- xSrc1->CopyTo( xObjDst );
+ uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OLELinks")), embed::ElementModes::WRITE );
+ SotStorageRef xObjDst = SotStorage::OpenOLEStorage( xOleStg, sOleId );
- if ( !xObjDst->GetError() )
- xObjDst->Commit();
- }
+ if ( xObjDst.Is() )
+ {
+ xSrc1->CopyTo( xObjDst );
- uno::Reference< embed::XTransactedObject > xTransact( xOleStg, uno::UNO_QUERY );
- if ( xTransact.is() )
- xTransact->commit();
+ if ( !xObjDst->GetError() )
+ xObjDst->Commit();
+ }
+
+ uno::Reference< embed::XTransactedObject > xTransact( xOleStg, uno::UNO_QUERY );
+ if ( xTransact.is() )
+ xTransact->commit();
+ }
// Store the OLE Id as a parameter
pFieldmark->GetParameters()->insert(
@@ -1112,7 +1114,6 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
{
aStr.EraseAllChars( 0x01 );
}
- // <--
eF_ResT eRes = (this->*aWW8FieldTab[aF.nId])( &aF, aStr );
pStrm->Seek( nOldPos );
@@ -1418,7 +1419,7 @@ of a set or ask field, either by word, or in some special cases by the import
filter itself.
*/
SwFltStackEntry *SwWW8FltRefStack::RefToVar(const SwField* pFld,
- SwFltStackEntry *pEntry)
+ SwFltStackEntry &rEntry)
{
SwFltStackEntry *pRet=0;
if (pFld && RES_GETREFFLD == pFld->Which())
@@ -1432,10 +1433,10 @@ SwFltStackEntry *SwWW8FltRefStack::RefToVar(const SwField* pFld,
{
SwGetExpField aFld( (SwGetExpFieldType*)
pDoc->GetSysFldType(RES_GETEXPFLD), rName, nsSwGetSetExpType::GSE_STRING, 0);
- delete pEntry->pAttr;
+ delete rEntry.pAttr;
SwFmtFld aTmp(aFld);
- pEntry->pAttr = aTmp.Clone();
- pRet = pEntry;
+ rEntry.pAttr = aTmp.Clone();
+ pRet = &rEntry;
}
}
return pRet;
@@ -3315,7 +3316,6 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
}
if ( pForm )
pBase->SetTOXForm( *pForm );
- // <--
}
if (eCreateFrom)
@@ -3358,7 +3358,6 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
aForm.SetTemplate( nLevel,
aOldForm.GetTemplate(nLevel));
}
- // <--
pBase->SetTOXForm( aForm );
}
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index e393472854..357711a4ba 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -619,7 +619,6 @@ void wwSectionManager::SetPageULSpaceItems(SwFrmFmt &rFmt,
const SwTwips nHdLowerSpace( Abs(rSection.maSep.dyaTop) - rData.nSwUp - rData.nSwHLo );
pHdFmt->SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE, 0, rData.nSwHLo + nHdLowerSpace));
aHdUL.SetLower( static_cast< sal_uInt16 >(nHdLowerSpace) );
- // <--
pHdFmt->SetFmtAttr(SwHeaderAndFooterEatSpacingItem(
RES_HEADER_FOOTER_EAT_SPACING, false));
}
@@ -647,7 +646,6 @@ void wwSectionManager::SetPageULSpaceItems(SwFrmFmt &rFmt,
const SwTwips nFtUpperSpace( Abs(rSection.maSep.dyaBottom) - rData.nSwLo - rData.nSwFUp );
pFtFmt->SetFmtAttr(SwFmtFrmSize(ATT_FIX_SIZE, 0, rData.nSwFUp + nFtUpperSpace));
aFtUL.SetUpper( static_cast< sal_uInt16 >(nFtUpperSpace) );
- // <--
pFtFmt->SetFmtAttr(SwHeaderAndFooterEatSpacingItem(
RES_HEADER_FOOTER_EAT_SPACING, false));
}
@@ -1691,10 +1689,11 @@ void WW8FlyPara::ReadFull(sal_uInt8 nOrigSp29, SwWW8ImplReader* pIo)
bGrafApo = false;
do{ // Block zum rausspringen
-
sal_uInt8 nTxt[2];
- pIoStrm->Read( nTxt, 2 ); // lies Text
+ if (!checkRead(*pIoStrm, nTxt, 2)) // lies Text
+ break;
+
if( nTxt[0] != 0x01 || nTxt[1] != 0x0d )// nur Grafik + CR ?
break; // Nein
@@ -1705,7 +1704,8 @@ void WW8FlyPara::ReadFull(sal_uInt8 nOrigSp29, SwWW8ImplReader* pIo)
const sal_uInt8* pS = pPap->HasSprm( bVer67 ? 29 : 0x261B );
// Nein -> Grafik-Apo
- if( !pS ){
+ if (!pS)
+ {
bGrafApo = true;
break; // Ende des APO
}
@@ -2022,7 +2022,6 @@ WW8SwFlyPara::WW8SwFlyPara( SwPaM& rPaM,
nRiMgn = rWW.nRiMgn;
}
else if (rWW.bBorderLines)
- // <--
{
/*
#i582#
@@ -2183,20 +2182,20 @@ WW8DupProperties::WW8DupProperties(SwDoc &rDoc, SwWW8FltControlStack *pStk)
{
//Close any open character properties and duplicate them inside the
//first table cell
- sal_uInt16 nCnt = static_cast< sal_uInt16 >(pCtrlStck->Count());
- for (sal_uInt16 i=0; i < nCnt; i++)
+ size_t nCnt = pCtrlStck->size();
+ for (size_t i=0; i < nCnt; ++i)
{
- const SwFltStackEntry* pEntry = (*pCtrlStck)[ i ];
- if(pEntry->bLocked)
+ const SwFltStackEntry& rEntry = (*pCtrlStck)[ i ];
+ if (rEntry.bOpen)
{
- if (isCHRATR(pEntry->pAttr->Which()))
+ if (isCHRATR(rEntry.pAttr->Which()))
{
- aChrSet.Put( *pEntry->pAttr );
+ aChrSet.Put( *rEntry.pAttr );
}
- else if (isPARATR(pEntry->pAttr->Which()))
+ else if (isPARATR(rEntry.pAttr->Which()))
{
- aParSet.Put( *pEntry->pAttr );
+ aParSet.Put( *rEntry.pAttr );
}
}
}
@@ -2275,7 +2274,12 @@ SwTwips SwWW8ImplReader::MoveOutsideFly(SwFrmFmt *pFlyFmt,
aIdx++;
if (aIdx == aEnd && pNd && !pNd->GetTxt().Len())
{
- rDoc.DelFullPara( *pPaM );
+ //An extra pre-created by writer unused paragraph
+ //
+ //delete after import is complete rather than now
+ //to avoid the complication of managing uncommitted
+ //ctrlstack properties that refer to it.
+ m_aExtraneousParas.push_back(pNd);
SwTable& rTable = pTable->GetTable();
SwFrmFmt* pTblFmt = rTable.GetFrmFmt();
@@ -2440,7 +2444,7 @@ bool SwWW8ImplReader::JoinNode(SwPaM &rPam, bool bStealAttr)
rPam.GetPoint()->nNode = aPref;
rPam.GetPoint()->nContent.Assign(pNode, pNode->GetTxt().Len());
if (bStealAttr)
- pCtrlStck->StealAttr(rPam.GetPoint());
+ pCtrlStck->StealAttr(rPam.GetPoint()->nNode);
pNode->JoinNext();
@@ -2627,14 +2631,12 @@ void SwWW8ImplReader::NewAttr( const SfxPoolItem& rAttr,
const SwNode* pNd = &(pPaM->GetPoint()->nNode.GetNode());
maTxtNodesHavingFirstLineOfstSet.insert( pNd );
}
- // <--
// #i105414#
if ( bLeftIndentSet )
{
const SwNode* pNd = &(pPaM->GetPoint()->nNode.GetNode());
maTxtNodesHavingLeftIndentSet.insert( pNd );
}
- // <--
}
if (mpPostProcessAttrsInfo && mpPostProcessAttrsInfo->mbCopy)
@@ -3173,12 +3175,12 @@ bool SwWW8ImplReader::ConvertSubToGraphicPlacement()
{
SwPaM aRegion(*pPaM->GetPoint());
- SwFltStackEntry aEntry = *((*pCtrlStck)[nPos]);
- aEntry.SetEndPos(*pPaM->GetPoint());
+ SwFltPosition aMkPos((*pCtrlStck)[nPos].m_aMkPos);
+ SwFltPosition aPtPos(*pPaM->GetPoint());
SwFrmFmt *pFlyFmt = 0;
if (
- aEntry.MakeRegion(&rDoc,aRegion,false) &&
+ SwFltStackEntry::MakeRegion(&rDoc,aRegion,false,aMkPos,aPtPos) &&
0 != (pFlyFmt = ContainsSingleInlineGraphic(aRegion))
)
{
@@ -4689,7 +4691,7 @@ void SwWW8ImplReader::Read_Border(sal_uInt16 , const sal_uInt8* , short nLen)
if( pAktColl )
nBorder = ::lcl_ReadBorders(bVer67, aBrcs, 0, pStyles);
else
- nBorder = ::lcl_ReadBorders(bVer67, aBrcs, pPlcxMan->GetPapPLCF());
+ nBorder = ::lcl_ReadBorders(bVer67, aBrcs, pPlcxMan ? pPlcxMan->GetPapPLCF() : NULL);
if( nBorder ) // Border
{
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 3db9bf6b54..3782dfdd71 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -49,7 +49,6 @@
#endif // dump
#include <comphelper/processfactory.hxx>
#include <unotools/localedatawrapper.hxx>
-#include <tools/debug.hxx>
#include <i18npool/lang.h>
#include <editeng/unolingu.hxx>
#include <vcl/svapp.hxx> // Application #i90932#
@@ -910,13 +909,18 @@ void WW8SprmIter::advance()
void WW8SprmIter::UpdateMyMembers()
{
- if (pSprms && nRemLen > (mrSprmParser.getVersion()?1:0))
+ bool bValid = (pSprms && nRemLen >= mrSprmParser.MinSprmLen());
+
+ if (bValid)
{
nAktId = mrSprmParser.GetSprmId(pSprms);
- pAktParams = pSprms + mrSprmParser.DistanceToData(nAktId);
nAktSize = mrSprmParser.GetSprmSize(nAktId, pSprms);
+ pAktParams = pSprms + mrSprmParser.DistanceToData(nAktId);
+ bValid = nAktSize <= nRemLen;
+ OSL_ENSURE(bValid, "sprm longer than remaining bytes");
}
- else
+
+ if (!bValid)
{
nAktId = 0;
pAktParams = 0;
@@ -927,9 +931,9 @@ void WW8SprmIter::UpdateMyMembers()
const sal_uInt8* WW8SprmIter::FindSprm(sal_uInt16 nId)
{
- while(GetSprms())
+ while (GetSprms())
{
- if( GetAktId() == nId )
+ if (GetAktId() == nId)
return GetAktParams(); // SPRM found!
advance();
}
@@ -1311,7 +1315,7 @@ short WW8_BRC::DetermineBorderProperties(bool bVer67, short *pSpace,
case 4:
case 5:
case 22:
- DBG_WARNING("Can't create these from the menus, please report");
+ OSL_FAIL("Can't create these from the menus, please report");
default:
case 23: //Only 3pt in the menus, but honours the size setting.
break;
@@ -1373,9 +1377,14 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
if( nFcPos == WW8_FC_MAX )
return nFallBackCpEnd;
+ bool bIsUnicode;
+ if (pWw8Fib->nVersion >= 8)
+ bIsUnicode = false;
+ else
+ bIsUnicode = pWw8Fib->fExtChar ? true : false;
+
if( pPieceIter ) // Complex File ?
{
- bool bIsUnicode = false;
sal_uLong nOldPos = pPieceIter->GetIdx();
for (pPieceIter->SetIdx(0);
@@ -1389,15 +1398,14 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
break;
}
sal_Int32 nFcStart = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
- if( 8 <= pWw8Fib->nVersion )
+ if (pWw8Fib->nVersion >= 8)
{
nFcStart = WW8PLCFx_PCD::TransformPieceAddress( nFcStart,
bIsUnicode );
}
else
{
- if (pWw8Fib->fExtChar)
- bIsUnicode=true;
+ bIsUnicode = pWw8Fib->fExtChar ? true : false;
}
sal_Int32 nLen = (nCpEnd - nCpStart) * (bIsUnicode ? 2 : 1);
@@ -1432,11 +1440,13 @@ WW8_CP WW8ScannerBase::WW8Fc2Cp( WW8_FC nFcPos ) const
*/
return nFallBackCpEnd;
}
+
// No complex file
- if (!pWw8Fib->fExtChar)
+ if (!bIsUnicode)
nFallBackCpEnd = (nFcPos - pWw8Fib->fcMin);
else
nFallBackCpEnd = (nFcPos - pWw8Fib->fcMin + 1) / 2;
+
return nFallBackCpEnd;
}
@@ -1452,8 +1462,14 @@ WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode,
if( !pIsUnicode )
pIsUnicode = &bIsUnicode;
+ if (pWw8Fib->nVersion >= 8)
+ *pIsUnicode = false;
+ else
+ *pIsUnicode = pWw8Fib->fExtChar ? true : false;
+
if( pPieceIter )
- { // Complex File
+ {
+ // Complex File
if( pNextPieceCp )
*pNextPieceCp = WW8_CP_MAX;
@@ -1481,16 +1497,10 @@ WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode,
*pNextPieceCp = nCpEnd;
WW8_FC nRet = SVBT32ToUInt32( ((WW8_PCD*)pData)->fc );
- if (8 > pWw8Fib->nVersion)
- {
- if (pWw8Fib->fExtChar)
- *pIsUnicode=true;
- else
- *pIsUnicode = false;
- }
- else
+ if (pWw8Fib->nVersion >= 8)
nRet = WW8PLCFx_PCD::TransformPieceAddress( nRet, *pIsUnicode );
-
+ else
+ *pIsUnicode = pWw8Fib->fExtChar ? true : false;
nRet += (nCpPos - nCpStart) * (*pIsUnicode ? 2 : 1);
@@ -1498,10 +1508,6 @@ WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode,
}
// No complex file
- if (pWw8Fib->fExtChar)
- *pIsUnicode = true;
- else
- *pIsUnicode = false;
return pWw8Fib->fcMin + nCpPos * (*pIsUnicode ? 2 : 1);
}
@@ -1512,31 +1518,36 @@ WW8_FC WW8ScannerBase::WW8Cp2Fc(WW8_CP nCpPos, bool* pIsUnicode,
WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF )
{
if ( ((8 > pWw8Fib->nVersion) && !pWwF->fComplex) || !pWwF->lcbClx )
- return 0;
+ return NULL;
WW8_FC nClxPos = pWwF->fcClx;
sal_Int32 nClxLen = pWwF->lcbClx;
sal_Int32 nLeft = nClxLen;
sal_Int16 nGrpprl = 0;
- sal_uInt8 clxt;
- pStr->Seek( nClxPos );
+ if (!checkSeek(*pStr, nClxPos))
+ return NULL;
+
while( 1 ) // Zaehle Zahl der Grpprls
{
+ sal_uInt8 clxt(2);
*pStr >> clxt;
nLeft--;
if( 2 == clxt ) // PLCFfpcd ?
break; // PLCFfpcd gefunden
if( 1 == clxt ) // clxtGrpprl ?
nGrpprl++;
- sal_uInt16 nLen;
+ sal_uInt16 nLen(0);
*pStr >> nLen;
nLeft -= 2 + nLen;
if( nLeft < 0 )
- return 0; // schiefgegangen
+ return NULL; // schiefgegangen
pStr->SeekRel( nLen ); // ueberlies grpprl
}
- pStr->Seek( nClxPos );
+
+ if (!checkSeek(*pStr, nClxPos))
+ return NULL;
+
nLeft = nClxLen;
pPieceGrpprls = new sal_uInt8*[nGrpprl + 1];
memset( pPieceGrpprls, 0, ( nGrpprl + 1 ) * sizeof(sal_uInt8 *) );
@@ -1544,30 +1555,35 @@ WW8PLCFpcd* WW8ScannerBase::OpenPieceTable( SvStream* pStr, const WW8Fib* pWwF )
sal_Int16 nAktGrpprl = 0; // lies Grpprls ein
while( 1 )
{
+ sal_uInt8 clxt(2);
*pStr >> clxt;
nLeft--;
if( 2 == clxt) // PLCFfpcd ?
break; // PLCFfpcd gefunden
- sal_uInt16 nLen;
+ sal_uInt16 nLen(0);
*pStr >> nLen;
nLeft -= 2 + nLen;
if( nLeft < 0 )
- return 0; // schiefgegangen
+ return NULL; // schiefgegangen
if( 1 == clxt ) // clxtGrpprl ?
{
sal_uInt8* p = new sal_uInt8[nLen+2]; // alloziere
ShortToSVBT16(nLen, p); // trage Laenge ein
- pStr->Read( p+2, nLen ); // lies grpprl
+ if (!checkRead(*pStr, p+2, nLen)) // lies grpprl
+ {
+ delete[] p;
+ return NULL;
+ }
pPieceGrpprls[nAktGrpprl++] = p; // trage in Array ein
}
else
pStr->SeekRel( nLen ); // ueberlies nicht-Grpprl
}
// lies Piece Table PLCF ein
- sal_Int32 nPLCFfLen;
+ sal_Int32 nPLCFfLen(0);
if (pWwF->GetFIBVersion() <= ww::eWW2)
{
- sal_Int16 nWordTwoLen;
+ sal_Int16 nWordTwoLen(0);
*pStr >> nWordTwoLen;
nPLCFfLen = nWordTwoLen;
}
@@ -1589,7 +1605,7 @@ void WW8ScannerBase::DeletePieceTable()
}
WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTblSt,
- SvStream* pDataSt, const WW8Fib* pWwFib )
+ SvStream* pDataSt, WW8Fib* pWwFib )
: pWw8Fib(pWwFib), pMainFdoa(0), pHdFtFdoa(0), pMainTxbx(0),
pMainTxbxBkd(0), pHdFtTxbx(0), pHdFtTxbxBkd(0), pMagicTables(0),
pSubdocs(0), pExtendedAtrds(0), pPieceGrpprls(0)
@@ -1695,14 +1711,19 @@ WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTblSt,
pSubdocs = new WW8PLCFspecial( pTblSt,
pWwFib->fcPlcfwkb, pWwFib->lcbPlcfwkb, 12);
}
- // Extended ATRD
+ // Extended ATRD
if (pWwFib->fcAtrdExtra && pWwFib->lcbAtrdExtra)
{
- pExtendedAtrds = new sal_uInt8[pWwFib->lcbAtrdExtra];
- long nOldPos = pTblSt->Tell();
- pTblSt->Seek(pWwFib->fcAtrdExtra);
- pTblSt->Read(pExtendedAtrds, pWwFib->lcbAtrdExtra);
- pTblSt->Seek(nOldPos);
+ sal_Size nOldPos = pTblSt->Tell();
+ if (checkSeek(*pTblSt, pWwFib->fcAtrdExtra))
+ {
+ pExtendedAtrds = new sal_uInt8[pWwFib->lcbAtrdExtra];
+ pWwFib->lcbAtrdExtra = pTblSt->Read(pExtendedAtrds,
+ pWwFib->lcbAtrdExtra);
+ }
+ else
+ pWwFib->lcbAtrdExtra = 0;
+ pTblSt->Seek(nOldPos);
}
break;
@@ -1712,7 +1733,7 @@ WW8ScannerBase::WW8ScannerBase( SvStream* pSt, SvStream* pTblSt,
}
// PLCF fuer TextBox-Stories im Maintext
- long nLenTxBxS = (8 > pWw8Fib->nVersion) ? 0 : 22;
+ sal_uInt32 nLenTxBxS = (8 > pWw8Fib->nVersion) ? 0 : 22;
if( pWwFib->fcPlcftxbxTxt && pWwFib->lcbPlcftxbxTxt )
{
pMainTxbx = new WW8PLCFspecial( pTblSt, pWwFib->fcPlcftxbxTxt,
@@ -1773,7 +1794,7 @@ static bool WW8SkipField(WW8PLCFspecial& rPLCF)
if (!rPLCF.Get(nP, pData)) // Ende des PLCFspecial ?
return false;
- rPLCF++;
+ rPLCF.advance();
if((((sal_uInt8*)pData)[0] & 0x1f ) != 0x13 ) // Kein Anfang ?
return true; // Bei Fehler nicht abbrechen
@@ -1794,7 +1815,7 @@ static bool WW8SkipField(WW8PLCFspecial& rPLCF)
{
// Field Separator ?
- rPLCF++;
+ rPLCF.advance();
if( !rPLCF.Get( nP, pData ) )
return false;
@@ -1807,7 +1828,7 @@ static bool WW8SkipField(WW8PLCFspecial& rPLCF)
return false;
}
}
- rPLCF++;
+ rPLCF.advance();
return true;
}
@@ -1822,7 +1843,7 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
if( !rPLCF.Get( rF.nSCode, pData ) ) // Ende des PLCFspecial ?
goto Err;
- rPLCF++;
+ rPLCF.advance();
if((((sal_uInt8*)pData)[0] & 0x1f ) != 0x13 ) // Kein Anfang ?
goto Err;
@@ -1845,8 +1866,9 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
goto Err;
}
- if((((sal_uInt8*)pData)[0] & 0x1f ) == 0x14 ){ // Field Separator ?
- rPLCF++;
+ if ((((sal_uInt8*)pData)[0] & 0x1f ) == 0x14 ) // Field Separator ?
+ {
+ rPLCF.advance();
if( !rPLCF.Get( rF.nLRes, pData ) )
goto Err;
@@ -1869,7 +1891,7 @@ static bool WW8GetFieldPara(WW8PLCFspecial& rPLCF, WW8FieldDesc& rF)
rF.nLen = rF.nSRes - rF.nSCode + 2; // Gesamtlaenge
}
- rPLCF++;
+ rPLCF.advance();
if((((sal_uInt8*)pData)[0] & 0x1f ) == 0x15 )
{
// Field Ende ?
@@ -2018,19 +2040,28 @@ xub_StrLen WW8ScannerBase::WW8ReadString( SvStream& rStrm, String& rStr,
// WW8PLCFspecial
//-----------------------------------------
-// Bei nStartPos < 0 wird das erste Element des PLCFs genommen
-WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, long nFilePos, long nPLCF,
- long nStruct, long nStartPos)
+WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos,
+ sal_uInt32 nPLCF, sal_uInt32 nStruct)
: nIdx(0), nStru(nStruct)
{
- nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
+ const sal_uInt32 nValidMin=4;
+
+ sal_Size nOldPos = pSt->Tell();
+ sal_Size nRemainingSize = pSt->remainingSize();
+
+ bool bValid = checkSeek(*pSt, nFilePos) && (nRemainingSize >= nValidMin) &&
+ (nPLCF >= nValidMin);
+ nPLCF = bValid ? std::min(nRemainingSize, static_cast<sal_Size>(nPLCF)) : nValidMin;
+
// Pointer auf Pos- u. Struct-Array
pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ];
+ pPLCF_PosArray[0] = 0;
+
+ nPLCF = bValid ? pSt->Read(pPLCF_PosArray, nPLCF) : nValidMin;
- long nOldPos = pSt->Tell();
+ nPLCF = std::max(nPLCF, nValidMin);
- pSt->Seek( nFilePos );
- pSt->Read( pPLCF_PosArray, nPLCF );
+ nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
#ifdef OSL_BIGENDIAN
for( nIdx = 0; nIdx <= nIMax; nIdx++ )
pPLCF_PosArray[nIdx] = SWAPLONG( pPLCF_PosArray[nIdx] );
@@ -2040,10 +2071,8 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, long nFilePos, long nPLCF,
pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
else
pPLCF_Contents = 0; // kein Inhalt
- if( nStartPos >= 0 )
- SeekPos( nStartPos );
- pSt->Seek( nOldPos );
+ pSt->Seek(nOldPos);
}
// WW8PLCFspecial::SeekPos() stellt den WW8PLCFspecial auf die Stelle nPos, wobei auch noch der
@@ -2140,14 +2169,14 @@ bool WW8PLCFspecial::GetData(long nInIdx, WW8_CP& rPos, void*& rpValue) const
// Ctor fuer *andere* als Fkps
// Bei nStartPos < 0 wird das erste Element des PLCFs genommen
-WW8PLCF::WW8PLCF( SvStream* pSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
- WW8_CP nStartPos ) : pPLCF_PosArray(0), nIdx(0), nStru(nStruct)
+WW8PLCF::WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
+ WW8_CP nStartPos) : pPLCF_PosArray(0), nIdx(0), nStru(nStruct)
{
OSL_ENSURE( nPLCF, "WW8PLCF: nPLCF ist Null!" );
nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
- ReadPLCF( pSt, nFilePos, nPLCF );
+ ReadPLCF(rSt, nFilePos, nPLCF);
if( nStartPos >= 0 )
SeekPos( nStartPos );
@@ -2158,40 +2187,36 @@ WW8PLCF::WW8PLCF( SvStream* pSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
// != 0, dann wird ein unvollstaendiger PLCF vervollstaendigt. Das ist bei
// WW6 bei Resourcenmangel und bei WordPad (W95) immer noetig. Bei nStartPos
// < 0 wird das erste Element des PLCFs genommen
-WW8PLCF::WW8PLCF( SvStream* pSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
- WW8_CP nStartPos, sal_Int32 nPN, sal_Int32 ncpN ) : pPLCF_PosArray(0), nIdx(0),
+WW8PLCF::WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
+ WW8_CP nStartPos, sal_Int32 nPN, sal_Int32 ncpN): pPLCF_PosArray(0), nIdx(0),
nStru(nStruct)
{
nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
if( nIMax >= ncpN )
- ReadPLCF( pSt, nFilePos, nPLCF );
+ ReadPLCF(rSt, nFilePos, nPLCF);
else
- GeneratePLCF( pSt, nPN, ncpN );
+ GeneratePLCF(rSt, nPN, ncpN);
if( nStartPos >= 0 )
SeekPos( nStartPos );
}
-void WW8PLCF::ReadPLCF( SvStream* pSt, WW8_FC nFilePos, sal_Int32 nPLCF )
+void WW8PLCF::ReadPLCF(SvStream& rSt, WW8_FC nFilePos, sal_uInt32 nPLCF)
{
- bool failure = false;
-
- // Pointer auf Pos-Array
- pPLCF_PosArray = new WW8_CP[ ( nPLCF + 3 ) / 4 ];
+ sal_Size nOldPos = rSt.Tell();
+ sal_Size nRemainingSize = rSt.remainingSize();
- sal_Size nOldPos = pSt->Tell();
-
- pSt->Seek( nFilePos );
- failure = pSt->GetError();
+ bool bValid = checkSeek(rSt, nFilePos) && (nRemainingSize >= nPLCF);
- if (!failure)
+ if (bValid)
{
- pSt->Read( pPLCF_PosArray, nPLCF );
- failure = pSt->GetError();
+ // Pointer auf Pos-Array
+ pPLCF_PosArray = new WW8_CP[ ( nPLCF + 3 ) / 4 ];
+ bValid = checkRead(rSt, pPLCF_PosArray, nPLCF);
}
- if (!failure)
+ if (bValid)
{
#ifdef OSL_BIGENDIAN
for( nIdx = 0; nIdx <= nIMax; nIdx++ )
@@ -2202,12 +2227,12 @@ void WW8PLCF::ReadPLCF( SvStream* pSt, WW8_FC nFilePos, sal_Int32 nPLCF )
pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
}
- pSt->Seek( nOldPos );
-
- OSL_ENSURE( !failure, "Document has corrupt PLCF, ignoring it" );
+ OSL_ENSURE(bValid, "Document has corrupt PLCF, ignoring it");
- if (failure)
+ if (!bValid)
MakeFailedPLCF();
+
+ rSt.Seek(nOldPos);
}
void WW8PLCF::MakeFailedPLCF()
@@ -2219,7 +2244,7 @@ void WW8PLCF::MakeFailedPLCF()
pPLCF_Contents = (sal_uInt8*)&pPLCF_PosArray[nIMax + 1];
}
-void WW8PLCF::GeneratePLCF( SvStream* pSt, sal_Int32 nPN, sal_Int32 ncpN )
+void WW8PLCF::GeneratePLCF(SvStream& rSt, sal_Int32 nPN, sal_Int32 ncpN)
{
OSL_ENSURE( nIMax < ncpN, "Pcl.Fkp: Warum ist PLCF zu gross ?" );
@@ -2235,32 +2260,43 @@ void WW8PLCF::GeneratePLCF( SvStream* pSt, sal_Int32 nPN, sal_Int32 ncpN )
size_t nElems = ( nSiz + 3 ) / 4;
pPLCF_PosArray = new sal_Int32[ nElems ]; // Pointer auf Pos-Array
- for (sal_Int32 i = 0; i < ncpN && !pSt->GetError(); ++i)
+ for (sal_Int32 i = 0; i < ncpN && !failure; ++i)
{
+ failure = true;
// Baue FC-Eintraege
- pSt->Seek( ( nPN + i ) << 9 ); // erster FC-Eintrag jedes Fkp
- WW8_CP nFc;
- *pSt >> nFc;
+ // erster FC-Eintrag jedes Fkp
+ if (checkSeek(rSt, ( nPN + i ) << 9 ))
+ continue;
+ WW8_CP nFc(0);
+ rSt >> nFc;
pPLCF_PosArray[i] = nFc;
+ failure = rSt.GetError();
}
-
- failure = pSt->GetError();
}
if (!failure)
{
- sal_Size nLastFkpPos = ( ( nPN + nIMax - 1 ) << 9 );
- pSt->Seek( nLastFkpPos + 511 ); // Anz. Fkp-Eintraege des letzten Fkp
+ do
+ {
+ failure = true;
- sal_uInt8 nb;
- *pSt >> nb;
- pSt->Seek( nLastFkpPos + nb * 4 ); // letzer FC-Eintrag des letzten Fkp
+ sal_Size nLastFkpPos = ( ( nPN + nIMax - 1 ) << 9 );
+ // Anz. Fkp-Eintraege des letzten Fkp
+ if (!checkSeek(rSt, nLastFkpPos + 511))
+ break;
+
+ sal_uInt8 nb(0);
+ rSt >> nb;
+ // letzer FC-Eintrag des letzten Fkp
+ if (!checkSeek(rSt, nLastFkpPos + nb * 4))
+ break;
- WW8_CP nFc;
- *pSt >> nFc;
- pPLCF_PosArray[nIMax] = nFc; // Ende des letzten Fkp
+ WW8_CP nFc(0);
+ rSt >> nFc;
+ pPLCF_PosArray[nIMax] = nFc; // Ende des letzten Fkp
- failure = pSt->GetError();
+ failure = rSt.GetError();
+ } while(0);
}
if (!failure)
@@ -2343,16 +2379,26 @@ WW8_CP WW8PLCF::Where() const
// WW8PLCFpcd
//-----------------------------------------
-WW8PLCFpcd::WW8PLCFpcd( SvStream* pSt, long nFilePos, long nPLCF, long nStruct )
- :nStru( nStruct )
+WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos,
+ sal_uInt32 nPLCF, sal_uInt32 nStruct)
+ : nStru( nStruct )
{
- nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
+ const sal_uInt32 nValidMin=4;
+
+ sal_Size nOldPos = pSt->Tell();
+ sal_Size nRemainingSize = pSt->remainingSize();
+
+ bool bValid = checkSeek(*pSt, nFilePos) && (nRemainingSize >= nValidMin) &&
+ (nPLCF >= nValidMin);
+ nPLCF = bValid ? std::min(nRemainingSize, static_cast<sal_Size>(nPLCF)) : nValidMin;
+
pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ]; // Pointer auf Pos-Array
+ pPLCF_PosArray[0] = 0;
- long nOldPos = pSt->Tell();
+ nPLCF = bValid ? pSt->Read(pPLCF_PosArray, nPLCF) : nValidMin;
+ nPLCF = std::max(nPLCF, nValidMin);
- pSt->Seek( nFilePos );
- pSt->Read( pPLCF_PosArray, nPLCF );
+ nIMax = ( nPLCF - 4 ) / ( 4 + nStruct );
#ifdef OSL_BIGENDIAN
for( long nI = 0; nI <= nIMax; nI++ )
pPLCF_PosArray[nI] = SWAPLONG( pPLCF_PosArray[nI] );
@@ -2443,26 +2489,64 @@ bool IsExpandableSprm(sal_uInt16 nSpId)
return 0x646B == nSpId;
}
+void WW8PLCFx_Fc_FKP::WW8Fkp::FillEntry(WW8PLCFx_Fc_FKP::WW8Fkp::Entry &rEntry,
+ sal_Size nDataOffset, sal_uInt16 nLen)
+{
+ bool bValidPos = (nDataOffset < sizeof(maRawData));
+
+ OSL_ENSURE(bValidPos, "sprm sequence offset is out of range, ignoring");
+
+ if (!bValidPos)
+ {
+ rEntry.mnLen = 0;
+ return;
+ }
+
+ sal_uInt16 nAvailableData = sizeof(maRawData)-nDataOffset;
+ OSL_ENSURE(nLen <= nAvailableData, "srpm sequence len is out of range, clipping");
+ rEntry.mnLen = std::min(nLen, nAvailableData);
+ rEntry.mpData = maRawData + nDataOffset;
+}
+
WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt,
SvStream* pDataSt, long _nFilePos, long nItemSiz, ePLCFT ePl,
WW8_FC nStartFc)
: nItemSize(nItemSiz), nFilePos(_nFilePos), mnIdx(0), ePLCF(ePl),
maSprmParser(eVersion)
{
- long nOldPos = pSt->Tell();
-
- pSt->Seek(nFilePos);
memset(maRawData, 0, 512);
- pSt->Read(maRawData, 512);
- mnIMax = maRawData[511];
+
+ sal_Size nOldPos = pSt->Tell();
+
+ bool bCouldSeek = checkSeek(*pSt, nFilePos);
+ bool bCouldRead = bCouldSeek ? checkRead(*pSt, maRawData, 512) : false;
+
+ mnIMax = bCouldRead ? maRawData[511] : 0;
sal_uInt8 *pStart = maRawData;
- // Pointer to Offset-Location in maRawData
- sal_uInt8* pOfs = maRawData + (mnIMax + 1) * 4;
+ // Offset-Location in maRawData
+ const size_t nRawDataStart = (mnIMax + 1) * 4;
for (mnIdx = 0; mnIdx < mnIMax; ++mnIdx)
{
- unsigned int nOfs = (*(pOfs + mnIdx * nItemSize)) * 2;
+ const size_t nRawDataOffset = nRawDataStart + mnIdx * nItemSize;
+
+ //clip to available data, corrupt fkp
+ if (nRawDataOffset >= 511)
+ {
+ mnIMax = mnIdx;
+ break;
+ }
+
+ unsigned int nOfs = maRawData[nRawDataOffset] * 2;
+
+ //clip to available data, corrupt fkp
+ if (nOfs >= 511)
+ {
+ mnIMax = mnIdx;
+ break;
+ }
+
Entry aEntry(Get_Long(pStart));
if (nOfs)
@@ -2470,8 +2554,13 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt,
switch (ePLCF)
{
case CHP:
- aEntry.mnLen = maRawData[nOfs];
- aEntry.mpData = maRawData + nOfs + 1;
+ {
+ aEntry.mnLen = maRawData[nOfs];
+
+ //len byte
+ sal_Size nDataOffset = nOfs + 1;
+
+ FillEntry(aEntry, nDataOffset, aEntry.mnLen);
if (aEntry.mnLen && eVersion == ww::eWW2)
{
@@ -2485,8 +2574,8 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt,
aEntry.mbMustDelete = true;
}
}
-
break;
+ }
case PAP:
{
sal_uInt8 nDelta = 0;
@@ -2520,10 +2609,18 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt,
{
if (aEntry.mnLen >= 2)
{
- aEntry.mnIStd = SVBT16ToShort(maRawData+nOfs+1+nDelta);
+ //len byte + optional extra len byte
+ sal_Size nDataOffset = nOfs + 1 + nDelta;
+ aEntry.mnIStd = nDataOffset <= sizeof(maRawData)-sizeof(aEntry.mnIStd) ?
+ SVBT16ToShort(maRawData+nDataOffset) : 0;
aEntry.mnLen-=2; //istd
- //skip istd, len byte + optional extra len byte
- aEntry.mpData = maRawData + nOfs + 3 + nDelta;
+ if (aEntry.mnLen)
+ {
+ //additional istd
+ nDataOffset += sizeof(aEntry.mnIStd);
+
+ FillEntry(aEntry, nDataOffset, aEntry.mnLen);
+ }
}
else
aEntry.mnLen=0; //Too short, ignore
@@ -2539,26 +2636,28 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt,
bool bExpand = IsExpandableSprm(nSpId);
if (IsReplaceAllSprm(nSpId) || bExpand)
{
- sal_uInt16 nOrigLen = bExpand ? aEntry.mnLen : 0;
- sal_uInt8 *pOrigData = bExpand ? aEntry.mpData : 0;
-
sal_uInt32 nCurr = pDataSt->Tell();
-
sal_uInt32 nPos = SVBT32ToUInt32(aEntry.mpData + 2);
- pDataSt->Seek(nPos);
- *pDataSt >> aEntry.mnLen;
- aEntry.mpData =
- new sal_uInt8[aEntry.mnLen + nOrigLen];
- aEntry.mbMustDelete = true;
- pDataSt->Read(aEntry.mpData, aEntry.mnLen);
+ if (checkSeek(*pDataSt, nPos))
+ {
+ sal_uInt16 nOrigLen = bExpand ? aEntry.mnLen : 0;
+ sal_uInt8 *pOrigData = bExpand ? aEntry.mpData : 0;
- pDataSt->Seek( nCurr );
+ *pDataSt >> aEntry.mnLen;
+ aEntry.mpData =
+ new sal_uInt8[aEntry.mnLen + nOrigLen];
+ aEntry.mbMustDelete = true;
+ aEntry.mnLen =
+ pDataSt->Read(aEntry.mpData, aEntry.mnLen);
- if (pOrigData)
- {
- memcpy(aEntry.mpData + aEntry.mnLen,
- pOrigData, nOrigLen);
- aEntry.mnLen = aEntry.mnLen + nOrigLen;
+ pDataSt->Seek( nCurr );
+
+ if (pOrigData)
+ {
+ memcpy(aEntry.mpData + aEntry.mnLen,
+ pOrigData, nOrigLen);
+ aEntry.mnLen = aEntry.mnLen + nOrigLen;
+ }
}
}
}
@@ -2577,8 +2676,11 @@ WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(ww::WordVersion eVersion, SvStream* pSt,
sal_uInt8* pSprms = GetLenAndIStdAndSprms( nLen );
WW8SprmIter aIter(pSprms, nLen, maSprmParser);
- while(aIter.GetSprms())
+ while (aIter.GetSprms())
+ {
+ fprintf(stderr, "id is %x\n", aIter.GetAktId());
aIter.advance();
+ }
}
#endif
}
@@ -2870,12 +2972,12 @@ WW8PLCFx_Fc_FKP::WW8PLCFx_Fc_FKP(SvStream* pSt, SvStream* pTblSt,
long nLenStruct = (8 > rFib.nVersion) ? 2 : 4;
if (ePl == CHP)
{
- pPLCF = new WW8PLCF(pTblSt, rFib.fcPlcfbteChpx, rFib.lcbPlcfbteChpx,
+ pPLCF = new WW8PLCF(*pTblSt, rFib.fcPlcfbteChpx, rFib.lcbPlcfbteChpx,
nLenStruct, GetStartFc(), rFib.pnChpFirst, rFib.cpnBteChp);
}
else
{
- pPLCF = new WW8PLCF(pTblSt, rFib.fcPlcfbtePapx, rFib.lcbPlcfbtePapx,
+ pPLCF = new WW8PLCF(*pTblSt, rFib.fcPlcfbtePapx, rFib.lcbPlcfbtePapx,
nLenStruct, GetStartFc(), rFib.pnPapFirst, rFib.cpnBtePap);
}
}
@@ -2999,7 +3101,7 @@ void WW8PLCFx_Fc_FKP::GetPCDSprms( WW8PLCFxDesc& rDesc )
{
if( !pFkp )
{
- DBG_WARNING(
+ OSL_FAIL(
"+Problem: GetPCDSprms: NewFkp necessay (not possible!)" );
if( !NewFkp() )
return;
@@ -3014,7 +3116,7 @@ const sal_uInt8* WW8PLCFx_Fc_FKP::HasSprm( sal_uInt16 nId )
// wegfallen
if( !pFkp )
{
- DBG_WARNING( "+Motz: HasSprm: NewFkp noetig ( kein const moeglich )" );
+ OSL_FAIL( "+Motz: HasSprm: NewFkp noetig ( kein const moeglich )" );
// Passiert bei BugDoc 31722
if( !NewFkp() )
return 0;
@@ -3044,7 +3146,7 @@ bool WW8PLCFx_Fc_FKP::HasSprm(sal_uInt16 nId, std::vector<const sal_uInt8 *> &rR
// wegfallen
if (!pFkp)
{
- DBG_WARNING( "+Motz: HasSprm: NewFkp noetig ( kein const moeglich )" );
+ OSL_FAIL( "+Motz: HasSprm: NewFkp noetig ( kein const moeglich )" );
// Passiert bei BugDoc 31722
if( !NewFkp() )
return 0;
@@ -3299,8 +3401,14 @@ void WW8PLCFx_Cp_FKP::GetSprms(WW8PLCFxDesc* p)
if (nSmallest <= nLimitFC)
{
- p->nEndPos = nCpEnd -
+ WW8_CP nEndPos = nCpEnd -
(nLimitFC-nSmallest) / (bIsUnicode ? 2 : 1);
+
+ OSL_ENSURE(nEndPos >= p->nStartPos, "EndPos before StartPos");
+
+ if (nEndPos >= p->nStartPos)
+ p->nEndPos = nEndPos;
+
break;
}
}
@@ -3357,7 +3465,7 @@ WW8PLCFx_SEPX::WW8PLCFx_SEPX(SvStream* pSt, SvStream* pTblSt,
pStrm(pSt), nArrMax(256), nSprmSiz(0)
{
pPLCF = rFib.lcbPlcfsed
- ? new WW8PLCF(pTblSt, rFib.fcPlcfsed, rFib.lcbPlcfsed,
+ ? new WW8PLCF(*pTblSt, rFib.fcPlcfsed, rFib.lcbPlcfsed,
GetFIBVersion() <= ww::eWW2 ? 6 : 12, nStartCp)
: 0;
@@ -3432,7 +3540,7 @@ void WW8PLCFx_SEPX::GetSprms(WW8PLCFxDesc* p)
nArrMax = nSprmSiz; // Hole mehr Speicher
pSprms = new sal_uInt8[nArrMax];
}
- pStrm->Read( pSprms, nSprmSiz ); // read Sprms
+ nSprmSiz = pStrm->Read(pSprms, nSprmSiz); // read Sprms
p->nSprmsLen = nSprmSiz;
p->pMemPos = pSprms; // return Position
@@ -3537,8 +3645,8 @@ WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, ww::WordVersion eVersion,
{
if( nLenRef && nLenTxt )
{
- pRef = new WW8PLCF( pSt, nFcRef, nLenRef, nStruct, nStartCp );
- pTxt = new WW8PLCF( pSt, nFcTxt, nLenTxt, 0, nStartCp );
+ pRef = new WW8PLCF(*pSt, nFcRef, nLenRef, nStruct, nStartCp);
+ pTxt = new WW8PLCF(*pSt, nFcTxt, nLenTxt, 0, nStartCp);
}
}
@@ -3714,7 +3822,7 @@ bool WW8PLCFx_FLD::EndPosIsFieldEnd()
{
long n = pPLCF->GetIdx();
- (*pPLCF)++;
+ pPLCF->advance();
void* pData;
sal_Int32 nTest;
@@ -3752,7 +3860,7 @@ void WW8PLCFx_FLD::GetSprms(WW8PLCFxDesc* p)
p->nStartPos = nP;
- (*pPLCF)++;
+ pPLCF->advance();
if (!pPLCF->Get(nP, pData)) // Ende des PLCFspecial ?
{
p->nStartPos = WW8_CP_MAX; // PLCF fertig abgearbeitet
@@ -3768,7 +3876,7 @@ void WW8PLCFx_FLD::GetSprms(WW8PLCFxDesc* p)
WW8PLCFx& WW8PLCFx_FLD::operator ++( int )
{
- (*pPLCF)++;
+ pPLCF->advance();
return *this;
}
@@ -3796,122 +3904,126 @@ void WW8ReadSTTBF(bool bVer8, SvStream& rStrm, sal_uInt32 nStart, sal_Int32 nLen
sal_uInt16 nExtraLen, rtl_TextEncoding eCS, std::vector<String> &rArray,
std::vector<ww::bytes>* pExtraArray, ::std::vector<String>* pValueArray)
{
- if(nLen==0) // Handle Empty STTBF
+ if (nLen==0) // Handle Empty STTBF
return;
- sal_uLong nOldPos = rStrm.Tell();
- rStrm.Seek( nStart );
-
- sal_uInt16 nLen2;
- rStrm >> nLen2; // bVer67: total length of structure
- // bVer8 : count of strings
-
- if( bVer8 )
+ sal_Size nOldPos = rStrm.Tell();
+ if (checkSeek(rStrm, nStart))
{
- sal_uInt16 nStrings;
- bool bUnicode = (0xFFFF == nLen2);
- if( bUnicode )
- rStrm >> nStrings;
- else
- nStrings = nLen2;
+ sal_uInt16 nLen2(0);
+ rStrm >> nLen2; // bVer67: total length of structure
+ // bVer8 : count of strings
- rStrm >> nExtraLen;
-
- for( sal_uInt16 i=0; i < nStrings; i++ )
+ if( bVer8 )
{
- if( bUnicode )
- rArray.push_back(WW8Read_xstz(rStrm, 0, false));
+ sal_uInt16 nStrings(0);
+ bool bUnicode = (0xFFFF == nLen2);
+ if (bUnicode)
+ rStrm >> nStrings;
else
- {
- sal_uInt8 nBChar;
- rStrm >> nBChar;
- ByteString aTmp;
- SafeReadString(aTmp,nBChar,rStrm);
- rArray.push_back(String(aTmp, eCS));
- }
+ nStrings = nLen2;
+
+ rStrm >> nExtraLen;
- // Skip the extra data
- if( nExtraLen )
+ for (sal_uInt16 i=0; i < nStrings; ++i)
{
- if (pExtraArray)
+ if (bUnicode)
+ rArray.push_back(WW8Read_xstz(rStrm, 0, false));
+ else
+ {
+ sal_uInt8 nBChar(0);
+ rStrm >> nBChar;
+ ByteString aTmp;
+ SafeReadString(aTmp,nBChar,rStrm);
+ rArray.push_back(String(aTmp, eCS));
+ }
+
+ // Skip the extra data
+ if (nExtraLen)
{
- ww::bytes extraData;
- sal_uInt8 iTmp;
- for(int j = 0; j < nExtraLen; ++j)
+ if (pExtraArray)
{
- rStrm >> iTmp;
- extraData.push_back(iTmp);
+ ww::bytes extraData;
+ for (sal_uInt16 j = 0; j < nExtraLen; ++j)
+ {
+ sal_uInt8 iTmp(0);
+ rStrm >> iTmp;
+ extraData.push_back(iTmp);
+ }
+ pExtraArray->push_back(extraData);
}
- pExtraArray->push_back(extraData);
+ else
+ rStrm.SeekRel( nExtraLen );
}
- else
- rStrm.SeekRel( nExtraLen );
}
- }
- // read the value of the document variables, if requested.
- if (pValueArray)
- {
- for( sal_uInt16 i=0; i < nStrings; i++ )
+ // read the value of the document variables, if requested.
+ if (pValueArray)
+ {
+ for (sal_uInt16 i=0; i < nStrings; ++i)
{
- if( bUnicode )
- pValueArray->push_back(WW8Read_xstz(rStrm, 0, false));
- else
- {
- sal_uInt8 nBChar;
- rStrm >> nBChar;
- ByteString aTmp;
- SafeReadString(aTmp,nBChar,rStrm);
- pValueArray->push_back(String(aTmp, eCS));
- }
+ if( bUnicode )
+ pValueArray->push_back(WW8Read_xstz(rStrm, 0, false));
+ else
+ {
+ sal_uInt8 nBChar(0);
+ rStrm >> nBChar;
+ ByteString aTmp;
+ SafeReadString(aTmp,nBChar,rStrm);
+ pValueArray->push_back(String(aTmp, eCS));
+ }
}
+ }
}
- }
- else
- {
- sal_uInt8 nBChar;
- if( nLen2 != nLen )
- {
- OSL_ENSURE( nLen2 == nLen, "Fib length and read length are different" );
- if (nLen > USHRT_MAX)
- nLen = USHRT_MAX;
- else if (nLen < 2 )
- nLen = 2;
- nLen2 = static_cast<sal_uInt16>(nLen);
- }
- sal_uLong nRead = 0;
- for( nLen2 -= 2; nRead < nLen2; )
+ else
{
- rStrm >> nBChar; ++nRead;
- if (nBChar)
+ if( nLen2 != nLen )
{
- ByteString aTmp;
- nRead += SafeReadString(aTmp,nBChar,rStrm);
- rArray.push_back(String(aTmp, eCS));
+ OSL_ENSURE(nLen2 == nLen,
+ "Fib length and read length are different");
+ if (nLen > USHRT_MAX)
+ nLen = USHRT_MAX;
+ else if (nLen < 2 )
+ nLen = 2;
+ nLen2 = static_cast<sal_uInt16>(nLen);
}
- else
- rArray.push_back(aEmptyStr);
-
- // Skip the extra data (for bVer67 versions this must come from external knowledge)
- if (nExtraLen)
+ sal_uLong nRead = 0;
+ for( nLen2 -= 2; nRead < nLen2; )
{
- if (pExtraArray)
+ sal_uInt8 nBChar(0);
+ rStrm >> nBChar;
+ ++nRead;
+ if (nBChar)
{
- ww::bytes extraData;
- for(int i =0;i < nExtraLen;i++)
+ ByteString aTmp;
+ nRead += SafeReadString(aTmp,nBChar,rStrm);
+ rArray.push_back(String(aTmp, eCS));
+ }
+ else
+ rArray.push_back(aEmptyStr);
+
+ // Skip the extra data (for bVer67 versions this must come from
+ // external knowledge)
+ if (nExtraLen)
+ {
+ if (pExtraArray)
{
- sal_uInt8 iTmp;
- rStrm >> iTmp;
- extraData.push_back(iTmp);
+ ww::bytes extraData;
+ for (sal_uInt16 i=0;i < nExtraLen;++i)
+ {
+ sal_uInt8 iTmp(0);
+ rStrm >> iTmp;
+ extraData.push_back(iTmp);
+ }
+ pExtraArray->push_back(extraData);
}
- pExtraArray->push_back(extraData);
+ else
+ rStrm.SeekRel( nExtraLen );
+ nRead+=nExtraLen;
}
- else
- rStrm.SeekRel( nExtraLen );
- nRead+=nExtraLen;
}
}
}
- rStrm.Seek( nOldPos );
+ rStrm.Seek(nOldPos);
}
WW8PLCFx_Book::WW8PLCFx_Book(SvStream* pTblSt, const WW8Fib& rFib)
@@ -4026,7 +4138,7 @@ WW8PLCFx& WW8PLCFx_Book::operator ++( int )
{
if( pBook[0] && pBook[1] && nIMax )
{
- (*pBook[nIsEnd])++;
+ (*pBook[nIsEnd]).advance();
sal_uLong l0 = pBook[0]->Where();
sal_uLong l1 = pBook[1]->Where();
@@ -4278,7 +4390,7 @@ void WW8PLCFMan::GetNewNoSprms( WW8PLCFxDesc& rDesc )
sal_uInt16 WW8PLCFMan::GetId(const WW8PLCFxDesc* p) const
{
- sal_uInt16 nId;
+ sal_uInt16 nId = 0; // Id = 0 for empty attributes
if (p == pFld)
nId = eFLD;
@@ -4288,10 +4400,8 @@ sal_uInt16 WW8PLCFMan::GetId(const WW8PLCFxDesc* p) const
nId = eEDN;
else if (p == pAnd)
nId = eAND;
- else if (p->nSprmsLen > 0)
+ else if (p->nSprmsLen >= maSprmParser.MinSprmLen())
nId = maSprmParser.GetSprmId(p->pMemPos);
- else
- nId = 0; // Id = 0 for empty attributes
return nId;
}
@@ -4589,7 +4699,7 @@ void WW8PLCFMan::GetSprmStart( short nIdx, WW8PLCFManResult* pRes ) const
pRes->nCp2OrIdx = p->nCp2OrIdx;
if ((p == pFtn) || (p == pEdn) || (p == pAnd))
pRes->nMemLen = p->nSprmsLen;
- else if (p->nSprmsLen) //Normal
+ else if (p->nSprmsLen >= maSprmParser.MinSprmLen()) //Normal
{
// Length of actual sprm
pRes->nMemLen = maSprmParser.GetSprmSize(pRes->nSprmId, pRes->pMemPos);
@@ -5548,6 +5658,9 @@ WW8Fib::WW8Fib(sal_uInt8 nVer)
nProduct = 0xc02d;
}
+ //If nFib is 0x00D9 or greater, then cQuickSaves MUST be 0xF
+ cQuickSaves = nFib >= 0x00D9 ? 0xF : 0;
+
// --> #i90932#
lid = 0x409; // LANGUAGE_ENGLISH_US
@@ -5571,7 +5684,6 @@ WW8Fib::WW8Fib(sal_uInt8 nVer)
fFarEast = false;
break;
};
- // <--
Locale aTempLocale;
SvxLanguageToLocale( aTempLocale, lid );
@@ -5914,23 +6026,35 @@ WW8Style::WW8Style(SvStream& rStream, WW8Fib& rFibPara)
stiMaxWhenSaved(0), istdMaxFixedWhenSaved(0), nVerBuiltInNamesWhenSaved(0),
ftcAsci(0), ftcFE(0), ftcOther(0), ftcBi(0)
{
- nStyleStart = rFib.fcStshf;
- nStyleLen = rFib.lcbStshf;
-
- rSt.Seek(nStyleStart);
+ if (!checkSeek(rSt, rFib.fcStshf))
+ return;
sal_uInt16 cbStshi = 0; // 2 bytes size of the following STSHI structure
+ sal_uInt32 nRemaining = rFib.lcbStshf;
+ const sal_uInt32 nMinValidStshi = 4;
if (rFib.GetFIBVersion() <= ww::eWW2)
{
cbStshi = 0;
cstd = 256;
}
- else if (rFib.nFib < 67) // old Version ? (need to find this again to fix)
- cbStshi = 4; // -> Laengenfeld fehlt
- else // neue Version:
- // lies die Laenge der in der Datei gespeicherten Struktur
- rSt >> cbStshi;
+ else
+ {
+ if (rFib.nFib < 67) // old Version ? (need to find this again to fix)
+ cbStshi = nMinValidStshi;
+ else // new version
+ {
+ if (nRemaining < sizeof(cbStshi))
+ return;
+ // lies die Laenge der in der Datei gespeicherten Struktur
+ rSt >> cbStshi;
+ nRemaining-=2;
+ }
+ }
+
+ cbStshi = std::min(static_cast<sal_uInt32>(cbStshi), nRemaining);
+ if (cbStshi < nMinValidStshi)
+ return;
sal_uInt16 nRead = cbStshi;
do
@@ -5977,10 +6101,16 @@ WW8Style::WW8Style(SvStream& rStream, WW8Fib& rFibPara)
while( !this ); // Trick: obiger Block wird genau einmal durchlaufen
// und kann vorzeitig per "break" verlassen werden.
- if( 0 != rSt.GetError() )
- {
- // wie denn nun den Error melden?
- }
+ nRemaining -= cbStshi;
+
+ //There will be stshi.cstd (cbSTD, STD) pairs in the file following the
+ //STSHI. Note that styles can be empty, i.e. cbSTD == 0
+ const sal_uInt32 nMinRecordSize = sizeof(sal_uInt16);
+ sal_uInt16 nMaxPossibleRecords = nRemaining/nMinRecordSize;
+
+ OSL_ENSURE(cstd <= nMaxPossibleRecords,
+ "allegedly more styles that available data\n");
+ cstd = std::min(cstd, nMaxPossibleRecords);
}
// Read1STDFixed() liest ein Style ein. Wenn der Style vollstaendig vorhanden
@@ -5991,7 +6121,7 @@ WW8_STD* WW8Style::Read1STDFixed( short& rSkip, short* pcbStd )
{
WW8_STD* pStd = 0;
- sal_uInt16 cbStd;
+ sal_uInt16 cbStd(0);
rSt >> cbStd; // lies Laenge
sal_uInt16 nRead = cbSTDBaseInFile;
@@ -6008,6 +6138,7 @@ WW8_STD* WW8Style::Read1STDFixed( short& rSkip, short* pcbStd )
sal_uInt16 a16Bit;
if( 2 > nRead ) break;
+ a16Bit = 0;
rSt >> a16Bit;
pStd->sti = a16Bit & 0x0fff ;
pStd->fScratch = 0 != ( a16Bit & 0x1000 );
@@ -6016,20 +6147,24 @@ WW8_STD* WW8Style::Read1STDFixed( short& rSkip, short* pcbStd )
pStd->fMassCopy = 0 != ( a16Bit & 0x8000 );
if( 4 > nRead ) break;
+ a16Bit = 0;
rSt >> a16Bit;
pStd->sgc = a16Bit & 0x000f ;
pStd->istdBase = ( a16Bit & 0xfff0 ) >> 4;
if( 6 > nRead ) break;
+ a16Bit = 0;
rSt >> a16Bit;
pStd->cupx = a16Bit & 0x000f ;
pStd->istdNext = ( a16Bit & 0xfff0 ) >> 4;
if( 8 > nRead ) break;
+ a16Bit = 0;
rSt >> pStd->bchUpe;
// ab Ver8 sollten diese beiden Felder dazukommen:
if(10 > nRead ) break;
+ a16Bit = 0;
rSt >> a16Bit;
pStd->fAutoRedef = a16Bit & 0x0001 ;
pStd->fHidden = ( a16Bit & 0x0002 ) >> 2;
@@ -6179,6 +6314,31 @@ void lcl_checkFontname( String& sString )
}
}
+namespace
+{
+ sal_uInt16 calcMaxFonts(sal_uInt8 *p, sal_Int32 nFFn)
+ {
+ // Figure out the max number of fonts defined here
+ sal_uInt16 nMax = 0;
+ sal_Int32 nRemaining = nFFn;
+ while (nRemaining)
+ {
+ //p[0] is cbFfnM1, the alleged total length of FFN - 1.
+ //i.e. length after cbFfnM1
+ sal_uInt16 cbFfnM1 = *p++;
+ --nRemaining;
+
+ if (cbFfnM1 > nRemaining)
+ break;
+
+ nMax++;
+ nRemaining -= cbFfnM1;
+ p += cbFfnM1;
+ }
+ return nMax;
+ }
+}
+
WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
: pFontA(0), nMax(0)
{
@@ -6187,19 +6347,17 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
if( rFib.lcbSttbfffn <= 2 )
{
OSL_ENSURE( !this, "Fonttabelle kaputt! (rFib.lcbSttbfffn < 2)" );
- pFontA = 0;
- nMax = 0;
return;
}
- rSt.Seek( rFib.fcSttbfffn );
+ if (!checkSeek(rSt, rFib.fcSttbfffn))
+ return;
sal_Int32 nFFn = rFib.lcbSttbfffn - 2;
// allocate Font Array
- sal_uInt8* pA = new sal_uInt8[ nFFn ];
+ sal_uInt8* pA = new sal_uInt8[nFFn];
memset(pA, 0, nFFn);
- WW8_FFN* p = (WW8_FFN*)pA;
ww::WordVersion eVersion = rFib.GetFIBVersion();
@@ -6215,37 +6373,26 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
rSt.SeekRel( 2 );
// read all font information
- nFFn = rSt.Read( pA, nFFn );
+ nFFn = rSt.Read(pA, nFFn);
+ sal_uInt16 nCalcMax = calcMaxFonts(pA, nFFn);
- if( eVersion < ww::eWW8 )
+ if (eVersion < ww::eWW8)
+ nMax = nCalcMax;
+ else
{
- // try to figure out how many fonts are defined here
- nMax = 0;
- long nLeft = nFFn;
- for(;;)
- {
- short nNextSiz;
-
- nNextSiz = p->cbFfnM1 + 1;
- if( nNextSiz > nLeft )
- break;
- nMax++;
- nLeft -= nNextSiz;
- if( nLeft < 1 ) // can we read the given ammount of bytes ?
- break;
- // increase p by nNextSiz Bytes
- p = (WW8_FFN *)( ( (sal_uInt8*)p ) + nNextSiz );
- }
+ //newer versions include purportive count of fonts, so take min of that
+ //and calced max
+ nMax = std::min(nMax, nCalcMax);
}
if( nMax )
{
// allocate Index Array
pFontA = new WW8_FFN[ nMax ];
- p = pFontA;
+ WW8_FFN* p = pFontA;
- if( eVersion <= ww::eWW2 )
- {
+ if( eVersion <= ww::eWW2 )
+ {
WW8_FFN_BASE* pVer2 = (WW8_FFN_BASE*)pA;
for(sal_uInt16 i=0; i<nMax; ++i, ++p)
{
@@ -6257,7 +6404,7 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
p->wWeight = ( *(((sal_uInt8*)pVer2) + 1) );
p->chs = ( *(((sal_uInt8*)pVer2) + 2) );
- /*
+ /*
#i8726# 7- seems to encode the name in the same encoding as
the font, e.g load the doc in 97 and save to see the unicode
ver of the asian fontnames in that example to confirm.
@@ -6269,7 +6416,7 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
p->sFontname = String ( (((const sal_Char*)pVer2) + 1 + 2), eEnc);
pVer2 = (WW8_FFN_BASE*)( ((sal_uInt8*)pVer2) + pVer2->cbFfnM1 + 1 );
}
- }
+ }
else if( eVersion < ww::eWW8 )
{
WW8_FFN_Ver6* pVer6 = (WW8_FFN_Ver6*)pA;
@@ -6317,48 +6464,80 @@ WW8Fonts::WW8Fonts( SvStream& rSt, WW8Fib& rFib )
}
else
{
- WW8_FFN_Ver8* pVer8 = (WW8_FFN_Ver8*)pA;
- sal_uInt8 c2;
- for(sal_uInt16 i=0; i<nMax; ++i, ++p)
+ //count of bytes in minimum FontFamilyInformation payload
+ const sal_uInt8 cbMinFFNPayload = 41;
+ sal_uInt16 nValidFonts = 0;
+ sal_Int32 nRemainingFFn = nFFn;
+ sal_uInt8* pRaw = pA;
+ for (sal_uInt16 i=0; i < nMax && nRemainingFFn; ++i, ++p)
{
- p->cbFfnM1 = pVer8->cbFfnM1;
- c2 = *(((sal_uInt8*)pVer8) + 1);
+ //pRaw[0] is cbFfnM1, the alleged total length of FFN - 1
+ //i.e. length after cbFfnM1
+ sal_uInt8 cbFfnM1 = *pRaw++;
+ --nRemainingFFn;
- p->prg = c2 & 0x02;
+ if (cbFfnM1 > nRemainingFFn)
+ break;
+
+ if (cbFfnM1 < cbMinFFNPayload)
+ break;
+
+ p->cbFfnM1 = cbFfnM1;
+
+ sal_uInt8 *pVer8 = pRaw;
+
+ sal_uInt8 c2 = *pVer8++;
+ --cbFfnM1;
+
+ p->prg = c2 & 0x02;
p->fTrueType = (c2 & 0x04) >> 2;
// ein Reserve-Bit ueberspringen
- p->ff = (c2 & 0x70) >> 4;
+ p->ff = (c2 & 0x70) >> 4;
- p->wWeight = SVBT16ToShort( *(SVBT16*)&pVer8->wWeight );
- p->chs = pVer8->chs;
- p->ibszAlt = pVer8->ibszAlt;
+ p->wWeight = SVBT16ToShort(*(SVBT16*)pVer8);
+ pVer8+=2;
+ cbFfnM1-=2;
-#ifdef __WW8_NEEDS_COPY
- {
- sal_uInt8 nLen = 0x28;
- sal_uInt8 nLength = sizeof( pVer8->szFfn ) / sizeof( SVBT16 );
- nLength = std::min( nLength, sal_uInt8( pVer8->cbFfnM1+1 ) );
- for( sal_uInt16* pTmp = pVer8->szFfn;
- nLen < nLength; ++pTmp, nLen+=2 )
- {
- *pTmp = SVBT16ToShort( *(SVBT16*)pTmp );
- }
- }
-#endif // defined __WW8_NEEDS_COPY
+ p->chs = *pVer8++;
+ --cbFfnM1;
- p->sFontname = pVer8->szFfn;
- if (p->ibszAlt)
+ p->ibszAlt = *pVer8++;
+ --cbFfnM1;
+
+ pVer8 += 10; //PANOSE
+ cbFfnM1-=10;
+ pVer8 += 24; //FONTSIGNATURE
+ cbFfnM1-=24;
+
+ OSL_ASSERT(cbFfnM1 >= 2);
+
+ sal_uInt8 nMaxNullTerminatedPossible = cbFfnM1/2 - 1;
+ sal_Unicode *pPrimary = reinterpret_cast<sal_Unicode*>(pVer8);
+ pPrimary[nMaxNullTerminatedPossible] = 0;
+#ifdef OSL_BIGENDIAN
+ swapEndian(pPrimary);
+#endif
+ p->sFontname = pPrimary;
+ if (p->ibszAlt && p->ibszAlt < nMaxNullTerminatedPossible)
{
p->sFontname.Append(';');
- p->sFontname.Append(pVer8->szFfn+p->ibszAlt);
+ sal_Unicode *pSecondary = pPrimary + p->ibszAlt;
+#ifdef OSL_BIGENDIAN
+ swapEndian(pSecondary);
+#endif
+ p->sFontname.Append(pSecondary);
}
// #i43762# check font name for illegal characters
lcl_checkFontname( p->sFontname );
// Zeiger auf Ursprungsarray einen Font nach hinten setzen
- pVer8 = (WW8_FFN_Ver8*)( ((sal_uInt8*)pVer8) + pVer8->cbFfnM1 + 1 );
+ pRaw += p->cbFfnM1;
+ nRemainingFFn -= p->cbFfnM1;
+ ++nValidFonts;
}
+ OSL_ENSURE(nMax == nValidFonts, "Font count differs with availability");
+ nMax = std::min(nMax, nValidFonts);
}
}
delete[] pA;
@@ -6391,7 +6570,7 @@ const WW8_FFN* WW8Fonts::GetFont( sal_uInt16 nNum ) const
// -> dann liefert GetTextPos() vielleicht auch ein richtiges Ergebnis
WW8PLCF_HdFt::WW8PLCF_HdFt( SvStream* pSt, WW8Fib& rFib, WW8Dop& rDop )
- : aPLCF( pSt, rFib.fcPlcfhdd , rFib.lcbPlcfhdd , 0 )
+ : aPLCF(*pSt, rFib.fcPlcfhdd , rFib.lcbPlcfhdd , 0)
{
nIdxOffset = 0;
@@ -7283,15 +7462,19 @@ sal_uInt16 wwSprmParser::DistanceToData(sal_uInt16 nId) const
sal_uInt8* wwSprmParser::findSprmData(sal_uInt16 nId, sal_uInt8* pSprms,
sal_uInt16 nLen) const
{
- while (nLen > (getVersion()?1:0))
+ while (nLen >= MinSprmLen())
{
sal_uInt16 nAktId = GetSprmId(pSprms);
- if (nAktId == nId) // Sprm found
- return pSprms + DistanceToData(nId);
-
// gib Zeiger auf Daten
sal_uInt16 nSize = GetSprmSize(nAktId, pSprms);
- OSL_ENSURE(nSize <= nLen, "sprm longer than remaining bytes");
+
+ bool bValid = nSize <= nLen;
+
+ OSL_ENSURE(bValid, "sprm longer than remaining bytes");
+
+ if (nAktId == nId && bValid) // Sprm found
+ return pSprms + DistanceToData(nId);
+
//Clip to available size if wrong
nSize = std::min(nSize, nLen);
pSprms += nSize;
@@ -7319,4 +7502,22 @@ SEPr::SEPr() :
memset(rgdxaColumnWidthSpacing, 0, sizeof(rgdxaColumnWidthSpacing));
}
+bool checkSeek(SvStream &rSt, sal_uInt32 nOffset)
+{
+ return (rSt.Seek(nOffset) == static_cast<sal_Size>(nOffset));
+}
+
+bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength)
+{
+ return (rSt.Read(pDest, nLength) == static_cast<sal_Size>(nLength));
+}
+
+#ifdef OSL_BIGENDIAN
+void swapEndian(sal_Unicode *pString)
+{
+ for (sal_Unicode *pWork = pString; *pWork; ++pWork)
+ *pWork = SWAPSHORT(*pWork);
+}
+#endif
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx
index 7d809d8ab1..c3b77d4457 100644
--- a/sw/source/filter/ww8/ww8scan.hxx
+++ b/sw/source/filter/ww8/ww8scan.hxx
@@ -149,8 +149,6 @@ public:
// if not found. nLen must be the <= length of pSprms
sal_uInt8* findSprmData(sal_uInt16 nId, sal_uInt8* pSprms, sal_uInt16 nLen)
const;
-
- inline int getVersion() const { return meVersion; } //cmc, I'm dubious about the usage of this, how can it be 0
};
//--Line abovewhich the code has meaningful comments
@@ -218,13 +216,13 @@ private:
sal_uInt8* pPLCF_Contents; ///< Pointer auf Inhalts-Array-Teil des Pos-Array
long nIMax; ///< Anzahl der Elemente
long nIdx; ///< Merker, wo wir gerade sind
- long nStru;
+ sal_uInt32 nStru;
public:
- WW8PLCFspecial( SvStream* pSt, long nFilePos, long nPLCF,
- long nStruct, long nStartPos = -1 );
+ WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos, sal_uInt32 nPLCF,
+ sal_uInt32 nStruct);
~WW8PLCFspecial() { delete[] pPLCF_PosArray; }
long GetIdx() const { return nIdx; }
- void SetIdx( long nI ) { nIdx = nI; }
+ void SetIdx( long nI ) { nIdx = nI; }
long GetIMax() const { return nIMax; }
bool SeekPos(long nPos); // geht ueber FC- bzw. CP-Wert
// bzw. naechste groesseren Wert
@@ -242,8 +240,11 @@ public:
sal_Int32 GetPos( long nInIdx ) const
{ return ( nInIdx >= nIMax ) ? SAL_MAX_INT32 : pPLCF_PosArray[nInIdx]; }
- WW8PLCFspecial& operator ++( int ) { nIdx++; return *this; }
- WW8PLCFspecial& operator --( int ) { nIdx--; return *this; }
+ void advance()
+ {
+ if (nIdx <= nIMax)
+ ++nIdx;
+ }
};
/** simple Iterator for SPRMs */
@@ -286,24 +287,24 @@ private:
sal_Int32 nIdx;
int nStru;
- void ReadPLCF( SvStream* pSt, WW8_FC nFilePos, sal_Int32 nPLCF );
+ void ReadPLCF(SvStream& rSt, WW8_FC nFilePos, sal_uInt32 nPLCF);
/*
Falls im Dok ein PLC fehlt und die FKPs solo dastehen,
machen wir uns hiermit einen PLC:
*/
- void GeneratePLCF( SvStream* pSt, sal_Int32 nPN, sal_Int32 ncpN );
+ void GeneratePLCF(SvStream& rSt, sal_Int32 nPN, sal_Int32 ncpN);
void MakeFailedPLCF();
public:
- WW8PLCF( SvStream* pSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
- WW8_CP nStartPos = -1 );
+ WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
+ WW8_CP nStartPos = -1);
/*
folgender Ctor generiert ggfs. einen PLC aus nPN und ncpN
*/
- WW8PLCF( SvStream* pSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
- WW8_CP nStartPos, sal_Int32 nPN, sal_Int32 ncpN );
+ WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
+ WW8_CP nStartPos, sal_Int32 nPN, sal_Int32 ncpN);
~WW8PLCF(){ delete[] pPLCF_PosArray; }
sal_Int32 GetIdx() const { return nIdx; }
@@ -328,9 +329,10 @@ friend class WW8PLCFpcd_Iter;
sal_Int32* pPLCF_PosArray; // Pointer auf Pos-Array und auf ganze Struktur
sal_uInt8* pPLCF_Contents; // Pointer auf Inhalts-Array-Teil des Pos-Array
long nIMax;
- long nStru;
+ sal_uInt32 nStru;
public:
- WW8PLCFpcd( SvStream* pSt, long nFilePos, long nPLCF, long nStruct );
+ WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos, sal_uInt32 nPLCF,
+ sal_uInt32 nStruct);
~WW8PLCFpcd(){ delete[] pPLCF_PosArray; }
};
@@ -506,6 +508,9 @@ public:
sal_uInt8 mnIMax; // Anzahl der Eintraege
wwSprmParser maSprmParser;
+
+ //Fill in an Entry with sanity testing
+ void FillEntry(Entry &rEntry, sal_Size nDataOffset, sal_uInt16 nLen);
public:
WW8Fkp (ww::WordVersion eVersion, SvStream* pFKPStrm,
SvStream* pDataStrm, long _nFilePos, long nItemSiz, ePLCFT ePl,
@@ -926,7 +931,7 @@ friend class SwWW8FltControlStack;
#endif
private:
- const WW8Fib* pWw8Fib;
+ WW8Fib* pWw8Fib;
WW8PLCFx_Cp_FKP* pChpPLCF; // Character-Attrs
WW8PLCFx_Cp_FKP* pPapPLCF; // Para-Attrs
WW8PLCFx_SEPX* pSepPLCF; // Section-Attrs
@@ -962,7 +967,7 @@ private:
void DeletePieceTable();
public:
WW8ScannerBase( SvStream* pSt, SvStream* pTblSt, SvStream* pDataSt,
- const WW8Fib* pWwF );
+ WW8Fib* pWwF );
~WW8ScannerBase();
bool AreThereFootnotes() const { return pFtnPLCF->Count() > 0; };
bool AreThereEndnotes() const { return pEdnPLCF->Count() > 0; };
@@ -1456,8 +1461,6 @@ class WW8Style
protected:
WW8Fib& rFib;
SvStream& rSt;
- long nStyleStart;
- long nStyleLen;
sal_uInt16 cstd; // Count of styles in stylesheet
sal_uInt16 cbSTDBaseInFile; // Length of STD Base as stored in a file
@@ -1780,11 +1783,21 @@ std::vector<sal_uInt8> ChpxToSprms(const Word2CHPX &rChpx);
sal_uLong SafeReadString(ByteString &rStr,sal_uInt16 nLen,SvStream &rStrm);
+bool checkSeek(SvStream &rSt, sal_uInt32 nOffset)
+ SAL_WARN_UNUSED_RESULT;
+
+bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength)
+ SAL_WARN_UNUSED_RESULT;
+
//MS has a (slightly) inaccurate view of how many twips
//are in the default letter size of a page
const sal_uInt16 lLetterWidth = 12242;
const sal_uInt16 lLetterHeight = 15842;
+#ifdef OSL_BIGENDIAN
+void swapEndian(sal_Unicode *pString);
+#endif
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx
index 6d14db78a2..4fafd5e223 100644
--- a/sw/source/filter/ww8/ww8struc.hxx
+++ b/sw/source/filter/ww8/ww8struc.hxx
@@ -41,8 +41,6 @@
#ifdef SAL_W32
# pragma pack(push, 2)
-#elif defined(SAL_OS2)
-# pragma pack(2)
#endif
inline void Set_UInt8( sal_uInt8 *& p, sal_uInt8 n )
@@ -902,8 +900,6 @@ struct WW8_WKB
#ifdef SAL_W32
# pragma pack(pop)
-#elif defined(SAL_OS2)
-# pragma pack()
#endif
struct SEPr
diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx
index 20bfcf380e..57fd027b81 100644
--- a/sw/source/filter/ww8/ww8toolbar.cxx
+++ b/sw/source/filter/ww8/ww8toolbar.cxx
@@ -237,13 +237,20 @@ bool CTBWrapper::ImportCustomToolBar( SfxObjectShell& rDocSh )
{
for ( std::vector< Customization >::iterator it = rCustomizations.begin(); it != rCustomizations.end(); ++it )
{
- uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
- uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ), uno::UNO_QUERY_THROW );
- CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) );
- helper.setMSOCommandMap( new MSOWordCommandConvertor() );
+ try
+ {
+ uno::Reference< lang::XMultiServiceFactory > xMSF( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ uno::Reference< ui::XModuleUIConfigurationManagerSupplier > xAppCfgSupp( xMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) ), uno::UNO_QUERY_THROW );
+ CustomToolBarImportHelper helper( rDocSh, xAppCfgSupp->getUIConfigurationManager( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextDocument" ) ) ) );
+ helper.setMSOCommandMap( new MSOWordCommandConvertor() );
- if ( !(*it).ImportCustomToolBar( *this, helper ) )
- return false;
+ if ( !(*it).ImportCustomToolBar( *this, helper ) )
+ return false;
+ }
+ catch(...)
+ {
+ continue;
+ }
}
return false;
}
@@ -592,7 +599,7 @@ bool CTB::ImportCustomToolBar( CTBWrapper& rWrapper, CustomToolBarImportHelper&
#endif
bRes = true;
}
- catch( uno::Exception& e )
+ catch( const uno::Exception& e )
{
OSL_TRACE("***** For some reason we have an exception %s", rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
bRes = false;
diff --git a/sw/source/filter/ww8/ww8toolbar.hxx b/sw/source/filter/ww8/ww8toolbar.hxx
index 61ae02304a..b983eaff0c 100644
--- a/sw/source/filter/ww8/ww8toolbar.hxx
+++ b/sw/source/filter/ww8/ww8toolbar.hxx
@@ -17,7 +17,7 @@
* Portions created by the Initial Developer are Copyright (C) 2010 the
* Initial Developer. All Rights Reserved.
*
- * Contributor(s):
+ * Contributor(s):
* Noel Power <noel.power@novell.com>
*
* For minor contributions see the git repository.
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 46f342bed8..fc39443350 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -80,7 +80,6 @@
#include <poolfmt.hxx>
#include <numrule.hxx>
#include <paratr.hxx>
-// <--
#include <svx/svdmodel.hxx>
#include <svx/svdpage.hxx>
@@ -153,10 +152,10 @@ sal_Int32 ReadThroughComponent(
sal_Bool bMustBeSuccessfull,
sal_Bool bEncrypted )
{
- DBG_ASSERT(xInputStream.is(), "input stream missing");
- DBG_ASSERT(xModelComponent.is(), "document missing");
- DBG_ASSERT(rFactory.is(), "factory missing");
- DBG_ASSERT(NULL != pFilterName,"I need a service name for the component!");
+ OSL_ENSURE(xInputStream.is(), "input stream missing");
+ OSL_ENSURE(xModelComponent.is(), "document missing");
+ OSL_ENSURE(rFactory.is(), "factory missing");
+ OSL_ENSURE(NULL != pFilterName,"I need a service name for the component!");
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "sw", LOGFILE_AUTHOR, "ReadThroughComponent" );
@@ -170,7 +169,7 @@ sal_Int32 ReadThroughComponent(
rFactory->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser"))),
UNO_QUERY );
- DBG_ASSERT( xParser.is(), "Can't create parser" );
+ OSL_ENSURE( xParser.is(), "Can't create parser" );
if( !xParser.is() )
return ERR_SWG_READ_ERROR;
RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" );
@@ -180,7 +179,7 @@ sal_Int32 ReadThroughComponent(
rFactory->createInstanceWithArguments(
OUString::createFromAscii(pFilterName), rFilterArguments),
UNO_QUERY );
- DBG_ASSERT( xFilter.is(), "Can't instantiate filter component." );
+ OSL_ENSURE( xFilter.is(), "Can't instantiate filter component." );
if( !xFilter.is() )
return ERR_SWG_READ_ERROR;
RTL_LOGFILE_CONTEXT_TRACE1( aLog, "%s created", pFilterName );
@@ -317,8 +316,8 @@ sal_Int32 ReadThroughComponent(
const OUString& rName,
sal_Bool bMustBeSuccessfull)
{
- DBG_ASSERT(xStorage.is(), "Need storage!");
- DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!");
+ OSL_ENSURE(xStorage.is(), "Need storage!");
+ OSL_ENSURE(NULL != pStreamName, "Please, please, give me a name!");
// open stream (and set parser input)
OUString sStreamName = OUString::createFromAscii(pStreamName);
@@ -358,7 +357,7 @@ sal_Int32 ReadThroughComponent(
uno::Reference< beans::XPropertySet > xInfoSet;
if( rFilterArguments.getLength() > 0 )
rFilterArguments.getConstArray()[0] >>= xInfoSet;
- DBG_ASSERT( xInfoSet.is(), "missing property set" );
+ OSL_ENSURE( xInfoSet.is(), "missing property set" );
if( xInfoSet.is() )
{
OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") );
@@ -465,7 +464,6 @@ void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc )
if ( !aOutlineLevelAssigned[ i ] &&
aCreatedDefaultOutlineStyles[ i ] != 0 &&
! aCreatedDefaultOutlineStyles[ i ]->IsAssignedToListLevelOfOutlineStyle() )
- // <--
{
// apply outline level at created default outline style
aCreatedDefaultOutlineStyles[ i ]->AssignToListLevelOfOutlineStyle(i);//#outline level added by zhaojianwei
@@ -482,7 +480,6 @@ void lcl_AdjustOutlineStylesForOOo( SwDoc& _rDoc )
}
}
-// <--
void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SwDoc& _rDoc )
{
@@ -644,7 +641,6 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
{ "ShapePositionInHoriL2R", sizeof("ShapePositionInHoriL2R")-1, 0,
&::getBooleanCppuType(),
beans::PropertyAttribute::MAYBEVOID, 0 },
- // <--
{ "BuildId", sizeof("BuildId")-1, 0,
&::getCppuType( (OUString *)0 ),
@@ -659,7 +655,6 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
{ "TextDocInOOoFileFormat", sizeof("TextDocInOOoFileFormat")-1, 0,
&::getBooleanCppuType(),
beans::PropertyAttribute::MAYBEVOID, 0 },
- // <--
{ NULL, 0, 0, NULL, 0, 0 }
};
uno::Reference< beans::XPropertySet > xInfoSet(
@@ -870,7 +865,6 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
OUString(RTL_CONSTASCII_USTRINGPARAM("ShapePositionInHoriL2R")),
makeAny( bShapePositionInHoriL2R ) );
}
- // <--
{
const sal_Bool bTextDocInOOoFileFormat = !bOASIS;
xInfoSet->setPropertyValue(
@@ -913,18 +907,19 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
}
}
- sal_uInt32 nWarn = 0;
- sal_uInt32 nWarn2 = 0;
// read storage streams
+
+ // #i103539#: always read meta.xml for generator
+ sal_uInt32 const nWarn = ReadThroughComponent(
+ xStorage, xModelComp, "meta.xml", "Meta.xml", xServiceFactory,
+ (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaImporter"
+ : "com.sun.star.comp.Writer.XMLMetaImporter"),
+ aEmptyArgs, rName, sal_False );
+
+ sal_uInt32 nWarn2 = 0;
if( !(IsOrganizerMode() || IsBlockMode() || aOpt.IsFmtsOnly() ||
bInsertMode) )
{
- nWarn = ReadThroughComponent(
- xStorage, xModelComp, "meta.xml", "Meta.xml", xServiceFactory,
- (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaImporter"
- : "com.sun.star.comp.Writer.XMLMetaImporter"),
- aEmptyArgs, rName, sal_False );
-
nWarn2 = ReadThroughComponent(
xStorage, xModelComp, "settings.xml", NULL, xServiceFactory,
(bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsImporter"
@@ -1020,12 +1015,10 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
{
lcl_AdjustOutlineStylesForOOo( rDoc );
}
- // <--
// Fix #i58251#: Unfortunately is the static default different to SO7 behaviour,
// so we have to set a dynamic default after importing SO7
rDoc.SetDefault( SfxBoolItem( RES_ROW_SPLIT, sal_False ) );
}
- // <--
rDoc.PropagateOutlineRule();
@@ -1034,7 +1027,6 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, con
{
rDoc.set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
}
- // <--
// Convert all instances of <SdrOle2Obj> into <SdrGrafObj>, because the
// Writer doesn't support such objects.
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 394be30647..2067ece9cc 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -87,7 +87,7 @@ SwXMLWriter::~SwXMLWriter()
sal_uInt32 SwXMLWriter::_Write( SfxMedium* pTargetMedium )
{
- DBG_ASSERT( pTargetMedium, "No medium is provided!" );
+ OSL_ENSURE( pTargetMedium, "No medium is provided!" );
// Get service factory
uno::Reference< lang::XMultiServiceFactory > xServiceFactory =
comphelper::getProcessServiceFactory();
@@ -174,7 +174,6 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg,
{ "OutlineStyleAsNormalListStyle", sizeof("OutlineStyleAsNormalListStyle")-1, 0,
&::getBooleanCppuType(),
beans::PropertyAttribute::MAYBEVOID, 0 },
- // <--
{ "TargetStorage", sizeof("TargetStorage")-1,0, &embed::XStorage::static_type(),
::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
@@ -278,7 +277,6 @@ pGraphicHelper = SvXMLGraphicHelper::Create( xStg,
RTL_CONSTASCII_USTRINGPARAM("OutlineStyleAsNormalListStyle") );
xInfoSet->setPropertyValue( sOutlineStyleAsNormalListStyle, makeAny( sal_True ) );
}
- // <--
// filter arguments
// - graphics + object resolver for styles + content
@@ -534,9 +532,9 @@ sal_Bool SwXMLWriter::WriteThroughComponent(
const Sequence<beans::PropertyValue> & rMediaDesc,
sal_Bool bPlainStream )
{
- DBG_ASSERT( xStg.is(), "Need storage!" );
- DBG_ASSERT( NULL != pStreamName, "Need stream name!" );
- DBG_ASSERT( NULL != pServiceName, "Need service name!" );
+ OSL_ENSURE( xStg.is(), "Need storage!" );
+ OSL_ENSURE( NULL != pStreamName, "Need stream name!" );
+ OSL_ENSURE( NULL != pServiceName, "Need service name!" );
RTL_LOGFILE_TRACE_AUTHOR1( "sw", LOGFILE_AUTHOR,
"SwXMLWriter::WriteThroughComponent : stream %s",
@@ -582,7 +580,7 @@ sal_Bool SwXMLWriter::WriteThroughComponent(
uno::Reference< beans::XPropertySet > xInfoSet;
if( rArguments.getLength() > 0 )
rArguments.getConstArray()[0] >>= xInfoSet;
- DBG_ASSERT( xInfoSet.is(), "missing property set" );
+ OSL_ENSURE( xInfoSet.is(), "missing property set" );
if( xInfoSet.is() )
{
OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") );
diff --git a/sw/source/filter/xml/xmlbrsh.cxx b/sw/source/filter/xml/xmlbrsh.cxx
index cfe911e0b4..fc9be6b884 100644
--- a/sw/source/filter/xml/xmlbrsh.cxx
+++ b/sw/source/filter/xml/xmlbrsh.cxx
@@ -32,7 +32,6 @@
#include "hintids.hxx"
-#include <tools/debug.hxx>
#include <com/sun/star/io/XOutputStream.hpp>
#include <editeng/memberids.hrc>
diff --git a/sw/source/filter/xml/xmlbrshi.hxx b/sw/source/filter/xml/xmlbrshi.hxx
index af1ec4b2dd..bdb236a876 100644
--- a/sw/source/filter/xml/xmlbrshi.hxx
+++ b/sw/source/filter/xml/xmlbrshi.hxx
@@ -26,8 +26,12 @@
*
************************************************************************/
-#ifndef _XMLBRSHI_HXX
-#define _XMLBRSHI_HXX
+#ifndef SW_XMLBRSHI_HXX
+#define SW_XMLBRSHI_HXX
+
+#include <com/sun/star/io/XOutputStream.hpp>
+
+#include <xmloff/xmlictxt.hxx>
class SvXMLImport;
class SvXMLUnitConverter;
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 8c1535c531..26831754c8 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -64,6 +64,7 @@
#include <editeng/unolingu.hxx>
#include <editeng/forbiddencharacterstable.hxx>
#include <ForbiddenCharactersEnum.hxx>
+#include <comphelper/servicehelper.hxx>
// for locking SolarMutex: svapp + mutex
#include <vcl/svapp.hxx>
@@ -879,10 +880,14 @@ Reference< XInterface > SAL_CALL SwXMLExportSettings_createInstance(
return (cppu::OWeakObject*)new SwXMLExport(rSMgr, EXPORT_SETTINGS|EXPORT_OASIS);
}
+namespace
+{
+ class theSwXMLExportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXMLExportUnoTunnelId > {};
+}
+
const Sequence< sal_Int8 > & SwXMLExport::getUnoTunnelId() throw()
{
- static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXMLExportUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId )
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index 76fc0d4c7b..04a31ae7ea 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -82,7 +82,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap,
sal_uInt16 nFlags,
- SvUShorts* pIndexArray ) const
+ std::vector<sal_uInt16> *pIndexArray ) const
{
const sal_uInt16 nCount = mrMapEntries->getCount();
sal_uInt16 nIndex = 0;
@@ -104,7 +104,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
// element items do not add any properties,
// we export it later
if( pIndexArray )
- pIndexArray->Insert( nIndex, pIndexArray->Count() );
+ pIndexArray->push_back( nIndex );
}
else
@@ -152,7 +152,7 @@ void SvXMLExportItemMapper::exportXML( const SvXMLExport& rExport,
{
OUStringBuffer aOut;
const SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
- DBG_ASSERT( pSplit != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pSplit != NULL, "Wrong Which-ID" );
sal_uInt16 eEnum = pSplit->GetValue() ? 1 : 0;
rUnitConverter.convertEnum( aOut, eEnum, aXML_KeepTogetherType );
aValue = aOut.makeStringAndClear();
@@ -240,16 +240,16 @@ void SvXMLExportItemMapper::exportElementItems(
const SvXMLUnitConverter& rUnitConverter,
const SfxItemSet &rSet,
sal_uInt16 nFlags,
- const SvUShorts& rIndexArray ) const
+ const std::vector<sal_uInt16> &rIndexArray ) const
{
- const sal_uInt16 nCount = rIndexArray.Count();
+ const sal_uInt16 nCount = rIndexArray.size();
sal_Bool bItemsExported = sal_False;
for( sal_uInt16 nIndex = 0; nIndex < nCount; nIndex++ )
{
- const sal_uInt16 nElement = rIndexArray.GetObject( nIndex );
+ const sal_uInt16 nElement = rIndexArray[ nIndex ];
SvXMLItemMapEntry* pEntry = mrMapEntries->getByIndex( nElement );
- DBG_ASSERT( 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_EXPORT),
+ OSL_ENSURE( 0 != (pEntry->nMemberId & MID_SW_FLAG_ELEMENT_ITEM_EXPORT),
"wrong mid flag!" );
const SfxPoolItem* pItem = GetItem( rSet, pEntry->nWhichId, nFlags );
@@ -313,14 +313,14 @@ void SvXMLExportItemMapper::exportXML( SvXMLExport& rExport,
XMLTokenEnum ePropToken,
sal_uInt16 nFlags ) const
{
- SvUShorts aIndexArray;
+ std::vector<sal_uInt16> aIndexArray;
exportXML( rExport, rExport.GetAttrList(), rSet, rUnitConverter,
rExport.GetNamespaceMap(), nFlags, &aIndexArray );
if( rExport.GetAttrList().getLength() > 0L ||
(nFlags & XML_EXPORT_FLAG_EMPTY) != 0 ||
- aIndexArray.Count() != 0 )
+ !aIndexArray.empty() )
{
if( (nFlags & XML_EXPORT_FLAG_IGN_WS) != 0 )
{
@@ -405,7 +405,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_LR_SPACE:
{
const SvxLRSpaceItem* pLRSpace = PTR_CAST(SvxLRSpaceItem, &rItem);
- DBG_ASSERT( pLRSpace != NULL, "Wrong Which-ID!" );
+ OSL_ENSURE( pLRSpace != NULL, "Wrong Which-ID!" );
bOk = sal_True;
switch( nMemberId )
@@ -455,7 +455,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_UL_SPACE:
{
const SvxULSpaceItem* pULSpace = PTR_CAST(SvxULSpaceItem, &rItem);
- DBG_ASSERT( pULSpace != NULL, "Wrong Which-ID!" );
+ OSL_ENSURE( pULSpace != NULL, "Wrong Which-ID!" );
switch( nMemberId )
{
@@ -484,7 +484,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_SHADOW:
{
const SvxShadowItem* pShadow = PTR_CAST(SvxShadowItem, &rItem);
- DBG_ASSERT( pShadow != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pShadow != NULL, "Wrong Which-ID" );
sal_Int32 nX = 1, nY = 1;
switch( pShadow->GetLocation() )
@@ -523,7 +523,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_BOX:
{
SvxBoxItem* pBox = PTR_CAST(SvxBoxItem, &rItem);
- DBG_ASSERT( pBox != NULL, "Wrong WHich-ID" );
+ OSL_ENSURE( pBox != NULL, "Wrong WHich-ID" );
/**
xml -> MemberId
@@ -812,7 +812,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_BREAK:
{
const SvxFmtBreakItem* pFmtBreak = PTR_CAST(SvxFmtBreakItem, &rItem);
- DBG_ASSERT( pFmtBreak != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pFmtBreak != NULL, "Wrong Which-ID" );
sal_uInt16 eEnum = 0;
@@ -859,7 +859,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_KEEP:
{
SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem);
- DBG_ASSERT( pFmtKeep != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pFmtKeep != NULL, "Wrong Which-ID" );
aOut.append( pFmtKeep->GetValue()
? GetXMLToken( XML_ALWAYS )
@@ -871,7 +871,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_BACKGROUND:
{
SvxBrushItem* pBrush = PTR_CAST(SvxBrushItem, &rItem);
- DBG_ASSERT( pBrush != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pBrush != NULL, "Wrong Which-ID" );
// note: the graphic is only exported if nMemberId equals
// MID_GRAPHIC..
@@ -982,7 +982,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_PAGEDESC:
{
const SwFmtPageDesc* pPageDesc = PTR_CAST(SwFmtPageDesc, &rItem);
- DBG_ASSERT( pPageDesc != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pPageDesc != NULL, "Wrong Which-ID" );
if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId )
{
@@ -1004,7 +1004,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_ROW_SPLIT:
{
const SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
- DBG_ASSERT( pSplit != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pSplit != NULL, "Wrong Which-ID" );
rUnitConverter.convertBool( aOut, pSplit->GetValue() );
bOk = sal_True;
@@ -1014,7 +1014,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_HORI_ORIENT:
{
SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem);
- DBG_ASSERT( pHoriOrient != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pHoriOrient != NULL, "Wrong Which-ID" );
rUnitConverter.convertEnum( aOut, pHoriOrient->GetHoriOrient(),
aXMLTableAlignMap );
@@ -1025,7 +1025,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_VERT_ORIENT:
{
SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem);
- DBG_ASSERT( pVertOrient != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pVertOrient != NULL, "Wrong Which-ID" );
rUnitConverter.convertEnum( aOut, pVertOrient->GetVertOrient(),
aXMLTableVAlignMap );
@@ -1036,7 +1036,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_FRM_SIZE:
{
SwFmtFrmSize* pFrmSize = PTR_CAST(SwFmtFrmSize, &rItem);
- DBG_ASSERT( pFrmSize != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pFrmSize != NULL, "Wrong Which-ID" );
sal_Bool bOutHeight = sal_False;
switch( nMemberId )
@@ -1087,7 +1087,7 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue(
case RES_COLLAPSING_BORDERS:
{
const SfxBoolItem* pBorders = PTR_CAST(SfxBoolItem, &rItem);
- DBG_ASSERT( pBorders != NULL, "Wrong RES-ID" );
+ OSL_ENSURE( pBorders != NULL, "Wrong RES-ID" );
aOut.append( pBorders->GetValue()
? GetXMLToken( XML_COLLAPSING )
diff --git a/sw/source/filter/xml/xmlexpit.hxx b/sw/source/filter/xml/xmlexpit.hxx
index e622a6c176..55090e920b 100644
--- a/sw/source/filter/xml/xmlexpit.hxx
+++ b/sw/source/filter/xml/xmlexpit.hxx
@@ -32,6 +32,7 @@
#include <tools/solar.h>
#include <tools/ref.hxx>
#include "xmlitmap.hxx"
+#include <vector>
#define XML_EXPORT_FLAG_DEFAULTS 0x0001 // export also default items
#define XML_EXPORT_FLAG_DEEP 0x0002 // export also items from
@@ -46,7 +47,6 @@ class SfxPoolItem;
class SfxItemSet;
class SvXMLAttributeList;
class SvXMLNamespaceMap;
-class SvUShorts;
class SvXMLExport;
@@ -62,7 +62,7 @@ protected:
const SvXMLUnitConverter& rUnitConverter,
const SvXMLNamespaceMap& rNamespaceMap,
sal_uInt16 nFlags,
- SvUShorts* pIndexArray ) const;
+ std::vector<sal_uInt16> *pIndexArray ) const;
void exportXML( const SvXMLExport& rExport,
SvXMLAttributeList& rAttrList,
@@ -78,7 +78,7 @@ protected:
const SvXMLUnitConverter& rUnitConverter,
const SfxItemSet &rSet,
sal_uInt16 nFlags,
- const SvUShorts& rIndexArray ) const;
+ const std::vector<sal_uInt16> &rIndexArray ) const;
static const SfxPoolItem* GetItem( const SfxItemSet &rSet,
sal_uInt16 nWhichId,
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index 641ad68ff5..96dd1036f8 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -668,7 +668,6 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc()
sName,
nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC,
sal_True);
- // <--
SwPageDesc *pPageDesc = pDoc->FindPageDescByName( sName );
if( !pPageDesc )
{
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index f3445f6d83..b21a7055f4 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -68,10 +68,10 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily )
CheckAttrList();
// style:family="..."
- DBG_ASSERT( RES_FRMFMT==rFmt.Which(), "frame format expected" );
+ OSL_ENSURE( RES_FRMFMT==rFmt.Which(), "frame format expected" );
if( RES_FRMFMT != rFmt.Which() )
return;
- DBG_ASSERT( eFamily != XML_TOKEN_INVALID, "family must be specified" );
+ OSL_ENSURE( eFamily != XML_TOKEN_INVALID, "family must be specified" );
// style:name="..."
sal_Bool bEncoded = sal_False;
AddAttribute( XML_NAMESPACE_STYLE, XML_NAME, EncodeStyleName(
@@ -118,7 +118,7 @@ void SwXMLExport::ExportFmt( const SwFmt& rFmt, enum XMLTokenEnum eFamily )
if( XML_TABLE_CELL == eFamily )
{
- DBG_ASSERT(RES_FRMFMT == rFmt.Which(), "only frame format");
+ OSL_ENSURE(RES_FRMFMT == rFmt.Which(), "only frame format");
const SfxPoolItem *pItem;
if( SFX_ITEM_SET ==
@@ -306,7 +306,7 @@ void SwXMLAutoStylePoolP::exportStyleAttributes(
for( ::std::vector< XMLPropertyState >::const_iterator
aProperty = rProperties.begin();
aProperty != rProperties.end();
- aProperty++ )
+ ++aProperty )
{
if (aProperty->mnIndex != -1) // #i26762#
{
@@ -327,7 +327,6 @@ void SwXMLAutoStylePoolP::exportStyleAttributes(
GetExport().AddAttribute( XML_NAMESPACE_STYLE,
sListStyleName,
GetExport().EncodeStyleName( sStyleName ) );
- // <--
}
break;
case CTF_PAGEDESCNAME:
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 6f8cf88a7f..a2463a6721 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -74,6 +74,7 @@
#include <xmloff/xmlmetai.hxx>
#include <xmloff/xformsimport.hxx>
+#include <comphelper/servicehelper.hxx>
using ::rtl::OUString;
@@ -245,7 +246,7 @@ SvXMLImportContext *SwXMLDocContext_Impl::CreateChildContext(
xAttrList );
break;
case XML_TOK_DOC_META:
- DBG_WARNING("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
+ OSL_FAIL("XML_TOK_DOC_META: should not have come here, maybe document is invalid?");
break;
case XML_TOK_DOC_SCRIPT:
pContext = GetSwImport().CreateScriptContext( rLocalName );
@@ -337,7 +338,6 @@ SvXMLImportContext* SwXMLOfficeDocContext_Impl::CreateChildContext(
nPrefix, rLocalName, xAttrList );
}
}
-// <--
// #i69629# - new subclass <SwXMLDocStylesContext_Impl> of class <SwXMLDocContext_Impl>
class SwXMLDocStylesContext_Impl : public SwXMLDocContext_Impl
@@ -378,9 +378,7 @@ void SwXMLDocStylesContext_Impl::EndElement()
SwXMLImport& rSwImport = dynamic_cast<SwXMLImport&>( GetImport());
GetImport().GetTextImport()->SetOutlineStyles(
(rSwImport.GetStyleFamilyMask() & SFX_STYLE_FAMILY_PARA ) ? sal_True : sal_False);
- // <--
}
-// <--
//----------------------------------------------------------------------------
const SvXMLTokenMap& SwXMLImport::GetDocElemTokenMap()
@@ -410,25 +408,24 @@ SvXMLImportContext *SwXMLImport::CreateContext(
pContext = CreateMetaContext(rLocalName);
}
else if ( XML_NAMESPACE_OFFICE==nPrefix &&
+ IsXMLToken( rLocalName, XML_DOCUMENT_STYLES ) )
+ {
+ pContext = new SwXMLDocStylesContext_Impl( *this, nPrefix, rLocalName,
+ xAttrList );
+ }
+ else if ( XML_NAMESPACE_OFFICE==nPrefix &&
IsXMLToken( rLocalName, XML_DOCUMENT ) )
{
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
mxServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.xml.dom.SAXDocumentBuilder"))),
uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- GetModel(), UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> const xDocProps(
+ GetDocumentProperties());
// flat OpenDocument file format
pContext = new SwXMLOfficeDocContext_Impl( *this, nPrefix, rLocalName,
- xAttrList, xDPS->getDocumentProperties(), xDocBuilder);
- }
- else if ( XML_NAMESPACE_OFFICE==nPrefix &&
- IsXMLToken( rLocalName, XML_DOCUMENT_STYLES ) )
- {
- pContext = new SwXMLDocStylesContext_Impl( *this, nPrefix, rLocalName,
- xAttrList );
+ xAttrList, xDocProps, xDocBuilder);
}
- // <--
else
pContext = SvXMLImport::CreateContext( nPrefix, rLocalName, xAttrList );
@@ -532,10 +529,14 @@ void SwXMLImport::setOrganizerMode( )
bOrganizerMode = sal_True;
}
+namespace
+{
+ class theSwXMLImportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXMLImportUnoTunnelId > {};
+}
+
const Sequence< sal_Int8 > & SwXMLImport::getUnoTunnelId() throw()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXMLImportUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXMLImport::getSomething( const Sequence< sal_Int8 >& rId )
@@ -568,7 +569,7 @@ void SwXMLImport::startDocument( void )
// delegate to parent
SvXMLImport::startDocument();
- DBG_ASSERT( GetModel().is(), "model is missing" );
+ OSL_ENSURE( GetModel().is(), "model is missing" );
if( !GetModel().is() )
return;
@@ -779,7 +780,7 @@ void SwXMLImport::startDocument( void )
void SwXMLImport::endDocument( void )
throw( xml::sax::SAXException, uno::RuntimeException )
{
- DBG_ASSERT( GetModel().is(), "model missing; maybe startDocument wasn't called?" );
+ OSL_ENSURE( GetModel().is(), "model missing; maybe startDocument wasn't called?" );
if( !GetModel().is() )
return;
@@ -865,14 +866,14 @@ void SwXMLImport::endDocument( void )
}
SwPosition* pPos = pPaM->GetPoint();
- DBG_ASSERT( !pPos->nContent.GetIndex(), "last paragraph isn't empty" );
+ OSL_ENSURE( !pPos->nContent.GetIndex(), "last paragraph isn't empty" );
if( !pPos->nContent.GetIndex() )
{
SwTxtNode* pCurrNd;
sal_uLong nNodeIdx = pPos->nNode.GetIndex();
pDoc = pPaM->GetDoc();
- DBG_ASSERT( pPos->nNode.GetNode().IsCntntNode(),
+ OSL_ENSURE( pPos->nNode.GetNode().IsCntntNode(),
"insert position is not a content node" );
if( !IsInsertMode() )
{
@@ -1391,7 +1392,6 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("DoNotJustifyLinesWithManualBreak")), makeAny( true ) );
}
- // <--
// This flag has to be set for all documents < SO8
if ( !bDoNotResetParaAttrsForNumFont && bDocumentPriorSO8 )
@@ -1431,7 +1431,6 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
xProps->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("UseOldPrinterMetrics") ), makeAny( true ) );
}
- // <--
// Old LO versions had 66 as the value for small caps percentage, later changed to 80.
// In order to keep backwards compatibility, SmallCapsPercentage66 option is written to .odt
diff --git a/sw/source/filter/xml/xmlimp.hxx b/sw/source/filter/xml/xmlimp.hxx
index 898b460b63..3f20b87ba7 100644
--- a/sw/source/filter/xml/xmlimp.hxx
+++ b/sw/source/filter/xml/xmlimp.hxx
@@ -26,14 +26,18 @@
*
************************************************************************/
-#ifndef _XMLIMP_HXX
-#define _XMLIMP_HXX
+#ifndef SW_XMLIMP_HXX
+#define SW_XMLIMP_HXX
+
+#include <com/sun/star/document/XDocumentProperties.hpp>
#include <sot/storage.hxx>
+
#include <xmloff/xmlictxt.hxx>
-#include "xmlitmap.hxx"
#include <xmloff/xmlimp.hxx>
+#include "xmlitmap.hxx"
+
class SwDoc;
class SwPaM;
class SvXMLUnitConverter;
@@ -180,6 +184,7 @@ public:
inline const SvXMLUnitConverter& GetTwipUnitConverter() const;
inline const SvXMLImportItemMapper& GetTableItemMapper() const;
+ inline SvXMLImportItemMapper& GetTableItemMapper();
SvXMLImportContext *CreateTableItemImportContext( sal_uInt16 nPrefix,
const ::rtl::OUString& rLocalName,
const ::com::sun::star::uno::Reference<
@@ -208,6 +213,11 @@ public:
// initialize XForms
virtual void initXForms();
+
+ // get the document properties, but only if they actually need importing
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::document::XDocumentProperties>
+ GetDocumentProperties() const;
};
inline const SvXMLUnitConverter& SwXMLImport::GetTwipUnitConverter() const
@@ -220,6 +230,11 @@ inline const SvXMLImportItemMapper& SwXMLImport::GetTableItemMapper() const
return *pTableItemMapper;
}
+inline SvXMLImportItemMapper& SwXMLImport::GetTableItemMapper()
+{
+ return *pTableItemMapper;
+}
+
inline void SwXMLImport::SetProgressValue( sal_Int32 nValue )
{
if ( bShowProgress )
diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 2c635c06ab..a8fadbcf29 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -78,11 +78,17 @@ SvXMLImportItemMapper::~SvXMLImportItemMapper()
{
}
+void
+SvXMLImportItemMapper::setMapEntries( SvXMLItemMapEntriesRef rMapEntries )
+{
+ mrMapEntries = rMapEntries;
+}
+
/** fills the given itemset with the attributes in the given list */
void SvXMLImportItemMapper::importXML( SfxItemSet& rSet,
uno::Reference< xml::sax::XAttributeList > xAttrList,
const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const
+ const SvXMLNamespaceMap& rNamespaceMap )
{
sal_Int16 nAttr = xAttrList->getLength();
@@ -163,7 +169,7 @@ void SvXMLImportItemMapper::importXML( SfxItemSet& rSet,
{
SfxPoolItem *pNew = pItem->Clone();
pUnknownItem = PTR_CAST( SvXMLAttrContainerItem, pNew );
- DBG_ASSERT( pUnknownItem,
+ OSL_ENSURE( pUnknownItem,
"SvXMLAttrContainerItem expected" );
if( !pUnknownItem )
delete pNew;
@@ -190,7 +196,7 @@ void SvXMLImportItemMapper::importXML( SfxItemSet& rSet,
delete pUnknownItem;
}
- finished( rSet );
+ finished(rSet, rUnitConverter);
}
/** this method is called for every item that has the
@@ -201,7 +207,7 @@ SvXMLImportItemMapper::handleSpecialItem( const SvXMLItemMapEntry& /*rEntry*/,
SfxItemSet& /*rSet*/,
const OUString& /*rValue*/,
const SvXMLUnitConverter& /*rUnitConverter*/,
- const SvXMLNamespaceMap& /*rNamespaceMap*/ ) const
+ const SvXMLNamespaceMap& /*rNamespaceMap*/ )
{
OSL_FAIL( "unsuported special item in xml import" );
return sal_False;
@@ -213,13 +219,14 @@ sal_Bool SvXMLImportItemMapper::handleNoItem( const SvXMLItemMapEntry& /*rEntry*
SfxItemSet& /*rSet*/,
const OUString& /*rValue*/,
const SvXMLUnitConverter& /*rUnitConverter*/,
- const SvXMLNamespaceMap& /*rNamespaceMap*/ ) const
+ const SvXMLNamespaceMap& /*rNamespaceMap*/ )
{
OSL_FAIL( "unsuported no item in xml import" );
return sal_False;
}
-void SvXMLImportItemMapper::finished( SfxItemSet& ) const
+void
+SvXMLImportItemMapper::finished(SfxItemSet &, SvXMLUnitConverter const&) const
{
// nothing to do here
}
@@ -240,7 +247,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_LR_SPACE:
{
SvxLRSpaceItem* pLRSpace = PTR_CAST(SvxLRSpaceItem, &rItem);
- DBG_ASSERT( pLRSpace != NULL, "Wrong Which-ID!" );
+ OSL_ENSURE( pLRSpace != NULL, "Wrong Which-ID!" );
switch( nMemberId )
{
@@ -301,7 +308,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_UL_SPACE:
{
SvxULSpaceItem* pULSpace = PTR_CAST(SvxULSpaceItem, &rItem);
- DBG_ASSERT( pULSpace != NULL, "Wrong Which-ID!" );
+ OSL_ENSURE( pULSpace != NULL, "Wrong Which-ID!" );
sal_Int32 nProp = 100;
sal_Int32 nAbs = 0;
@@ -328,7 +335,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_SHADOW:
{
SvxShadowItem* pShadow = PTR_CAST(SvxShadowItem, &rItem);
- DBG_ASSERT( pShadow != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pShadow != NULL, "Wrong Which-ID" );
sal_Bool bColorFound = sal_False;
sal_Bool bOffsetFound = sal_False;
@@ -407,7 +414,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_BOX:
{
SvxBoxItem* pBox = PTR_CAST(SvxBoxItem, &rItem);
- DBG_ASSERT( pBox != NULL, "Wrong WHich-ID" );
+ OSL_ENSURE( pBox != NULL, "Wrong WHich-ID" );
/** copy SvxBorderLines */
SvxBorderLine* pTop = pBox->GetTop() == NULL ?
@@ -572,7 +579,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_BREAK:
{
SvxFmtBreakItem* pFmtBreak = PTR_CAST(SvxFmtBreakItem, &rItem);
- DBG_ASSERT( pFmtBreak != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pFmtBreak != NULL, "Wrong Which-ID" );
sal_uInt16 eEnum;
@@ -607,7 +614,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_KEEP:
{
SvxFmtKeepItem* pFmtKeep = PTR_CAST(SvxFmtKeepItem, &rItem);
- DBG_ASSERT( pFmtKeep != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pFmtKeep != NULL, "Wrong Which-ID" );
if( IsXMLToken( rValue, XML_ALWAYS ) ||
IsXMLToken( rValue, XML_TRUE ) )
@@ -627,7 +634,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_BACKGROUND:
{
SvxBrushItem* pBrush = PTR_CAST(SvxBrushItem, &rItem);
- DBG_ASSERT( pBrush != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pBrush != NULL, "Wrong Which-ID" );
Color aTempColor;
switch( nMemberId )
@@ -769,7 +776,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_PAGEDESC:
{
SwFmtPageDesc* pPageDesc = PTR_CAST(SwFmtPageDesc, &rItem);
- DBG_ASSERT( pPageDesc != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pPageDesc != NULL, "Wrong Which-ID" );
if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId )
{
@@ -785,7 +792,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_ROW_SPLIT:
{
SfxBoolItem* pSplit = PTR_CAST(SfxBoolItem, &rItem);
- DBG_ASSERT( pSplit != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pSplit != NULL, "Wrong Which-ID" );
if( IsXMLToken( rValue, XML_AUTO ) ||
IsXMLToken( rValue, XML_TRUE ) )
@@ -805,7 +812,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_HORI_ORIENT:
{
SwFmtHoriOrient* pHoriOrient = PTR_CAST(SwFmtHoriOrient, &rItem);
- DBG_ASSERT( pHoriOrient != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pHoriOrient != NULL, "Wrong Which-ID" );
sal_uInt16 nValue;
bOk = rUnitConverter.convertEnum( nValue, rValue,
@@ -818,7 +825,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_VERT_ORIENT:
{
SwFmtVertOrient* pVertOrient = PTR_CAST(SwFmtVertOrient, &rItem);
- DBG_ASSERT( pVertOrient != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pVertOrient != NULL, "Wrong Which-ID" );
sal_uInt16 nValue;
bOk = rUnitConverter.convertEnum( nValue, rValue,
@@ -837,7 +844,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_FRM_SIZE:
{
SwFmtFrmSize* pFrmSize = PTR_CAST(SwFmtFrmSize, &rItem);
- DBG_ASSERT( pFrmSize != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pFrmSize != NULL, "Wrong Which-ID" );
sal_Bool bSetHeight = sal_False;
sal_Bool bSetWidth = sal_False;
@@ -939,7 +946,7 @@ sal_Bool SvXMLImportItemMapper::PutXMLValue(
case RES_COLLAPSING_BORDERS:
{
SfxBoolItem* pBorders = PTR_CAST(SfxBoolItem, &rItem);
- DBG_ASSERT( pBorders != NULL, "Wrong Which-ID" );
+ OSL_ENSURE( pBorders != NULL, "Wrong Which-ID" );
if( IsXMLToken( rValue, XML_COLLAPSING ) )
{
diff --git a/sw/source/filter/xml/xmlimpit.hxx b/sw/source/filter/xml/xmlimpit.hxx
index d786c9ce78..2ef2eaecd8 100644
--- a/sw/source/filter/xml/xmlimpit.hxx
+++ b/sw/source/filter/xml/xmlimpit.hxx
@@ -59,7 +59,7 @@ public:
void importXML( SfxItemSet& rSet,
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > xAttrList,
const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
+ const SvXMLNamespaceMap& rNamespaceMap );
/** this method is called for every item that has the
MID_SW_FLAG_SPECIAL_ITEM_IMPORT flag set */
@@ -68,7 +68,7 @@ public:
SfxItemSet& rSet,
const ::rtl::OUString& rValue,
const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
+ const SvXMLNamespaceMap& rNamespaceMap );
/** this method is called for every item that has the
MID_SW_FLAG_NO_ITEM_IMPORT flag set */
@@ -76,13 +76,14 @@ public:
SfxItemSet& rSet,
const ::rtl::OUString& rValue,
const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
+ const SvXMLNamespaceMap& rNamespaceMap );
/** This method is called when all attributes have benn processed. It
* may be used to remove items that are incomplete */
- virtual void finished( SfxItemSet& rSet ) const;
+ virtual void finished(SfxItemSet & rSet,
+ SvXMLUnitConverter const& rUnitConverter) const;
- inline void setMapEntries( SvXMLItemMapEntriesRef rMapEntries );
+ virtual void setMapEntries( SvXMLItemMapEntriesRef rMapEntries );
inline SvXMLItemMapEntriesRef getMapEntries() const;
@@ -95,12 +96,6 @@ public:
const SvXMLUnitConverter& rUnitConverter );
};
-inline void
-SvXMLImportItemMapper::setMapEntries( SvXMLItemMapEntriesRef rMapEntries )
-{
- mrMapEntries = rMapEntries;
-}
-
inline SvXMLItemMapEntriesRef
SvXMLImportItemMapper::getMapEntries() const
{
diff --git a/sw/source/filter/xml/xmlitem.cxx b/sw/source/filter/xml/xmlitem.cxx
index 6f5cf67dee..c8a1fcc067 100644
--- a/sw/source/filter/xml/xmlitem.cxx
+++ b/sw/source/filter/xml/xmlitem.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <tools/debug.hxx>
#include <xmloff/xmlimp.hxx>
#include "xmlimpit.hxx"
#include "xmlitem.hxx"
@@ -40,15 +39,14 @@ SvXMLItemSetContext::SvXMLItemSetContext( SvXMLImport& rImp, sal_uInt16 nPrfx,
const OUString& rLName,
const uno::Reference< xml::sax::XAttributeList >& xAttrList,
SfxItemSet& rISet,
- const SvXMLImportItemMapper& rIMap,
+ SvXMLImportItemMapper& rIMap,
const SvXMLUnitConverter& rUnitConverter ):
SvXMLImportContext( rImp, nPrfx, rLName ),
rItemSet( rISet ),
rIMapper( rIMap ),
rUnitConv( rUnitConverter )
-
{
- rIMapper.importXML( rItemSet, xAttrList, rUnitConv,
+ rIMap.importXML( rItemSet, xAttrList, rUnitConv,
GetImport().GetNamespaceMap() );
}
diff --git a/sw/source/filter/xml/xmlitem.hxx b/sw/source/filter/xml/xmlitem.hxx
index 6779c2f3c8..7157d32b94 100644
--- a/sw/source/filter/xml/xmlitem.hxx
+++ b/sw/source/filter/xml/xmlitem.hxx
@@ -54,7 +54,7 @@ public:
const ::rtl::OUString& rLName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList,
SfxItemSet& rItemSet,
- const SvXMLImportItemMapper& rIMappper,
+ SvXMLImportItemMapper& rIMap,
const SvXMLUnitConverter& rUnitConv );
virtual ~SvXMLItemSetContext();
diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx
index 3914e83e92..27a765bae9 100644
--- a/sw/source/filter/xml/xmlitemi.cxx
+++ b/sw/source/filter/xml/xmlitemi.cxx
@@ -29,29 +29,34 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
-
-#include <hintids.hxx>
#include <rtl/ustring.hxx>
+
#include <rsc/rscsfx.hxx>
-#include "xmlitmap.hxx"
-#include "xmlimpit.hxx"
-#include "xmlitem.hxx"
+
#include <xmloff/i18nmap.hxx>
#include <xmloff/xmluconv.hxx>
#include <xmloff/families.hxx>
-#include <svx/unomid.hxx>
+#include <xmloff/xmlnmspe.hxx>
+#include <xmloff/xmltoken.hxx>
+
#include <editeng/boxitem.hxx>
#include <editeng/fontitem.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/brshitem.hxx>
#include <editeng/langitem.hxx>
+#include <editeng/memberids.hrc>
-#include "xmlbrshi.hxx"
+#include <svx/unomid.hxx>
+
+#include <hintids.hxx>
#include <paratr.hxx>
#include <doc.hxx>
#include <unomid.h>
+#include "xmlbrshi.hxx"
#include "xmlimp.hxx"
+#include "xmlitmap.hxx"
+#include "xmlimpit.hxx"
+#include "xmlitem.hxx"
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -75,32 +80,93 @@ public:
SfxItemSet& rSet,
const OUString& rValue,
const SvXMLUnitConverter& rUnitConverter,
- const SvXMLNamespaceMap& rNamespaceMap ) const;
- virtual void finished( SfxItemSet& rSet ) const;
+ const SvXMLNamespaceMap& rNamespaceMap );
+
+ virtual sal_Bool
+ handleNoItem(SvXMLItemMapEntry const& rEntry,
+ SfxItemSet & rSet,
+ ::rtl::OUString const& rValue,
+ SvXMLUnitConverter const& rUnitConverter,
+ SvXMLNamespaceMap const& rNamespaceMap);
+
+ virtual void finished(SfxItemSet & rSet,
+ SvXMLUnitConverter const& rUnitConverter) const;
+
+ virtual void setMapEntries( SvXMLItemMapEntriesRef rMapEntries );
+
+private:
+ void Reset();
+
+ ::rtl::OUString m_FoMarginValue;
+ enum { LEFT = 0, RIGHT = 1, TOP = 2, BOTTOM = 3 };
+ bool m_bHaveMargin[4];
};
SwXMLImportTableItemMapper_Impl::SwXMLImportTableItemMapper_Impl(
SvXMLItemMapEntriesRef rMapEntries ) :
SvXMLImportItemMapper( rMapEntries, RES_UNKNOWNATR_CONTAINER)
{
+ Reset();
}
SwXMLImportTableItemMapper_Impl::~SwXMLImportTableItemMapper_Impl()
{
}
+void SwXMLImportTableItemMapper_Impl::Reset()
+{
+ m_FoMarginValue = ::rtl::OUString();
+ for (int i = 0; i < 3; ++i)
+ {
+ m_bHaveMargin[i] = false;
+ }
+}
+
+void SwXMLImportTableItemMapper_Impl::setMapEntries(
+ SvXMLItemMapEntriesRef rMapEntries )
+{
+ Reset();
+ SvXMLImportItemMapper::setMapEntries(rMapEntries);
+}
+
sal_Bool SwXMLImportTableItemMapper_Impl::handleSpecialItem(
const SvXMLItemMapEntry& rEntry,
SfxPoolItem& rItem,
SfxItemSet& rItemSet,
const OUString& rValue,
const SvXMLUnitConverter& rUnitConv,
- const SvXMLNamespaceMap& ) const
+ const SvXMLNamespaceMap& )
{
sal_Bool bRet = sal_False;
sal_uInt16 nMemberId = static_cast< sal_Int16 >(rEntry.nMemberId & MID_SW_FLAG_MASK);
switch( rItem.Which() )
{
+ case RES_LR_SPACE:
+ switch (nMemberId)
+ {
+ case MID_L_MARGIN:
+ m_bHaveMargin[LEFT] = true;
+ break;
+ case MID_R_MARGIN:
+ m_bHaveMargin[RIGHT] = true;
+ break;
+ }
+ bRet = SvXMLImportItemMapper::PutXMLValue(
+ rItem, rValue, nMemberId, rUnitConv);
+ break;
+ case RES_UL_SPACE:
+ switch (nMemberId)
+ {
+ case MID_UP_MARGIN:
+ m_bHaveMargin[TOP] = true;
+ break;
+ case MID_LO_MARGIN:
+ m_bHaveMargin[BOTTOM] = true;
+ break;
+ }
+ bRet = SvXMLImportItemMapper::PutXMLValue(
+ rItem, rValue, nMemberId, rUnitConv);
+ break;
case RES_FRM_SIZE:
switch( nMemberId )
{
@@ -118,8 +184,72 @@ sal_Bool SwXMLImportTableItemMapper_Impl::handleSpecialItem(
return bRet;
}
-void SwXMLImportTableItemMapper_Impl::finished( SfxItemSet& /*rSet*/ ) const
+
+sal_Bool SwXMLImportTableItemMapper_Impl::handleNoItem(
+ SvXMLItemMapEntry const& rEntry,
+ SfxItemSet & rSet,
+ ::rtl::OUString const& rValue,
+ SvXMLUnitConverter const& rUnitConverter,
+ SvXMLNamespaceMap const& rNamespaceMap)
+{
+ if ((XML_NAMESPACE_FO == rEntry.nNameSpace) &&
+ (xmloff::token::XML_MARGIN == rEntry.eLocalName))
+ {
+ m_FoMarginValue = rValue;
+ return true;
+ }
+ else
+ {
+ return SvXMLImportItemMapper::handleNoItem(
+ rEntry, rSet, rValue, rUnitConverter, rNamespaceMap);
+ }
+}
+
+void SwXMLImportTableItemMapper_Impl::finished(
+ SfxItemSet & rSet, SvXMLUnitConverter const& rUnitConverter) const
{
+ if (m_FoMarginValue.getLength())
+ {
+ sal_uInt16 const Ids[4][2] = {
+ { RES_LR_SPACE, MID_L_MARGIN },
+ { RES_LR_SPACE, MID_R_MARGIN },
+ { RES_UL_SPACE, MID_UP_MARGIN },
+ { RES_UL_SPACE, MID_LO_MARGIN },
+ };
+ for (int i = 0; i < 4; ++i)
+ {
+ if (m_bHaveMargin[i])
+ {
+ continue; // already read fo:margin-top etc.
+ }
+ // first get item from itemset
+ SfxPoolItem const* pItem = 0;
+ SfxItemState eState =
+ rSet.GetItemState(Ids[i][0], sal_True, &pItem);
+
+ // if not set, try the pool
+ if ((SFX_ITEM_SET != eState) && (SFX_WHICH_MAX > Ids[i][0]))
+ {
+ pItem = &rSet.GetPool()->GetDefaultItem(Ids[i][0]);
+ }
+
+ // do we have an item?
+ if (eState >= SFX_ITEM_DEFAULT && pItem)
+ {
+ SfxPoolItem *const pNewItem = pItem->Clone();
+ bool const bPut = PutXMLValue(
+ *pNewItem, m_FoMarginValue, Ids[i][1], rUnitConverter);
+ if (bPut)
+ {
+ rSet.Put(*pNewItem);
+ }
+ }
+ else
+ {
+ OSL_ENSURE(false, "could not get item");
+ }
+ }
+ }
}
// ---------------------------------------------------------------------
@@ -135,7 +265,7 @@ public:
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
SfxItemSet& rItemSet,
- const SvXMLImportItemMapper& rIMapper,
+ SvXMLImportItemMapper & rIMapper,
const SvXMLUnitConverter& rUnitConv );
virtual ~SwXMLItemSetContext_Impl();
@@ -152,7 +282,7 @@ SwXMLItemSetContext_Impl::SwXMLItemSetContext_Impl(
const OUString& rLName,
const Reference< xml::sax::XAttributeList > & xAttrList,
SfxItemSet& _rItemSet,
- const SvXMLImportItemMapper& _rIMapper,
+ SvXMLImportItemMapper & _rIMapper,
const SvXMLUnitConverter& _rUnitConv ) :
SvXMLItemSetContext( rImport, nPrfx, rLName, xAttrList,
_rItemSet, _rIMapper, _rUnitConv )
diff --git a/sw/source/filter/xml/xmlitemm.cxx b/sw/source/filter/xml/xmlitemm.cxx
index d50c96aa9e..88a08ee12d 100644
--- a/sw/source/filter/xml/xmlitemm.cxx
+++ b/sw/source/filter/xml/xmlitemm.cxx
@@ -42,11 +42,13 @@
using namespace ::xmloff::token;
#define MAP_ENTRY( p, l, w, m ) \
- { XML_NAMESPACE_##p, XML_##l, w, m }
+ { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), m }
#define M_E_SI( p, l, w, m ) \
- { XML_NAMESPACE_##p, XML_##l, w, MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
+ { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
#define M_E_SE( p, l, w, m ) \
- { XML_NAMESPACE_##p, XML_##l, w, MID_SW_FLAG_SPECIAL_ITEM_EXPORT|m }
+ { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_EXPORT|m }
+#define M_E_SIE( p, l, w, m ) \
+ { XML_NAMESPACE_##p, XML_##l, static_cast<sal_uInt16>(w), MID_SW_FLAG_SPECIAL_ITEM_EXPORT|MID_SW_FLAG_SPECIAL_ITEM_IMPORT|m }
#define M_END { 0, XML_TOKEN_INVALID, 0, 0 }
@@ -60,11 +62,12 @@ SvXMLItemMapEntry aXMLTableItemMap[] =
// RES_PAPER_BIN
// not required
// TODO: RES_LR_SPACE
- M_E_SE( FO, MARGIN_LEFT, RES_LR_SPACE, MID_L_MARGIN ),
- M_E_SE( FO, MARGIN_RIGHT, RES_LR_SPACE, MID_R_MARGIN ),
+ M_E_SE( FO, MARGIN, -1, MID_SW_FLAG_NO_ITEM_IMPORT),
+ M_E_SIE( FO, MARGIN_LEFT, RES_LR_SPACE, MID_L_MARGIN ),
+ M_E_SIE( FO, MARGIN_RIGHT, RES_LR_SPACE, MID_R_MARGIN ),
// RES_UL_SPACE
- MAP_ENTRY( FO, MARGIN_TOP, RES_UL_SPACE, MID_UP_MARGIN ),
- MAP_ENTRY( FO, MARGIN_BOTTOM, RES_UL_SPACE, MID_LO_MARGIN ),
+ M_E_SI( FO, MARGIN_TOP, RES_UL_SPACE, MID_UP_MARGIN ),
+ M_E_SI( FO, MARGIN_BOTTOM, RES_UL_SPACE, MID_LO_MARGIN ),
// RES_PAGEDESC
MAP_ENTRY( STYLE, PAGE_NUMBER, RES_PAGEDESC, MID_PAGEDESC_PAGENUMOFFSET),
// RES_BREAK
diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx
index 6a509373b9..5aeb3b9471 100644
--- a/sw/source/filter/xml/xmlithlp.cxx
+++ b/sw/source/filter/xml/xmlithlp.cxx
@@ -261,7 +261,7 @@ const struct SvXMLEnumMapEntry psXML_BrushVertPos[] =
void lcl_frmitems_MergeXMLHoriPos( SvxGraphicPosition& ePos,
SvxGraphicPosition eHori )
{
- DBG_ASSERT( GPOS_LM==eHori || GPOS_MM==eHori || GPOS_RM==eHori,
+ OSL_ENSURE( GPOS_LM==eHori || GPOS_MM==eHori || GPOS_RM==eHori,
"lcl_frmitems_MergeXMLHoriPos: vertical pos must be middle" );
switch( ePos )
@@ -291,7 +291,7 @@ void lcl_frmitems_MergeXMLHoriPos( SvxGraphicPosition& ePos,
void lcl_frmitems_MergeXMLVertPos( SvxGraphicPosition& ePos,
SvxGraphicPosition eVert )
{
- DBG_ASSERT( GPOS_MT==eVert || GPOS_MM==eVert || GPOS_MB==eVert,
+ OSL_ENSURE( GPOS_MT==eVert || GPOS_MM==eVert || GPOS_MB==eVert,
"lcl_frmitems_MergeXMLVertPos: horizontal pos must be middle" );
switch( ePos )
diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx
index ca9e473975..3d82c6e9fe 100644
--- a/sw/source/filter/xml/xmlmeta.cxx
+++ b/sw/source/filter/xml/xmlmeta.cxx
@@ -58,22 +58,34 @@ using namespace ::xmloff::token;
// ---------------------------------------------------------------------
+uno::Reference<document::XDocumentProperties>
+SwXMLImport::GetDocumentProperties() const
+{
+ if (IsOrganizerMode() || IsStylesOnlyMode() ||
+ IsBlockMode() || IsInsertMode())
+ {
+ return 0;
+ }
+ uno::Reference<document::XDocumentPropertiesSupplier> const xDPS(
+ GetModel(), UNO_QUERY_THROW);
+ return xDPS->getDocumentProperties();
+}
+
SvXMLImportContext *SwXMLImport::CreateMetaContext(
const OUString& rLocalName )
{
SvXMLImportContext *pContext = 0;
- if( !(IsStylesOnlyMode() || IsInsertMode()) )
+ if (getImportFlags() & IMPORT_META)
{
- uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
+ uno::Reference<xml::sax::XDocumentHandler> const xDocBuilder(
mxServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.xml.dom.SAXDocumentBuilder"))),
- uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
- GetModel(), UNO_QUERY_THROW);
+ uno::UNO_QUERY_THROW);
+ uno::Reference<document::XDocumentProperties> const xDocProps(
+ GetDocumentProperties());
pContext = new SvXMLMetaDocumentContext(*this,
- XML_NAMESPACE_OFFICE, rLocalName,
- xDPS->getDocumentProperties(), xDocBuilder);
+ XML_NAMESPACE_OFFICE, rLocalName, xDocProps, xDocBuilder);
}
if( !pContext )
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 6263292f0c..52666faeb1 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -997,7 +997,6 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine,
nCol = nOldCol;
}
}
- // <--
sal_uInt16 nColSpan = nCol - nOldCol + 1U;
@@ -1099,7 +1098,7 @@ void SwXMLExport::ExportTableLines( const SwTableLines& rLines,
SvXMLElementExport aElem( *this, XML_NAMESPACE_TABLE,
XML_TABLE_HEADER_ROWS, sal_True, sal_True );
- DBG_ASSERT( nHeaderRows <= nLines, "more headers then lines?" );
+ OSL_ENSURE( nHeaderRows <= nLines, "more headers then lines?" );
for( sal_uInt16 nLine = 0U; nLine < nHeaderRows; nLine++ )
ExportTableLine( *(rLines[nLine]), *pLines, rTblInfo );
}
@@ -1202,7 +1201,7 @@ void SwXMLTextParagraphExport::exportTable(
((SwXMLExport&)GetExport()).SetShowProgress( _bProgress );
Reference < XTextTable > xTxtTbl( rTextContent, UNO_QUERY );
- DBG_ASSERT( xTxtTbl.is(), "text table missing" );
+ OSL_ENSURE( xTxtTbl.is(), "text table missing" );
if( xTxtTbl.is() )
{
const SwXTextTable *pXTable = 0;
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index bbe48cc842..e0523dac6e 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -1230,7 +1230,7 @@ SwDDEFieldType* lcl_GetDDEFieldType(SwXMLDDETableContext_Impl* pContext,
GetDoc()->InsertFldType(aDDEFieldType);
}
- DBG_ASSERT(NULL != pType, "We really want a SwDDEFieldType here!");
+ OSL_ENSURE(NULL != pType, "We really want a SwDDEFieldType here!");
return pType;
}
@@ -1813,7 +1813,6 @@ const SwStartNode *SwXMLTableContext::GetPrevStartNode( sal_uInt32 nRow,
// #i95726# - Some fault tolerance
// else
else if ( pPrevCell->GetSubTable() )
- // <--
pSttNd = pPrevCell->GetSubTable()->GetLastStartNode();
OSL_ENSURE( pSttNd != 0,
@@ -2293,7 +2292,6 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper,
OSL_FAIL( "table seems to be corrupt." );
break;
}
- // <--
// Could the table fragment be splitted vertically behind the
// current column (uptp the current line?
@@ -2326,7 +2324,6 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper,
if( ( !bHasSubTables || ( pCell->GetRowSpan() == (nBottomRow-nTopRow) ) ) &&
pCell->GetColSpan() == (nCol+1UL-nStartCol) &&
( pCell->GetStartNode() || pCell->GetSubTable() ) )
- // <--
{
// insert new empty cell for covered cells:
long nBoxRowSpan = 1;
@@ -2787,7 +2784,7 @@ void SwXMLTableContext::MakeTable()
}
SwTableLine *pLine1 = pTableNode->GetTable().GetTabLines()[0U];
- DBG_ASSERT( pBox1 == pLine1->GetTabBoxes()[0U],
+ OSL_ENSURE( pBox1 == pLine1->GetTabBoxes()[0U],
"Why is box 1 change?" );
pBox1->pSttNd = pSttNd1;
pLine1->GetTabBoxes().Remove(0U);
@@ -2889,7 +2886,6 @@ const SwStartNode *SwXMLTableContext::InsertTableSection(
{
pDoc = const_cast<SwDoc*>(pEndNd->GetDoc());
}
- // <--
sal_uInt32 nOffset = pPrevSttNd ? 1UL : 0UL;
SwNodeIndex aIdx( *pEndNd, nOffset );
SwTxtFmtColl *pColl =
diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx
index fce08c5dda..ba505b13e1 100644
--- a/sw/source/filter/xml/xmltexte.cxx
+++ b/sw/source/filter/xml/xmltexte.cxx
@@ -166,7 +166,7 @@ void SwXMLTextParagraphExport::exportStyleContent(
}
OUString sVal( sBuffer.makeStringAndClear() );
- DBG_ASSERT( eFunc != XML_TOKEN_INVALID,
+ OSL_ENSURE( eFunc != XML_TOKEN_INVALID,
"SwXMLExport::ExportFmt: unknown condition" );
if( eFunc != XML_TOKEN_INVALID )
{
@@ -506,7 +506,7 @@ void SwXMLTextParagraphExport::_exportTextEmbedded(
if ( bIsOwnLink )
sURL = xLinkage->getLinkURL();
}
- catch( uno::Exception )
+ catch(const uno::Exception&)
{
// TODO/LATER: error handling
OSL_FAIL( "Link detection or retrieving of the URL of OOo link is failed!\n" );
diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx
index bfa231c10d..ea9d15f61b 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -994,7 +994,7 @@ void SwXMLTextImportHelper::RedlineAdd(
sal_Bool bMergeLastPara)
{
// create redline helper on demand
- DBG_ASSERT(NULL != pRedlineHelper, "helper should have been created in constructor");
+ OSL_ENSURE(NULL != pRedlineHelper, "helper should have been created in constructor");
if (NULL != pRedlineHelper)
pRedlineHelper->Add(rType, rId, rAuthor, rComment, rDateTime,
bMergeLastPara);
diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src
index 67715544bc..dcbbd416b0 100644
--- a/sw/source/ui/app/app.src
+++ b/sw/source/ui/app/app.src
@@ -410,6 +410,16 @@ String STR_EMPTYPAGE
Text [ en-US ] = "blank page" ;
};
+String STR_HEADER
+{
+ Text [ en-US ] = "Header: " ;
+};
+
+String STR_FOOTER
+{
+ Text [ en-US ] = "Footer: " ;
+};
+
QueryBox MSG_CLPBRD_CLEAR
{
BUTTONS = WB_YES_NO ;
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index 53c7bc8b4e..4540e3ba36 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -79,9 +79,9 @@
#include "envelp.hrc"
#include "envimg.hxx"
-#define ENV_NEWDOC RET_OK
-#define ENV_INSERT RET_USER
-#define ENV_CANCEL SHRT_MAX
+#define ENV_NEWDOC RET_OK
+#define ENV_INSERT RET_USER
+#define ENV_CANCEL SHRT_MAX
// Function used for labels and envelopes in applab.cxx and appenv.cxx
@@ -138,7 +138,7 @@ String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText
}
rSh.InsertLineBreak();
}
- rSh.DelLeft(); // Again remove last linebreak
+ rSh.DelLeft(); // Again remove last linebreak
return sRet;
}
@@ -156,15 +156,15 @@ void SwModule::InsertEnv( SfxRequest& rReq )
{
static sal_uInt16 nTitleNo = 0;
- SwDocShell *pMyDocSh;
- SfxViewFrame *pFrame;
+ SwDocShell *pMyDocSh;
+ SfxViewFrame *pFrame;
SwView *pNewView;
- SwWrtShell *pOldSh,
+ SwWrtShell *pOldSh,
*pSh;
// Get current shell
pMyDocSh = (SwDocShell*) SfxObjectShell::Current();
- pOldSh = pMyDocSh ? pMyDocSh->GetWrtShell() : 0;
+ pOldSh = pMyDocSh ? pMyDocSh->GetWrtShell() : 0;
// Create new document (don't show!)
SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_STANDARD ) );
@@ -349,7 +349,7 @@ void SwModule::InsertEnv( SfxRequest& rReq )
Printer *pPrt = pSh->getIDocumentDeviceAccess()->getPrinter( true );
- // Borders (are put together by Shift-Offset and alignment)
+ // Borders (are put together by Shift-Offset and alignment)
Size aPaperSize = pPrt->PixelToLogic( pPrt->GetPaperSizePixel(),
MAP_TWIP);
if ( !aPaperSize.Width() && !aPaperSize.Height() )
@@ -505,7 +505,7 @@ void SwModule::InsertEnv( SfxRequest& rReq )
rReq.Done();
}
- else // Abort
+ else // Abort
{
rReq.Ignore();
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 7b06465023..f41e10b78c 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -580,8 +580,8 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium )
if( pFlt->GetUserData().EqualsAscii( "HTML") )
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if( !pHtmlOpt->IsStarBasic() && pHtmlOpt->IsStarBasicWarning() && HasBasic() )
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if( !rHtmlOpt.IsStarBasic() && rHtmlOpt.IsStarBasicWarning() && HasBasic() )
{
uno::Reference< XLibraryContainer > xLibCont(GetBasicContainer(), UNO_QUERY);
uno::Reference< XNameAccess > xLib;
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 35e971c7e2..fa56013e32 100644..100755
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -636,7 +636,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
case SID_AUTO_CORRECT_DLG:
{
- SvxSwAutoFmtFlags* pAFlags = &SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
+ SvxSwAutoFmtFlags* pAFlags = &SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags();
SwAutoCompleteWord& rACW = SwDoc::GetAutoCompleteWords();
bool bOldLocked = rACW.IsLockWordLstLocked(),
@@ -801,12 +801,16 @@ void SwDocShell::Execute(SfxRequest& rReq)
SfxObjectFactory &rFact = GetFactory();
SfxFilterMatcher aMatcher( String::CreateFromAscii(rFact.GetShortName()) );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
const SfxFilter* pFlt = aIter.First();
while( pFlt )
{
- if( pFlt && pFlt->IsAllowedAsTemplate() )
+ // --> OD #i117339#
+// if( pFlt && pFlt->IsAllowedAsTemplate() )
+ if( pFlt && pFlt->IsAllowedAsTemplate() &&
+ ( pFlt->GetUserData().EqualsAscii("CXML") ||
+ pFlt->GetUserData().EqualsAscii("CXMLV") ) )
{
const String sWild = ((WildCard&)pFlt->GetWildcard()).GetWildCard();
xFltMgr->appendFilter( pFlt->GetUIName(), sWild );
@@ -826,7 +830,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
}
bool bError = false;
- // catch expception if wrong filter is selected - should not happen anymore
+ // catch exception if wrong filter is selected - should not happen anymore
try
{
xFltMgr->setCurrentFilter( pOwnFlt->GetUIName() );
@@ -1062,6 +1066,8 @@ void SwDocShell::Execute(SfxRequest& rReq)
case FN_OUTLINE_TO_CLIPBOARD:
case FN_OUTLINE_TO_IMPRESS:
{
+ sal_Bool bEnable = IsEnableSetModified();
+ EnableSetModified( sal_False );
WriterRef xWrt;
// mba: looks as if relative URLs don't make sense here
::GetRTFWriter( 'O', String(), xWrt );
@@ -1069,6 +1075,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
pStrm->SetBufferSize( 16348 );
SwWriter aWrt( *pStrm, *GetDoc() );
ErrCode eErr = aWrt.Write( xWrt );
+ EnableSetModified( bEnable );
if( !ERRCODE_TOERROR( eErr ) )
{
pStrm->Seek( STREAM_SEEK_TO_END );
@@ -1585,11 +1592,11 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
// A EnterBasicCall is not needed here, because nothing is called and
// there can't be any Dok-Basic, that has not yet been loaded inside
// of an HTML document.
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
//#59620# HasBasic() shows, that there already is a BasicManager at the DocShell.
// That was always generated in HTML-Import, when there are
// Macros in the source code.
- if( pHtmlOptions && pHtmlOptions->IsStarBasic() && HasBasic())
+ if( rHtmlOptions.IsStarBasic() && HasBasic())
{
BasicManager *pBasicMan = GetBasicManager();
if( pBasicMan && (pBasicMan != SFX_APP()->GetBasicManager()) )
@@ -1688,10 +1695,6 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
INetURLObject aURLObj( rURL );
String sURL( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) );
- SwRead pRead = 0;
- SwReader* pReader = 0;
- SwPaM* pPam = 0;
-
// Set filter:
String sFactory(String::CreateFromAscii(SwDocShell::Factory().GetShortName()));
SfxFilterMatcher aMatcher( sFactory );
@@ -1706,10 +1709,40 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
SfxFilterMatcher aWebMatcher( sWebFactory );
aWebMatcher.DetectFilter( aMed, &pFlt, sal_False, sal_False );
}
- if( aMed.IsStorage() )
+ // --> OD #i117339# - trigger import only for own formats
+// if( aMed.IsStorage() )
+ bool bImport( false );
+ {
+ if ( aMed.IsStorage() )
+ {
+ // As <SfxMedium.GetFilter().IsOwnFormat() resp. IsOwnTemplateFormat()
+ // does not work correct (e.g., MS Word 2007 XML Template),
+ // use workaround provided by MAV.
+ uno::Reference< embed::XStorage > xStorage = aMed.GetStorage();
+ if ( xStorage.is() )
+ {
+ // use <try-catch> on retrieving <MediaType> in order to check,
+ // if the storage is one of our own ones.
+ try
+ {
+ uno::Reference< beans::XPropertySet > xProps( xStorage, uno::UNO_QUERY_THROW );
+ const ::rtl::OUString aMediaTypePropName( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) );
+ xProps->getPropertyValue( aMediaTypePropName );
+ bImport = true;
+ }
+ catch( const uno::Exception& )
+ {
+ bImport = false;
+ }
+ }
+ }
+ }
+ if ( bImport )
+ // <--
{
- OSL_ENSURE((pFlt ? pFlt->GetVersion() : 0) >= SOFFICE_FILEFORMAT_60, "which file version?");
- pRead = ReadXML;
+ SwRead pRead = ReadXML;
+ SwReader* pReader = 0;
+ SwPaM* pPam = 0;
// the SW3IO - Reader need the pam/wrtshell, because only then he
// insert the styles!
if( bUnoCall )
@@ -1719,16 +1752,10 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
pReader = new SwReader( aMed, rURL, *pPam );
}
else
+ {
pReader = new SwReader( aMed, rURL, *pWrtShell->GetCrsr() );
- }
- else if( pFlt )
- {
- pReader = new SwReader( aMed, rURL, pDoc );
- }
+ }
- OSL_ENSURE( pRead, "no reader found" );
- if( pRead )
- {
pRead->GetReaderOpt().SetTxtFmts( rOpt.IsTxtFmts() );
pRead->GetReaderOpt().SetFrmFmts( rOpt.IsFrmFmts() );
pRead->GetReaderOpt().SetPageDescs( rOpt.IsPageDescs() );
@@ -1746,9 +1773,10 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
nErr = pReader->Read( *pRead );
pWrtShell->EndAllAction();
}
+ delete pPam;
+ delete pReader;
}
- delete pPam;
- delete pReader;
+
return nErr;
}
diff --git a/sw/source/ui/app/docshdrw.cxx b/sw/source/ui/app/docshdrw.cxx
index a6beb5993e..215dc56afc 100644
--- a/sw/source/ui/app/docshdrw.cxx
+++ b/sw/source/ui/app/docshdrw.cxx
@@ -64,7 +64,7 @@ void SwDocShell::InitDraw()
rOutliner.SetHyphenator( xHyphenator );
}
else
- PutItem( SvxColorTableItem( XColorTable::GetStdColorTable(), SID_COLOR_TABLE ));
+ PutItem( SvxColorTableItem( &XColorTable::GetStdColorTable(), SID_COLOR_TABLE ));
}
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index 0146355270..cd947b4ae7 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -334,18 +334,17 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
// the static pool default.
pDoc->SetDefault( SwFmtFollowTextFlow( sal_False ) );
-// --> collapsing borders FME 2005-05-27 #i29550#
+// #i29550#
pDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, sal_True ) );
// <-- collapsing
//#i16874# AutoKerning as default for new documents
pDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) );
- // --> OD 2005-02-10 #i42080# - Due to the several calls of method <SetDefault(..)>
+ // #i42080# - Due to the several calls of method <SetDefault(..)>
// at the document instance, the document is modified. Thus, reset this
// status here. Note: In method <SubInitNew()> this is also done.
pDoc->ResetModified();
- // <--
return bRet;
}
@@ -435,7 +434,7 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
{
XColorTable* pTable = pColItem->GetColorTable();
// when a new Table was created, it has to be deleted as well.
- if((void*)pTable != (void*)(XColorTable::GetStdColorTable()) )
+ if(pTable != &XColorTable::GetStdColorTable())
delete pTable;
}
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index fca6e9d8a6..35432155ef 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -121,7 +121,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
switch (nWhich)
{
case SID_STYLE_APPLY:
- {// here the template and its family are passed to the StyleBox
+ {// here the template and its family are passed to the StyleBox
// so that this family is being showed
if(pShell->IsFrmSelected())
{
@@ -202,8 +202,8 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
case SID_STYLE_FAMILY4:
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if( pDoc->get(IDocumentSettingAccess::HTML_MODE) && !pHtmlOpt->IsPrintLayoutExtension())
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if( pDoc->get(IDocumentSettingAccess::HTML_MODE) && !rHtmlOpt.IsPrintLayoutExtension())
rSet.DisableItem( nWhich );
else
{
@@ -262,7 +262,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh)
/*--------------------------------------------------------------------
- Description: evaluate StyleSheet-Requests
+ Description: evaluate StyleSheet-Requests
--------------------------------------------------------------------*/
@@ -643,7 +643,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
}
if (!bBasic)
{
- // prior to the dialog the HtmlMode at the DocShell is being sunk
+ // prior to the dialog the HtmlMode at the DocShell is being sunk
sal_uInt16 nHtmlMode = ::GetHtmlMode(this);
// In HTML mode, we do not always have a printer. In order to show
@@ -670,7 +670,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
{
GetWrtShell()->StartAllAction();
- // newly set the mask only with paragraph-templates
+ // newly set the mask only with paragraph-templates
if( bNew )
{
nRet = SFX_STYLE_FAMILY_PARA == pStyle->GetFamily()
@@ -864,11 +864,10 @@ sal_uInt16 SwDocShell::ApplyStyles(const String &rName, sal_uInt16 nFamily,
}
case SFX_STYLE_FAMILY_PARA:
{
- // --> OD 2007-11-06 #i62675#
+ // #i62675#
// clear also list attributes at affected text nodes, if paragraph
// style has the list style attribute set.
pSh->SetTxtFmtColl( pStyle->GetCollection(), true );
- // <--
break;
}
case SFX_STYLE_FAMILY_FRAME:
@@ -1004,10 +1003,9 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr
pCurrWrtShell->StartAllAction();
pCurrWrtShell->GetFlyFrmAttr( aSet );
- // --> OD 2009-12-28 #i105535#
+ // #i105535#
// no update of anchor attribute
aSet.ClearItem( RES_ANCHOR );
- // <--
pFrm->SetFmtAttr( aSet );
@@ -1024,7 +1022,7 @@ sal_uInt16 SwDocShell::UpdateStyle(const String &rName, sal_uInt16 nFamily, SwWr
{
pCurrWrtShell->StartAllAction();
pCurrWrtShell->FillByEx(pChar);
- // also apply template to remove hard set attributes
+ // also apply template to remove hard set attributes
pCurrWrtShell->EndAllAction();
}
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index a822462b4f..2bf690de00 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -1282,11 +1282,10 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
if( rDoc.FindPageDescByName( pDesc->GetName(), &nPgDscPos ))
{
pNewDsc = new SwPageDesc( *pDesc );
- // --> OD 2005-05-09 #i48949# - no undo actions for the
+ // #i48949# - no undo actions for the
// copy of the page style
::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo());
rDoc.CopyPageDesc(*pDesc, *pNewDsc); // #i7983#
- // <--
pFmt = &pNewDsc->GetMaster();
}
@@ -2167,9 +2166,8 @@ void SwDocStyleSheetPool::Replace( SfxStyleSheetBase& rSource,
pTargetFmt->ResetFmtAttr( RES_PAGEDESC, RES_FRMATR_END-1 );
else
{
- // --> OD 2007-01-25 #i73790# - method renamed
+ // #i73790# - method renamed
pTargetFmt->ResetAllFmtAttr();
- // <--
}
if( USHRT_MAX != nPgDscPos )
diff --git a/sw/source/ui/app/mn.src b/sw/source/ui/app/mn.src
index 22370c3d11..7838f9935e 100644
--- a/sw/source/ui/app/mn.src
+++ b/sw/source/ui/app/mn.src
@@ -862,7 +862,6 @@ Menu MN_TAB_POPUPMENU
};
#define MN_WRAP_CONTOUR_1 MN_WRAP_CONTOUR
-#define MN_EDIT_CONTOUR_1 MN_EDIT_CONTOUR
#define MN_MOUSE_FRAME_BEGIN \
MenuItem\
diff --git a/sw/source/ui/app/swdll.cxx b/sw/source/ui/app/swdll.cxx
index d3a55d9cde..6124324b35 100644
--- a/sw/source/ui/app/swdll.cxx
+++ b/sw/source/ui/app/swdll.cxx
@@ -46,6 +46,8 @@
#include <cfgid.h>
#include <unotools/moduleoptions.hxx>
+#include <comphelper/scoped_disposing_ptr.hxx>
+#include <comphelper/processfactory.hxx>
#include <svx/fmobjfac.hxx>
#include <svx/svdfield.hxx>
@@ -53,7 +55,32 @@
#include <unomid.h>
-void SwDLL::Init()
+#include "swdllimpl.hxx"
+
+namespace
+{
+ //Holds a SwDLL and release it on exit, or dispose of the
+ //default XComponent, whichever comes first
+ class SwDLLInstance : public comphelper::scoped_disposing_solar_mutex_reset_ptr<SwDLL>
+ {
+ public:
+ SwDLLInstance() : comphelper::scoped_disposing_solar_mutex_reset_ptr<SwDLL>(::com::sun::star::uno::Reference<com::sun::star::lang::XComponent>(comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop"))), ::com::sun::star::uno::UNO_QUERY_THROW), new SwDLL)
+ {
+ }
+ };
+
+ struct theSwDLLInstance : public rtl::Static<SwDLLInstance, theSwDLLInstance> {};
+}
+
+namespace SwGlobals
+{
+ void ensure()
+ {
+ theSwDLLInstance::get();
+ }
+}
+
+SwDLL::SwDLL()
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDLL" );
@@ -74,7 +101,7 @@ void SwDLL::Init()
SfxObjectFactory* pWDocFact = &SwWebDocShell::Factory();
SwModule* pModule = new SwModule( pWDocFact, pDocFact, pGlobDocFact );
- (*ppShlPtr) = pModule;
+ *ppShlPtr = pModule;
pWDocFact->SetDocumentServiceName(C2S("com.sun.star.text.WebDocument"));
@@ -115,11 +142,8 @@ void SwDLL::Init()
RegisterControls();
}
-void SwDLL::Exit()
+SwDLL::~SwDLL()
{
- // called directly befor unloading the DLL
- // do whatever you want, Sw-DLL is accessible
-
// Pool has to be deleted before statics are
SW_MOD()->RemoveAttrPool();
@@ -128,10 +152,12 @@ void SwDLL::Exit()
::_FinitCore();
// sign out Objekt-Factory
SdrObjFactory::RemoveMakeObjectHdl(LINK(&aSwObjectFactory, SwObjectFactory, MakeObject ));
+#if 0
// the SwModule must be destroyed
SwModule** ppShlPtr = (SwModule**) GetAppData(SHL_WRITER);
delete (*ppShlPtr);
(*ppShlPtr) = NULL;
+#endif
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/app/swdllimpl.hxx b/sw/source/ui/app/swdllimpl.hxx
new file mode 100644
index 0000000000..74724366b4
--- /dev/null
+++ b/sw/source/ui/app/swdllimpl.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Caolán McNamara <caolanm@redhat.com> (Red Hat, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2011 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Caolán McNamara <caolanm@redhat.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef SWDLL_IMPL_INCLUDE
+#define SWDLL_IMPL_INCLUDE
+
+class SwDLL
+{
+public:
+ static void RegisterFactories();
+ static void RegisterInterfaces();
+ static void RegisterControls();
+
+ SwDLL();
+ ~SwDLL();
+};
+
+#endif
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index 1429bc1670..9c327681b4 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <boost/scoped_ptr.hpp>
#include <hintids.hxx>
#include <sfx2/request.hxx>
@@ -81,14 +82,14 @@ using namespace ::com::sun::star::view;
using namespace ::com::sun::star::lang;
-void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh )
+void lcl_SetUIPrefs(const SwViewOption &rPref, SwView* pView, ViewShell* pSh )
{
// in FrameSets the actual visibility can differ from the ViewOption's setting
- sal_Bool bVScrollChanged = pPref->IsViewVScrollBar() != pSh->GetViewOptions()->IsViewVScrollBar();
- sal_Bool bHScrollChanged = pPref->IsViewHScrollBar() != pSh->GetViewOptions()->IsViewHScrollBar();
- sal_Bool bVAlignChanged = pPref->IsVRulerRight() != pSh->GetViewOptions()->IsVRulerRight();
+ sal_Bool bVScrollChanged = rPref.IsViewVScrollBar() != pSh->GetViewOptions()->IsViewVScrollBar();
+ sal_Bool bHScrollChanged = rPref.IsViewHScrollBar() != pSh->GetViewOptions()->IsViewHScrollBar();
+ sal_Bool bVAlignChanged = rPref.IsVRulerRight() != pSh->GetViewOptions()->IsVRulerRight();
- pSh->SetUIOptions(*pPref);
+ pSh->SetUIOptions(rPref);
const SwViewOption* pNewPref = pSh->GetViewOptions();
// Scrollbars on / off
@@ -199,24 +200,24 @@ void SwModule::ApplyUsrPref(const SwViewOption &rUsrPref, SwView* pActView,
bReadonly = pDocSh->IsReadOnly();
else //Use existing option if DocShell missing
bReadonly = pSh->GetViewOptions()->IsReadonly();
- SwViewOption* pViewOpt;
- if(!bViewOnly)
- pViewOpt = new SwViewOption( *pPref );
+ boost::scoped_ptr<SwViewOption> xViewOpt;
+ if (!bViewOnly)
+ xViewOpt.reset(new SwViewOption(*pPref));
else
- pViewOpt = new SwViewOption( rUsrPref );
- pViewOpt->SetReadonly( bReadonly );
- if( !(*pSh->GetViewOptions() == *pViewOpt) )
+ xViewOpt.reset(new SwViewOption(rUsrPref));
+ xViewOpt->SetReadonly( bReadonly );
+ if( !(*pSh->GetViewOptions() == *xViewOpt) )
{
//is maybe only a ViewShell
pSh->StartAction();
- pSh->ApplyViewOptions( *pViewOpt );
- ((SwWrtShell*)pSh)->SetReadOnlyAvailable(pViewOpt->IsCursorInProtectedArea());
+ pSh->ApplyViewOptions( *xViewOpt );
+ ((SwWrtShell*)pSh)->SetReadOnlyAvailable(xViewOpt->IsCursorInProtectedArea());
pSh->EndAction();
}
if ( pSh->GetViewOptions()->IsReadonly() != bReadonly )
pSh->SetReadonlyOption(bReadonly);
- lcl_SetUIPrefs(pViewOpt, pCurrView, pSh);
+ lcl_SetUIPrefs(*xViewOpt, pCurrView, pSh);
// in the end the Idle-Flag is set again
pPref->SetIdle(sal_True);
@@ -426,6 +427,13 @@ sal_uInt16 SwModule::GetRedlineAuthor()
return InsertRedlineAuthor( sActAuthor );
}
+void SwModule::SetRedlineAuthor(const String &rAuthor)
+{
+ bAuthorInitialised = sal_True;
+ sActAuthor = rAuthor;
+ InsertRedlineAuthor( sActAuthor );
+}
+
const String& SwModule::GetRedlineAuthor(sal_uInt16 nPos)
{
OSL_ENSURE(nPos<pAuthorNames->Count(), "author not found!"); //#i45342# RTF doc with no author table caused reader to crash
diff --git a/sw/source/ui/app/swmodule.cxx b/sw/source/ui/app/swmodule.cxx
index 4599fabf8b..d3efbbee37 100644
--- a/sw/source/ui/app/swmodule.cxx
+++ b/sw/source/ui/app/swmodule.cxx
@@ -147,6 +147,8 @@ sal_Bool bNoInterrupt = sal_False;
#include <unomid.h>
+#include "swdllimpl.hxx"
+
using namespace com::sun::star;
@@ -185,7 +187,7 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
{
SetName( String::CreateFromAscii("StarWriter") );
pSwResMgr = GetResMgr();
- SvxErrorHandler::Get();
+ SvxErrorHandler::ensure();
pErrorHdl = new SfxErrorHandler( RID_SW_ERRHDL,
ERRCODE_AREA_SW,
ERRCODE_AREA_SW_END,
@@ -202,12 +204,9 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
pAuthorNames = new SvStringsDtor(5, 1); // All Redlining-Authors
// replace SvxAutocorrect with SwAutocorrect
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- if( pACfg )
- {
- const SvxAutoCorrect* pOld = pACfg->GetAutoCorrect();
- pACfg->SetAutoCorrect(new SwAutoCorrect( *pOld ));
- }
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrect* pOld = rACfg.GetAutoCorrect();
+ rACfg.SetAutoCorrect(new SwAutoCorrect( *pOld ));
StartListening( *SFX_APP() );
@@ -254,8 +253,6 @@ uno::Reference< linguistic2::XLanguageGuessing > SwModule::GetLanguageGuesser()
SwModule::~SwModule()
{
- SetPool(0);
- SfxItemPool::Free(pAttrPool);
delete pErrorHdl;
EndListening( *SFX_APP() );
}
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index 6e1e9fce46..0cd310a5d6 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -36,8 +36,6 @@
#define _SVSTDARR_STRINGSDTOR
#define _SVSTDARR_STRINGSISORTDTOR
#define _SVSTDARR_XUB_STRLEN
-#define _SVSTDARR_USHORTS
-#define _SVSTDARR_ULONGS
#include <svl/svstdarr.hxx>
#include "cmdid.h"
@@ -100,9 +98,18 @@ class SwDropCapsPict : public Control
sal_Int32 mnLeading;
Printer* mpPrinter;
sal_Bool mbDelPrinter;
- SvULongs maTextWidth;
- SvXub_StrLens maScriptChg;
- SvUShorts maScriptType;
+ /// The _ScriptInfo structure holds information on where we change from one
+ /// script to another.
+ struct _ScriptInfo
+ {
+ sal_uLong textWidth; ///< Physical width of this segment.
+ sal_uInt16 scriptType; ///< Script type (e.g. Latin, Asian, Complex)
+ xub_StrLen changePos; ///< Character position where the script changes.
+ _ScriptInfo(sal_uLong txtWidth, sal_uInt16 scrptType, xub_StrLen position)
+ : textWidth(txtWidth), scriptType(scrptType), changePos(position) {}
+ bool operator<(_ScriptInfo other) { return changePos < other.changePos; }
+ };
+ std::vector<_ScriptInfo> maScriptChanges;
SvxFont maFont;
SvxFont maCJKFont;
SvxFont maCTLFont;
@@ -115,6 +122,8 @@ class SwDropCapsPict : public Control
inline void InitPrinter( void );
void _InitPrinter( void );
void GetFontSettings( const SwDropCapsPage& _rPage, Font& _rFont, sal_uInt16 _nWhich );
+ void GetFirstScriptSegment(xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType);
+ bool GetNextScriptSegment(size_t &nIdx, xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType);
public:
SwDropCapsPict(Window *pParent, const ResId &rResId)
@@ -200,6 +209,41 @@ static void calcFontHeightAnyAscent( OutputDevice* _pWin, Font& _rFont, long& _n
delete mpPrinter;
}
+/// Get the details of the first script change.
+/// @param[out] start The character position of the start of the segment.
+/// @param[out] end The character position of the end of the segment.
+/// @param[out] scriptType The script type (Latin, Asian, Complex etc.)
+void SwDropCapsPict::GetFirstScriptSegment(xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType)
+{
+ start = 0;
+ if( maScriptChanges.empty() )
+ {
+ end = maText.Len();
+ scriptType = I18N_SCRIPTTYPE::LATIN;
+ }
+ else
+ {
+ end = maScriptChanges[ 0 ].changePos;
+ scriptType = maScriptChanges[ 0 ].scriptType;
+ }
+}
+
+/// Get the details of the first script change.
+/// @param[in,out] nIdx Index of the current script change.
+/// @param[out] start The character position of the start of the segment.
+/// @param[in,out] end The character position of the end of the segment.
+/// @param[out] scriptType The script type (Latin, Asian, Complex etc.)
+/// @returns True if there was a next segment, false if not.
+bool SwDropCapsPict::GetNextScriptSegment(size_t &nIdx, xub_StrLen &start, xub_StrLen &end, sal_uInt16 &scriptType)
+{
+ if (maScriptChanges.empty() || nIdx >= maScriptChanges.size() - 1 || end >= maText.Len())
+ return false;
+ start = maScriptChanges[nIdx++].changePos;
+ end = maScriptChanges[ nIdx ].changePos;
+ scriptType = maScriptChanges[ nIdx ].scriptType;
+ return true;
+}
+
#define LINES 10
#define BORDER 2
@@ -350,20 +394,9 @@ void SwDropCapsPict::DrawPrev( const Point& rPt )
Font aOldFont = mpPrinter->GetFont();
sal_uInt16 nScript;
size_t nIdx = 0;
- xub_StrLen nStart = 0;
+ xub_StrLen nStart;
xub_StrLen nEnd;
- size_t nCnt = maScriptChg.size();
-
- if( nCnt )
- {
- nEnd = maScriptChg[ nIdx ];
- nScript = maScriptType[ nIdx ];
- }
- else
- {
- nEnd = maText.Len();
- nScript = I18N_SCRIPTTYPE::LATIN;
- }
+ GetFirstScriptSegment(nStart, nEnd, nScript);
do
{
SvxFont& rFnt = (nScript==I18N_SCRIPTTYPE::ASIAN) ? maCJKFont : ((nScript==I18N_SCRIPTTYPE::COMPLEX) ? maCTLFont : maFont);
@@ -371,14 +404,8 @@ void SwDropCapsPict::DrawPrev( const Point& rPt )
rFnt.DrawPrev( this, mpPrinter, aPt, maText, nStart, nEnd - nStart );
- aPt.X() += maTextWidth[ nIdx++ ];
- if( nEnd < maText.Len() && nIdx < nCnt )
- {
- nStart = nEnd;
- nEnd = maScriptChg[ nIdx ];
- nScript = maScriptType[ nIdx ];
- }
- else
+ aPt.X() += maScriptChanges[ nIdx ].textWidth;
+ if ( !GetNextScriptSegment(nIdx, nStart, nEnd, nScript) )
break;
}
while( sal_True );
@@ -391,14 +418,7 @@ void SwDropCapsPict::CheckScript( void )
return;
maScriptText = maText;
- size_t nCnt = maScriptChg.size();
- if( nCnt )
- {
- maScriptChg.clear();
- maScriptType.Remove( 0, nCnt );
- maTextWidth.Remove( 0, nCnt );
- nCnt = 0;
- }
+ maScriptChanges.clear();
if( !xBreak.is() )
{
Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
@@ -421,9 +441,7 @@ void SwDropCapsPict::CheckScript( void )
do
{
nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript );
- maScriptChg.push_back( nChg );
- maScriptType.Insert( nScript, nCnt );
- maTextWidth.Insert( sal_uLong(0), nCnt++ );
+ maScriptChanges.push_back( _ScriptInfo(0, nScript, nChg) );
if( nChg < maText.Len() )
nScript = xBreak->getScriptType( maText, nChg );
@@ -439,19 +457,9 @@ Size SwDropCapsPict::CalcTextSize( void )
sal_uInt16 nScript;
size_t nIdx = 0;
- xub_StrLen nStart = 0;
+ xub_StrLen nStart;
xub_StrLen nEnd;
- size_t nCnt = maScriptChg.size();
- if( nCnt )
- {
- nEnd = maScriptChg[ nIdx ];
- nScript = maScriptType[ nIdx ];
- }
- else
- {
- nEnd = maText.Len();
- nScript = I18N_SCRIPTTYPE::LATIN;
- }
+ GetFirstScriptSegment(nStart, nEnd, nScript);
long nTxtWidth = 0;
long nCJKHeight = 0;
long nCTLHeight = 0;
@@ -465,8 +473,8 @@ Size SwDropCapsPict::CalcTextSize( void )
( ( nScript == I18N_SCRIPTTYPE::COMPLEX )? maCTLFont : maFont );
sal_uLong nWidth = rFnt.GetTxtSize( mpPrinter, maText, nStart, nEnd-nStart ).Width();
- if( nIdx < maTextWidth.Count() )
- maTextWidth[ nIdx++ ] = nWidth;
+ if( nIdx < maScriptChanges.size() )
+ maScriptChanges[ nIdx ].textWidth = nWidth;
nTxtWidth += nWidth;
switch(nScript)
{
@@ -480,13 +488,7 @@ Size SwDropCapsPict::CalcTextSize( void )
calcFontHeightAnyAscent( this, maFont, nHeight, nAscent );
}
- if( nEnd < maText.Len() && nIdx < nCnt )
- {
- nStart = nEnd;
- nEnd = maScriptChg[ nIdx ];
- nScript = maScriptType[ nIdx ];
- }
- else
+ if ( !GetNextScriptSegment(nIdx, nStart, nEnd, nScript) )
break;
}
while( sal_True );
diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index 86f5f31080..5e85e3fcc9 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -105,8 +105,8 @@ SwParaDlg::SwParaDlg(Window *pParent,
OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!");
AddTabPage( TP_PARA_ALIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) );
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if (!bDrawParaDlg && (!bHtmlMode || pHtmlOpt->IsPrintLayoutExtension()))
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if (!bDrawParaDlg && (!bHtmlMode || rHtmlOpt.IsPrintLayoutExtension()))
{
OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!");
OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!");
diff --git a/sw/source/ui/config/cfgitems.cxx b/sw/source/ui/config/cfgitems.cxx
index abf7bba55e..451bccdd55 100644
--- a/sw/source/ui/config/cfgitems.cxx
+++ b/sw/source/ui/config/cfgitems.cxx
@@ -382,4 +382,4 @@ int SwTestItem::operator==( const SfxPoolItem& rAttr ) const
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/config/mailconfigpage.cxx b/sw/source/ui/config/mailconfigpage.cxx
index 4e9d2c5fbe..544a25cafa 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -337,6 +337,8 @@ void SwTestAccountSettingsDialog::Test()
{
uno::Reference<XMultiServiceFactory> rMgr = ::comphelper::getProcessServiceFactory();
+ rtl::OUString sException;
+
bool bIsLoggedIn = false;
bool bIsServer = false;
if (rMgr.is())
@@ -412,9 +414,9 @@ void SwTestAccountSettingsDialog::Test()
if( xMailService->isConnected())
xMailService->disconnect();
}
- catch(uno::Exception&)
+ catch (const uno::Exception& e)
{
- OSL_FAIL("exception caught");
+ sException = e.Message;
}
}
@@ -437,7 +439,10 @@ void SwTestAccountSettingsDialog::Test()
if(!bIsServer || !bIsLoggedIn )
{
- m_eErrorsED.SetText( m_sErrorServer );
+ rtl::OUStringBuffer aErrorMessage(m_sErrorServer);
+ if (!sException.isEmpty())
+ aErrorMessage.appendAscii(RTL_CONSTASCII_STRINGPARAM("\n--\n")).append(sException);
+ m_eErrorsED.SetText(aErrorMessage.makeStringAndClear());
}
}
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 0dfcfc6329..7f76b613d6 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -548,11 +548,6 @@ sal_Bool SwCompatibilityOptPage::FillItemSet( SfxItemSet& )
m_pWrtShell->SetAddParaSpacingToTableCells( bChecked );
bModified = sal_True;
}
- else if ( COPT_ADD_TABLESPACING == nOption )
- {
- m_pWrtShell->SetAddParaSpacingToTableCells( bChecked );
- bModified = sal_True;
- }
else if ( COPT_USE_OBJECTPOSITIONING == nOption )
{
m_pWrtShell->SetUseFormerObjectPositioning( bChecked );
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index 4af01f1a35..8a21f450ee 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -59,7 +59,7 @@ TabPage TP_CONTENT_OPT
HelpID = "sw:CheckBox:TP_CONTENT_OPT:CB_CROSS";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 118 , 10 ) ;
- Text [ en-US ] = "Guides ~while moving";
+ Text [ en-US ] = "Helplines ~While Moving";
};
CheckBox CB_HANDLE
{
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 164186c5f7..fbad543bea 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -312,9 +312,6 @@ void SwLoadOptPage::Reset( const SfxItemSet& rSet)
aUseCharUnit.SaveValue();
}
-/*-----------------13.01.97 14.44-------------------
- Switch Deftabstops' metric
---------------------------------------------------*/
IMPL_LINK(SwLoadOptPage, MetricHdl, ListBox*, EMPTYARG)
{
const sal_uInt16 nMPos = aMetricLB.GetSelectEntryPos();
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 4602efe874..da8c0e39c6 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -1679,7 +1679,7 @@ void SwMarkPreview::Paint(const Rectangle &/*rRect*/)
void SwMarkPreview::PaintPage(const Rectangle &rRect)
{
- // draw PrintArea
+ // draw PrintArea
DrawRect(rRect, m_aTransCol, m_aPrintAreaCol );
// draw Testparagraph
@@ -1699,7 +1699,7 @@ void SwMarkPreview::PaintPage(const Rectangle &rRect)
nStep = aTextLine.GetHeight() + 2;
nLines = (sal_uInt16)(rRect.GetHeight() / (aTextLine.GetHeight() + 2)) - 1;
- // simulate text
+ // simulate text
for (sal_uInt16 i = 0; i < nLines; ++i)
{
if (i == (nLines - 1))
@@ -1978,11 +1978,11 @@ void SwRedlineOptionsTabPage::Reset( const SfxItemSet& )
aDeletedColorLB.InsertEntry(sAuthor);
aChangedColorLB.InsertEntry(sAuthor);
- XColorTable* pColorTbl = XColorTable::GetStdColorTable();
+ XColorTable& rColorTbl = XColorTable::GetStdColorTable();
sal_uInt16 i;
- for( i = 0; i < pColorTbl->Count(); ++i )
+ for( i = 0; i < rColorTbl.Count(); ++i )
{
- XColorEntry* pEntry = pColorTbl->GetColor( i );
+ XColorEntry* pEntry = rColorTbl.GetColor( i );
Color aColor = pEntry->GetColor();
String sName = pEntry->GetName();
diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx
index ae96f2ae6f..ac139fce27 100644
--- a/sw/source/ui/config/uinums.cxx
+++ b/sw/source/ui/config/uinums.cxx
@@ -39,7 +39,7 @@
#include <tools/resid.hxx>
#include <fmtornt.hxx>
-#include <swtypes.hxx> // empty string
+#include <swtypes.hxx> // empty string
#include <wrtsh.hxx>
#include <uinums.hxx>
#include <poolfmt.hxx>
@@ -51,12 +51,12 @@
using namespace ::com::sun::star;
-#define VERSION_30B ((sal_uInt16)250)
-#define VERSION_31B ((sal_uInt16)326)
-#define VERSION_40A ((sal_uInt16)364)
+#define VERSION_30B ((sal_uInt16)250)
+#define VERSION_31B ((sal_uInt16)326)
+#define VERSION_40A ((sal_uInt16)364)
#define VERSION_50A ((sal_uInt16)373)
#define VERSION_53A ((sal_uInt16)596)
-#define ACT_NUM_VERSION VERSION_53A
+#define ACT_NUM_VERSION VERSION_53A
#define NUMRULE_FILENAME "numrule.cfg"
#define CHAPTER_FILENAME "chapter.cfg"
@@ -67,9 +67,9 @@ SV_IMPL_PTRARR( _SwNumFmtsAttrs, SfxPoolItem* )
// SwNumRulesWithName ----------------------------------------------------
// PUBLIC METHODES -------------------------------------------------------
/*------------------------------------------------------------------------
- Description: Saving a rule
- Parameter: rCopy -- the rule to save
- nIdx -- position, where the rule is to be saved.
+ Description: Saving a rule
+ Parameter: rCopy -- the rule to save
+ nIdx -- position, where the rule is to be saved.
An old rule at that position will be overwritten.
------------------------------------------------------------------------*/
@@ -145,7 +145,7 @@ sal_Bool SwBaseNumRules::Store(SvStream &rStream)
int SwBaseNumRules::Load(SvStream &rStream)
{
- int rc = 0;
+ int rc = 0;
rStream >> nVersion;
@@ -339,48 +339,48 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
sal_Bool bFlag;
String sStr;
- rStream >> nUS; aFmt.SetNumberingType((sal_Int16)nUS );
+ rStream >> nUS; aFmt.SetNumberingType((sal_Int16)nUS );
if( VERSION_53A > nVersion )
{
- rStream >> cChar; aFmt.SetBulletChar( cChar );
+ rStream >> cChar; aFmt.SetBulletChar( cChar );
}
else
{
- rStream >> nUS; aFmt.SetBulletChar( nUS );
+ rStream >> nUS; aFmt.SetBulletChar( nUS );
}
- rStream >> bFlag; aFmt.SetIncludeUpperLevels( bFlag );
+ rStream >> bFlag; aFmt.SetIncludeUpperLevels( bFlag );
if( VERSION_30B == nVersion )
{
long nL;
- rStream >> cChar; aFmt.SetStart( (sal_uInt16)cChar );
+ rStream >> cChar; aFmt.SetStart( (sal_uInt16)cChar );
rStream.ReadByteString(sStr, eEncoding);
aFmt.SetPrefix( sStr );
rStream.ReadByteString(sStr, eEncoding);
aFmt.SetSuffix( sStr );
- rStream >> nUS; aFmt.SetNumAdjust( SvxAdjust( nUS ) );
- rStream >> nL; aFmt.SetLSpace( lNumIndent );
- rStream >> nL; aFmt.SetFirstLineOffset( (short)nL );
+ rStream >> nUS; aFmt.SetNumAdjust( SvxAdjust( nUS ) );
+ rStream >> nL; aFmt.SetLSpace( lNumIndent );
+ rStream >> nL; aFmt.SetFirstLineOffset( (short)nL );
}
- else // old start-value was a Byte
+ else // old start-value was a Byte
{
short nShort;
- rStream >> nUS; aFmt.SetStart( nUS );
+ rStream >> nUS; aFmt.SetStart( nUS );
rStream.ReadByteString(sStr, eEncoding);
aFmt.SetPrefix( sStr );
rStream.ReadByteString(sStr, eEncoding);
aFmt.SetSuffix( sStr );
- rStream >> nUS; aFmt.SetNumAdjust( SvxAdjust( nUS ) );
- rStream >> nUS; aFmt.SetAbsLSpace( nUS );
- rStream >> nShort; aFmt.SetFirstLineOffset( nShort );
- rStream >> nUS; aFmt.SetCharTextDistance( nUS );
- rStream >> nShort; aFmt.SetLSpace( nShort );
+ rStream >> nUS; aFmt.SetNumAdjust( SvxAdjust( nUS ) );
+ rStream >> nUS; aFmt.SetAbsLSpace( nUS );
+ rStream >> nShort; aFmt.SetFirstLineOffset( nShort );
+ rStream >> nUS; aFmt.SetCharTextDistance( nUS );
+ rStream >> nShort; aFmt.SetLSpace( nShort );
rStream >> bFlag;
}
- sal_uInt16 nFamily;
+ sal_uInt16 nFamily;
sal_uInt16 nCharSet;
short nWidth;
short nHeight;
@@ -567,7 +567,7 @@ void SwNumRulesWithName::_SwNumFmtGlobal::ChgNumFmt( SwWrtShell& rSh,
else
pFmt = rSh.GetCharFmtFromPool( nCharPoolId );
- if( !pFmt->GetDepends() ) // set attributes
+ if( !pFmt->GetDepends() ) // set attributes
for( sal_uInt16 n = aItems.Count(); n; )
pFmt->SetFmtAttr( *aItems[ --n ] );
}
diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx
index 20627df243..de73d21ae8 100644
--- a/sw/source/ui/config/usrpref.cxx
+++ b/sw/source/ui/config/usrpref.cxx
@@ -250,7 +250,7 @@ Sequence<OUString> SwLayoutViewConfig::GetPropertyNames()
"Window/IsVerticalRulerRight", //16
"ViewLayout/Columns", //17
"ViewLayout/BookMode", //18
- "Other/IsSquaredPageMode" //19
+ "Other/IsSquaredPageMode", //19
"Other/ApplyCharUnit" //20
};
const int nCount = bWeb ? 15 : 21;
@@ -315,7 +315,7 @@ void SwLayoutViewConfig::Commit()
case 17: rVal <<= (sal_Int32)rParent.GetViewLayoutColumns(); break; // "ViewLayout/Columns",
case 18: rVal <<= (sal_Bool) rParent.IsViewLayoutBookMode(); break; // "ViewLayout/BookMode",
case 19: rVal <<= (sal_Bool) rParent.IsSquaredPageMode(); break; // "Other/IsSquaredPageMode",
- case 20: rVal <<= (sal_Bool) rParent.IsApplyCharUnit(); break; // "Other/IsSquaredPageMode",
+ case 20: rVal <<= (sal_Bool) rParent.IsApplyCharUnit(); break; // "Other/ApplyCharUnit",
}
}
PutProperties(aNames, aValues);
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index de768a172a..afe6d06461 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -317,7 +317,7 @@ void SwViewOption::Init( Window *pWin )
sal_Bool SwViewOption::IsAutoCompleteWords() const
{
- const SvxSwAutoFmtFlags& rFlags = SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags();
+ const SvxSwAutoFmtFlags& rFlags = SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags();
return rFlags.bAutoCmpltCollectWords;
}
@@ -334,8 +334,8 @@ sal_uInt16 GetHtmlMode(const SwDocShell* pShell)
if(!pShell || PTR_CAST(SwWebDocShell, pShell))
{
nRet = HTMLMODE_ON;
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- switch ( pHtmlOpt->GetExportMode() )
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ switch ( rHtmlOpt.GetExportMode() )
{
case HTML_CFG_MSIE_40:
nRet |= HTMLMODE_PARA_BORDER|HTMLMODE_SMALL_CAPS|
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index fc018d5414..fe8262adb3 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -263,7 +263,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) :
SWUnoHelper::UCB_IsFile( pUserData->sURL ) && //#i97577#
!SWUnoHelper::UCB_IsReadOnlyFileName( pUserData->sURL );
}
- catch(const uno::Exception& )
+ catch (const uno::Exception&)
{
bEnableOK = sal_False;
}
@@ -345,7 +345,7 @@ IMPL_LINK(SwAddressListDialog, FilterHdl_Impl, PushButton*, EMPTYARG)
}
::comphelper::disposeComponent(xRowSet);
}
- catch(Exception& )
+ catch (const Exception&)
{
OSL_FAIL("exception caught in SwAddressListDialog::FilterHdl_Impl");
}
@@ -448,7 +448,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, PushButton*, pButton)
m_aCreateListPB.Enable(sal_False);
}
- catch(Exception& )
+ catch (const Exception&)
{
}
}
@@ -645,7 +645,7 @@ void SwAddressListDialog::DetectTablesAndQueries(
m_aFilterPB.Enable( pUserData->xConnection.is() && sCommand.Len() );
m_aTablePB.Enable( pUserData->nTableAndQueryCount > 1 );
}
- catch(Exception& )
+ catch (const Exception&)
{
OSL_FAIL("exception caught in SwAddressListDialog::DetectTablesAndQueries");
m_aOK.Enable( sal_False );
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 2616491893..991f196770 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -352,7 +352,7 @@ SwInsertDBColAutoPilot::SwInsertDBColAutoPilot( SwView& rView,
}
pNew->nDBNumFmt = nKey;
}
- catch(const Exception& )
+ catch (const Exception&)
{
OSL_FAIL("illegal number format key");
}
@@ -1097,7 +1097,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
else if(!i)
bBreak = !xResultSet->first();
}
- catch(const Exception& )
+ catch (const Exception&)
{
bBreak = sal_True;
}
@@ -1177,14 +1177,12 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
}
}
}
- catch(Exception&
-#if OSL_DEBUG_LEVEL > 1
- aExcept
-#endif
- )
+ catch (const Exception& rExcept)
{
#if OSL_DEBUG_LEVEL > 1
- OSL_FAIL(ByteString(String(aExcept.Message), gsl_getSystemTextEncoding()).GetBuffer());
+ OSL_FAIL(ByteString(String(rExcept.Message), gsl_getSystemTextEncoding()).GetBuffer());
+#else
+ (void)rExcept;
#endif
}
}
@@ -1299,7 +1297,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection,
else if(!i)
bBreak = !xResultSet->first();
}
- catch(Exception&)
+ catch (const Exception&)
{
bBreak = sal_True;
}
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index 60b6661017..b8d9ac00c3 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -188,7 +188,7 @@ bool lcl_getCountFromResultSet( sal_Int32& rCount, const uno::Reference<XResultS
if( aCount >>= rCount )
return true;
}
- catch(Exception&)
+ catch(const Exception&)
{
}
}
@@ -282,7 +282,7 @@ sal_Bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos)
OSL_FAIL("no absolute positioning available");
}
}
- catch(Exception aExcept)
+ catch(const Exception&)
{
}
return bRet;
@@ -297,7 +297,7 @@ sal_Bool lcl_GetColumnCnt(SwDSParam* pParam,
{
xCols = xColsSupp->getColumns();
}
- catch( lang::DisposedException& )
+ catch(const lang::DisposedException&)
{
}
if(!xCols.is() || !xCols->hasByName(rColumnName))
@@ -377,7 +377,7 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
if(xComponent.is())
xComponent->addEventListener(pImpl->xDisposeListener);
}
- catch(Exception&)
+ catch(const Exception&)
{
}
}
@@ -403,7 +403,7 @@ sal_Bool SwNewDBMgr::MergeNew(const SwMergeDescriptor& rMergeDesc )
pImpl->pMergeData->CheckEndOfDB();
}
}
- catch(Exception&)
+ catch(const Exception&)
{
pImpl->pMergeData->bEndOfDB = sal_True;
pImpl->pMergeData->CheckEndOfDB();
@@ -744,7 +744,7 @@ SwNewDBMgr::~SwNewDBMgr()
if(xComp.is())
xComp->dispose();
}
- catch(const RuntimeException& )
+ catch(const RuntimeException&)
{
//may be disposed already since multiple entries may have used the same connection
}
@@ -858,8 +858,8 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
sBodyMimeType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("text/html; charset="));
sBodyMimeType += ::rtl::OUString::createFromAscii(
rtl_getBestMimeCharsetFromTextEncoding( eEncoding ));
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
- eEncoding = pHtmlOptions->GetTextEncoding();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
+ eEncoding = rHtmlOptions.GetTextEncoding();
}
else
sBodyMimeType =
@@ -1333,7 +1333,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
//remove the temporary files
::std::vector<String>::iterator aFileIter;
for(aFileIter = aFilesToRemove.begin();
- aFileIter != aFilesToRemove.end(); aFileIter++)
+ aFileIter != aFilesToRemove.end(); ++aFileIter)
SWUnoHelper::UCB_DeleteFile( *aFileIter );
// unlock all dispatchers
@@ -1427,7 +1427,7 @@ sal_uLong SwNewDBMgr::GetColumnFmt( const String& rDBName,
{
xCols = xColsSupp->getColumns();
}
- catch(Exception&)
+ catch(const Exception&)
{
OSL_FAIL("Exception in getColumns()");
}
@@ -1524,7 +1524,7 @@ sal_uLong SwNewDBMgr::GetColumnFmt( uno::Reference< XDataSource> xSource,
}
}
}
- catch( const Exception& )
+ catch(const Exception&)
{
OSL_FAIL("no FormatKey property found");
}
@@ -1595,7 +1595,9 @@ uno::Reference< sdbc::XConnection> SwNewDBMgr::GetConnection(const String& rData
xConnection = xComplConnection->connectWithCompletion( xHandler );
}
}
- catch(Exception&) {}
+ catch(const Exception&)
+ {
+ }
return xConnection;
}
@@ -1641,7 +1643,7 @@ uno::Reference< sdbcx::XColumnsSupplier> SwNewDBMgr::GetColumnSupplier(uno::Refe
xRowSet->execute();
xRet = Reference<XColumnsSupplier>( xRowSet, UNO_QUERY );
}
- catch( const uno::Exception& )
+ catch(const uno::Exception&)
{
OSL_FAIL("Exception in SwDBMgr::GetColumnSupplier");
}
@@ -1671,7 +1673,7 @@ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps,
{
sRet = xColumn->getString();
}
- catch( SQLException& )
+ catch(const SQLException&)
{
}
break;
@@ -1708,7 +1710,7 @@ String SwNewDBMgr::GetDBField(uno::Reference<XPropertySet> xColumnProps,
}
}
}
- catch(Exception& )
+ catch(const Exception&)
{
OSL_FAIL("exception caught");
}
@@ -1800,7 +1802,7 @@ sal_Bool SwNewDBMgr::GetColumnCnt(const String& rSourceName, const String& rTabl
{
nOldRow = pFound->xResultSet->getRow();
}
- catch(const Exception& )
+ catch(const Exception&)
{
return sal_False;
}
@@ -1895,7 +1897,7 @@ sal_Bool SwNewDBMgr::ToNextRecord(SwDSParam* pParam)
++pParam->nSelectionIndex;
}
}
- catch(Exception&)
+ catch(const Exception&)
{
}
return bRet;
@@ -1921,7 +1923,7 @@ sal_uInt32 SwNewDBMgr::GetSelectedRecordId()
{
nRet = pImpl->pMergeData->xResultSet->getRow();
}
- catch(Exception& )
+ catch(const Exception&)
{
}
return nRet;
@@ -1975,7 +1977,7 @@ sal_Bool SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTa
pFound->bScrollable = xMetaData
->supportsResultSetType((sal_Int32)ResultSetType::SCROLL_INSENSITIVE);
}
- catch(Exception&)
+ catch(const Exception&)
{
// DB driver may not be ODBC 3.0 compliant
pFound->bScrollable = sal_True;
@@ -1995,7 +1997,7 @@ sal_Bool SwNewDBMgr::OpenDataSource(const String& rDataSource, const String& rTa
pFound->CheckEndOfDB();
++pFound->nSelectionIndex;
}
- catch (Exception&)
+ catch (const Exception&)
{
pFound->xResultSet = 0;
pFound->xStatement = 0;
@@ -2018,7 +2020,7 @@ uno::Reference< XConnection> SwNewDBMgr::RegisterConnection(rtl::OUString& rData
if(xComponent.is())
xComponent->addEventListener(pImpl->xDisposeListener);
}
- catch(Exception&)
+ catch(const Exception&)
{
}
}
@@ -2057,7 +2059,9 @@ sal_uInt32 SwNewDBMgr::GetSelectedRecordId(
else
nRet = pFound->xResultSet->getRow();
}
- catch(Exception&){}
+ catch(const Exception&)
+ {
+ }
}
}
return nRet;
@@ -2082,7 +2086,7 @@ void SwNewDBMgr::CloseAll(sal_Bool bIncludingMerge)
if(!bInMerge && pParam->xResultSet.is())
pParam->xResultSet->first();
}
- catch(Exception& )
+ catch(const Exception&)
{}
}
}
@@ -2129,7 +2133,7 @@ SwDSParam* SwNewDBMgr::FindDSData(const SwDBData& rData, sal_Bool bCreate)
if(xComponent.is())
xComponent->addEventListener(pImpl->xDisposeListener);
}
- catch(Exception&)
+ catch(const Exception&)
{
}
}
@@ -2166,7 +2170,7 @@ SwDSParam* SwNewDBMgr::FindDSConnection(const rtl::OUString& rDataSource, sal_B
if(xComponent.is())
xComponent->addEventListener(pImpl->xDisposeListener);
}
- catch(Exception&)
+ catch(const Exception&)
{
}
}
@@ -2377,7 +2381,7 @@ String SwNewDBMgr::LoadAndRegisterDataSource()
xNaming->registerObject( sFind, xNewInstance );
}
- catch(Exception&)
+ catch(const Exception&)
{
}
}
@@ -2459,9 +2463,8 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
sTempURL = URIHelper::SmartRel2Abs( INetURLObject(), utl::TempFile::CreateTempName() );
xStore->storeToURL( sTempURL, aValues );
}
- catch( const uno::Exception& rEx )
+ catch(const uno::Exception&)
{
- (void) rEx;
}
if( xDocShell->GetError() )
{
@@ -2487,7 +2490,13 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
SwMergeDescriptor aMergeDesc( pImpl->pMergeDialog->GetMergeType(), pView->GetWrtShell(), aDescriptor );
aMergeDesc.sSaveToFilter = pImpl->pMergeDialog->GetSaveFilter();
- aMergeDesc.bCreateSingleFile= true;
+ aMergeDesc.bCreateSingleFile = !pImpl->pMergeDialog->IsSaveIndividualDocs();
+ if( !aMergeDesc.bCreateSingleFile && pImpl->pMergeDialog->IsGenerateFromDataBase() )
+ {
+ aMergeDesc.sAddressFromColumn = pImpl->pMergeDialog->GetColumnName();
+ aMergeDesc.sSubject = pImpl->pMergeDialog->GetPath();
+ }
+
MergeNew(aMergeDesc);
pWorkDoc->SetNewDBMgr( pWorkDBMgr );
@@ -2501,7 +2510,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
//! I.e. now that object is responsible for closing the model and doc shell.
xClose->close( sal_True );
}
- catch ( const uno::Exception& )
+ catch (const uno::Exception&)
{
}
}
@@ -2529,7 +2538,7 @@ void SwNewDBMgr::ExecuteFormLetter( SwWrtShell& rSh,
if(xComp.is())
xComp->dispose();
}
- catch(const RuntimeException& )
+ catch(const RuntimeException&)
{
//may be disposed already since multiple entries may have used the same connection
}
@@ -2602,7 +2611,7 @@ void SwNewDBMgr::InsertText(SwWrtShell& rSh,
{
pDlg->DataToDoc( aSelection , xSource, xConnection, xResSet);
}
- catch(Exception& )
+ catch(const Exception&)
{
OSL_FAIL("exception caught");
}
@@ -2715,7 +2724,7 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
pImpl->pMergeData->CheckEndOfDB();
}
}
- catch(Exception&)
+ catch(const Exception&)
{
pImpl->pMergeData->bEndOfDB = sal_True;
pImpl->pMergeData->CheckEndOfDB();
@@ -2939,9 +2948,8 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
pTargetShell->SttDoc();
}
- catch( Exception& rEx)
+ catch(const Exception&)
{
- (void)rEx;
OSL_FAIL("exception caught in SwNewDBMgr::MergeDocuments");
}
DELETEZ(pImpl->pMergeData);
diff --git a/sw/source/ui/dbui/dbtree.cxx b/sw/source/ui/dbui/dbtree.cxx
index 3595e44fc5..0f27ba6415 100644
--- a/sw/source/ui/dbui/dbtree.cxx
+++ b/sw/source/ui/dbui/dbtree.cxx
@@ -314,8 +314,9 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
aTable >>= xPropSet;
xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY);
}
- catch(Exception&)
- {}
+ catch (const Exception&)
+ {
+ }
}
}
else
@@ -332,8 +333,9 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
aQuery >>= xPropSet;
xColsSupplier = Reference<XColumnsSupplier>(xPropSet, UNO_QUERY);
}
- catch(Exception&)
- {}
+ catch (const Exception&)
+ {
+ }
}
}
@@ -353,7 +355,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
}
}
}
- catch(const Exception&)
+ catch (const Exception&)
{
}
}
@@ -403,7 +405,7 @@ void SwDBTreeList::RequestingChilds(SvLBoxEntry* pParent)
}
}
}
- catch(const Exception&)
+ catch (const Exception&)
{
}
}
diff --git a/sw/source/ui/dbui/maildispatcher.cxx b/sw/source/ui/dbui/maildispatcher.cxx
index d2c9e28fbf..8a1e5b549d 100644
--- a/sw/source/ui/dbui/maildispatcher.cxx
+++ b/sw/source/ui/dbui/maildispatcher.cxx
@@ -232,12 +232,12 @@ void MailDispatcher::sendMailMessageNotifyListener(uno::Reference<mail::XMailMes
MailDispatcherListenerContainer_t listeners_cloned(cloneListener());
std::for_each(listeners_cloned.begin(), listeners_cloned.end(), MailDeliveryNotifier(this, message));
}
- catch (mail::MailException& ex)
+ catch (const mail::MailException& ex)
{
MailDispatcherListenerContainer_t listeners_cloned(cloneListener());
std::for_each(listeners_cloned.begin(), listeners_cloned.end(), MailDeliveryErrorNotifier(this, message, ex.Message));
}
- catch (uno::RuntimeException& ex)
+ catch (const uno::RuntimeException& ex)
{
MailDispatcherListenerContainer_t listeners_cloned(cloneListener());
std::for_each(listeners_cloned.begin(), listeners_cloned.end(), MailDeliveryErrorNotifier(this, message, ex.Message));
diff --git a/sw/source/ui/dbui/mailmergechildwindow.cxx b/sw/source/ui/dbui/mailmergechildwindow.cxx
index fcf0fa53b0..6c850c98c5 100644
--- a/sw/source/ui/dbui/mailmergechildwindow.cxx
+++ b/sw/source/ui/dbui/mailmergechildwindow.cxx
@@ -115,10 +115,10 @@ IMPL_LINK( SwMailMergeChildWin, BackHdl, ToolBox *, EMPTYARG )
return 0;
}
-void SwMailMergeChildWin::FillInfo(SfxChildWinInfo& rInfo) const
+void SwMailMergeChildWin::FillInfo(SfxChildWinInfo& rInfo) const
{
SfxFloatingWindow::FillInfo(rInfo);
- rInfo.aWinState.Erase();
+ rInfo.aWinState = rtl::OString();
rInfo.bVisible = sal_False;
}
diff --git a/sw/source/ui/dbui/mailmergehelper.cxx b/sw/source/ui/dbui/mailmergehelper.cxx
index 4421ddc6c0..7554ce77f6 100644
--- a/sw/source/ui/dbui/mailmergehelper.cxx
+++ b/sw/source/ui/dbui/mailmergehelper.cxx
@@ -173,7 +173,7 @@ uno::Reference< mail::XSmtpService > ConnectToSmtpServer(
xSmtpServer->connect(xConnectionContext, xAuthenticator);
rxInMailService = uno::Reference< mail::XMailService >( xSmtpServer, uno::UNO_QUERY );
}
- catch(uno::Exception& )
+ catch (const uno::Exception&)
{
OSL_FAIL("exception caught");
}
@@ -539,7 +539,7 @@ String SwAddressPreview::FillData(
aItem.sText = sReplace;
}
}
- catch( sdbc::SQLException& )
+ catch (const sdbc::SQLException&)
{
OSL_FAIL("SQLException caught");
}
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index ee2dc55d14..c785c96b04 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1057,13 +1057,15 @@ SwAssignFieldsControl::SwAssignFieldsControl(
uno::Reference< XColumn > xColumn;
aCol >>= xColumn;
if(xColumn.is())
+ {
try
{
pNewPreview->SetText(xColumn->getString());
}
- catch(SQLException& )
+ catch (const SQLException&)
{
}
+ }
}
if(!i)
{
@@ -1198,7 +1200,7 @@ IMPL_LINK(SwAssignFieldsControl, MatchHdl_Impl, ListBox*, pBox)
{
sPreview = xColumn->getString();
}
- catch( sdbc::SQLException& )
+ catch (const sdbc::SQLException&)
{
}
}
diff --git a/sw/source/ui/dbui/mmconfigitem.cxx b/sw/source/ui/dbui/mmconfigitem.cxx
index b2c93f6f3c..3937f15770 100644
--- a/sw/source/ui/dbui/mmconfigitem.cxx
+++ b/sw/source/ui/dbui/mmconfigitem.cxx
@@ -601,7 +601,7 @@ void SwMailMergeConfigItem_Impl::Commit()
::std::vector<DBAddressDataAssignment>::iterator aAssignIter;
for(aAssignIter = aAddressDataAssignments.begin();
- aAssignIter != aAddressDataAssignments.end(); aAssignIter++)
+ aAssignIter != aAddressDataAssignments.end(); ++aAssignIter)
{
if(aAssignIter->bColumnAssignmentsChanged)
{
@@ -928,7 +928,7 @@ Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const
xRowProperties->setPropertyValue(C2U("ApplyFilter"), makeAny(m_pImpl->sFilter.getLength()>0));
xRowProperties->setPropertyValue(C2U("Filter"), makeAny(m_pImpl->sFilter));
}
- catch(Exception&)
+ catch (const Exception&)
{
OSL_FAIL("exception caught in xResultSet->SetFilter()");
}
@@ -938,7 +938,7 @@ Reference< XResultSet> SwMailMergeConfigItem::GetResultSet() const
m_pImpl->nResultSetCursorPos = 1;
}
}
- catch(Exception& )
+ catch (const Exception&)
{
OSL_FAIL("exception caught in: SwMailMergeConfigItem::GetResultSet() ");
}
@@ -976,7 +976,7 @@ void SwMailMergeConfigItem::SetFilter(::rtl::OUString& rFilter)
uno::Reference<XRowSet> xRowSet( m_pImpl->xResultSet, UNO_QUERY_THROW );
xRowSet->execute();
}
- catch(Exception&)
+ catch (const Exception&)
{
OSL_FAIL("exception caught in SwMailMergeConfigItem::SetFilter()");
}
@@ -1011,7 +1011,7 @@ sal_Int32 SwMailMergeConfigItem::MoveResultSet(sal_Int32 nTarget)
m_pImpl->nResultSetCursorPos = m_pImpl->xResultSet->getRow();
}
}
- catch(Exception&)
+ catch (const Exception&)
{
}
}
@@ -1031,7 +1031,7 @@ bool SwMailMergeConfigItem::IsResultSetFirstLast(bool& bIsFirst, bool& bIsLast)
bIsLast = m_pImpl->xResultSet->isLast();
bRet = true;
}
- catch(Exception&)
+ catch (const Exception&)
{
}
}
@@ -1248,7 +1248,7 @@ Sequence< ::rtl::OUString> SwMailMergeConfigItem::GetColumnAssignment(
Sequence< ::rtl::OUString> aRet;
::std::vector<DBAddressDataAssignment>::iterator aAssignIter;
for(aAssignIter = m_pImpl->aAddressDataAssignments.begin();
- aAssignIter != m_pImpl->aAddressDataAssignments.end(); aAssignIter++)
+ aAssignIter != m_pImpl->aAddressDataAssignments.end(); ++aAssignIter)
{
if(aAssignIter->aDBData == rDBData)
{
@@ -1278,7 +1278,7 @@ void SwMailMergeConfigItem::SetColumnAssignment( const SwDBData& rDBData,
::std::vector<DBAddressDataAssignment>::iterator aAssignIter;
sal_Bool bFound = sal_False;
for(aAssignIter = m_pImpl->aAddressDataAssignments.begin();
- aAssignIter != m_pImpl->aAddressDataAssignments.end(); aAssignIter++)
+ aAssignIter != m_pImpl->aAddressDataAssignments.end(); ++aAssignIter)
{
if(aAssignIter->aDBData == rDBData)
{
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 10fb6251ba..d9865dd5f4 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -151,7 +151,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, PushButton*, pButton)
SfxObjectFactory &rFact = m_pWizard->GetSwView()->GetDocShell()->GetFactory();
SfxFilterMatcher aMatcher( String::CreateFromAscii(rFact.GetShortName()) );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
const SfxFilter* pFlt = aIter.First();
while( pFlt )
diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx
index 165dfecd15..8820e81ea4 100644
--- a/sw/source/ui/dbui/mmgreetingspage.cxx
+++ b/sw/source/ui/dbui/mmgreetingspage.cxx
@@ -208,7 +208,7 @@ void SwMailMergeGreetingsPage::UpdatePreview()
}
}
}
- catch( sdbc::SQLException& )
+ catch (const sdbc::SQLException&)
{
OSL_FAIL("SQLException caught");
}
diff --git a/sw/source/ui/dbui/mmoutputpage.cxx b/sw/source/ui/dbui/mmoutputpage.cxx
index 1019b0665b..7b82c00bbb 100644
--- a/sw/source/ui/dbui/mmoutputpage.cxx
+++ b/sw/source/ui/dbui/mmoutputpage.cxx
@@ -101,13 +101,19 @@ String lcl_GetExtensionForDocType(sal_uLong nDocType)
::rtl::OUString lcl_GetColumnValueOf(const ::rtl::OUString& rColumn, Reference < container::XNameAccess>& rxColAccess )
{
::rtl::OUString sRet;
- if(rxColAccess->hasByName(rColumn))
+ try
+ {
+ if (rxColAccess->hasByName(rColumn))
+ {
+ Any aCol = rxColAccess->getByName(rColumn);
+ Reference< sdb::XColumn > xColumn;
+ aCol >>= xColumn;
+ if(xColumn.is())
+ sRet = xColumn->getString();
+ }
+ }
+ catch (const uno::Exception&)
{
- Any aCol = rxColAccess->getByName(rColumn);
- Reference< sdb::XColumn > xColumn;
- aCol >>= xColumn;
- if(xColumn.is())
- sRet = xColumn->getString();
}
return sRet;
}
@@ -687,11 +693,11 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
{
xStore->storeToURL( sPath, aValues );
}
- catch( task::ErrorCodeIOException& aErrorEx )
+ catch (const task::ErrorCodeIOException& rErrorEx)
{
- nErrorCode = (sal_uInt32)aErrorEx.ErrCode;
+ nErrorCode = (sal_uInt32)rErrorEx.ErrCode;
}
- catch( Exception& )
+ catch (const Exception&)
{
nErrorCode = ERRCODE_IO_GENERAL;
}
@@ -739,11 +745,11 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
{
xStore->storeToURL( sTargetTempURL, aValues );
}
- catch( task::ErrorCodeIOException& aErrorEx )
+ catch (const task::ErrorCodeIOException& rErrorEx)
{
- nErrorCode = (sal_uInt32)aErrorEx.ErrCode;
+ nErrorCode = (sal_uInt32)rErrorEx.ErrCode;
}
- catch( Exception& )
+ catch (const Exception&)
{
nErrorCode = ERRCODE_IO_GENERAL;
}
@@ -818,7 +824,7 @@ IMPL_LINK(SwMailMergeOutputPage, SaveOutputHdl_Impl, PushButton*, pButton)
uno::Reference< frame::XStorable > xTempStore( xTempDocShell->GetModel(), uno::UNO_QUERY);
xTempStore->storeToURL( sOutPath, aValues );
}
- catch( const uno::Exception& )
+ catch (const uno::Exception&)
{
bFailed = true;
}
@@ -1065,7 +1071,7 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
//the method SwIOSystemGetFilterOfFormat( ) returns the template filter
//because it uses the same user data :-(
SfxFilterMatcher aMatcher( pFilterContainer->GetName() );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFilter = aIter.First();
String sFilterUserData( String::CreateFromAscii( FILTER_WW8 ));
while ( pFilter )
@@ -1083,8 +1089,8 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
case MM_DOCTYPE_HTML:
{
bAsBody = true;
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
- eEncoding = pHtmlOptions->GetTextEncoding();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
+ eEncoding = rHtmlOptions.GetTextEncoding();
}
break;
case MM_DOCTYPE_TEXT:
diff --git a/sw/source/ui/dbui/mmoutputpage.src b/sw/source/ui/dbui/mmoutputpage.src
index 4801706083..648da3f271 100644
--- a/sw/source/ui/dbui/mmoutputpage.src
+++ b/sw/source/ui/dbui/mmoutputpage.src
@@ -316,7 +316,7 @@ TabPage DLG_MM_OUTPUT_PAGE
};
String ST_CONFIGUREMAIL
{
- Text[ en-US ] = "In order to be able to send mail merge documents by e-mail, %PRODUCTNAME requires information about the e-mail account to be used.\n\n Do you want to enter e-mail account information now?";
+ Text[ en-US ] = "In order to be able to send mail merge documents by e-mail, %PRODUCTNAME requires information about the e-mail account to be used.\n\nDo you want to enter e-mail account information now?";
};
};
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
index a4af1218ca..3614cf2044 100644
--- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
@@ -481,7 +481,7 @@ void SwSpellDialogChildWindow::ApplyChangedSentence(const svx::SpellPortions& rC
void SwSpellDialogChildWindow::AddAutoCorrection(
const String& rOld, const String& rNew, LanguageType eLanguage)
{
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
pACorr->PutText( rOld, rNew, eLanguage );
}
diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx
index cf6319600d..cd2fb7a762 100644
--- a/sw/source/ui/dialog/docstdlg.cxx
+++ b/sw/source/ui/dialog/docstdlg.cxx
@@ -156,9 +156,6 @@ void SwDocStatPage::Update()
SetData(aDocStat);
}
-/*-----------------19.06.97 16.37-------------------
- upate line number
---------------------------------------------------*/
IMPL_LINK( SwDocStatPage, UpdateHdl, PushButton*, EMPTYARG)
{
Update();
diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx
index 69b8d43773..8b31f40f4d 100644
--- a/sw/source/ui/dialog/macassgn.cxx
+++ b/sw/source/ui/dialog/macassgn.cxx
@@ -158,4 +158,4 @@ sal_Bool SwMacroAssignDlg::INetFmtDlg( Window* pParent, SwWrtShell& rSh,
return bRet;
}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 96cd7eae99..9e197bbaab 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -494,6 +494,22 @@ uno::Reference< sdbc::XResultSet> AbstractMailMergeDlg_Impl::GetResultSet() cons
{
return pDlg->GetResultSet();
}
+bool AbstractMailMergeDlg_Impl::IsSaveIndividualDocs() const
+{
+ return pDlg->IsSaveIndividualDocs();
+}
+bool AbstractMailMergeDlg_Impl::IsGenerateFromDataBase() const
+{
+ return pDlg->IsGenerateFromDataBase();
+}
+String AbstractMailMergeDlg_Impl::GetColumnName() const
+{
+ return pDlg->GetColumnName();
+}
+String AbstractMailMergeDlg_Impl::GetPath() const
+{
+ return pDlg->GetPath();
+}
sal_Bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() const
{
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 1f18e01eae..e65452943d 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -332,6 +332,10 @@ class AbstractMailMergeDlg_Impl : public AbstractMailMergeDlg
virtual const ::rtl::OUString& GetSaveFilter() const;
virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const ;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const;
+ virtual bool IsSaveIndividualDocs() const;
+ virtual bool IsGenerateFromDataBase() const;
+ virtual String GetColumnName() const;
+ virtual String GetPath() const;
};
//for SwMailMergeDlg end
//for SwMailMergeCreateFromDlg begin
@@ -584,4 +588,4 @@ struct SwDialogsResMgr
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 85c2c4901c..08105bb65b 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -1526,8 +1526,8 @@ SwInsertSectionTabDialog::SwInsertSectionTabDialog(
AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0);
AddTabPage(TP_SECTION_INDENTS, SwSectionIndentTabPage::Create, 0);
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- long nHtmlMode = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ long nHtmlMode = rHtmlOpt.GetExportMode();
sal_Bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
if(bWeb)
@@ -2206,8 +2206,8 @@ SwSectionPropertyTabDialog::SwSectionPropertyTabDialog(
AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0);
AddTabPage(TP_SECTION_INDENTS, SwSectionIndentTabPage::Create, 0);
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- long nHtmlMode = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ long nHtmlMode = rHtmlOpt.GetExportMode();
sal_Bool bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
if(bWeb)
{
diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx
index ba831d380b..69fb2fc4ef 100644
--- a/sw/source/ui/dochdl/gloshdl.cxx
+++ b/sw/source/ui/dochdl/gloshdl.cxx
@@ -361,10 +361,10 @@ sal_Bool SwGlossaryHdl::NewGlossary(const String& rName, const String& rShortNam
pOnlyTxt = &sOnlyTxt;
}
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
const sal_uInt16 nSuccess = pWrtShell->MakeGlossary( *pTmp, rName, rShortName,
- pCfg->IsSaveRelFile(), pOnlyTxt );
+ rCfg.IsSaveRelFile(), pOnlyTxt );
if(nSuccess == (sal_uInt16) -1 )
{
InfoBox(pWrtShell->GetView().GetWindow(), SW_RES(MSG_ERR_INSERT_GLOS)).Execute();
@@ -440,9 +440,9 @@ sal_Bool SwGlossaryHdl::Expand( const String& rShortName,
String aShortName( rShortName );
sal_Bool bCancel = sal_False;
// search for text block
- //#b6633427# - don't prefer current group depending on configuration setting
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- sal_uInt16 nFound = !pCfg->IsSearchInAllCategories() ? pGlossary->GetIndex( aShortName ) : -1;
+ // - don't prefer current group depending on configuration setting
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
+ sal_uInt16 nFound = !rCfg.IsSearchInAllCategories() ? pGlossary->GetIndex( aShortName ) : -1;
// if not found then search in all groups
if( nFound == (sal_uInt16) -1 )
{
@@ -794,9 +794,9 @@ sal_Bool SwGlossaryHdl::ImportGlossaries( const String& rName )
SwReader aReader( *pMed, rName );
if( aReader.HasGlossaries( *pR ) )
{
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
bRet = aReader.ReadGlossaries( *pR, *pGlossary,
- pCfg->IsSaveRelFile() );
+ rCfg.IsSaveRelFile() );
}
}
}
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index b7db95cb78..1c9017cde5 100644..100755
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -44,6 +44,7 @@
#include <unotools/tempfile.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <sot/filelist.hxx>
#include <svx/svxdlg.hxx>
@@ -155,24 +156,6 @@ using namespace nsTransferBufferType;
#define DDE_TXT_ENCODING gsl_getSystemTextEncoding()
-//---------------------------------------------
-// this struct conforms to the Microsoft
-// OBJECTDESCRIPTOR -> see oleidl.h
-// (MS platform sdk)
-//---------------------------------------------
-
-struct OleObjectDescriptor
-{
- sal_uInt32 cbSize;
- ClsId clsid;
- sal_uInt32 dwDrawAspect;
- Size sizel;
- Point pointl;
- sal_uInt32 dwStatus;
- sal_uInt32 dwFullUserTypeName;
- sal_uInt32 dwSrcOfCopy;
-};
-
class SwTrnsfrDdeLink : public ::sfx2::SvBaseLink
{
String sName;
@@ -193,8 +176,8 @@ protected:
public:
SwTrnsfrDdeLink( SwTransferable& rTrans, SwWrtShell& rSh );
- virtual void DataChanged( const String& rMimeType,
- const uno::Any & rValue );
+ virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(
+ const String& rMimeType, const ::com::sun::star::uno::Any & rValue );
virtual void Closed();
sal_Bool WriteData( SvStream& rStrm );
@@ -796,6 +779,10 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
AddFormat( SOT_FORMATSTR_ID_EMBED_SOURCE );
+ // --> OD #i98753#
+ // set size of embedded object at the object description structure
+ aObjDesc.maSize = OutputDevice::LogicToLogic( pWrtShell->GetObjSize(), MAP_TWIP, MAP_100TH_MM );
+ // <--
PrepareOLE( aObjDesc );
AddFormat( SOT_FORMATSTR_ID_OBJECTDESCRIPTOR );
@@ -1613,7 +1600,9 @@ int SwTransferable::_PasteFileContent( TransferableDataHelper& rData,
Link aOldLink( rSh.GetChgLnk() );
rSh.SetChgLnk( Link() );
+ const SwPosition& rInsPos = *rSh.GetCrsr()->Start();
SwReader aReader( *pStream, aEmptyStr, String(), *rSh.GetCrsr() );
+ rSh.SaveTblBoxCntnt( &rInsPos );
if( IsError( aReader.Read( *pRead )) )
nResId = ERR_CLPBRD_READ;
else
@@ -1864,8 +1853,8 @@ int SwTransferable::_PasteTargetURL( TransferableDataHelper& rData,
//!!! check at FileSystem - only then it make sense to test graphics !!!
Graphic aGrf;
- GraphicFilter *pFlt = GraphicFilter::GetGraphicFilter();
- nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( sURL, aEmptyStr, aGrf, pFlt );
+ GraphicFilter &rFlt = GraphicFilter::GetGraphicFilter();
+ nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( sURL, aEmptyStr, aGrf, &rFlt );
if( nRet )
{
switch( nAction )
@@ -2195,9 +2184,9 @@ int SwTransferable::_PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh,
if( bCheckForGrf )
{
//!!! check at FileSystem - only then it makes sense to test the graphics !!!
- GraphicFilter *pFlt = GraphicFilter::GetGraphicFilter();
+ GraphicFilter &rFlt = GraphicFilter::GetGraphicFilter();
nRet = GRFILTER_OK == GraphicFilter::LoadGraphic( aBkmk.GetURL(), aEmptyStr,
- aGrf, pFlt );
+ aGrf, &rFlt );
if( !nRet && SW_PASTESDR_SETATTR == nAction &&
SOT_FORMAT_FILE == nFmt &&
// only at frame selection
@@ -3399,17 +3388,14 @@ void SwTransferable::ClearSelection( SwWrtShell& rSh,
}
}
+namespace
+{
+ class theSwTransferableUnoTunnelId : public rtl::Static< UnoTunnelIdInit, SwTransferable > {};
+}
+
const Sequence< sal_Int8 >& SwTransferable::getUnoTunnelId()
{
- static Sequence< sal_Int8 > aSeq;
- if( !aSeq.getLength() )
- {
- static osl::Mutex aCreateMutex;
- osl::Guard< osl::Mutex > aGuard( aCreateMutex );
- aSeq.realloc( 16 );
- rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True );
- }
- return aSeq;
+ return theSwTransferableUnoTunnelId::get().getSeq();
}
sal_Int64 SwTransferable::getSomething( const Sequence< sal_Int8 >& rId ) throw( RuntimeException )
@@ -3500,7 +3486,7 @@ SwTrnsfrDdeLink::~SwTrnsfrDdeLink()
Disconnect( sal_True );
}
-void SwTrnsfrDdeLink::DataChanged( const String& ,
+::sfx2::SvBaseLink::UpdateResult SwTrnsfrDdeLink::DataChanged( const String& ,
const uno::Any& )
{
// well, that's it with the link
@@ -3510,6 +3496,7 @@ void SwTrnsfrDdeLink::DataChanged( const String& ,
rTrnsfr.RemoveDDELinkFormat( pDocShell->GetView()->GetEditWin() );
Disconnect( sal_False );
}
+ return SUCCESS;
}
sal_Bool SwTrnsfrDdeLink::WriteData( SvStream& rStrm )
diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx
index 214fef8f3d..e936496374 100644
--- a/sw/source/ui/docvw/AnnotationWin.cxx
+++ b/sw/source/ui/docvw/AnnotationWin.cxx
@@ -109,15 +109,23 @@ void SwAnnotationWin::UpdateData()
{
if ( Engine()->IsModified() )
{
- SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld();
- SwPosition aPosition( pTxtFld->GetTxtNode() );
- aPosition.nContent = *pTxtFld->GetStart();
- SwField* pOldField = mpFld->Copy();
+ IDocumentUndoRedo & rUndoRedo(
+ DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo());
+ ::std::auto_ptr<SwField> pOldField;
+ if (rUndoRedo.DoesUndo())
+ {
+ pOldField.reset(mpFld->Copy());
+ }
mpFld->SetPar2(Engine()->GetEditEngine().GetText());
mpFld->SetTextObject(Engine()->CreateParaObject());
- DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo().AppendUndo(
- new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
- delete pOldField;
+ if (rUndoRedo.DoesUndo())
+ {
+ SwTxtFld *const pTxtFld = mpFmtFld->GetTxtFld();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
+ rUndoRedo.AppendUndo(
+ new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
+ }
// so we get a new layout of notes (anchor position is still the same and we would otherwise not get one)
Mgr().SetLayout();
// #i98686# if we have several views, all notes should update their text
@@ -240,15 +248,23 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText)
// lets insert an undo step so the initial text can be easily deleted
// but do not use UpdateData() directly, would set modified state again and reentrance into Mgr
Engine()->SetModifyHdl( Link() );
- SwTxtFld* pTxtFld = mpFmtFld->GetTxtFld();
- SwPosition aPosition( pTxtFld->GetTxtNode() );
- aPosition.nContent = *pTxtFld->GetStart();
- SwField* pOldField = mpFld->Copy();
+ IDocumentUndoRedo & rUndoRedo(
+ DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo());
+ ::std::auto_ptr<SwField> pOldField;
+ if (rUndoRedo.DoesUndo())
+ {
+ pOldField.reset(mpFld->Copy());
+ }
mpFld->SetPar2(Engine()->GetEditEngine().GetText());
mpFld->SetTextObject(Engine()->CreateParaObject());
- DocView().GetDocShell()->GetDoc()->GetIDocumentUndoRedo().AppendUndo(
- new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
- delete pOldField;
+ if (rUndoRedo.DoesUndo())
+ {
+ SwTxtFld *const pTxtFld = mpFmtFld->GetTxtFld();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
+ rUndoRedo.AppendUndo(
+ new SwUndoFieldFromDoc(aPosition, *pOldField, *mpFld, 0, true));
+ }
Engine()->SetModifyHdl( LINK( this, SwAnnotationWin, ModifyHdl ) );
Engine()->ClearModifyFlag();
Engine()->GetUndoManager().Clear();
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 89f13a8b65..10ca2c7352 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -443,7 +443,7 @@ bool SwPostItMgr::CalcRects()
SwPosition aPosition = pItem->GetAnchorPosition();
pItem->mLayoutStatus = SwPostItHelper::getLayoutInfos( aInfo, aPosition );
}
- if( aInfo.size() )
+ if( !aInfo.empty() )
{
pItem->maLayoutInfo = aInfo[0];
}
@@ -656,7 +656,7 @@ void SwPostItMgr::LayoutPostIts()
}
}
- if ((aVisiblePostItList.size()>0) && ShowNotes())
+ if ((!aVisiblePostItList.empty()) && ShowNotes())
{
bool bOldScrollbar = mPages[n]->bScrollbar;
if (ShowNotes())
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
index dc0c57c78f..958067ceb6 100644
--- a/sw/source/ui/docvw/SidebarWin.cxx
+++ b/sw/source/ui/docvw/SidebarWin.cxx
@@ -555,25 +555,22 @@ void SwSidebarWin::SetPosAndSize()
{
if (IsFollow() && !HasChildPathFocus())
{
- // --> OD 2010-06-03 #i111964#
+ // #i111964#
if ( mpAnchor )
{
mpAnchor->SetAnchorState(AS_END);
}
- // <--
}
else
{
- // --> OD 2010-06-03 #i111964#
+ // #i111964#
if ( mpAnchor )
{
mpAnchor->SetAnchorState(AS_ALL);
}
- // <--
SwSidebarWin* pWin = GetTopReplyNote();
- // --> OD 2010-06-03 #i111964#
+ // #i111964#
if ( pWin && pWin->Anchor() )
- // <--
{
pWin->Anchor()->SetAnchorState(AS_END);
}
@@ -1127,9 +1124,8 @@ void SwSidebarWin::SetViewState(ViewState bViewState)
{
mpAnchor->SetAnchorState(AS_ALL);
SwSidebarWin* pWin = GetTopReplyNote();
- // --> OD 2010-06-03 #i111964#
+ // #i111964#
if ( pWin && pWin->Anchor() )
- // <--
{
pWin->Anchor()->SetAnchorState(AS_END);
}
@@ -1160,10 +1156,9 @@ void SwSidebarWin::SetViewState(ViewState bViewState)
SwSidebarWin* pTopWinActive = mrMgr.HasActiveSidebarWin()
? mrMgr.GetActiveSidebarWin()->GetTopReplyNote()
: 0;
- // --> OD 2010-06-03 #i111964#
+ // #i111964#
if ( pTopWinSelf && ( pTopWinSelf != pTopWinActive ) &&
pTopWinSelf->Anchor() )
- // <--
{
if ( pTopWinSelf != mrMgr.GetActiveSidebarWin() )
{
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index a9fef657fe..1f4a398b7f 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -268,7 +268,7 @@ inline sal_Bool IsMinMove(const Point &rStartPos, const Point &rLPt)
}
/*--------------------------------------------------------------------
- for MouseButtonDown - determine whether a DrawObject
+ for MouseButtonDown - determine whether a DrawObject
an NO SwgFrame was hit! Shift/Ctrl should only result
in selecting, with DrawObjects; at SwgFlys to trigger
hyperlinks if applicable (DownLoad/NewWindow!)
@@ -700,6 +700,105 @@ sal_Bool SwEditWin::IsInputSequenceCheckingRequired( const String &rText, const
return (0 <= nCTLScriptPos && nCTLScriptPos <= rText.Len());
}
+//return INVALID_HINT if language should not be explictly overridden, the correct
+//HintId to use for the eBufferLanguage otherwise
+sal_uInt16 lcl_isNonDefaultLanguage(LanguageType eBufferLanguage, SwView& rView,
+ const String &rInBuffer)
+{
+ sal_uInt16 nWhich = INVALID_HINT;
+ bool bLang = true;
+ if(eBufferLanguage != LANGUAGE_DONTKNOW)
+ {
+ switch( GetI18NScriptTypeOfLanguage( eBufferLanguage ))
+ {
+ case i18n::ScriptType::ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break;
+ case i18n::ScriptType::COMPLEX: nWhich = RES_CHRATR_CTL_LANGUAGE; break;
+ case i18n::ScriptType::LATIN: nWhich = RES_CHRATR_LANGUAGE; break;
+ default: bLang = false;
+ }
+ if(bLang)
+ {
+ SfxItemSet aLangSet(rView.GetPool(), nWhich, nWhich);
+ SwWrtShell& rSh = rView.GetWrtShell();
+ rSh.GetCurAttr(aLangSet);
+ if(SFX_ITEM_DEFAULT <= aLangSet.GetItemState(nWhich, sal_True))
+ {
+ LanguageType eLang = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage();
+ if ( eLang == eBufferLanguage )
+ {
+ // current language attribute equal to language reported from system
+ bLang = false;
+ }
+ else if ( !bInputLanguageSwitched && RES_CHRATR_LANGUAGE == nWhich )
+ {
+ // special case: switching between two "LATIN" languages
+ // In case the current keyboard setting might be suitable
+ // for both languages we can't safely assume that the user
+ // wants to use the language reported from the system,
+ // except if we knew that it was explicitly switched (thus
+ // the check for "bInputLangeSwitched").
+ //
+ // The language reported by the system could be just the
+ // system default language that the user is not even aware
+ // of, because no language selection tool is installed at
+ // all. In this case the OOo language should get preference
+ // as it might have been selected by the user explicitly.
+ //
+ // Usually this case happens if the OOo language is
+ // different to the system language but the system keyboard
+ // is still suitable for the OOo language (e.g. writing
+ // English texts with a German keyboard).
+ //
+ // For non-latin keyboards overwriting the attribute is
+ // still valid. We do this for kyrillic and greek ATM. In
+ // future versions of OOo this should be replaced by a
+ // configuration switch that allows to give the preference
+ // to the OOo setting or the system setting explicitly
+ // and/or a better handling of the script type.
+ i18n::UnicodeScript eType = rInBuffer.Len() ?
+ (i18n::UnicodeScript)GetAppCharClass().getScript( rInBuffer, 0 ) :
+ i18n::UnicodeScript_kScriptCount;
+
+ bool bSystemIsNonLatin = false, bOOoLangIsNonLatin = false;
+ switch ( eType )
+ {
+ case i18n::UnicodeScript_kGreek:
+ case i18n::UnicodeScript_kCyrillic:
+ // in case other UnicodeScripts require special
+ // keyboards they can be added here
+ bSystemIsNonLatin = true;
+ break;
+ default:
+ break;
+ }
+
+ switch ( eLang )
+ {
+ case LANGUAGE_AZERI_CYRILLIC:
+ case LANGUAGE_BOSNIAN_CYRILLIC_BOSNIA_HERZEGOVINA:
+ case LANGUAGE_BULGARIAN:
+ case LANGUAGE_GREEK:
+ case LANGUAGE_RUSSIAN:
+ case LANGUAGE_RUSSIAN_MOLDOVA:
+ case LANGUAGE_SERBIAN_CYRILLIC:
+ case LANGUAGE_SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA:
+ case LANGUAGE_UZBEK_CYRILLIC:
+ case LANGUAGE_UKRAINIAN:
+ case LANGUAGE_BELARUSIAN:
+ bOOoLangIsNonLatin = true;
+ break;
+ default:
+ break;
+ }
+
+ bLang = (bSystemIsNonLatin != bOOoLangIsNonLatin);
+ }
+ }
+ }
+ }
+ return bLang ? nWhich : INVALID_HINT;
+}
+
/*--------------------------------------------------------------------
Description: character buffer is inserted into the document
--------------------------------------------------------------------*/
@@ -827,83 +926,12 @@ void SwEditWin::FlushInBuffer()
aReq.Done();
}
}
- sal_Bool bLang = true;
- if(eBufferLanguage != LANGUAGE_DONTKNOW)
- {
- sal_uInt16 nWhich = 0;
- switch( GetI18NScriptTypeOfLanguage( eBufferLanguage ))
- {
- case i18n::ScriptType::ASIAN: nWhich = RES_CHRATR_CJK_LANGUAGE; break;
- case i18n::ScriptType::COMPLEX: nWhich = RES_CHRATR_CTL_LANGUAGE; break;
- case i18n::ScriptType::LATIN: nWhich = RES_CHRATR_LANGUAGE; break;
- default: bLang = sal_False;
- }
- if(bLang)
- {
- SfxItemSet aLangSet(rView.GetPool(), nWhich, nWhich);
- rSh.GetCurAttr(aLangSet);
- if(SFX_ITEM_DEFAULT <= aLangSet.GetItemState(nWhich, sal_True))
- {
- LanguageType eLang = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage();
- if ( eLang == eBufferLanguage )
- // current language attribute equal to language reported from system
- bLang = sal_False;
- else if ( !bInputLanguageSwitched && RES_CHRATR_LANGUAGE == nWhich )
- {
- // special case: switching between two "LATIN" languages
- // In case the current keyboard setting might be suitable for both languages we can't safely assume that the user
- // wants to use the language reported from the system, except if we knew that it was explicitly switched (thus the check for "bInputLangeSwitched").
- // The language reported by the system could be just the system default language that the user is not even aware of,
- // because no language selection tool is installed at all. In this case the OOo language should get preference as
- // it might have been selected by the user explicitly.
- // Usually this case happens if the OOo language is different to the system language but the system keyboard is still suitable
- // for the OOo language (e.g. writing English texts with a German keyboard).
- // For non-latin keyboards overwriting the attribute is still valid. We do this for kyrillic and greek ATM.
- // In future versions of OOo this should be replaced by a configuration switch that allows to give the preference to
- // the OOo setting or the system setting explicitly and/or a better handling of the script type.
- sal_Int16 nScript = GetAppCharClass().getScript( aInBuffer, 0 );
- i18n::UnicodeScript eType = (i18n::UnicodeScript) nScript;
-
- bool bSystemIsNonLatin = false, bOOoLangIsNonLatin = false;
- switch ( eType )
- {
- case i18n::UnicodeScript_kGreek:
- case i18n::UnicodeScript_kCyrillic:
- // in case other UnicodeScripts require special keyboards they can be added here
- bSystemIsNonLatin = true;
- break;
- default:
- break;
- }
-
- switch ( eLang )
- {
- case LANGUAGE_AZERI_CYRILLIC:
- case LANGUAGE_BOSNIAN_CYRILLIC_BOSNIA_HERZEGOVINA:
- case LANGUAGE_BULGARIAN:
- case LANGUAGE_GREEK:
- case LANGUAGE_RUSSIAN:
- case LANGUAGE_RUSSIAN_MOLDOVA:
- case LANGUAGE_SERBIAN_CYRILLIC:
- case LANGUAGE_SERBIAN_CYRILLIC_BOSNIA_HERZEGOVINA:
- case LANGUAGE_UZBEK_CYRILLIC:
- case LANGUAGE_UKRAINIAN:
- case LANGUAGE_BELARUSIAN:
- bOOoLangIsNonLatin = true;
- break;
- default:
- break;
- }
- bLang = (bSystemIsNonLatin != bOOoLangIsNonLatin);
- }
- }
- if(bLang)
- {
- SvxLanguageItem aLangItem( eBufferLanguage, nWhich );
- rSh.SetAttr( aLangItem );
- }
- }
+ sal_uInt16 nWhich = lcl_isNonDefaultLanguage(eBufferLanguage, rView, aInBuffer);
+ if (nWhich != INVALID_HINT )
+ {
+ SvxLanguageItem aLangItem( eBufferLanguage, nWhich );
+ rSh.SetAttr( aLangItem );
}
rSh.Insert( aInBuffer );
@@ -1224,6 +1252,8 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir )
void SwEditWin::KeyInput(const KeyEvent &rKEvt)
{
+ SwWrtShell &rSh = rView.GetWrtShell();
+
if( rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE &&
pApplyTempl && pApplyTempl->pFormatClipboard )
{
@@ -1231,10 +1261,15 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
SetApplyTemplate(SwApplyTemplate());
rView.GetViewFrame()->GetBindings().Invalidate(SID_FORMATPAINTBRUSH);
}
+ else if ( rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE &&
+ rSh.IsHeaderFooterEdit( ) )
+ {
+ rSh.ToggleHeaderFooterEdit();
+ }
SfxObjectShell *pObjSh = (SfxObjectShell*)rView.GetViewFrame()->GetObjectShell();
if ( bLockInput || (pObjSh && pObjSh->GetProgress()) )
- // When the progress bar is active or a progress is
+ // When the progress bar is active or a progress is
// running on a document, no order is being taken
return;
@@ -1242,7 +1277,6 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
delete pShadCrsr, pShadCrsr = 0;
aKeyInputFlushTimer.Stop();
- SwWrtShell &rSh = rView.GetWrtShell();
sal_Bool bIsDocReadOnly = rView.GetDocShell()->IsReadOnly() &&
rSh.IsCrsrReadonly();
@@ -1284,15 +1318,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
if (rKEvt.GetKeyCode().GetCode() == KEY_F12)
{
SwRootFrm* pLayout = GetView().GetDocShell()->GetWrtShell()->GetLayout();
- xmlTextWriterPtr writer = xmlNewTextWriterFilename("layout.xml", 0);
- if (writer!=NULL)
- {
- printf("dumping layout in \"layout.xml\"\n");
- xmlTextWriterStartDocument(writer, NULL, NULL, NULL);
- pLayout->dumpAsXml(writer);
- xmlTextWriterEndDocument(writer);
- xmlFreeTextWriter(writer);
- }
+ pLayout->dumpAsXml( );
return;
}
#endif
@@ -1411,7 +1437,7 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt)
rView.GetViewFrame()->GetBindings().GetRecorder();
if ( !xRecorder.is() )
{
- pACfg = SvxAutoCorrCfg::Get();
+ pACfg = &SvxAutoCorrCfg::Get();
pACorr = pACfg->GetAutoCorrect();
}
@@ -2231,7 +2257,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
if( bChkInsBlank && bIsNormalChar &&
(aInBuffer.Len() || !rSh.IsSttPara() || !rSh.IsEndPara() ))
{
- // insert a blank ahead of the character. this ends up
+ // insert a blank ahead of the character. this ends up
// between the expanded text and the new "non-word-seperator".
aInBuffer.Expand( aInBuffer.Len() + 1, ' ' );
}
@@ -2576,6 +2602,16 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
const Point aDocPos( PixelToLogic( rMEvt.GetPosPixel() ) );
+ sal_Bool bOverHdrFtr = rSh.IsOverHeaderFooterPos( aDocPos );
+ if ( ( rSh.IsHeaderFooterEdit( ) && !bOverHdrFtr ) ||
+ ( !rSh.IsHeaderFooterEdit() && bOverHdrFtr ) )
+ {
+ if ( rMEvt.GetButtons() == MOUSE_LEFT && rMEvt.GetClicks( ) == 2 )
+ rSh.SwCrsrShell::SetCrsr( aDocPos );
+
+ return;
+ }
+
if ( IsChainMode() )
{
SetChainMode( sal_False );
@@ -2903,7 +2939,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
if( !bSelObj )
{
- // move cursor here so that it is not drawn in the
+ // move cursor here so that it is not drawn in the
// frame first; ShowCrsr() happens in LeaveSelFrmMode()
bValidCrsrPos = !(CRSR_POSCHG & (rSh.*rSh.fnSetCrsr)(&aDocPos,sal_False));
rSh.LeaveSelFrmMode();
@@ -3212,7 +3248,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
}
if ( !rSh.IsExtMode() )
{
- // don't start a selection when an
+ // don't start a selection when an
// URL field or a graphic is clicked
sal_Bool bSttSelect = rSh.HasSelection() ||
Pointer(POINTER_REFHAND) != GetPointer();
@@ -4358,7 +4394,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
}
ReleaseMouse();
- // Only processed MouseEvents arrive here; only at these the moduses can
+ // Only processed MouseEvents arrive here; only at these the moduses can
// be resetted.
bMBPressed = sal_False;
@@ -4837,8 +4873,8 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
// works on the last input character, this is escpecially in Korean text often done
// quotes that are inside of the string are not replaced!
const sal_Unicode aCh = sRecord.GetChar(sRecord.Len() - 1);
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
if(pACorr &&
(( pACorr->IsAutoCorrFlag( ChgQuotes ) && ('\"' == aCh ))||
( pACorr->IsAutoCorrFlag( ChgSglQuotes ) && ( '\'' == aCh))))
@@ -4896,14 +4932,14 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
rView.GetViewFrame()->GetBindings().GetRecorder();
if(!xRecorder.is())
{
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
- if( pACfg && pACorr &&
- ( pACfg->IsAutoTextTip() ||
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
+ if( pACorr &&
+ ( rACfg.IsAutoTextTip() ||
pACorr->GetSwFlags().bAutoCompleteWords ) &&
rSh.GetPrevAutoCorrWord( *pACorr, sWord ) )
{
- ShowAutoTextCorrectQuickHelp(sWord, pACfg, pACorr, sal_True);
+ ShowAutoTextCorrectQuickHelp(sWord, &rACfg, pACorr, sal_True);
}
}
}
@@ -5420,7 +5456,18 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen )
EXTTEXTINPUT_ATTR_HIGHLIGHT;
pCETID = new CommandExtTextInputData( sStr, pAttrs, nL,
0, 0, 0, sal_False );
- rSh.CreateExtTextInput(rWin.GetInputLanguage());
+
+ //fdo#33092. If the current input language is the default
+ //language that text would appear in if typed, then don't
+ //force a language on for the ExtTextInput.
+ LanguageType eInputLanguage = rWin.GetInputLanguage();
+ if (lcl_isNonDefaultLanguage(eInputLanguage,
+ rSh.GetView(), sStr) == INVALID_HINT)
+ {
+ eInputLanguage = LANGUAGE_DONTKNOW;
+ }
+
+ rSh.CreateExtTextInput(eInputLanguage);
rSh.SetExtTextInputData( *pCETID );
}
}
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index 83d9e7eea6..bfbf1be1fe 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -76,10 +76,9 @@
#include <PostItMgr.hxx>
#include <fmtfld.hxx>
-// --> OD 2009-08-18 #i104300#
+// #i104300#
#include <IDocumentMarkAccess.hxx>
#include <ndtxt.hxx>
-// <--
/*--------------------------------------------------------------------
Description: KeyEvents
@@ -151,8 +150,8 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( rSh.GetContentAtPos( aPos, aCntntAtPos, sal_False, &aFldRect ) )
{
- sal_uInt16 nStyle = 0; // style of quick help
- switch( aCntntAtPos.eCntntAtPos )
+ sal_uInt16 nStyle = 0; // style of quick help
+ switch( aCntntAtPos.eCntntAtPos )
{
case SwContentAtPos::SW_TABLEBOXFML:
sTxt.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "= " ));
@@ -161,10 +160,9 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
#if OSL_DEBUG_LEVEL > 1
case SwContentAtPos::SW_TABLEBOXVALUE:
{
- sTxt = UniString(
- ByteString::CreateFromDouble(
- ((SwTblBoxValue*)aCntntAtPos.aFnd.pAttr)->GetValue() )
- , gsl_getSystemTextEncoding());
+ sTxt = rtl::OStringToOUString(rtl::OString::valueOf(
+ ((SwTblBoxValue*)aCntntAtPos.aFnd.pAttr)->GetValue()),
+ gsl_getSystemTextEncoding());
}
break;
case SwContentAtPos::SW_CURR_ATTRS:
@@ -525,7 +523,7 @@ void SwEditWin::Paint(const Rectangle& rRect)
else if( rRect.IsOver( aRect ))
{
// resides somewhat above, then everything is clipped outside
- // and we have to make the "inner part" at the end of the
+ // and we have to make the "inner part" at the end of the
// Paint visible again. Otherwise Paint errors occur!
bPaintShadowCrsr = sal_True;
}
diff --git a/sw/source/ui/docvw/edtwin3.cxx b/sw/source/ui/docvw/edtwin3.cxx
index ccac547822..bf0532b045 100644
--- a/sw/source/ui/docvw/edtwin3.cxx
+++ b/sw/source/ui/docvw/edtwin3.cxx
@@ -186,8 +186,8 @@ void SwEditWin::DataChanged( const DataChangedEvent& rDCEvt )
{
case DATACHANGED_SETTINGS:
// rearrange ScrollBars, respectively trigger resize, because
- // the ScrollBar size can have change. For that, in the reset
- // handler, the size of the ScrollBars also has to be queried
+ // the ScrollBar size can have change. For that, in the reset
+ // handler, the size of the ScrollBars also has to be queried
// from the settings.
if( rDCEvt.GetFlags() & SETTINGS_STYLE )
{
diff --git a/sw/source/ui/docvw/extedit.cxx b/sw/source/ui/docvw/extedit.cxx
index bf39575bbf..8010a9d1d1 100644
--- a/sw/source/ui/docvw/extedit.cxx
+++ b/sw/source/ui/docvw/extedit.cxx
@@ -75,7 +75,7 @@ IMPL_LINK (ExternalProcessClass_Impl, StartListeningEvent, void*, pEvent)
String aURL( pData->fileName );
new FileChangedChecker(
- pData->fileName,
+ pData->fileName,
::boost::bind(&HandleCloseEvent,aURL,pData->rSh));
return 0;
@@ -120,7 +120,7 @@ void EditWithExternalTool(GraphicObject *pGraphicObject, SwWrtShell *rSh)
osl::File::move(tempFileBase, tempFileName);
//Write Graphic to the Temp File
- GraphicFilter& rGF = *GraphicFilter::GetGraphicFilter();
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
sal_uInt16 nFilter(rGF.GetExportFormatNumber(fExt));
String aFilter(rGF.GetExportFormatShortName(nFilter));
String sPath(tempFileName.getStr());
diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx
index a717da3d1c..15c0228d12 100644..100755
--- a/sw/source/ui/docvw/romenu.cxx
+++ b/sw/source/ui/docvw/romenu.cxx
@@ -414,7 +414,7 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName )
SvtPathOptions aPathOpt;
String sGrfPath( aPathOpt.GetGraphicPath() );
- FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_SIMPLE, 0 );
+ FileDialogHelper aDlgHelper( TemplateDescription::FILESAVE_AUTOEXTENSION, 0 );
Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker();
INetURLObject aPath;
@@ -429,7 +429,7 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName )
aURL.SetSmartURL( aName );
aDlgHelper.SetFileName( aURL.GetName() );
- GraphicFilter& rGF = *GraphicFilter::GetGraphicFilter();
+ GraphicFilter& rGF = GraphicFilter::GetGraphicFilter();
const sal_uInt16 nCount = rGF.GetExportFormatCount();
String aExt( aURL.GetExtension() );
@@ -501,7 +501,7 @@ String ExportGraphic( const Graphic &rGraphic, const String &rGrfName )
nFilter = GRFILTER_FORMAT_DONTKNOW;
String aFilter( rGF.GetExportFormatShortName( nFilter ) );
XOutBitmap::WriteGraphic( rGraphic, sPath, aFilter,
- XOUTBMP_DONT_EXPAND_FILENAME );
+ XOUTBMP_DONT_EXPAND_FILENAME|XOUTBMP_DONT_ADD_EXTENSION );
return sPath;
}
}
diff --git a/sw/source/ui/docvw/srcedtw.cxx b/sw/source/ui/docvw/srcedtw.cxx
index 9bc0d1ae78..3c42717bfe 100644
--- a/sw/source/ui/docvw/srcedtw.cxx
+++ b/sw/source/ui/docvw/srcedtw.cxx
@@ -263,7 +263,7 @@ void SwSrcEditWindow::DataChanged( const DataChangedEvent& rDCEvt )
switch ( rDCEvt.GetType() )
{
case DATACHANGED_SETTINGS:
- // newly rearrange ScrollBars or trigger Resize, because
+ // newly rearrange ScrollBars or trigger Resize, because
// ScrollBar size could have changed. For this, in the
// Resize handler the size of ScrollBars has to be queried
// from the settings as well.
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index dde2851650..b0377faf4d 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -35,10 +35,6 @@
#include <hintids.hxx>
-#include <tools/pstm.hxx>
-
-#define _SVSTDARR_LONGSSORT
-#include <svl/svstdarr.hxx>
#include <editeng/paperinf.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/lrspitem.hxx>
@@ -64,10 +60,73 @@
#include <envfmt.hrc>
#include <vector>
+#include <algorithm>
#include "swabstdlg.hxx"
#include "chrdlg.hrc"
+namespace {
+ /// Converts a ranges array to a list containing one entry for each
+ /// element covered by the ranges.
+ /// @param aRanges An array containing zero or more range specifications and
+ /// terminated by one or more zero entries. A range
+ /// specification is two consecutive entries that specify
+ /// the start and end points of the range.
+ /// @returns A vector containing one element for each item covered by the
+ /// ranges. This is not gauranteed to be sorted and may contain
+ /// duplicates if the original ranges contained overlaps.
+ static std::vector<sal_uInt16> lcl_convertRangesToList(const sal_uInt16 aRanges[]) {
+ std::vector<sal_uInt16> aVec;
+ int i = 0;
+ while (aRanges[i])
+ {
+ for (sal_uInt16 n = aRanges[i]; n <= aRanges[i+1]; ++n)
+ {
+ aVec.push_back(n);
+ }
+ i += 2;
+ }
+ return aVec;
+ }
+
+ /// Converts a list of elements to a ranges array.
+ /// @param rElements Vector of the initial elements, this need not be sorted,
+ /// and may contain duplicate items. The vector is sorted
+ /// on exit from this function but may still contain duplicates.
+ /// @returns An array containing zero or more range specifications and
+ /// terminated by one or more zero entries. A range specification
+ /// is two consecutive entries that specify the start and end
+ /// points of the range. This list will be sorted and will not
+ /// contain any overlapping ranges.
+ static sal_uInt16* lcl_convertListToRanges(std::vector<sal_uInt16> &rElements) {
+ std::sort(rElements.begin(), rElements.end());
+ std::vector<sal_uInt16> aRanges;
+ size_t i;
+ for (i = 0; i < rElements.size(); ++i)
+ {
+ //Push the start of the this range.
+ aRanges.push_back(rElements[i]);
+ //Seek to the end of this range.
+ while (i + 1 < rElements.size() && rElements[i+1] - rElements[i] <= 1)
+ {
+ ++i;
+ }
+ //Push the end of this range (may be the same as the start).
+ aRanges.push_back( rElements[i] );
+ }
+
+ // Convert the vector to an array with terminating zero
+ sal_uInt16 *pNewRanges = new sal_uInt16[aRanges.size() + 1];
+ for (i = 0; i < aRanges.size(); ++i)
+ {
+ pNewRanges[i] = aRanges[i];
+ }
+ pNewRanges[i] = 0;
+ return pNewRanges;
+ }
+
+}
+
namespace swui
{
SwAbstractDialogFactory * GetFactory();
@@ -174,11 +233,11 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) :
bFound = sal_True;
}
aSizeFormatBox.InsertEntry(aPaperName, nPos);
- aIDs.Insert((sal_uInt16) i, nPos);
+ aIDs.insert( aIDs.begin() + nPos, (sal_uInt16) i);
}
}
aSizeFormatBox.InsertEntry(SvxPaperInfo::GetName(PAPER_USER));
- aIDs.Insert((sal_uInt16) PAPER_USER, aIDs.Count());
+ aIDs.push_back( (sal_uInt16) PAPER_USER );
}
@@ -201,7 +260,7 @@ IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit )
{
Paper ePaper = SvxPaperInfo::GetSvxPaper(
Size(lHeight, lWidth), MAP_TWIP, sal_True);
- for (sal_uInt16 i = 0; i < aIDs.Count(); i++)
+ for (sal_uInt16 i = 0; i < (sal_uInt16)aIDs.size(); i++)
if (aIDs[i] == (sal_uInt16)ePaper)
aSizeFormatBox.SelectEntryPos(i);
@@ -246,7 +305,7 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
SfxAllItemSet aTmpSet(*pCollSet);
// The CHRATR_BACKGROUND attribute gets transformed into a
- // RES_BACKGROUND for the dialog and back again ...
+ // RES_BACKGROUND for the dialog and back again ...
const SfxPoolItem *pTmpBrush;
if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_CHRATR_BACKGROUND,
@@ -307,14 +366,14 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff );
aTmpSet.Put( aOff );
- // set BoxInfo
+ // set BoxInfo
::PrepareBoxInfo( aTmpSet, *pSh );
SwParaDlg *pDlg = new SwParaDlg(GetParent(), pSh->GetView(), aTmpSet, DLG_ENVELOP, &pColl->GetName());
if ( pDlg->Execute() == RET_OK )
{
- // maybe relocate defaults
+ // maybe relocate defaults
const SfxPoolItem* pItem = 0;
SfxItemSet* pOutputSet = (SfxItemSet*)pDlg->GetOutputItemSet();
sal_uInt16 nNewDist;
@@ -367,55 +426,13 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender)
};
// BruteForce merge because MergeRange in SvTools is buggy:
- sal_uInt16 i = 0;
- SvLongsSort aMergedRanges( 0, 10 );
-
- while (pRanges[i])
- {
- for (sal_uInt16 nPos = pRanges[i]; nPos <= pRanges[i+1]; nPos++)
- aMergedRanges.Insert(nPos);
- i += 2;
- }
-
- i = 0;
-
- while (aRanges[i])
- {
- for (sal_uInt16 nPos = aRanges[i]; nPos <= aRanges[i+1]; nPos++)
- aMergedRanges.Insert(nPos);
- i += 2;
- }
-
- // compact ranges
- std::vector<sal_uInt16> aCompactedRanges;
-
- aCompactedRanges.push_back(aMergedRanges[0]);
-
- for (i = 0; i < aMergedRanges.Count(); ++i)
- {
- while (i + 1 < aMergedRanges.Count() &&
- aMergedRanges[i+1] - aMergedRanges[i] == 1)
- {
- i++;
- }
- aCompactedRanges.push_back( aMergedRanges[i] );
-
- if (i + 1 < aMergedRanges.Count())
- {
- aCompactedRanges.push_back( aMergedRanges[i+1] );
- }
- }
-
- // create new ranges
- sal_uInt16 *pNewRanges = new sal_uInt16[aCompactedRanges.size() + 1];
- for (i = 0; i < aCompactedRanges.size(); ++i)
- pNewRanges[i] = aCompactedRanges[i];
-
- pNewRanges[i] = 0;
+ std::vector<sal_uInt16> pVec = ::lcl_convertRangesToList(pRanges);
+ std::vector<sal_uInt16> aVec = ::lcl_convertRangesToList(aRanges);
+ pVec.insert(pVec.end(), aVec.begin(), aVec.end());
+ sal_uInt16 *pNewRanges = ::lcl_convertListToRanges(pVec);
pAddrSet = new SfxItemSet(GetParent()->pSh->GetView().GetCurShell()->GetPool(),
pNewRanges);
-
pAddrSet->Put(pColl->GetAttrSet());
delete[] pNewRanges;
}
@@ -559,7 +576,7 @@ void SwEnvFmtPage::Reset(const SfxItemSet& rSet)
Paper ePaper = SvxPaperInfo::GetSvxPaper(
Size( Min(rItem.lWidth, rItem.lHeight),
Max(rItem.lWidth, rItem.lHeight)), MAP_TWIP, sal_True);
- for (sal_uInt16 i = 0; i < (sal_uInt16) aIDs.Count(); i++)
+ for (sal_uInt16 i = 0; i < (sal_uInt16) aIDs.size(); i++)
if (aIDs[i] == (sal_uInt16)ePaper)
aSizeFormatBox.SelectEntryPos(i);
diff --git a/sw/source/ui/envelp/envfmt.hxx b/sw/source/ui/envelp/envfmt.hxx
index de5845d007..58f49202a2 100644
--- a/sw/source/ui/envelp/envfmt.hxx
+++ b/sw/source/ui/envelp/envfmt.hxx
@@ -28,11 +28,6 @@
#ifndef _ENVFMT_HXX
#define _ENVFMT_HXX
-
-#ifndef _SVSTDARR_HXX
-#define _SVSTDARR_USHORTS
-#include <svl/svstdarr.hxx>
-#endif
#include <svtools/stdctrl.hxx>
#include <vcl/field.hxx>
#include <vcl/menubtn.hxx>
@@ -72,7 +67,7 @@ class SwEnvFmtPage : public SfxTabPage
MetricField aSizeHeightField;
SwEnvPreview aPreview;
- SvUShorts aIDs;
+ std::vector<sal_uInt16> aIDs;
SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet);
~SwEnvFmtPage();
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index cda3fded49..914c280f50 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -105,7 +105,7 @@ void SwEnvPreview::Paint(const Rectangle &)
SetLineColor( aFront );
- // Envelope
+ // Envelope
long nW = (sal_uInt16) (f * nPageW),
nH = (sal_uInt16) (f * nPageH),
nX = (GetOutputSizePixel().Width () - nW) / 2,
diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx
index ad5ea2ac44..94f7153a0c 100644
--- a/sw/source/ui/envelp/label1.cxx
+++ b/sw/source/ui/envelp/label1.cxx
@@ -412,7 +412,7 @@ IMPL_LINK( SwLabPage, MakeHdl, ListBox *, EMPTYARG )
aTypeBox.Clear();
aHiddenSortTypeBox.Clear();
- GetParent()->TypeIds().Remove( 0, GetParent()->TypeIds().Count() );
+ GetParent()->TypeIds().clear();
const String aMake = aMakeBox.GetSelectEntry();
GetParent()->ReplaceGroup( aMake );
@@ -443,9 +443,9 @@ IMPL_LINK( SwLabPage, MakeHdl, ListBox *, EMPTYARG )
}
if(bInsert)
{
- GetParent()->TypeIds().Insert(i, GetParent()->TypeIds().Count());
+ GetParent()->TypeIds().push_back(i);
if ( !nLstType && aType == String(aItem.aLstType) )
- nLstType = GetParent()->TypeIds().Count();
+ nLstType = GetParent()->TypeIds().size();
}
}
for(sal_uInt16 nEntry = 0; nEntry < aHiddenSortTypeBox.GetEntryCount(); nEntry++)
diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx
index a670927baf..5d5bceee57 100644
--- a/sw/source/ui/envelp/labfmt.cxx
+++ b/sw/source/ui/envelp/labfmt.cxx
@@ -140,12 +140,12 @@ void SwLabPreview::Paint(const Rectangle &)
else
lDispH += ROUND(aItem.lVDist / 10);
- // Scale factor
+ // Scale factor
float fx = (float) lOutWPix23 / Max(1L, lDispW),
fy = (float) lOutHPix23 / Max(1L, lDispH),
f = fx < fy ? fx : fy;
- // zero point
+ // zero point
long lOutlineW = ROUND(f * lDispW);
long lOutlineH = ROUND(f * lDispH);
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index 63305862d3..272bf19b49 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -203,7 +203,7 @@ SvLBoxEntry* SwChangeDBDlg::Insert(const String& rDBName)
}
/*--------------------------------------------------------------------
- Description: destroy dialog
+ Description: destroy dialog
--------------------------------------------------------------------*/
SwChangeDBDlg::~SwChangeDBDlg()
{
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 9c74cb36a8..79b45be116 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -86,7 +86,7 @@ SwFldDBPage::~SwFldDBPage()
}
/*--------------------------------------------------------------------
- Description: initialise TabPage
+ Description: initialise TabPage
--------------------------------------------------------------------*/
void SwFldDBPage::Reset(const SfxItemSet&)
{
@@ -102,7 +102,7 @@ void SwFldDBPage::Reset(const SfxItemSet&)
if (!IsFldEdit())
{
- // initialise TypeListBox
+ // initialise TypeListBox
const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
for(i = rRg.nStart; i < rRg.nEnd; ++i)
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index f1a15f6392..2a18e114df 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -103,7 +103,7 @@ void SwFldDokInfPage::Reset(const SfxItemSet& )
{
Init(); // general initialisation
- // initialise TypeListBox
+ // initialise TypeListBox
aTypeTLB.SetUpdateMode(sal_False);
aTypeTLB.Clear();
pSelEntry = 0;
@@ -219,7 +219,7 @@ void SwFldDokInfPage::Reset(const SfxItemSet& )
IMPL_LINK( SwFldDokInfPage, TypeHdl, ListBox *, EMPTYARG )
{
- // save old ListBoxPos
+ // save old ListBoxPos
SvLBoxEntry* pOldEntry = pSelEntry;
// current ListBoxPos
@@ -377,7 +377,7 @@ IMPL_LINK( SwFldDokInfPage, SubTypeHdl, ListBox *, EMPTYARG )
sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType)
{
- // fill Format-Listbox
+ // fill Format-Listbox
sal_uInt16 nTypeId = TYP_DOCINFOFLD;
EnableInsert(nSubType != USHRT_MAX);
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index 5a2337a26f..ea9f15ba23 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -93,9 +93,9 @@ SwFldDokPage::~SwFldDokPage()
void SwFldDokPage::Reset(const SfxItemSet& )
{
SavePos(&aTypeLB);
- Init(); // general initialisation
+ Init(); // general initialisation
- // initialise TypeListBox
+ // initialise TypeListBox
const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
aTypeLB.SetUpdateMode(sal_False);
@@ -106,7 +106,7 @@ void SwFldDokPage::Reset(const SfxItemSet& )
if (!IsFldEdit())
{
- // fill Type-Listbox
+ // fill Type-Listbox
for(short i = rRg.nStart; i < rRg.nEnd; ++i)
{
nTypeId = GetFldMgr().GetTypeId(i);
@@ -194,7 +194,7 @@ void SwFldDokPage::Reset(const SfxItemSet& )
IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
{
- // save old ListBoxPos
+ // save old ListBoxPos
const sal_uInt16 nOld = GetTypeSel();
// current ListBoxPos
@@ -212,7 +212,7 @@ IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
- // fill Selection-Listbox
+ // fill Selection-Listbox
aSelectionLB.Clear();
if (nTypeId != USHRT_MAX)
@@ -304,7 +304,7 @@ IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
aSelectionLB.Enable( bEnable );
aSelectionFT.Enable( bEnable );
- // fill Format-Listbox
+ // fill Format-Listbox
sal_uInt16 nSize = FillFormatLB(nTypeId);
sal_Bool bValue = sal_False, bLevel = sal_False, bNumFmt = sal_False, bOffset = sal_False;
@@ -332,7 +332,7 @@ IMPL_LINK( SwFldDokPage, TypeHdl, ListBox *, EMPTYARG )
nFmtType = NUMBERFORMAT_TIME;
aValueFT.SetText(sTimeOffset);
- aDateOffsetED.SetFirst(-1440); // one day
+ aDateOffsetED.SetFirst(-1440); // one day
aDateOffsetED.SetLast(1440);
if (IsFldEdit())
@@ -488,7 +488,7 @@ IMPL_LINK( SwFldDokPage, SubTypeHdl, ListBox *, EMPTYARG )
sal_uInt16 SwFldDokPage::FillFormatLB(sal_uInt16 nTypeId)
{
- // fill Format-Listbox
+ // fill Format-Listbox
aFormatLB.Clear();
if (nTypeId == TYP_AUTHORFLD)
diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 9556f71b41..41d0c6ce38 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -94,9 +94,9 @@ SwFldEditDlg::SwFldEditDlg(SwView& rVw) :
GetOKButton()->SetClickHdl(LINK(this, SwFldEditDlg, OKHdl));
- // position buttons ourselves because otherwise when font sizes are
+ // position buttons ourselves because otherwise when font sizes are
// varying, they are in the woods, and because PB uses fixed pixel sizes
- // for its buttons and dialog width in SingleTabDlg.
+ // for its buttons and dialog width in SingleTabDlg.
aPrevBT.SetPosPixel(Point(GetOKButton()->GetPosPixel().X(), aPrevBT.GetPosPixel().Y()));
sal_uInt16 nWidth = static_cast< sal_uInt16 >(GetOKButton()->GetOutputSize().Width() / 2 - 3);
Size aNewSize(LogicToPixel(Size(nWidth, GetOKButton()->GetOutputSize().Height())));
@@ -162,7 +162,7 @@ void SwFldEditDlg::Init()
SfxTabPage* SwFldEditDlg::CreatePage(sal_uInt16 nGroup)
{
- // create TabPage
+ // create TabPage
SfxTabPage* pTabPage = 0;
const char* pHelpId = 0;
diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index 46a3e5849f..f4041d5424 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -116,10 +116,10 @@ void SwFldFuncPage::Reset(const SfxItemSet& )
if (!IsFldEdit())
{
- // initialise TypeListBox
+ // initialise TypeListBox
const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
- // fill Typ-Listbox
+ // fill Typ-Listbox
for(short i = rRg.nStart; i < rRg.nEnd; ++i)
{
nTypeId = GetFldMgr().GetTypeId(i);
@@ -193,7 +193,7 @@ void SwFldFuncPage::Reset(const SfxItemSet& )
IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
{
- // save old ListBoxPos
+ // save old ListBoxPos
const sal_uInt16 nOld = GetTypeSel();
// current ListBoxPos
@@ -209,10 +209,10 @@ IMPL_LINK( SwFldFuncPage, TypeHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
- // fill Selection-Listbox
+ // fill Selection-Listbox
UpdateSubType();
- // fill Format-Listbox
+ // fill Format-Listbox
aFormatLB.Clear();
sal_uInt16 nSize = GetFldMgr().GetFormatCount(nTypeId, sal_False, IsFldDlgHtmlMode());
@@ -498,7 +498,7 @@ void SwFldFuncPage::UpdateSubType()
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
- // fill Selction-Listbox
+ // fill Selction-Listbox
aSelectionLB.SetUpdateMode(sal_False);
aSelectionLB.Clear();
@@ -539,7 +539,7 @@ void SwFldFuncPage::UpdateSubType()
}
/*--------------------------------------------------------------------
- Description: call MacroBrowser, fill Listbox with Macros
+ Description: call MacroBrowser, fill Listbox with Macros
--------------------------------------------------------------------*/
IMPL_LINK( SwFldFuncPage, MacroHdl, Button *, pBtn )
{
@@ -629,7 +629,7 @@ String SwFldFuncPage::TurnMacroString(const String &rMacro)
{
if (rMacro.Len())
{
- // reverse content of aName
+ // reverse content of aName
String sTmp, sBuf;
sal_uInt16 nPos = 0;
diff --git a/sw/source/ui/fldui/fldfunc.hxx b/sw/source/ui/fldui/fldfunc.hxx
index 0f712c5fb2..7bfa47e7ee 100644
--- a/sw/source/ui/fldui/fldfunc.hxx
+++ b/sw/source/ui/fldui/fldfunc.hxx
@@ -82,7 +82,7 @@ class SwFldFuncPage : public SwFldPage
DECL_LINK( ListModifyHdl, Control*);
DECL_LINK( ListEnableHdl, void*);
- // select Macro
+ // select Macro
DECL_LINK( MacroHdl, Button * );
void UpdateSubType();
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 1923d92efa..2e663854cf 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -62,7 +62,7 @@
#include <view.hxx>
#include <wrtsh.hxx> // active window
#include <doc.hxx> // active window
-#include <docsh.hxx> // active window
+#include <docsh.hxx> // active window
#include <swmodule.hxx>
#include <charatr.hxx>
#include <fmtinfmt.hxx>
@@ -356,7 +356,7 @@ SwField* SwFldMgr::GetCurFld()
if(!pCurFld)
return 0;
- // preprocess current values; determine parameter 1 and parameter 2
+ // preprocess current values; determine parameter 1 and parameter 2
// as well as the format
const sal_uInt16 nTypeId = pCurFld->GetTypeId();
@@ -410,7 +410,7 @@ static SwFldGroupRgn const aWebRanges[] =
}
/*--------------------------------------------------------------------
- Description: determine GroupId
+ Description: determine GroupId
--------------------------------------------------------------------*/
sal_uInt16 SwFldMgr::GetGroup(sal_Bool bHtmlMode, sal_uInt16 nTypeId, sal_uInt16 nSubType) const
@@ -440,7 +440,7 @@ sal_uInt16 SwFldMgr::GetGroup(sal_Bool bHtmlMode, sal_uInt16 nTypeId, sal_uInt16
}
/*--------------------------------------------------------------------
- Description: determine names to TypeId
+ Description: determine names to TypeId
ACCESS over TYP_....
--------------------------------------------------------------------*/
@@ -605,7 +605,7 @@ sal_Bool SwFldMgr::GetSubTypes(sal_uInt16 nTypeId, SvStringsDtor& rToFill)
}
/*--------------------------------------------------------------------
- Description: determine format
+ Description: determine format
ACCESS over TYP_....
--------------------------------------------------------------------*/
@@ -682,7 +682,7 @@ String SwFldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const
nStart = aSwFlds[nPos].nFmtBegin;
if (TYP_AUTHORFLD == nTypeId|| TYP_FILENAMEFLD == nTypeId)
- nFormatId &= ~FF_FIXED; // mask out Fixed-Flag
+ nFormatId &= ~FF_FIXED; // mask out Fixed-Flag
if((nStart + nFormatId) < aSwFlds[nPos].nFmtEnd)
aRet = SW_RESSTR((sal_uInt16)(nStart + nFormatId));
@@ -714,7 +714,7 @@ String SwFldMgr::GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const
}
/*--------------------------------------------------------------------
- Description: determine FormatId from Pseudo-ID
+ Description: determine FormatId from Pseudo-ID
--------------------------------------------------------------------*/
sal_uInt16 SwFldMgr::GetFormatId(sal_uInt16 nTypeId, sal_uLong nFormatId) const
@@ -836,7 +836,7 @@ void SwFldMgr::InsertFldType(SwFieldType& rType)
}
/*--------------------------------------------------------------------
- Description: determine current TypeId
+ Description: determine current TypeId
--------------------------------------------------------------------*/
@@ -1552,7 +1552,7 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat,
}
// set format
- // setup format before SetPar2 because of NumberFormatter!
+ // setup format before SetPar2 because of NumberFormatter!
pTmpFld->ChangeFormat(nFormat);
if(bSetPar1)
@@ -1581,7 +1581,7 @@ void SwFldMgr::UpdateCurFld(sal_uLong nFormat,
}
/*--------------------------------------------------------------------
- Description: explicitly evaluate ExpressionFields
+ Description: explicitly evaluate ExpressionFields
--------------------------------------------------------------------*/
void SwFldMgr::EvalExpFlds(SwWrtShell* pSh)
{
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index aaa9c1dc63..cc491517c9 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -80,7 +80,7 @@ SwFldPage::~SwFldPage()
}
/*--------------------------------------------------------------------
- Description: initialise TabPage
+ Description: initialise TabPage
--------------------------------------------------------------------*/
void SwFldPage::Init()
@@ -362,7 +362,7 @@ IMPL_LINK( SwFldPage, InsertHdl, Button *, pBtn )
}
/*--------------------------------------------------------------------
- Description: enable/disable "Insert"-Button
+ Description: enable/disable "Insert"-Button
--------------------------------------------------------------------*/
void SwFldPage::EnableInsert(sal_Bool bEnable)
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index ba309d6b86..51a0e37322 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -47,11 +47,10 @@
#include <fldui.hrc>
#include <fldtdlg.hrc>
#include <globals.hrc>
-// --> OD 2007-11-14 #i83479#
+// #i83479#
#include <SwNodeNum.hxx>
#include <IDocumentMarkAccess.hxx>
#include <ndtxt.hxx>
-// <--
// sw/inc/expfld.hxx
SV_IMPL_PTRARR( _SwSeqFldList, _SeqFldLstElem* )
@@ -60,10 +59,9 @@ SV_IMPL_PTRARR( _SwSeqFldList, _SeqFldLstElem* )
#define REFFLDFLAG_BOOKMARK 0x4800
#define REFFLDFLAG_FOOTNOTE 0x5000
#define REFFLDFLAG_ENDNOTE 0x6000
-// --> OD 2007-11-09 #i83479#
+// #i83479#
#define REFFLDFLAG_HEADING 0x7100
#define REFFLDFLAG_NUMITEM 0x7200
-// <--
sal_uInt16 nFldDlgFmtSel = 0;
@@ -77,9 +75,8 @@ SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) :
aTypeLB (this, SW_RES(LB_REFTYPE)),
aSelectionFT (this, SW_RES(FT_REFSELECTION)),
aSelectionLB (this, SW_RES(LB_REFSELECTION)),
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
aSelectionToolTipLB( this, SW_RES(LB_REFSELECTION_TOOLTIP) ),
- // <--
aFormatFT (this, SW_RES(FT_REFFORMAT)),
aFormatLB (this, SW_RES(LB_REFFORMAT)),
aNameFT (this, SW_RES(FT_REFNAME)),
@@ -90,14 +87,13 @@ SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) :
sBookmarkTxt (SW_RES(STR_REFBOOKMARK)),
sFootnoteTxt (SW_RES(STR_REFFOOTNOTE)),
sEndnoteTxt (SW_RES(STR_REFENDNOTE)),
- // --> OD 2007-11-09 #i83479#
+ // #i83479#
sHeadingTxt (SW_RES(STR_REFHEADING)),
sNumItemTxt (SW_RES(STR_REFNUMITEM)),
maOutlineNodes(),
maNumItems(),
mpSavedSelectedTxtNode( 0 ),
mnSavedSelectedPos( 0 )
- // <--
{
FreeResource();
@@ -109,20 +105,19 @@ SwFldRefPage::SwFldRefPage(Window* pParent, const SfxItemSet& rCoreSet ) :
aSelectionLB.SetDoubleClickHdl (LINK(this, SwFldRefPage, InsertHdl));
aFormatLB.SetDoubleClickHdl (LINK(this, SwFldRefPage, InsertHdl));
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
aSelectionToolTipLB.SetSelectHdl( LINK(this, SwFldRefPage, SubTypeHdl) );
aSelectionToolTipLB.SetDoubleClickHdl( LINK(this, SwFldRefPage, InsertHdl) );
aSelectionToolTipLB.SetStyle( aSelectionToolTipLB.GetStyle() | WB_HSCROLL );
aSelectionToolTipLB.SetSpaceBetweenEntries(1);
aSelectionToolTipLB.SetHighlightRange();
- // <--
}
SwFldRefPage::~SwFldRefPage()
{
}
-// --> OD 2007-11-22 #i83479#
+// #i83479#
void SwFldRefPage::SaveSelectedTxtNode()
{
mpSavedSelectedTxtNode = 0;
@@ -168,26 +163,24 @@ sal_uInt16 SwFldRefPage::GetSavedSelectedPos() const
return mnSavedSelectedPos;
}
-// <--
void SwFldRefPage::Reset(const SfxItemSet& )
{
if (!IsFldEdit())
{
SavePos(&aTypeLB);
- // --> OD 2007-11-22 #i83479#
+ // #i83479#
SaveSelectedTxtNode();
- // <--
}
SetSelectionSel(LISTBOX_ENTRY_NOTFOUND);
SetTypeSel(LISTBOX_ENTRY_NOTFOUND);
Init(); // general initialisation
- // initialise TypeListBox
+ // initialise TypeListBox
aTypeLB.SetUpdateMode(sal_False);
aTypeLB.Clear();
- // fill Type-Listbox
+ // fill Type-Listbox
sal_uInt16 nPos;
// set/insert reference
@@ -204,13 +197,12 @@ void SwFldRefPage::Reset(const SfxItemSet& )
}
}
- // --> OD 2007-11-09 #i83479#
+ // #i83479#
// entries for headings and numbered items
nPos = aTypeLB.InsertEntry(sHeadingTxt);
aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_HEADING);
nPos = aTypeLB.InsertEntry(sNumItemTxt);
aTypeLB.SetEntryData(nPos, (void*)REFFLDFLAG_NUMITEM);
- // <--
// fill up with the sequence types
SwWrtShell *pSh = GetWrtShell();
@@ -289,7 +281,7 @@ void SwFldRefPage::Reset(const SfxItemSet& )
IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
{
- // save old ListBoxPos
+ // save old ListBoxPos
const sal_uInt16 nOld = GetTypeSel();
// current ListBoxPos
@@ -307,7 +299,7 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
{
case REF_BOOKMARK:
{
- // --> OD 2007-11-14 #i83479#
+ // #i83479#
SwGetRefField* pRefFld = dynamic_cast<SwGetRefField*>(GetCurField());
if ( pRefFld &&
pRefFld->IsRefToHeadingCrossRefBookmark() )
@@ -326,7 +318,6 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
sName = sBookmarkTxt;
nFlag = REFFLDFLAG_BOOKMARK;
}
- // <--
}
break;
@@ -371,7 +362,7 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
{
sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
- // fill selection-ListBox
+ // fill selection-ListBox
UpdateSubType();
sal_Bool bName = sal_False; nFldDlgFmtSel = 0;
@@ -413,7 +404,7 @@ IMPL_LINK( SwFldRefPage, TypeHdl, ListBox *, EMPTYARG )
aNameED.Enable(bName);
aNameFT.Enable(bName);
- // fill Format-Listbox
+ // fill Format-Listbox
sal_uInt16 nSize = FillFormatLB(nTypeId);
sal_Bool bFormat = nSize != 0;
aFormatLB.Enable(bFormat);
@@ -452,7 +443,7 @@ IMPL_LINK( SwFldRefPage, SubTypeHdl, ListBox *, EMPTYARG )
}
break;
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
case REFFLDFLAG_HEADING:
case REFFLDFLAG_NUMITEM:
{
@@ -463,7 +454,6 @@ IMPL_LINK( SwFldRefPage, SubTypeHdl, ListBox *, EMPTYARG )
}
}
break;
- // <--
default:
if (!IsFldEdit() || aSelectionLB.GetSelectEntryCount())
@@ -475,7 +465,7 @@ IMPL_LINK( SwFldRefPage, SubTypeHdl, ListBox *, EMPTYARG )
}
/*--------------------------------------------------------------------
- Description: renew types in SelectionLB
+ Description: renew types in SelectionLB
--------------------------------------------------------------------*/
void SwFldRefPage::UpdateSubType()
@@ -487,7 +477,7 @@ void SwFldRefPage::UpdateSubType()
const sal_uInt16 nTypeId = (sal_uInt16)(sal_uLong)aTypeLB.GetEntryData(GetTypeSel());
String sOldSel;
- // --> OD 2007-11-22 #i83479#
+ // #i83479#
if ( aSelectionLB.IsVisible() )
{
const sal_uInt16 nSelectionSel = aSelectionLB.GetSelectEntryPos();
@@ -496,17 +486,15 @@ void SwFldRefPage::UpdateSubType()
sOldSel = aSelectionLB.GetEntry(nSelectionSel);
}
}
- // <--
if (IsFldEdit() && !sOldSel.Len())
sOldSel = String::CreateFromInt32( pRefFld->GetSeqNo() + 1 );
aSelectionLB.SetUpdateMode(sal_False);
aSelectionLB.Clear();
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
aSelectionToolTipLB.SetUpdateMode(sal_False);
aSelectionToolTipLB.Clear();
bool bShowSelectionToolTipLB( false );
- // <--
if( REFFLDFLAG & nTypeId )
{
@@ -552,7 +540,7 @@ void SwFldRefPage::UpdateSubType()
sOldSel = aArr[n]->sDlgEntry;
}
}
- // --> OD 2007-11-14 #i83479#
+ // #i83479#
else if ( nTypeId == REFFLDFLAG_HEADING )
{
bShowSelectionToolTipLB = true;
@@ -613,7 +601,6 @@ void SwFldRefPage::UpdateSubType()
}
}
}
- // <--
else
{
aSelectionLB.SetStyle(aSelectionLB.GetStyle()|WB_SORT);
@@ -653,7 +640,7 @@ void SwFldRefPage::UpdateSubType()
sOldSel = pRefFld->GetSetRefName();
}
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
aSelectionToolTipLB.Show( bShowSelectionToolTipLB );
aSelectionLB.Show( !bShowSelectionToolTipLB );
if ( bShowSelectionToolTipLB )
@@ -693,7 +680,6 @@ void SwFldRefPage::UpdateSubType()
if (IsFldEdit() && !aSelectionLB.GetSelectEntryCount()) // in case the reference was already deleted...
aNameED.SetText(sOldSel);
}
- // <--
}
sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
@@ -704,7 +690,7 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
if (nFormatSel != LISTBOX_ENTRY_NOTFOUND)
sOldSel = aFormatLB.GetEntry(nFormatSel);
- // fill Format-Listbox
+ // fill Format-Listbox
aFormatLB.Clear();
// refernce has less that the annotation
@@ -712,12 +698,11 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
bool bAddCrossRefFormats( false );
switch (nTypeId)
{
- // --> OD 2007-11-16 #i83479#
+ // #i83479#
case REFFLDFLAG_HEADING:
case REFFLDFLAG_NUMITEM:
bAddCrossRefFormats = true;
// intentional no break here
- // <--
case TYP_GETREFFLD:
case REFFLDFLAG_BOOKMARK:
@@ -727,7 +712,7 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
break;
default:
- // --> OD 2007-11-16 #i83479#
+ // #i83479#
if ( REFFLDFLAG & nTypeId )
{
@@ -748,7 +733,7 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
sal_uInt16 nPos = aFormatLB.InsertEntry(GetFldMgr().GetFormatStr( nTypeId, i ));
aFormatLB.SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, i )));
}
- // --> OD 2007-11-16 #i83479#
+ // #i83479#
if ( bAddCrossRefFormats )
{
sal_uInt16 nFormat = FMT_REF_NUMBER - FMT_REF_BEGIN;
@@ -762,7 +747,6 @@ sal_uInt16 SwFldRefPage::FillFormatLB(sal_uInt16 nTypeId)
aFormatLB.SetEntryData( nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId( nTypeId, nFormat )));
nSize += 3;
}
- // <--
// select a certain entry
if (nSize)
@@ -902,7 +886,7 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
else if (IsFldEdit())
aVal = String::CreateFromInt32( pRefFld->GetSeqNo() );
}
- // --> OD 2007-11-16 #i83479#
+ // #i83479#
else if ( nTypeId == REFFLDFLAG_HEADING )
{
SvLBoxEntry* pEntry = aSelectionToolTipLB.GetCurEntry();
@@ -943,7 +927,6 @@ sal_Bool SwFldRefPage::FillItemSet(SfxItemSet& )
}
}
}
- // <--
else // SeqenceFields
{
// get fields for Seq-FeldType:
diff --git a/sw/source/ui/fldui/fldref.hxx b/sw/source/ui/fldui/fldref.hxx
index cbb67fd9de..67aa51a070 100644
--- a/sw/source/ui/fldui/fldref.hxx
+++ b/sw/source/ui/fldui/fldref.hxx
@@ -36,12 +36,11 @@
#include <vcl/edit.hxx>
#include "fldpage.hxx"
-// --> OD 2007-11-15 #i83479#
+// #i83479#
#include <IDocumentOutlineNodes.hxx>
#include <IDocumentListItems.hxx>
#include <FldRefTreeListBox.hxx>
class SwTxtNode;
-// <--
class SwFldRefPage : public SwFldPage
{
@@ -49,9 +48,8 @@ class SwFldRefPage : public SwFldPage
ListBox aTypeLB;
FixedText aSelectionFT;
ListBox aSelectionLB;
- // --> OD 2007-11-21 #i83479#
+ // #i83479#
SwFldRefTreeListBox aSelectionToolTipLB;
- // <--
FixedText aFormatFT;
ListBox aFormatLB;
FixedText aNameFT;
@@ -61,7 +59,7 @@ class SwFldRefPage : public SwFldPage
const String sBookmarkTxt;
const String sFootnoteTxt;
const String sEndnoteTxt;
- // --> OD 2007-11-09 #i83479#
+ // #i83479#
const String sHeadingTxt;
const String sNumItemTxt;
@@ -73,7 +71,6 @@ class SwFldRefPage : public SwFldPage
const SwTxtNode* mpSavedSelectedTxtNode;
// fallback, if previously selected text node doesn't exist anymore
sal_uInt16 mnSavedSelectedPos;
- // <--
DECL_LINK( TypeHdl, ListBox* pLB = 0 );
DECL_LINK( SubTypeHdl, ListBox* pLB = 0 );
@@ -82,11 +79,10 @@ class SwFldRefPage : public SwFldPage
void UpdateSubType();
sal_uInt16 FillFormatLB(sal_uInt16 nTypeId);
- // --> OD 2007-12-05 #i83479#
+ // #i83479#
void SaveSelectedTxtNode();
const SwTxtNode* GetSavedSelectedTxtNode() const;
sal_uInt16 GetSavedSelectedPos() const;
- // <--
protected:
virtual sal_uInt16 GetGroup();
diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 1a6f5edb25..95a8db377d 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -152,7 +152,7 @@ void SwFldDlg::Initialize(SfxChildWinInfo *pInfo)
if ( GetStyle() & WB_SIZEABLE )
SetSizePixel( pInfo->aSize );
- // remember initial size from pInfo
+ // remember initial size from pInfo
aSize = GetSizePixel();
// should the FloatingWindow get zoomed?
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index e743d8b23e..15c71fc353 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -114,7 +114,7 @@ void SwFldVarPage::Reset(const SfxItemSet& )
if (!IsFldEdit())
{
- // initialise TypeListBox
+ // initialise TypeListBox
const SwFldGroupRgn& rRg = GetFldMgr().GetGroupRange(IsFldDlgHtmlMode(), GetGroup());
for (short i = rRg.nStart; i < rRg.nEnd; ++i)
@@ -144,7 +144,7 @@ void SwFldVarPage::Reset(const SfxItemSet& )
}
}
- // select old Pos
+ // select old Pos
RestorePos(&aTypeLB);
aTypeLB.SetDoubleClickHdl (LINK(this, SwFldVarPage, InsertHdl));
@@ -196,7 +196,7 @@ void SwFldVarPage::Reset(const SfxItemSet& )
IMPL_LINK( SwFldVarPage, TypeHdl, ListBox *, EMPTYARG )
{
- // save old ListBoxPos
+ // save old ListBoxPos
const sal_uInt16 nOld = GetTypeSel();
// current ListBoxPos
@@ -589,7 +589,7 @@ IMPL_LINK( SwFldVarPage, SubTypeHdl, ListBox *, pBox )
}
/*--------------------------------------------------------------------
- Description: renew types in SelectionBox
+ Description: renew types in SelectionBox
--------------------------------------------------------------------*/
void SwFldVarPage::UpdateSubType()
{
@@ -600,7 +600,7 @@ void SwFldVarPage::UpdateSubType()
if(GetSelectionSel() != LISTBOX_ENTRY_NOTFOUND)
sOldSel = aSelectionLB.GetEntry(GetSelectionSel());
- // fill Selection-Listbox
+ // fill Selection-Listbox
aSelectionLB.SetUpdateMode(sal_False);
aSelectionLB.Clear();
@@ -710,7 +710,7 @@ sal_uInt16 SwFldVarPage::FillFormatLB(sal_uInt16 nTypeId)
nOldNumFormat = aNumFormatLB.GetFormat();
}
- // fill Format-Listbox
+ // fill Format-Listbox
aFormatLB.Clear();
aNumFormatLB.Clear();
sal_Bool bSpecialFmt = sal_False;
@@ -848,13 +848,13 @@ IMPL_LINK( SwFldVarPage, ModifyHdl, Edit *, EMPTYARG )
nLen = sName.Len();
Selection aSel(aNameED.GetSelection());
aNameED.SetText( sName );
- aNameED.SetSelection( aSel ); // restore Cursorpos
+ aNameED.SetSelection( aSel ); // restore Cursorpos
}
break;
}
- // check buttons
+ // check buttons
switch (nTypeId)
{
case TYP_DDEFLD:
@@ -1026,7 +1026,7 @@ IMPL_LINK( SwFldVarPage, TBClickHdl, ToolBox *, pBox )
sal_uLong nFmt = nNumFormatPos == 0 ? 0 : aNumFormatLB.GetFormat();
if (nFmt)
{ // Switch language to office-language because Kalkulator expects
- // String in office format and it should be fed into dialog like
+ // String in office format and it should be fed into dialog like
// that
nFmt = SwValueField::GetSystemFormat(pSh->GetNumberFormatter(), nFmt);
}
@@ -1151,7 +1151,7 @@ sal_Bool SwFldVarPage::FillItemSet(SfxItemSet& )
if (nFormat && nFormat != ULONG_MAX && aNumFormatLB.IsAutomaticLanguage())
{
// Switch language to office language because Kalkulator expects
- // String in office format and it should be fed into the dialog
+ // String in office format and it should be fed into the dialog
// like that
SwWrtShell *pSh = GetWrtShell();
if(!pSh)
diff --git a/sw/source/ui/fldui/fldvar.hxx b/sw/source/ui/fldui/fldvar.hxx
index 4ca45675b4..786e9b874a 100644
--- a/sw/source/ui/fldui/fldvar.hxx
+++ b/sw/source/ui/fldui/fldvar.hxx
@@ -52,7 +52,7 @@ class SelectionListBox : public ListBox
public:
SelectionListBox( SwFldVarPage* pDialog, const ResId& rResId );
- // detect selection via Ctrl or Alt and evaluate with SelectHdl
+ // detect selection via Ctrl or Alt and evaluate with SelectHdl
sal_Bool IsCallAddSelection() const {return bCallAddSelection;}
void ResetCallAddSelection() {bCallAddSelection = sal_False;}
};
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index ec3b136d24..c802f1bb05 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -206,8 +206,8 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
SvtCJKOptions aCJKOptions;
if(nHtmlMode & HTMLMODE_ON)
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- if (!pHtmlOpt->IsPrintLayoutExtension())
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ if (!rHtmlOpt.IsPrintLayoutExtension())
RemoveTabPage(TP_PARA_EXT);
RemoveTabPage(TP_PARA_ASIAN);
RemoveTabPage(TP_TABULATOR);
@@ -505,10 +505,10 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
case TP_PAGE_STD:
if(0 == (nHtmlMode & HTMLMODE_ON ))
{
- List aList;
- String* pNew = new String;
- SwStyleNameMapper::FillUIName( RES_POOLCOLL_TEXT, *pNew );
- aList.Insert( pNew, (sal_uLong)0 );
+ std::vector<String> aList;
+ String aNew;
+ SwStyleNameMapper::FillUIName( RES_POOLCOLL_TEXT, aNew );
+ aList.push_back( aNew );
if( pWrtShell )
{
SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell->
@@ -517,15 +517,12 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
SfxStyleSheetBase *pFirstStyle = pStyleSheetPool->First();
while(pFirstStyle)
{
- aList.Insert( new String(pFirstStyle->GetName()),
- aList.Count());
+ aList.push_back( pFirstStyle->GetName() );
pFirstStyle = pStyleSheetPool->Next();
}
}
aSet.Put (SfxStringListItem(SID_COLLECT_LIST, &aList));
rPage.PageCreated(aSet);
- for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
- delete (String*)aList.Remove(i);
}
break;
@@ -557,19 +554,15 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
rCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
::FillCharStyleListBox(rCharFmtLB, pDocShell);
- List aList;
+
+ std::vector<String> aList;
for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++)
- {
+ aList.push_back( rCharFmtLB.GetEntry(j) );
- aList.Insert( new XubString(rCharFmtLB.GetEntry(j)), LIST_APPEND );
- }
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
rPage.PageCreated(aSet);
- for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
- delete (XubString*)aList.Remove(i);
- aList.Clear();
}
break;
case RID_SVXPAGE_NUM_POSITION:
diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx
index fc4da4a81a..96492f6e50 100644
--- a/sw/source/ui/frmdlg/column.cxx
+++ b/sw/source/ui/frmdlg/column.cxx
@@ -538,10 +538,10 @@ SwColumnPage::SwColumnPage(Window *pParent, const SfxItemSet &rSet)
aLineTypeDLB.InsertEntry( ::editeng::SvxBorderLine::getWidthImpl( ::editeng::DOTTED ), ::editeng::DOTTED );
aLineTypeDLB.InsertEntry( ::editeng::SvxBorderLine::getWidthImpl( ::editeng::DASHED ), ::editeng::DASHED );
- long nLineWidth = MetricField::ConvertDoubleValue(
+ long nLineWidth = static_cast<long>(MetricField::ConvertDoubleValue(
aLineWidthEdit.GetValue( ),
aLineWidthEdit.GetDecimalDigits( ),
- aLineWidthEdit.GetUnit(), MAP_TWIP );
+ aLineWidthEdit.GetUnit(), MAP_TWIP ));
aLineTypeDLB.SetWidth( nLineWidth );
// Fill the color listbox
@@ -641,7 +641,7 @@ void SwColumnPage::Reset(const SfxItemSet &rSet)
}
/*--------------------------------------------------------------------
- Description: create TabPage
+ Description: create TabPage
--------------------------------------------------------------------*/
SfxTabPage* SwColumnPage::Create(Window *pParent, const SfxItemSet &rSet)
{
@@ -687,7 +687,7 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ )
long nGutterWidth = pColMgr->GetGutterWidth();
if(nCols > 1)
{
- // Determine whether the most narrow column is too narrow
+ // Determine whether the most narrow column is too narrow
// for the adjusted column gap
long nMin = nColWidth[0];
sal_uInt16 i;
@@ -729,10 +729,10 @@ IMPL_LINK( SwColumnPage, UpdateColMgr, void *, /*pField*/ )
sal_Bool bEnable = 0 != nPos;
aLineHeightEdit.Enable( bEnable );
aLineHeightLbl.Enable( bEnable );
- long nLineWidth = MetricField::ConvertDoubleValue(
+ long nLineWidth = static_cast<long>(MetricField::ConvertDoubleValue(
aLineWidthEdit.GetValue( ),
aLineWidthEdit.GetDecimalDigits( ),
- aLineWidthEdit.GetUnit(), MAP_TWIP );
+ aLineWidthEdit.GetUnit(), MAP_TWIP ));
if( !bEnable )
pColMgr->SetNoLine();
else if( LISTBOX_ENTRY_NOTFOUND != nPos )
@@ -981,7 +981,7 @@ IMPL_LINK( SwColumnPage, ColModify, NumericField *, pNF )
the column gap.
These changes take effect time-displaced. With an
alteration of the column width the automatic calculation
- of the column width is overruled; only an alteration
+ of the column width is overruled; only an alteration
of the column number leads back to that default.
------------------------------------------------------------------------*/
IMPL_LINK( SwColumnPage, GapModify, PercentField *, pFld )
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index e6deb8cbef..12f6af741c 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -112,6 +112,8 @@ public:
String GetCharacterStyle() const;
};
+String SwCaptionDialog::our_aSepTextSave = String::CreateFromAscii(": "); // Caption separator text
+
SwCaptionDialog::SwCaptionDialog( Window *pParent, SwView &rV ) :
SvxStandardDialog( pParent, SW_RES(DLG_CAPTION) ),
@@ -282,6 +284,7 @@ SwCaptionDialog::SwCaptionDialog( Window *pParent, SwView &rV ) :
FreeResource();
CheckButtonWidth();
+ aSepEdit.SetText(our_aSepTextSave);
aTextEdit.GrabFocus();
DrawSample();
}
@@ -308,6 +311,7 @@ void SwCaptionDialog::Apply()
aOpt.CopyAttributes() = bCopyAttributes;
aOpt.SetCharacterStyle( sCharacterStyle );
rView.InsertCaption( &aOpt );
+ our_aSepTextSave = aSepEdit.GetText();
}
IMPL_LINK_INLINE_START( SwCaptionDialog, OptionHdl, Button*, pButton )
diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx
index 80a89d8645..4673f21666 100644
--- a/sw/source/ui/frmdlg/frmmgr.cxx
+++ b/sw/source/ui/frmdlg/frmmgr.cxx
@@ -292,7 +292,6 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
// --> OD 2009-09-01 #mongolianlayout#
if ( bIsInVertical || bIsInVerticalL2R )
- // <--
{
Point aPos(aBoundRect.Pos());
long nTmp = aPos.X();
@@ -491,7 +490,6 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal,
}
// --> OD 2009-09-01 #mongolianlayout#
if ( bIsInVertical || bIsInVerticalL2R )
- // <--
{
//restore width/height exchange
long nTmp = rVal.nWidth;
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 5cccb59816..496c5c3522 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -456,23 +456,23 @@ void lcl_InsertVectors(ListBox& rBox,
{
::std::vector< String >::const_iterator aIt;
sal_uInt16 nEntry = 0;
- for(aIt = rPrev.begin(); aIt != rPrev.end(); aIt++)
+ for(aIt = rPrev.begin(); aIt != rPrev.end(); ++aIt)
nEntry = rBox.InsertEntry(*aIt);
- for(aIt = rThis.begin(); aIt != rThis.end(); aIt++)
+ for(aIt = rThis.begin(); aIt != rThis.end(); ++aIt)
nEntry = rBox.InsertEntry(*aIt);
- for(aIt = rNext.begin(); aIt != rNext.end(); aIt++)
+ for(aIt = rNext.begin(); aIt != rNext.end(); ++aIt)
nEntry = rBox.InsertEntry(*aIt);
rBox.SetSeparatorPos(nEntry);
//now insert all strings sorted
sal_uInt16 nStartPos = rBox.GetEntryCount();
- for(aIt = rPrev.begin(); aIt != rPrev.end(); aIt++)
+ for(aIt = rPrev.begin(); aIt != rPrev.end(); ++aIt)
::InsertStringSorted(*aIt, rBox, nStartPos );
- for(aIt = rThis.begin(); aIt != rThis.end(); aIt++)
+ for(aIt = rThis.begin(); aIt != rThis.end(); ++aIt)
::InsertStringSorted(*aIt, rBox, nStartPos );
- for(aIt = rNext.begin(); aIt != rNext.end(); aIt++)
+ for(aIt = rNext.begin(); aIt != rNext.end(); ++aIt)
::InsertStringSorted(*aIt, rBox, nStartPos );
- for(aIt = rRemain.begin(); aIt != rRemain.end(); aIt++)
+ for(aIt = rRemain.begin(); aIt != rRemain.end(); ++aIt)
::InsertStringSorted(*aIt, rBox, nStartPos );
}
@@ -500,7 +500,6 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString
eStringId = SwFPos::FROMLEFT;
return eStringId;
}
- // <--
if ( bVertical )
{
//exchange horizontal strings with vertical strings and vice versa
@@ -538,7 +537,6 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString
{SwFPos::REL_FRM_TOP, SwFPos::REL_FRM_LEFT },
{SwFPos::REL_FRM_BOTTOM, SwFPos::REL_FRM_RIGHT }
};
- // <--
sal_uInt16 nIndex;
for(nIndex = 0; nIndex < sizeof(aHoriIds) / sizeof(StringIdPair_Impl); ++nIndex)
{
@@ -568,7 +566,6 @@ SvxSwFramePosString::StringId lcl_ChangeResIdToVerticalOrRTL(SvxSwFramePosString
break;
}
}
- // <--
}
}
return eStringId;
@@ -675,7 +672,6 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
bNoModifyHdl(sal_True),
// --> OD 2009-08-31 #mongolianlayout# - no used
// bVerticalChanged(sal_False),
- // <--
bIsVerticalFrame(sal_False),
bIsVerticalL2R(sal_False),
bIsInRightToLeft(sal_False),
@@ -828,7 +824,6 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
// --> OD 2009-08-31 #mongolianlayout#
// if ( !bVerticalChanged && pSh->IsFrmVertical(sal_True, bIsInRightToLeft) )
if ( pSh->IsFrmVertical( sal_True, bIsInRightToLeft, bIsVerticalL2R ) )
- // <--
{
String sHLabel = aHorizontalFT.GetText();
aHorizontalFT.SetText(aVerticalFT.GetText());
@@ -1311,7 +1306,7 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap,
? 0L
: ::lcl_GetLBRelationsForRelations( _nRel );
- // fill Listbox
+ // fill Listbox
size_t nCount = ::lcl_GetFrmMapCount(_pMap);
for (size_t i = 0; _pMap && i < nCount; ++i)
{
@@ -1323,7 +1318,6 @@ sal_uInt16 SwFrmPage::FillPosLB(const FrmMap* _pMap,
bIsVerticalFrame,
bIsVerticalL2R,
bIsInRightToLeft);
- // <--
String sEntry(aFramePosString.GetString(eStrId));
if (_rLB.GetEntryPos(sEntry) == LISTBOX_ENTRY_NOTFOUND)
{
@@ -1390,7 +1384,6 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
bIsVerticalFrame,
bIsVerticalL2R,
bIsInRightToLeft);
- // <--
String sEntry = aFramePosString.GetString(sStrId1);
sal_uInt16 nPos = _rLB.InsertEntry(sEntry);
_rLB.SetEntryData(nPos, &aAsCharRelationMap[nRelPos]);
@@ -1456,7 +1449,6 @@ sal_uLong SwFrmPage::FillRelLB( const FrmMap* _pMap,
bIsVerticalFrame,
bIsVerticalL2R,
bIsInRightToLeft);
- // <--
String sEntry = aFramePosString.GetString(eStrId1);
sal_uInt16 nPos = _rLB.InsertEntry(sEntry);
_rLB.SetEntryData(nPos, &aRelationMap[nRelPos]);
@@ -2145,7 +2137,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
if (!bReset)
{
// values was changed by circulation-Tabpage and
- // has to be set with Modify-Flag
+ // has to be set with Modify-Flag
aHeightED.SetUserValue(nHeight, FUNIT_TWIP);
}
else
@@ -2179,7 +2171,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
else
aAutoHeightCB.Hide();
- // organise circulation-gap for character bound frames
+ // organise circulation-gap for character bound frames
const SvxULSpaceItem &rUL = (const SvxULSpaceItem &)rSet.Get(RES_UL_SPACE);
nUpperBorder = rUL.GetUpper();
nLowerBorder = rUL.GetLower();
@@ -2231,7 +2223,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
rVert.GetPos());
}
- // transparent for example
+ // transparent for example
// circulation for example
const SwFmtSurround& rSurround = (const SwFmtSurround&)rSet.Get(RES_SURROUND);
aExampleWN.SetWrap ( static_cast< sal_uInt16 >(rSurround.GetSurround()) );
diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx
index 3f254104c2..abe0ad7db5 100644
--- a/sw/source/ui/frmdlg/wrap.cxx
+++ b/sw/source/ui/frmdlg/wrap.cxx
@@ -73,7 +73,7 @@ SwWrapDlg::SwWrapDlg(Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Boo
pWrtShell(pSh)
{
- // create TabPage
+ // create TabPage
SwWrapTabPage* pNewPage = (SwWrapTabPage*) SwWrapTabPage::Create(this, rSet);
pNewPage->SetFormatUsed(sal_False, bDrawMode);
pNewPage->SetShell(pWrtShell);
@@ -286,7 +286,7 @@ void SwWrapTabPage::Reset(const SfxItemSet &rSet)
WrapTypeHdl(pBtn);
// For character objects that currently are in passage, the default
// "contour on" is prepared here, in case we switch to any other
- // passage later.
+ // passage later.
if (bDrawMode && !aWrapOutlineCB.IsEnabled())
aWrapOutlineCB.Check();
}
diff --git a/sw/source/ui/inc/actctrl.hxx b/sw/source/ui/inc/actctrl.hxx
index a778a2f366..259c8871aa 100644
--- a/sw/source/ui/inc/actctrl.hxx
+++ b/sw/source/ui/inc/actctrl.hxx
@@ -32,7 +32,7 @@
#include "swdllapi.h"
/*--------------------------------------------------------------------
- Beschreibung: numerische Eingabe
+ Description: numerical input
--------------------------------------------------------------------*/
class SW_DLLPUBLIC NumEditAction: public NumericField
{
@@ -51,7 +51,7 @@ public:
/* --------------------------------------------------
- * Edit, dass keine Spaces akzeptiert
+ * Edit that doesn't accept spaces
* --------------------------------------------------*/
class SW_DLLPUBLIC NoSpaceEdit : public Edit
{
@@ -68,7 +68,7 @@ public:
};
/* --------------------------------------------------
- * Kein Space und kein Punkt
+ * No space and no full stop
* --------------------------------------------------*/
class TableNameEdit : public NoSpaceEdit
{
diff --git a/sw/source/ui/inc/app.hrc b/sw/source/ui/inc/app.hrc
index 9d017f5ed6..b13583113c 100644
--- a/sw/source/ui/inc/app.hrc
+++ b/sw/source/ui/inc/app.hrc
@@ -33,7 +33,7 @@
// Document-Icon
#define RC_DOC_ICON (RC_APP_BEGIN + 2)
-//Soll das Clipboard fuer andere Applikationen...
+// Should the clipboard for other applications...
#define MSG_CLPBRD_CLEAR (RC_APP_BEGIN + 3)
#define STR_CANTCREATE (RC_APP_BEGIN + 4)
@@ -43,7 +43,7 @@
#define MSG_ERROR_SEND_MAIL ( RC_APP_BEGIN + 6)
#define MSG_SAVE_HTML_QUERY ( RC_APP_BEGIN + 7)
-//Fuer das Interface, weil der RID_APP_BEGIN jetzt Desktop ist.
+// For the interface because the RID_APP_BEGIN is now Desktop.
#define RID_SW_NAME ( RC_APP_BEGIN + 8)
#define MSG_SAVEAS_HTML_QUERY ( RC_APP_BEGIN + 9)
@@ -53,10 +53,10 @@
#define STR_PRINT_MERGE_MACRO (RC_APP_BEGIN + 15)
#define STR_PAGE_COUNT_MACRO (RC_APP_BEGIN + 16)
-// Bitmap fuer die NumerierungsVorlagen im Organizer
+// Bitmap for the numbering style in organizer
#define BMP_STYLES_FAMILY_NUM (RC_APP_BEGIN + 17)
-// Strings fuer Bereiche in der Konfiguration
+// Strings for regions in the configuration
#define STR_GRP_FILE (RC_APP_BEGIN + 56)
#define STR_GRP_EDIT (RC_APP_BEGIN + 57)
#define STR_GRP_TRAVELLING (RC_APP_BEGIN + 58)
@@ -102,7 +102,7 @@
#define STR_FDLG_TEMPLATE_NAME (RC_APP_BEGIN + 2)
-// Ids fuer die einzelnen PopUpMenues
+// Ids for all the PopUpMenues
#define MN_FORMAT_STYLE (RC_APP_BEGIN + 17)
#define MN_FORMAT_ALGN (RC_APP_BEGIN + 18)
#define MN_FORMAT_LINESPACE (RC_APP_BEGIN + 19)
@@ -120,7 +120,6 @@
#define STR_DONT_ASK_AGAIN (RC_APP_BEGIN + 103)
// --> OD 2008-04-14 #outlinelevel#
#define STR_OUTLINE_NUMBERING (RC_APP_BEGIN + 104)
-// <--
//#outline level,zhaojianwei
#define STR_FDLG_OUTLINE_LEVEL (RC_APP_BEGIN + 105)
#define STR_FDLG_STYLE (RC_APP_BEGIN + 106)
diff --git a/sw/source/ui/inc/autoedit.hxx b/sw/source/ui/inc/autoedit.hxx
index c3221a76ee..5f349333c5 100644
--- a/sw/source/ui/inc/autoedit.hxx
+++ b/sw/source/ui/inc/autoedit.hxx
@@ -40,7 +40,7 @@ protected:
virtual void KeyInput( const KeyEvent& rEvent );
};
-// Implementieriung im autocorr.cxx
+// Implementation in autocorr.cxx
diff --git a/sw/source/ui/inc/basesh.hxx b/sw/source/ui/inc/basesh.hxx
index 76d32e6af6..dae181def9 100644
--- a/sw/source/ui/inc/basesh.hxx
+++ b/sw/source/ui/inc/basesh.hxx
@@ -31,7 +31,6 @@
#include <shellid.hxx>
-#define _SVSTDARR_USHORTSSORT
#define _SVSTDARR_USHORTS
#include <tools/link.hxx>
#include <vcl/timer.hxx>
@@ -40,6 +39,7 @@
#include <svl/svstdarr.hxx>
#include <mdiexp.hxx>
+#include <set>
class SwWrtShell;
class SwCrsrShell;
@@ -52,15 +52,15 @@ class SwBaseShell: public SfxShell
{
SwView &rView;
- // DragModus
+ // DragMode
static FlyMode eFrameMode;
// Bug 75078 - if in GetState the asynch call of GetGraphic returns
// synch, the set the state directly into the itemset
SfxItemSet* pGetStateSet;
- //Update-Timer fuer Graphic
- SvUShortsSort aGrfUpdateSlots;
+ // Update-Timer for graphic
+ std::set<sal_uInt16> aGrfUpdateSlots;
DECL_LINK( GraphicArrivedHdl, SwCrsrShell* );
@@ -70,7 +70,7 @@ protected:
inline SwView& GetView() { return rView; }
inline void SetGetStateSet( SfxItemSet* p ) { pGetStateSet = p; }
- inline sal_Bool AddGrfUpdateSlot( sal_uInt16 nSlot ){ return aGrfUpdateSlots.Insert( nSlot ); }
+ inline sal_Bool AddGrfUpdateSlot( sal_uInt16 nSlot ){ return aGrfUpdateSlots.insert( nSlot ).second; }
DECL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, DBTextStruct_Impl* );
@@ -118,7 +118,7 @@ public:
void ExecField(SfxRequest& rReq);
- static void SetFrmMode( FlyMode eMode, SwWrtShell *pShell ); //Mit Update!
+ static void SetFrmMode( FlyMode eMode, SwWrtShell *pShell ); // with update!
static void _SetFrmMode( FlyMode eMode ) { eFrameMode = eMode; }
static FlyMode GetFrmMode() { return eFrameMode; }
diff --git a/sw/source/ui/inc/bmpwin.hxx b/sw/source/ui/inc/bmpwin.hxx
index baefb78de3..2a146194d2 100644
--- a/sw/source/ui/inc/bmpwin.hxx
+++ b/sw/source/ui/inc/bmpwin.hxx
@@ -34,7 +34,7 @@
#include <vcl/window.hxx>
/*--------------------------------------------------------------------
- Beschreibung: Extended Page fuer Grafiken
+ Description: extended page for graphics
--------------------------------------------------------------------*/
class BmpWindow : public Window
{
diff --git a/sw/source/ui/inc/caption.hxx b/sw/source/ui/inc/caption.hxx
index 16e0a2c772..2c72e6d15e 100644
--- a/sw/source/ui/inc/caption.hxx
+++ b/sw/source/ui/inc/caption.hxx
@@ -49,7 +49,7 @@ private:
String sSeparator;
String sCharacterStyle;
- sal_Bool bIgnoreSeqOpts; // wird nicht gespeichert
+ sal_Bool bIgnoreSeqOpts; // is not being saved
sal_Bool bCopyAttributes; // -""-
public:
diff --git a/sw/source/ui/inc/cfgitems.hxx b/sw/source/ui/inc/cfgitems.hxx
index 25aa2962da..999415b281 100644
--- a/sw/source/ui/inc/cfgitems.hxx
+++ b/sw/source/ui/inc/cfgitems.hxx
@@ -52,7 +52,7 @@ SfxPrinter* GetPrt( ViewShell* );
void SetPrt( SfxPrinter* );
/*--------OS 12.01.95 -----------------------------------
-Item fuer Einstellungsdialog - Dokumentanzeige
+Item for settings dialog - document view
--------------------------------------------------------- */
class SW_DLLPUBLIC SwDocDisplayItem : public SfxPoolItem
{
@@ -89,7 +89,7 @@ public:
};
/*--------OS 12.01.95 -----------------------------------
-Item fuer Einstellungsdialog, Elementeseite
+Item for settings dialog, element page
--------------------------------------------------------- */
class SW_DLLPUBLIC SwElemItem : public SfxPoolItem
{
@@ -130,7 +130,7 @@ public:
};
/*--------OS 12.01.95 -----------------------------------
-Item fuer Einstellungsdialog - Drucker/Zusaetze
+Item for settings dialog - printer/add ons
--------------------------------------------------------- */
class SW_DLLPUBLIC SwAddPrinterItem : public SfxPoolItem, public SwPrintData
{
@@ -177,7 +177,7 @@ public:
};
/*--------OS 12.01.95 -----------------------------------
-Item fuer Einstellungsdialog, ShadowCursorSeite
+Item for settings dialog, ShadowCursorPage
--------------------------------------------------------- */
class SW_DLLPUBLIC SwShadowCursorItem : public SfxPoolItem
{
@@ -206,7 +206,7 @@ public:
#if OSL_DEBUG_LEVEL > 1
/*--------OS 12.01.95 -----------------------------------
-Item fuer Einstellungsdialog - Testeinstellungen
+Item for settings dialog - test settings
--------------------------------------------------------- */
class SW_DLLPUBLIC SwTestItem : public SfxPoolItem
{
diff --git a/sw/source/ui/inc/changedb.hxx b/sw/source/ui/inc/changedb.hxx
index de7a678dbc..92dbdcb218 100644
--- a/sw/source/ui/inc/changedb.hxx
+++ b/sw/source/ui/inc/changedb.hxx
@@ -43,7 +43,7 @@ class SwWrtShell;
struct SwDBData;
/*--------------------------------------------------------------------
- Beschreibung: Datenbank an Feldern austauschen
+ Description: exchange database at fields
--------------------------------------------------------------------*/
class SwChangeDBDlg: public SvxStandardDialog
{
diff --git a/sw/source/ui/inc/chrdlg.hxx b/sw/source/ui/inc/chrdlg.hxx
index 55b853047b..d6cbe5fe93 100644
--- a/sw/source/ui/inc/chrdlg.hxx
+++ b/sw/source/ui/inc/chrdlg.hxx
@@ -44,10 +44,6 @@
class SwView;
class SvxMacroItem;
-/*--------------------------------------------------------------------
- Beschreibung: Der Tabdialog Traeger der TabPages
- --------------------------------------------------------------------*/
-
class SwCharDlg: public SfxTabDialog
{
SwView& rView;
@@ -62,10 +58,6 @@ public:
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
};
-/*-----------------14.08.96 11.03-------------------
- Beschreibung: Tabpage fuer URL-Attribut
---------------------------------------------------*/
-
class SwCharURLPage : public SfxTabPage
{
FixedLine aURLFL;
diff --git a/sw/source/ui/inc/colmgr.hxx b/sw/source/ui/inc/colmgr.hxx
index 3712aa109e..7ded3b51f5 100644
--- a/sw/source/ui/inc/colmgr.hxx
+++ b/sw/source/ui/inc/colmgr.hxx
@@ -36,8 +36,7 @@ SW_DLLPUBLIC void FitToActualSize(SwFmtCol& rCol, sal_uInt16 nWidth);
class SW_DLLPUBLIC SwColMgr
{
public:
- // lActWidth wird aus den Edits des Seitendialogs
- // direkt uebergeben
+ // lActWidth is passed directly from the page dialogs edits
SwColMgr(const SfxItemSet &rSet, sal_uInt16 nActWidth = USHRT_MAX);
~SwColMgr();
@@ -82,7 +81,7 @@ private:
sal_uInt16 nWidth;
};
-// INLINE METHODE --------------------------------------------------------
+// INLINE METHOD --------------------------------------------------------
inline sal_uInt16 SwColMgr::GetCount() const
{
return aFmtCol.GetNumCols();
diff --git a/sw/source/ui/inc/column.hxx b/sw/source/ui/inc/column.hxx
index 04ca404bb0..2c352dd3c6 100644
--- a/sw/source/ui/inc/column.hxx
+++ b/sw/source/ui/inc/column.hxx
@@ -99,7 +99,7 @@ class ColumnValueSet : public ValueSet
};
/*--------------------------------------------------------------------
- Beschreibung: Spaltendialog jetzt als TabPage
+ Description: column dialog now as TabPage
--------------------------------------------------------------------*/
class SwColumnPage : public SfxTabPage
{
diff --git a/sw/source/ui/inc/conarc.hxx b/sw/source/ui/inc/conarc.hxx
index 56204a2a41..3e2779e8ba 100644
--- a/sw/source/ui/inc/conarc.hxx
+++ b/sw/source/ui/inc/conarc.hxx
@@ -32,7 +32,7 @@
/*************************************************************************
|*
-|* Rechteck zeichnen
+|* draw rectangle
|*
\************************************************************************/
@@ -48,7 +48,7 @@ public:
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Funktion aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
virtual void Deactivate();
};
diff --git a/sw/source/ui/inc/concustomshape.hxx b/sw/source/ui/inc/concustomshape.hxx
index e2dd43bb46..254f670a01 100644
--- a/sw/source/ui/inc/concustomshape.hxx
+++ b/sw/source/ui/inc/concustomshape.hxx
@@ -37,7 +37,7 @@ class SfxRequest;
/*************************************************************************
|*
-|* Rechteck zeichnen
+|* draw rectangle
|*
\************************************************************************/
@@ -56,7 +56,7 @@ class ConstCustomShape : public SwDrawBase
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
rtl::OUString GetShapeType() const;
static rtl::OUString GetShapeTypeFromRequest( SfxRequest& rReq );
diff --git a/sw/source/ui/inc/conform.hxx b/sw/source/ui/inc/conform.hxx
index 28914d60eb..e7750d85ce 100644
--- a/sw/source/ui/inc/conform.hxx
+++ b/sw/source/ui/inc/conform.hxx
@@ -38,7 +38,7 @@ public:
// Mouse- & Key-Events
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
virtual void CreateDefaultObject();
};
diff --git a/sw/source/ui/inc/conpoly.hxx b/sw/source/ui/inc/conpoly.hxx
index bcfb77e31f..a765d4f9e1 100644
--- a/sw/source/ui/inc/conpoly.hxx
+++ b/sw/source/ui/inc/conpoly.hxx
@@ -32,7 +32,7 @@
/*************************************************************************
|*
-|* Basisklasse fuer alle Funktionen
+|* base class for all functions
|*
\************************************************************************/
@@ -48,7 +48,7 @@ public:
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
};
diff --git a/sw/source/ui/inc/conrect.hxx b/sw/source/ui/inc/conrect.hxx
index a5ef397315..5152bd26ee 100644
--- a/sw/source/ui/inc/conrect.hxx
+++ b/sw/source/ui/inc/conrect.hxx
@@ -33,7 +33,7 @@
/*************************************************************************
|*
-|* Rechteck zeichnen
+|* draw rectangle
|*
\************************************************************************/
@@ -52,7 +52,7 @@ class ConstRectangle : public SwDrawBase
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonDown(const MouseEvent& rMEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
};
diff --git a/sw/source/ui/inc/content.hxx b/sw/source/ui/inc/content.hxx
index 5c75666565..60f91505fe 100644
--- a/sw/source/ui/inc/content.hxx
+++ b/sw/source/ui/inc/content.hxx
@@ -41,7 +41,7 @@ class SwTOXBase;
class SwRedline;
//----------------------------------------------------------------------------
-// Hilfsklassen
+// helper classes
//----------------------------------------------------------------------------
class SwPopup : public PopupMenu
@@ -169,29 +169,28 @@ public:
const SwTOXBase* GetTOXBase() const {return pBase;}
};
/*
- class ContentType enthaelt Informationen zu einer Inhaltsform
- Das MemberArray wird nur gefuellt, wenn der Inhalt mit GetMember
- angefordert wird. Es wird nach Invalidate() nur dann neu geladen,
- wenn der Inhalt erneut ausgelesen werden soll.
+ class ContentType contains information to one type of content.
+ MemberArray is only populated if the content is requested by
+ GetMember. It is reloaded after Invalidate() only if the content
+ should be read again.
*/
//----------------------------------------------------------------------------
-//----------------------------------------------------------------------------
class SwContentType : public SwTypeNumber
{
SwWrtShell* pWrtShell;
- SwContentArr* pMember; // Array fuer Inhalte
- String sContentTypeName; // Name der Inhaltsform
- String sSingleContentTypeName; // Name der Inhaltsform, Singular
- String sTypeToken; // Anhaengsel fuer URL
- sal_uInt16 nMemberCount; // Inhaltsanzahl
- sal_uInt16 nContentType; // Id der Inhaltsform
+ SwContentArr* pMember; // array for content
+ String sContentTypeName; // name of content type
+ String sSingleContentTypeName; // name of content type, singular
+ String sTypeToken; // attachment for URL
+ sal_uInt16 nMemberCount; // content count
+ sal_uInt16 nContentType; // content type's Id
sal_uInt8 nOutlineLevel;
- sal_Bool bMemberFilled : 1; // wurden die Inhalte bereits eingefuegt?
- sal_Bool bIsInternalDrag:1; // koennen die Inhalte verschoben werden?
+ sal_Bool bMemberFilled : 1; // has content already been inserted?
+ sal_Bool bIsInternalDrag:1; // can content be relocated?
sal_Bool bDataValid : 1; //
- sal_Bool bEdit: 1; // kann diese Type bearbeitet werden ?
- sal_Bool bDelete: 1; // kann diese Type geloescht werden ?
+ sal_Bool bEdit: 1; // can this type be edited?
+ sal_Bool bDelete: 1; // can this type be deleted?
protected:
void RemoveNewline(String&);
public:
@@ -214,7 +213,7 @@ public:
Invalidate();
}
- void Invalidate(); // nur nMemberCount wird neu gelesen
+ void Invalidate(); // only nMemberCount is read again
sal_Bool IsEditable() const {return bEdit;}
sal_Bool IsDeletable() const {return bDelete;}
diff --git a/sw/source/ui/inc/conttree.hxx b/sw/source/ui/inc/conttree.hxx
index f6e8468d4a..899f7d6af1 100644
--- a/sw/source/ui/inc/conttree.hxx
+++ b/sw/source/ui/inc/conttree.hxx
@@ -73,8 +73,8 @@ class SwContentTree : public SvTreeListBox
String sPostItHide;
String sPostItDelete;
- SwWrtShell* pHiddenShell; // gedropptes Doc
- SwWrtShell* pActiveShell; // die aktive oder eine konst. offene View
+ SwWrtShell* pHiddenShell; // dropped Doc
+ SwWrtShell* pActiveShell; // the active or a const. open view
SwNavigationConfig* pConfig;
std::map< void*, sal_Bool > mOutLineNodeMap;
@@ -207,7 +207,7 @@ public:
//----------------------------------------------------------------------------
-// TreeListBox fuer Globaldokumente
+// TreeListBox for global documents
//----------------------------------------------------------------------------
class SwLBoxString : public SvLBoxString
@@ -235,9 +235,9 @@ private:
ImageList aEntryImages;
SwWrtShell* pActiveShell; //
- SvLBoxEntry* pEmphasisEntry; // Drag'n Drop-Emphasis
- SvLBoxEntry* pDDSource; // Quelle beim DnD
- SwGlblDocContents* pSwGlblDocContents; // Array mit sortierten Inhalten
+ SvLBoxEntry* pEmphasisEntry; // Drag'n Drop emphasis
+ SvLBoxEntry* pDDSource; // source for Drag'n Drop
+ SwGlblDocContents* pSwGlblDocContents; // array with sorted content
Window* pDefParentWin;
SwGlblDocContent* pDocContent;
diff --git a/sw/source/ui/inc/cption.hxx b/sw/source/ui/inc/cption.hxx
index b6fe3e7ef9..144f05ceb4 100644
--- a/sw/source/ui/inc/cption.hxx
+++ b/sw/source/ui/inc/cption.hxx
@@ -95,8 +95,8 @@ class SwCaptionDialog : public SvxStandardDialog
SwCaptionPreview aPrevWin;
- SwView &rView; //Suchen per aktive ::com::sun::star::sdbcx::View vermeiden.
- SwFldMgr *pMgr; //Ptr um das include zu sparen
+ SwView &rView; // search per active, avoid ::com::sun::star::sdbcx::View
+ SwFldMgr *pMgr; // pointer to save the include
SelectionType eType;
String sCharacterStyle;
@@ -118,6 +118,7 @@ class SwCaptionDialog : public SvxStandardDialog
void CheckButtonWidth();
void ApplyCaptionOrder(); //#i61007# order of captions
+ static String our_aSepTextSave; // Save caption separator text
public:
SwCaptionDialog( Window *pParent, SwView &rV );
~SwCaptionDialog();
diff --git a/sw/source/ui/inc/dbinsdlg.hxx b/sw/source/ui/inc/dbinsdlg.hxx
index e299bff0ab..89a59482f8 100644
--- a/sw/source/ui/inc/dbinsdlg.hxx
+++ b/sw/source/ui/inc/dbinsdlg.hxx
@@ -160,7 +160,7 @@ class SwInsertDBColAutoPilot : public SfxModalDialog, public utl::ConfigItem
virtual void Commit();
void Load();
- // setze die Tabellen - Eigenschaften
+ // set the tables - properties
void SetTabSet();
public:
diff --git a/sw/source/ui/inc/docstdlg.hxx b/sw/source/ui/inc/docstdlg.hxx
index ee4fc41c9e..233f7d25a3 100644
--- a/sw/source/ui/inc/docstdlg.hxx
+++ b/sw/source/ui/inc/docstdlg.hxx
@@ -36,7 +36,7 @@
#include "docstat.hxx"
/*--------------------------------------------------------------------
- Beschreibung: DocInfo jetzt als Page
+ Description: DocInfo now as page
--------------------------------------------------------------------*/
class SwDocStatPage: public SfxTabPage
{
diff --git a/sw/source/ui/inc/drawbase.hxx b/sw/source/ui/inc/drawbase.hxx
index 47f7a2d11d..24430ca36a 100644
--- a/sw/source/ui/inc/drawbase.hxx
+++ b/sw/source/ui/inc/drawbase.hxx
@@ -40,7 +40,7 @@ class MouseEvent;
/*************************************************************************
|*
-|* Basisklasse fuer alle Funktionen
+|* base class for all functions
|*
\************************************************************************/
@@ -50,8 +50,8 @@ protected:
SwView* m_pView;
SwWrtShell* m_pSh;
SwEditWin* m_pWin;
- Point m_aStartPos; // Position von BeginCreate
- Point m_aMDPos; // Position von MouseButtonDown
+ Point m_aStartPos; // position of BeginCreate
+ Point m_aMDPos; // position of MouseButtonDown
sal_uInt16 m_nSlotId;
sal_Bool m_bCreateObj :1;
sal_Bool m_bInsForm :1;
@@ -66,7 +66,7 @@ public:
inline sal_Bool IsInsertForm() const { return m_bInsForm; }
inline sal_Bool IsCreateObj() const { return m_bCreateObj; }
- // Mouse- & Key-Events; Returnwert=sal_True: Event wurde bearbeitet
+ // mouse- & key events; return value=sal_True: event was edited
virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
virtual sal_Bool MouseMove(const MouseEvent& rMEvt);
virtual sal_Bool MouseButtonUp(const MouseEvent& rMEvt);
@@ -76,8 +76,8 @@ public:
void SetSlotId(sal_uInt16 nSlot) {m_nSlotId = nSlot;}
sal_uInt16 GetSlotId() { return m_nSlotId;}
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
- virtual void Deactivate(); // Function deaktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate fuction
+ virtual void Deactivate(); // deactivate function
virtual void CreateDefaultObject();
diff --git a/sw/source/ui/inc/dselect.hxx b/sw/source/ui/inc/dselect.hxx
index 165ae46f92..fa6e036797 100644
--- a/sw/source/ui/inc/dselect.hxx
+++ b/sw/source/ui/inc/dselect.hxx
@@ -32,7 +32,7 @@
/*************************************************************************
|*
-|* Rechteck zeichnen
+|* draw rectangle
|*
\************************************************************************/
@@ -41,10 +41,10 @@ class DrawSelection : public SwDrawBase
public:
DrawSelection(SwWrtShell* pSh, SwEditWin* pWin, SwView* pView);
- // Mouse- & Key-Events
+ // mouse- & key events
virtual sal_Bool KeyInput(const KeyEvent& rKEvt);
- virtual void Activate(const sal_uInt16 nSlotId); // Function aktivieren
+ virtual void Activate(const sal_uInt16 nSlotId); // activate function
};
diff --git a/sw/source/ui/inc/edtwin.hxx b/sw/source/ui/inc/edtwin.hxx
index 87031f5bd3..a7ca84f7b0 100644
--- a/sw/source/ui/inc/edtwin.hxx
+++ b/sw/source/ui/inc/edtwin.hxx
@@ -54,7 +54,7 @@ struct QuickHelpData;
class SdrDropMarkerOverlay;
/*--------------------------------------------------------------------
- Beschreibung: Eingabe-Fenster
+ Description: input window
--------------------------------------------------------------------*/
class SwEditWin: public Window,
@@ -76,18 +76,18 @@ friend void PageNumNotify( ViewShell* pVwSh,
static sal_Bool bReplaceQuote;
static long nDDStartPosX, nDDStartPosY;
- static Color aTextColor; //Textfarbe, fuer die Giesskanne
- static sal_Bool bTransparentBackColor; // Hintergrund transparent
- static Color aTextBackColor; //Texthintergrundfarbe, fuer die Giesskanne
+ static Color aTextColor; // text color; for the watering can
+ static sal_Bool bTransparentBackColor; // transparent background
+ static Color aTextBackColor; // text background; for the watering can
/*
- * Timer und Handler fuer das Weiterscrollen, wenn der
- * Mauspointer innerhalb eines Drag-Vorgangs ausserhalb des
- * EditWin stehen bleibt. In regelmaessigen Intervallen wird
- * die Selektion in Richtung der Mausposition vergroessert.
+ * timer and handler for scrolling on when the mousepointer
+ * stopps outside of EditWin during a drag-operation.
+ * The selection is increased towards the mouse position
+ * regularly.
*/
AutoTimer aTimer;
- // Timer fuer verschachtelte KeyInputs (z.B. fuer Tabellen)
+ // timer for overlapping KeyInputs (e.g. for tables)
Timer aKeyInputTimer;
// timer for ANY-KeyInut question without a following KeyInputEvent
Timer aKeyInputFlushTimer;
@@ -99,11 +99,11 @@ friend void PageNumNotify( ViewShell* pVwSh,
Point aRszMvHdlPt;
Timer aTemplateTimer;
- // Type/Objecte ueber dem der MousePointer steht
+ // type/object where the mouse pointer is
SwCallMouseEvent aSaveCallEvent;
SwApplyTemplate *pApplyTempl;
- SwAnchorMarker *pAnchorMarker; // zum Verschieben eines Ankers
+ SwAnchorMarker *pAnchorMarker; // for relocating the anchor
SdrDropMarkerOverlay *pUserMarker;
SdrObject *pUserMarkerObj;
@@ -112,29 +112,29 @@ friend void PageNumNotify( ViewShell* pVwSh,
SwView &rView;
- int aActHitType; // aktueller Mauspointer
+ int aActHitType; // current mouse pointer
- sal_uLong m_nDropFormat; //Format aus dem letzten QueryDrop
- sal_uInt16 m_nDropAction; //Action aus dem letzten QueryDrop
- sal_uInt16 m_nDropDestination; //Ziel aus dem letzten QueryDrop
+ sal_uLong m_nDropFormat; // format from the last QueryDrop
+ sal_uInt16 m_nDropAction; // action from the last QueryDrop
+ sal_uInt16 m_nDropDestination; // destination from the last QueryDrop
sal_uInt16 eBezierMode;
- sal_uInt16 nInsFrmColCount; //Spaltenzahl fuer interaktiven Rahmen
+ sal_uInt16 nInsFrmColCount; // column number for interactive frame
SdrObjKind eDrawMode;
sal_Bool bLinkRemoved : 1,
bMBPressed : 1,
bInsDraw : 1,
bInsFrm : 1,
bIsInMove : 1,
- bIsInDrag : 1, //StartExecuteDrag nich doppelt ausfuehren
- bOldIdle : 1, //Zum abschalten des Idle'ns
- bOldIdleSet : 1, //waehrend QeueryDrop
+ bIsInDrag : 1, // don't execute StartExecuteDrag twice
+ bOldIdle : 1, // to stop to idle
+ bOldIdleSet : 1, // during QeueryDrop
bTblInsDelMode : 1, //
bTblIsInsMode : 1, //
bTblIsColMode : 1, //
- bChainMode : 1, //Rahmen verbinden
- bWasShdwCrsr : 1, //ShadowCrsr war im MouseButtonDown an
- bLockInput : 1, //Lock waehrend die Rechenleiste aktiv ist
+ bChainMode : 1, // connect frames
+ bWasShdwCrsr : 1, // ShadowCrsr was on in MouseButtonDown
+ bLockInput : 1, // lock while calc panel is active
bIsRowDrag : 1, //selection of rows is used, in combination with pRowColumnSelectionStart
/** #i42732# display status of font size/name depending on either the input language or the
selection position depending on what has changed lately
@@ -158,7 +158,7 @@ friend void PageNumNotify( ViewShell* pVwSh,
sal_Bool EnterDrawMode(const MouseEvent& rMEvt, const Point& aDocPos);
sal_Bool RulerColumnDrag( const MouseEvent& rMEvt, sal_Bool bVerticalMode);
- //Hilfsfunktionen fuer D&D
+ // helper function for D&D
void DropCleanup();
void CleanupDropUserMarker();
sal_uInt16 GetDropDestination( const Point& rPixPnt,
@@ -167,10 +167,10 @@ friend void PageNumNotify( ViewShell* pVwSh,
sal_Bool SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos );
/*
- * Handler fuer das Weiterscrollen, wenn der Mauspointer innerhalb eines
- * Drag-Vorgangs ausserhalb des EditWin stehen bleibt. In regelmaessigen
- * Intervallen wird die Selektion in Richtung der Mausposition
- * vergroessert.
+ * handler for scrolling on when the mousepointer
+ * stopps outside of EditWin during a drag-operation.
+ * The selection is regularly increased towards the mouse
+ * position.
*/
DECL_LINK( TimerHandler, Timer * );
void StartDDTimer();
@@ -180,10 +180,10 @@ friend void PageNumNotify( ViewShell* pVwSh,
// timer for ANY-KeyInut question without a following KeyInputEvent
DECL_LINK( KeyInputFlushHandler, Timer * );
- // Timer fuer verschachtelte KeyInputs (z.B. fuer Tabellen)
+ // timer for overlapping KeyInputs (e.g. for tables)
DECL_LINK( KeyInputTimerHandler, Timer * );
- // Timer fuer das ApplyTemplates per Maus (verkapptes Drag&Drop)
+ // timer for ApplyTemplates via mouse (in disguise Drag&Drop)
DECL_LINK( TemplateTimerHdl, Timer* );
using OutputDevice::GetTextColor;
@@ -234,10 +234,10 @@ public:
sal_Bool IsFrmAction() { return (bInsFrm); }
inline sal_uInt16 GetBezierMode() { return eBezierMode; }
void SetBezierMode(sal_uInt16 eBezMode) { eBezierMode = eBezMode; }
- void EnterDrawTextMode(const Point& aDocPos); // DrawTextEditMode einschalten
+ void EnterDrawTextMode(const Point& aDocPos); // turn on DrawTextEditMode
void InsFrm(sal_uInt16 nCols);
void StopInsFrm();
- sal_uInt16 GetFrmColCount() const {return nInsFrmColCount;} //Spaltenzahl fuer interaktiven Rahmen
+ sal_uInt16 GetFrmColCount() const {return nInsFrmColCount;} // column number for interactive frame
void SetChainMode( sal_Bool bOn );
@@ -277,7 +277,7 @@ public:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
- // Tipfenster loeschen
+ // delete tip window
static void ClearTip();
static inline long GetDDStartPosX() { return nDDStartPosX; }
@@ -289,10 +289,9 @@ public:
//#i3370# remove quick help to prevent saving of autocorrection suggestions
void StopQuickHelp();
- // --> OD 2005-02-18 #i42921# - add parameter <bVerticalMode>
+ // #i42921# - add parameter <bVerticalMode>
sal_Bool RulerMarginDrag( const MouseEvent& rMEvt,
const bool bVerticalMode );
- // <--
/** #i42732# display status of font size/name depending on either the input
language or the selection position depending on what has changed lately
diff --git a/sw/source/ui/inc/envimg.hxx b/sw/source/ui/inc/envimg.hxx
index 4b0ddc85a7..6eae7d9f20 100644
--- a/sw/source/ui/inc/envimg.hxx
+++ b/sw/source/ui/inc/envimg.hxx
@@ -51,19 +51,19 @@ class SW_DLLPUBLIC SwEnvItem : public SfxPoolItem
{
public:
- rtl::OUString aAddrText; // Text fuer Empfaenger
- sal_Bool bSend; // Absender?
- rtl::OUString aSendText; // Text fuer Absender
- sal_Int32 lAddrFromLeft; // Linker Abstand fuer Empfaenger (twips)
- sal_Int32 lAddrFromTop; // Oberer Abstand fuer Empfaenger (twips)
- sal_Int32 lSendFromLeft; // Linker Abstand fuer Absender (twips)
- sal_Int32 lSendFromTop; // Oberer Abstand fuer Absender (twips)
- sal_Int32 lWidth; // Breite des Umschlags (twips)
- sal_Int32 lHeight; // Hoehe des Umschlags (twips)
- SwEnvAlign eAlign; // Ausrichtung beim Einzug
- sal_Bool bPrintFromAbove; // Von oben drucken?
- sal_Int32 lShiftRight; // Verschiebung nach rechts (twips)
- sal_Int32 lShiftDown; // Verschiebung nach unten (twips)
+ rtl::OUString aAddrText; // text for reciever
+ sal_Bool bSend; // sender?
+ rtl::OUString aSendText; // text for sender
+ sal_Int32 lAddrFromLeft; // left gap for reciever (twips)
+ sal_Int32 lAddrFromTop; // upper gap for reciever (twips)
+ sal_Int32 lSendFromLeft; // left gap for sender (twips)
+ sal_Int32 lSendFromTop; // upper gap for sender (twips)
+ sal_Int32 lWidth; // envelope's width (twips)
+ sal_Int32 lHeight; // envelope's height (twips)
+ SwEnvAlign eAlign; // alignment at indent
+ sal_Bool bPrintFromAbove; // print from above?
+ sal_Int32 lShiftRight; // shift to right (twips)
+ sal_Int32 lShiftDown; // shift down (twips)
SwEnvItem();
SwEnvItem(const SwEnvItem& rItem);
diff --git a/sw/source/ui/inc/fldmgr.hxx b/sw/source/ui/inc/fldmgr.hxx
index 6689bfd33c..52c8eff852 100644
--- a/sw/source/ui/inc/fldmgr.hxx
+++ b/sw/source/ui/inc/fldmgr.hxx
@@ -55,7 +55,7 @@ class SvNumberFormatter;
class Window;
/*--------------------------------------------------------------------
- Beschreibung: Die Gruppen von Feldern
+ Description: the groups of fields
--------------------------------------------------------------------*/
enum SwFldGroups
{
@@ -74,8 +74,8 @@ struct SwFldGroupRgn
};
/*--------------------------------------------------------------------
- Beschreibung: Der FeldManager handelt das Einfuegen von Felder
- ueber Command-Strings
+ Description: the field manager handles the insertation of fields
+ with command strings
--------------------------------------------------------------------*/
struct SwInsertFld_Data
{
@@ -117,7 +117,7 @@ private:
SwField* pCurFld;
SbModule* pModule;
const SvxMacroItem* pMacroItem;
- SwWrtShell* pWrtShell; // darf auch NULL sein!
+ SwWrtShell* pWrtShell; // can be ZERO too!
String aCurPar1;
String aCurPar2;
String sCurFrame;
@@ -141,10 +141,10 @@ public:
void SetWrtShell( SwWrtShell* pShell )
{ pWrtShell = pShell; }
- // Feld einfuegen ueber TypeId (TYP_ ...)
+ // insert field using TypeID (TYP_ ...)
sal_Bool InsertFld( const SwInsertFld_Data& rData );
- // Direkt das aktuelle Feld aendern
+ // change the current field directly
void UpdateCurFld(sal_uLong nFormat,
const String& rPar1,
const String& rPar2,
@@ -154,7 +154,7 @@ public:
inline const String& GetCurFldPar2() const;
inline sal_uLong GetCurFldFmt() const;
- // Ein Feld ermitteln
+ // determine a field
SwField* GetCurFld();
void InsertFldType(SwFieldType& rType);
@@ -165,54 +165,54 @@ public:
inline const String& GetMacroName() const { return (sMacroName); }
inline void SetMacroModule(SbModule* pMod) { pModule = pMod; }
- // Vorheriger Naechster gleichen Typ
+ // previous and next of the same type
sal_Bool GoNextPrev( sal_Bool bNext = sal_True, SwFieldType* pTyp = 0 );
sal_Bool GoNext( SwFieldType* pTyp = 0 ) { return GoNextPrev( sal_True, pTyp ); }
sal_Bool GoPrev( SwFieldType* pTyp = 0 ) { return GoNextPrev( sal_False, pTyp ); }
- // Erfragen von Werten aus Datenbankfeldern (BASIC )
+ // query values from database fields (BASIC )
// String GetDataBaseFieldValue(const String &rDBName, const String &rFieldName, SwWrtShell* pSh);
sal_Bool IsDBNumeric(const String& rDBName, const String& rTblQryName,
sal_Bool bIsTable, const String& rFldName);
- // RefMark mit Namen organisieren
+ // organise RefMark with names
sal_Bool CanInsertRefMark( const String& rStr );
- // Zugriff ueber ResId auf Feldtypen
+ // access to field types via ResId
sal_uInt16 GetFldTypeCount(sal_uInt16 nResId = USHRT_MAX) const;
SwFieldType* GetFldType(sal_uInt16 nResId, sal_uInt16 nId = 0) const;
SwFieldType* GetFldType(sal_uInt16 nResId, const String& rName) const;
void RemoveFldType(sal_uInt16 nResId, const String& rName);
- // Zugriff ueber TypeId aus dem Dialog
- // Ids fuer einen Bereich von Feldern
+ // access via TypeId from the dialog
+ // Ids for a range of fields
const SwFldGroupRgn& GetGroupRange(sal_Bool bHtmlMode, sal_uInt16 nGrpId) const;
sal_uInt16 GetGroup(sal_Bool bHtmlMode, sal_uInt16 nTypeId, sal_uInt16 nSubType = 0) const;
- // TypeId des aktuellen Feldes
+ // the current field's TypeId
sal_uInt16 GetCurTypeId() const;
- // TypeId fuer einen konkrete Pos in der Liste
+ // TypeId for a concrete position in the list
static sal_uInt16 GetTypeId(sal_uInt16 nPos);
- // Name des Typen in der Liste der Felder
+ // name of the type in the list of fields
static const String& GetTypeStr(sal_uInt16 nPos);
- // Pos in der Liste der Felder
+ // Pos in the list of fields
static sal_uInt16 GetPos(sal_uInt16 nTypeId);
- // Untertypen zu einem Typ
+ // subtypes to a type
sal_Bool GetSubTypes(sal_uInt16 nId, SvStringsDtor& rToFill);
- // Formate zu einem Typ
+ // format to a type
sal_uInt16 GetFormatCount(sal_uInt16 nTypeId, sal_Bool bIsText, sal_Bool bHtmlMode = sal_False) const;
String GetFormatStr(sal_uInt16 nTypeId, sal_uLong nFormatId) const;
sal_uInt16 GetFormatId(sal_uInt16 nTypeId, sal_uLong nFormatId) const;
sal_uLong GetDefaultFormat(sal_uInt16 nTypeId, sal_Bool bIsText, SvNumberFormatter* pFormatter, double* pVal = 0L);
- // Evaluierung der ExpressionFelder ausschalten fuer das Einfuegen
- // vieler Expressionfelder (siehe Etiketten)
+ // turn off evaluation of expression fields for insertation
+ // of many expressino fields (see labels)
//
inline void SetEvalExpFlds(sal_Bool bEval);
void EvalExpFlds(SwWrtShell* pSh = NULL);
diff --git a/sw/source/ui/inc/formedt.hxx b/sw/source/ui/inc/formedt.hxx
index 2d07f60d88..5372c963ff 100644
--- a/sw/source/ui/inc/formedt.hxx
+++ b/sw/source/ui/inc/formedt.hxx
@@ -44,7 +44,7 @@ class SwWrtShell;
class SwForm;
/*--------------------------------------------------------------------
- Beschreibung: Markierung fuer Verzeichniseintrag einfuegen
+ Description: insert marker for index entry
--------------------------------------------------------------------*/
class SwIdxFormDlg : public SvxStandardDialog
{
diff --git a/sw/source/ui/inc/frmdlg.hxx b/sw/source/ui/inc/frmdlg.hxx
index 75f3f477b9..792b629978 100644
--- a/sw/source/ui/inc/frmdlg.hxx
+++ b/sw/source/ui/inc/frmdlg.hxx
@@ -34,7 +34,7 @@
class SwWrtShell;
/*--------------------------------------------------------------------
- Beschreibung: Rahmendialog
+ Description: frame dialog
--------------------------------------------------------------------*/
class SwFrmDlg : public SfxTabDialog
{
diff --git a/sw/source/ui/inc/frmmgr.hxx b/sw/source/ui/inc/frmmgr.hxx
index 15a1f71a47..792ca8b17e 100644
--- a/sw/source/ui/inc/frmmgr.hxx
+++ b/sw/source/ui/inc/frmmgr.hxx
@@ -68,20 +68,19 @@ class SW_DLLPUBLIC SwFlyFrmAttrMgr
sal_Bool bIsInVertical;
// --> OD 2009-09-01 #mongolianlayout#
sal_Bool bIsInVerticalL2R;
- // <--
- // interne Verrechnung fuer Umrandung
+ // internal calculation for borders
SW_DLLPRIVATE SwTwips CalcTopSpace();
SW_DLLPRIVATE SwTwips CalcBottomSpace();
SW_DLLPRIVATE SwTwips CalcLeftSpace();
SW_DLLPRIVATE SwTwips CalcRightSpace();
- SW_DLLPRIVATE void _UpdateFlyFrm(); //Nacharbeit nach Einfuegen oder Update
+ SW_DLLPRIVATE void _UpdateFlyFrm(); // post-treatment after insert or update
public:
SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell* pSh, sal_uInt8 nType );
- //CopyCtor fuer die Dialoge, zum Pruefen der Metrics
+ //CopyCtor for dialogs to check the metrics
SwFlyFrmAttrMgr( sal_Bool bNew, SwWrtShell *pSh, const SfxItemSet &rSet );
inline SwWrtShell* GetShell() { return pOwnSh; }
@@ -92,14 +91,14 @@ public:
void SetHorzOrientation(sal_Int16 eOrient);
void SetVertOrientation(sal_Int16 eOrient);
- // Absolute Position
+ // absolute position
void SetAbsPos(const Point& rLPoint);
- // Relative Position vom Anker
+ // anchor's relative position
void SetPos(const Point& rLPoint);
inline Point GetPos() const;
- // Groesse
+ // size
void SetSize(const Size& rLSize);
inline const Size& GetSize() const;
@@ -107,7 +106,7 @@ public:
void SetHeightSizeType(SwFrmSize eType);
- // Abstand zum Inhalt
+ // space to content
void SetLRSpace( long nLeft = LONG_MAX,
long nRight = LONG_MAX );
void SetULSpace( long nTop = LONG_MAX,
@@ -115,25 +114,25 @@ public:
void SetCol( const SwFmtCol &rCol);
- // Attribute aendern und erfragen
+ // change and query attributes
void UpdateAttrMgr();
void UpdateFlyFrm();
- // neuen Rahmen erzeugen
+ // create new frame
sal_Bool InsertFlyFrm();
void InsertFlyFrm(RndStdIds eAnchorType,
const Point &rPos,
const Size &rSize,
sal_Bool bAbsPos = sal_False);
- // Metriken pruefen und aendern
+ // check and change metrics
void ValidateMetrics(SvxSwFrameValidation& rVal,
const SwPosition* pToCharCntntPos,
sal_Bool bOnlyPercentRefValue = sal_False);
void DelAttr(sal_uInt16 nId);
- // Set rausreichen
+ // reach out the set
inline const SfxItemSet &GetAttrSet() const { return aSet; }
inline SfxItemSet &GetAttrSet() { return aSet; }
void SetAttrSet(const SfxItemSet& rSet);
diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx
index 2cc63a3c60..97ddfcf868 100644
--- a/sw/source/ui/inc/frmpage.hxx
+++ b/sw/source/ui/inc/frmpage.hxx
@@ -48,11 +48,11 @@ struct FrmMap;
struct SwPosition;
/*--------------------------------------------------------------------
- Beschreibung: Rahmendialog
+ Description: frame dialog
--------------------------------------------------------------------*/
class SwFrmPage: public SfxTabPage
{
- // Size
+ // size
FixedLine aSizeFL;
FixedText aWidthFT;
FixedText aWidthAutoFT;
@@ -67,7 +67,7 @@ class SwFrmPage: public SfxTabPage
CheckBox aFixedRatioCB;
PushButton aRealSizeBT;
- // Anker
+ // anchor
FixedLine aTypeSepFL;
FixedLine aTypeFL;
RadioButton aAnchorAtPageRB;
@@ -76,7 +76,7 @@ class SwFrmPage: public SfxTabPage
RadioButton aAnchorAsCharRB;
RadioButton aAnchorAtFrameRB;
- // Position
+ // position
FixedLine aPositionFL;
FixedText aHorizontalFT;
ListBox aHorizontalDLB;
@@ -94,7 +94,7 @@ class SwFrmPage: public SfxTabPage
// OD 02.10.2003 #i18732# - check box for new option 'FollowTextFlow'
CheckBox aFollowTextFlowCB;
- // Example
+ // example
SvxSwFrameExample aExampleWN;
//'string provider'
@@ -110,7 +110,6 @@ class SwFrmPage: public SfxTabPage
sal_Bool bIsVerticalFrame; //current frame is in vertical environment - strings are exchanged
// --> OD 2009-08-31 #mongolianlayou#
sal_Bool bIsVerticalL2R;
- // <--
sal_Bool bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged
sal_Bool bHtmlMode;
sal_uInt16 nHtmlMode;
@@ -125,7 +124,7 @@ class SwFrmPage: public SfxTabPage
// to character anchored objects.
const SwPosition* mpToCharCntntPos;
- // Die alten Ausrichtungen
+ // old alignment
short nOldH;
short nOldHRel;
short nOldV;
@@ -157,7 +156,7 @@ class SwFrmPage: public SfxTabPage
DECL_LINK( AutoWidthClickHdl, void* );
DECL_LINK( AutoHeightClickHdl, void* );
- // Beispiel aktualisieren
+ // update example
void UpdateExample();
DECL_LINK( ModifyHdl, Edit * );
@@ -206,7 +205,7 @@ public:
class SwGrfExtPage: public SfxTabPage
{
- // Spiegeln
+ // mirror
FixedLine aMirrorFL;
CheckBox aMirrorVertBox;
CheckBox aMirrorHorzBox;
@@ -227,7 +226,7 @@ class SwGrfExtPage: public SfxTabPage
sal_Bool bHtmlMode;
- // Handler fuer Spiegeln
+ // handler for mirroring
DECL_LINK( MirrorHdl, CheckBox * );
DECL_LINK( BrowseHdl, Button * );
@@ -249,7 +248,7 @@ public:
class SwFrmURLPage : public SfxTabPage
{
- //Hyperlink
+ // hyperlink
FixedLine aHyperLinkFL;
FixedText aURLFT;
Edit aURLED;
@@ -259,7 +258,7 @@ class SwFrmURLPage : public SfxTabPage
FixedText aFrameFT;
ComboBox aFrameCB;
- //Image map
+ // image map
FixedLine aImageFL;
CheckBox aServerCB;
CheckBox aClientCB;
diff --git a/sw/source/ui/inc/gloshdl.hxx b/sw/source/ui/inc/gloshdl.hxx
index ebc869fa9e..3e26b9edce 100644
--- a/sw/source/ui/inc/gloshdl.hxx
+++ b/sw/source/ui/inc/gloshdl.hxx
@@ -78,8 +78,8 @@ public:
sal_Bool CopyOrMove( const String& rSourceGroupName, String& rSourceShortName,
const String& rDestGroupName, const String& rLongName, sal_Bool bMove );
sal_Bool HasShortName(const String &rShortName) const;
- //wird NewGlossary vom Basic gerufen, dann soll dir zuvor eingestellte
- //Gruppe ggf. neu erstellt werden
+ // when NewGlossary is called from Basic then the previously set group should
+ // be newly created if applicable.
sal_Bool NewGlossary(const String &rName, const String &rShortName,
sal_Bool bApiCall = sal_False, sal_Bool bNoAttr = sal_False );
sal_Bool DelGlossary(const String&);
@@ -100,7 +100,7 @@ public:
sal_Bool IsReadOnly( const String* = 0 ) const;
sal_Bool IsOld() const;
- sal_Bool FindGroupName(String & rGroup); // Gruppe ohne Pfadindex finden
+ sal_Bool FindGroupName(String & rGroup); // find group without path index
sal_Bool ImportGlossaries( const String& rName );
diff --git a/sw/source/ui/inc/gloslst.hxx b/sw/source/ui/inc/gloslst.hxx
index d216b23386..58be8b9e49 100644
--- a/sw/source/ui/inc/gloslst.hxx
+++ b/sw/source/ui/inc/gloslst.hxx
@@ -43,8 +43,8 @@ struct AutoTextGroup
sal_uInt16 nCount;
String sName;
String sTitle;
- String sLongNames; // durch 0x0A getrennte Langnamen
- String sShortNames; // durch 0x0A getrennte Kurznamen
+ String sLongNames; // by 0x0A seperated long names
+ String sShortNames; // by 0x0A seperated short names
DateTime aDateModified;
};
diff --git a/sw/source/ui/inc/hidfunc.h b/sw/source/ui/inc/hidfunc.h
deleted file mode 100644
index 0dd616e223..0000000000
--- a/sw/source/ui/inc/hidfunc.h
+++ /dev/null
@@ -1,353 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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.
- *
- ************************************************************************/
-#define HID_EXIT 1017
-#define HID_NEW_WINDOW 1701
-#define HID_ARRANGE_CASCADE_WIN 1703
-#define HID_ARRANGE_HORZ_WIN 1704
-#define HID_ARRANGE_VERT_WIN 1705
-#define HID_ARRANGE_ALL_WIN 1702
-#define HID_SHOW_HELP_INDEX 1802
-#define HID_NEW_FILE 1005
-#define HID_NEW_FILE_DEFAULT 1024
-#define HID_CLOSE_FILE 1001
-#define HID_DOC_MGR_DLG 1032
-#define HID_CONFIG_TOOLBOX 1629
-#define HID_CONFIG_MENU 1630
-#define HID_CONFIG_KEY 1631
-#define HID_TEMPLATE_PI 1657
-#define HID_ADDR_PI 1658
-#define HID_AUTO_FORMAT 1651
-#define HID_NAVIGATION_PI 1656
-#define HID_NAVIGATION_PI_GOTO_PAGE 1659
-#define HID_HELP_PI 1655
-#define HID_FORMAT_DROPCAPS 1454
-#define HID_CONFIG_VIEWOPTIONS 1635
-#define HID_CONFIG_COLORS 1636
-#define HID_TOOLBOX 1213
-#define HID_RIBBON 1210
-#define HID_RULER 1211
-#define HID_VLINEAL 1216
-#define HID_VSCROLLBAR 1217
-#define HID_HSCROLLBAR 1218
-#define HID_SAVE_FILE 1013
-#define HID_SAVE_ALL 1023
-#define HID_SAVE_FILE_AS 1012
-#define HID_OPEN_LASTVERSION 1009
-#define HID_STATUSBAR 1212
-#define HID_ABOUT_DLG 1806
-#define HID_SEND_MAIL 1022
-#define HID_OPEN_FILE 1007
-#define HID_INSERT_FILE 1309
-#define HID_DOCSTAT_DLG 1020
-#define HID_LOAD_TEMPLATE_DLG 1021
-#define HID_ESCAPE 1941
-#define HID_PLAY_MACRO_DLG 1624
-#define HID_RECORD_MACRO_DLG 1622
-#define HID_ASSIGN_LOCAL_MACRO_DLG 1632
-#define HID_COMPILE_MACRO 1633
-#define HID_CREATE_DOCUMENT 1019
-#define HID_PAGEUP 1937
-#define HID_PAGEDOWN 1938
-#define HID_SET_LEFT_PARA 1418
-#define HID_SET_RIGHT_PARA 1419
-#define HID_SET_CENTER_PARA 1420
-#define HID_SET_JUSTIFY_PARA 1421
-#define HID_SET_ADJUST 1428
-#define HID_FORMAT_RESET 1469
-#define HID_INDENT_TO_TABSTOP 1417
-#define HID_UNINDENT_TO_TABSTOP 1431
-#define HID_SET_BOLD 1405
-#define HID_SET_ITALIC 1406
-#define HID_SET_UNDERLINE 1409
-#define HID_SET_STRIKEOUT 1410
-#define HID_SET_OUTLINE 1408
-#define HID_SET_SHADOW 1407
-#define HID_SET_SUPER_SCRIPT 1411
-#define HID_SET_SUB_SCRIPT 1412
-#define HID_SET_COLOR 1413
-#define HID_SET_CASEMAP 1414
-#define HID_SET_LANGUAGE 1415
-#define HID_SET_KERNING 1416
-#define HID_SET_FONT 1401
-#define HID_SET_FONT_SIZE 1402
-#define HID_GROW_FONT_SIZE 1403
-#define HID_SHRINK_FONT_SIZE 1404
-#define HID_SET_LINE_SPACE_1 1422
-#define HID_SET_LINE_SPACE_15 1423
-#define HID_SET_LINE_SPACE_2 1424
-#define HID_SET_PROP_LINE_SPACE 1540
-#define HID_SET_ABS_LINE_SPACE 1541
-#define HID_INSERT_SYMBOL 1328
-#define HID_INSERT_OBJECT_DLG 1322
-#define HID_EDIT_OBJECT 1110
-#define HID_EDIT_LINK_DLG 1109
-#define HID_EDIT_FILE_INFO_DLG 1107
-#define HID_EDIT_IDX_ENTRY_DLG 1123
-#define HID_NUM_BULLET_DOWN 1130
-#define HID_NUM_BULLET_MOVEUP 1134
-#define HID_NUM_BULLET_MOVEDOWN 1135
-#define HID_NUM_BULLET_UP 1131
-#define HID_NUM_BULLET_PREV 1132
-#define HID_NUM_BULLET_NEXT 1133
-#define HID_NUM_BULLET_OUTLINE_MOVEDOWN 1142
-#define HID_NUM_BULLET_OUTLINE_MOVEUP 1141
-#define HID_NUM_BULLET_OUTLINE_UP 1140
-#define HID_NUM_BULLET_OUTLINE_DOWN 1139
-#define HID_NUM_BULLET_NONUM 1136
-#define HID_NUM_NUMBERING_ON 1144
-#define HID_NUM_BULLET_ON 1138
-#define HID_NUM_BULLET_OFF 1137
-#define HID_INSERT_IDX_ENTRY_DLG 1335
-#define HID_POSTIT 1329
-#define HID_INSERT_CAPTION 1310
-#define HID_INSERT_IDX 1336
-#define HID_INSERT_USERIDX 1337
-#define HID_INSERT_CNTNTIDX 1338
-#define HID_INSERT_IDX_ENTRY 1340
-#define HID_INSERT_USERIDX_ENTRY 1341
-#define HID_INSERT_CNTNTIDX_ENTRY 1342
-#define HID_INSERT_FRAME 1334
-#define HID_INSERT_FRAME_INTERACT 1333
-#define HID_INSERT_SOFT_HYPHEN 1350
-#define HID_INSERT_HARD_SPACE 1351
-#define HID_FORMAT_FRAME_DLG 1456
-#define HID_FRAME_TO_TOP 1470
-#define HID_FRAME_TO_BOTTOM 1471
-#define HID_FRAME_NOWRAP 1472
-#define HID_FRAME_WRAP 1473
-#define HID_FRAME_WRAPTHRU 1474
-#define HID_FRAME_ALIGN_HORZ_LEFT 1475
-#define HID_FRAME_ALIGN_HORZ_RIGHT 1476
-#define HID_FRAME_ALIGN_HORZ_CENTER 1477
-#define HID_FRAME_ALIGN_VERT_TOP 1478
-#define HID_FRAME_ALIGN_VERT_BOTTOM 1479
-#define HID_FRAME_ALIGN_VERT_CENTER 1480
-#define HID_EDIT_FIELD 1104
-#define HID_SET_FIELD_VALUE 1112
-#define HID_INSERT_FIELD 1308
-#define HID_INSERT_MERGEFIELD_DLG 1320
-#define HID_EXECUTE_MACROFIELD 1127
-#define HID_UPDATE_FIELDS 1126
-#define HID_UPDATE_INPUTFIELDS 1143
-#define HID_CALC_TABLE 1129
-#define HID_INSERT_BREAK_DLG 1304
-#define HID_INSERT_BOOKMARK 1302
-#define HID_DELETE_BOOKMARK 1301
-#define HID_INSERT_GRAFIC 1315
-#define HID_FORMAT_TABLE_DLG 1460
-#define HID_INSERT_TABLE 1330
-#define HID_INSERT_COLS 1332
-#define HID_PAGE_STYLE_SET_COLS 1538
-#define HID_CONVERT_TEXT_TABLE 1500
-#define HID_TABLE_INSERT_ROW 1501
-#define HID_TABLE_INSERT_COL 1502
-#define HID_TABLE_DELETE_ROW 1503
-#define HID_TABLE_DELETE_COL 1504
-#define HID_TABLE_SPLIT_CELLS 1505
-#define HID_TABLE_MERGE_CELLS 1506
-#define HID_TABLE_SET_ROW_HEIGHT 1507
-#define HID_TABLE_SET_COL_WIDTH 1508
-#define HID_TABLE_SET_ULSPACE 1509
-#define HID_TABLE_SET_GRID 1510
-#define HID_TABLE_SET_SHADOW 1511
-#define HID_FORMAT_CHAR_DLG 1441
-#define HID_FORMAT_PAGE_DLG 1452
-#define HID_CHANGE_PAGENUM 1634
-#define HID_FORMAT_PARA_DLG 1443
-#define HID_FORMAT_TAB_DLG 1445
-#define HID_FORMAT_BORDER_DLG 1447
-#define HID_FORMAT_BORDER 1439
-#define HID_FORMAT_SHADOW 1438
-#define HID_FORMAT_BACKGROUND 1448
-#define HID_FORMAT_BACKGROUND_DLG 1450
-#define HID_SET_FRM_SIZE 1481
-#define HID_SET_FRM_POSITION 1482
-#define HID_SET_FRM_ANCHOR 1483
-#define HID_SET_FRM_WRAP 1484
-#define HID_SET_FRM_DIST 1485
-#define HID_SET_FRM_OPTIONS 1486
-#define HID_SET_FRM_MACRO 1494
-#define HID_SET_FRM_COLUMNS 1495
-#define HID_SET_FRM_COLUMN_WIDTH 1496
-#define HID_SET_GRF_MIRROR 1488
-#define HID_SET_TABLE_WIDTH 1489
-#define HID_SET_TABLE_ALIGN 1490
-#define HID_TABLE_SET_READ_ONLY_CELLS 1517
-#define HID_TABLE_UNSET_READ_ONLY_CELLS 1519
-#define HID_NEW_STYLE_BY_EXAMPLE 1462
-#define HID_UPDATE_STYLES_DIRECT 1497
-#define HID_UPDATE_STYLE_BY_EXAMPLE 1463
-#define HID_STYLE_SHEET_FRAME_DLG 1464
-#define HID_STYLE_SHEET_DOC_DLG 1465
-#define HID_SET_STANDARD_FONTS 1442
-#define HID_COPY 1102
-#define HID_PASTE 1113
-#define HID_PASTEUNFORMATTED 1115
-#define HID_PASTESPECIAL 1114
-#define HID_CUT 1103
-#define HID_FLIP_HORZ_GRAFIC 1425
-#define HID_FLIP_VERT_GRAFIC 1426
-#define HID_FORMAT_GRAFIC_DLG 1458
-#define HID_VIEW_BOUNDS 1214
-#define HID_VIEW_FIELDS 1215
-#define HID_VIEW_META_CHARS 1224
-#define HID_VIEW_MARKS 1225
-#define HID_VIEW_FIELDNAME 1226
-#define HID_VIEW_TABLEGRID 1227
-#define HID_SEARCH 1117
-#define HID_REPEAT_SEARCH 1150
-#define HID_REPLACE 1118
-#define HID_GOTO 1111
-#define HID_SETUP_PRINTER_DLG 1015
-#define HID_PRINT_FILE 1010
-#define HID_PRINT_FILE_DEFAULT 1025
-#define HID_FAX 1028
-#define HID_PRINT_FILE_OPTIONS 1011
-#define HID_THESAURUS_DLG 1604
-#define HID_SPELLING_DLG 1601
-#define HID_HYPHENATE_OPT_DLG 1607
-#define HID_MERGE_FILE_DLG 1004
-#define HID_SELECT_DATABASE 1030
-#define HID_DOC_INFO_DLG 1031
-#define HID_MERGE_FILE 1003
-#define HID_MERGE_RECORD 1327
-#define HID_INSERT_RECORD 1326
-#define HID_NUMBERING_OUTLINE_DLG 1612
-#define HID_NUMBER_BULLETS 1121
-#define HID_ZOOM 1231
-#define HID_SORTING 1613
-#define HID_SORTING_DLG 1614
-#define HID_CALCULATE 1615
-#define HID_REFRESH_VIEW 1201
-#define HID_CHAR_LEFT 1901
-#define HID_CHAR_RIGHT 1902
-#define HID_LINE_UP 1903
-#define HID_LINE_DOWN 1904
-#define HID_START_OF_LINE 1905
-#define HID_END_OF_LINE 1906
-#define HID_START_OF_DOCUMENT 1907
-#define HID_END_OF_DOCUMENT 1908
-#define HID_SELECT_WORD 1943
-#define HID_SELECT_ALL 1119
-#define HID_START_OF_NEXT_PAGE 1909
-#define HID_END_OF_NEXT_PAGE 1910
-#define HID_START_OF_PREV_PAGE 1911
-#define HID_END_OF_PREV_PAGE 1912
-#define HID_START_OF_PAGE 1913
-#define HID_END_OF_PAGE 1914
-#define HID_NEXT_WORD 1921
-#define HID_START_OF_PARA 1919
-#define HID_END_OF_PARA 1920
-#define HID_PREV_WORD 1922
-#define HID_NEXT_SENT 1923
-#define HID_PREV_SENT 1924
-#define HID_SET_INS_MODE 1936
-#define HID_SET_ADD_MODE 1939
-#define HID_SET_EXT_MODE 1940
-#define HID_START_TABLE 1947
-#define HID_END_TABLE 1948
-#define HID_NEXT_TABLE 1949
-#define HID_PREV_TABLE 1950
-#define HID_TABLE_SELECT_ALL 1515
-#define HID_TABLE_SELECT_COL 1514
-#define HID_TABLE_SELECT_ROW 1513
-#define HID_START_OF_COLUMN 1917
-#define HID_END_OF_COLUMN 1918
-#define HID_START_OF_NEXT_COLUMN 1951
-#define HID_END_OF_NEXT_COLUMN 1952
-#define HID_START_OF_PREV_COLUMN 1953
-#define HID_END_OF_PREV_COLUMN 1954
-#define HID_FOOTNOTE_TO_ANCHOR 1955
-#define HID_NEXT_FOOTNOTE 1956
-#define HID_PREV_FOOTNOTE 1957
-#define HID_CNTNT_TO_NEXT_FRAME 1958
-#define HID_FRAME_TO_ANCHOR 1959
-#define HID_TO_HEADER 1960
-#define HID_TO_FOOTER 1961
-#define HID_IDX_MARK_TO_IDX 1962
-#define HID_DELETE 1925
-#define HID_BACKSPACE 1926
-#define HID_DELETE_SENT 1927
-#define HID_DELETE_BACK_SENT 1928
-#define HID_DELETE_WORD 1929
-#define HID_DELETE_BACK_WORD 1930
-#define HID_DELETE_LINE 1931
-#define HID_DELETE_BACK_LINE 1932
-#define HID_DELETE_PARA 1933
-#define HID_DELETE_BACK_PARA 1934
-#define HID_DELETE_WHOLE_LINE 1935
-#define HID_INSERT_BREAK 1303
-#define HID_INSERT_PAGEBREAK 1323
-#define HID_INSERT_LINEBREAK 1318
-#define HID_INSERT_COLUMN_BREAK 1305
-#define HID_INSERT_FOOTNOTE 1311
-#define HID_INSERT_FOOTNOTE_DLG 1312
-#define HID_FORMAT_FOOTNOTE_DLG 1468
-#define HID_UNDO 1120
-#define HID_REDO 1116
-#define HID_REPEAT 1122
-#define HID_REPAGINATE 1161
-#define HID_SHOW_UPDATE_HELP 1805
-#define HID_SHOW_KEYBOARD_HELP 1803
-#define HID_SHOW_HELP_MANUAL 1804
-#define HID_GLOSSARY_DLG 1620
-#define HID_EXPAND_GLOSSARY 1628
-#define HID_INSERT_GLOSSARY 1640
-#define HID_AUTO_CORRECT_DLG 1650
-#define HID_AUTO_CORRECT 1649
-#define HID_CONFIG_DLG 1627
-#define HID_INSERT_STRING 1331
-#define HID_SET_CHAR_STYLE 1491
-#define HID_SET_PARA_STYLE 1492
-#define HID_SET_PAGE_STYLE 1493
-#define HID_SET_LRMARGIN 1429
-#define HID_SET_ULMARGIN 1430
-#define HID_SET_HYPHEN_ZONE 1432
-#define HID_SET_PAGE_BREAK 1433
-#define HID_FORMAT_PAGE 1451
-#define HID_SET_KEEP_TOGETHER 1434
-#define HID_SET_WIDOW 1436
-#define HID_SET_ORPHAN 1437
-#define HID_BUFFER_UPDATE 1124
-#define HID_FORMAT_TAB 1444
-#define HID_IS_END_OF_PARA 2000
-#define HID_IS_END_OF_WORD 2000
-#define HID_IS_END_OF_DOC 2000
-#define HID_IS_START_OF_PARA 2000
-#define HID_IS_START_OF_WORD 2000
-#define HID_IS_START_OF_DOC 2000
-#define HID_EDIT_FORMULA 1128
-#define HID_ENVELOP 2050
-#define HID_LABEL 2051
-#define HID_AGENDA_WIZZARD 1663
-#define HID_MEMO_WIZZARD 1662
-#define HID_FAX_WIZZARD 1661
-#define HID_LETTER_WIZZARD 1660
-#define HID_LAUNCH_REGISTRY 1002
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/hyp.hxx b/sw/source/ui/inc/hyp.hxx
index d8d49e0734..e9f3018a34 100644
--- a/sw/source/ui/inc/hyp.hxx
+++ b/sw/source/ui/inc/hyp.hxx
@@ -41,12 +41,12 @@ private:
::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XHyphenator > xHyph;
Link aOldLnk;
- LanguageType nLangError; // nicht vorhandene Sprache
- sal_uInt16 nPageCount; // Seitenanzahl fuer Progressanzeige
- sal_uInt16 nPageStart; // 1. gepruefte Seite
- sal_Bool bInSelection : 1; // Trennen von selektiertem Text
- sal_Bool bShowError : 1; // nicht vorhandene Sprache melden
- sal_Bool bAutomatic : 1; // Trennstellen ohne Rueckfrage einfuegen
+ LanguageType nLangError; // non existing language
+ sal_uInt16 nPageCount; // page count for progress view
+ sal_uInt16 nPageStart; // 1st checked page
+ sal_Bool bInSelection : 1; // seperating selected text
+ sal_Bool bShowError : 1; // report non existing language
+ sal_Bool bAutomatic : 1; // insert seperators without further inquiry
sal_Bool bInfoBox : 1; // display info-box when ending
DECL_LINK( SpellError, LanguageType * );
@@ -55,7 +55,7 @@ protected:
virtual sal_Bool SpellContinue();
virtual void SpellEnd( );
virtual sal_Bool SpellMore();
- virtual void InsertHyphen( const sal_uInt16 nPos ); // Hyphen einfuegen
+ virtual void InsertHyphen( const sal_uInt16 nPos ); // insert hyphen
public:
SwHyphWrapper( SwView* pVw,
diff --git a/sw/source/ui/inc/initui.hxx b/sw/source/ui/inc/initui.hxx
index 6e4acd3bb4..9ec0bb30ff 100644
--- a/sw/source/ui/inc/initui.hxx
+++ b/sw/source/ui/inc/initui.hxx
@@ -62,7 +62,7 @@ extern SvStringsDtor* pDBNameList;
extern SvStringsDtor* pAuthFieldNameList;
extern SvStringsDtor* pAuthFieldTypeList;
-// stellt die Textbausteinverwaltung zur Verfuegung
+// provides textblock management
class SwGlossaries;
SW_DLLPUBLIC SwGlossaries* GetGlossaries();
diff --git a/sw/source/ui/inc/inpdlg.hxx b/sw/source/ui/inc/inpdlg.hxx
index 29159a53bb..0fe511aaf2 100644
--- a/sw/source/ui/inc/inpdlg.hxx
+++ b/sw/source/ui/inc/inpdlg.hxx
@@ -41,7 +41,7 @@ class SwField;
class SwWrtShell;
/*--------------------------------------------------------------------
- Beschreibung: Einfuegen Felder
+ Description: insert fields
--------------------------------------------------------------------*/
class SwFldInputDlg: public SvxStandardDialog
diff --git a/sw/source/ui/inc/inputwin.hxx b/sw/source/ui/inc/inputwin.hxx
index 05f1896674..a43438c045 100644
--- a/sw/source/ui/inc/inputwin.hxx
+++ b/sw/source/ui/inc/inputwin.hxx
@@ -69,8 +69,8 @@ friend class InputEdit;
String aAktTableName, sOldFml;
sal_Int32 m_nActionCount;
- sal_Bool bFirst : 1; //Initialisierungen beim ersten Aufruf
- sal_Bool bActive : 1; //fuer Hide/Show beim Dokumentwechsel
+ sal_Bool bFirst : 1; // initialisations at first call
+ sal_Bool bActive : 1; // for hide/show when switching documents
sal_Bool bIsTable : 1;
sal_Bool bDelSel : 1;
bool m_bDoesUndo : 1;
diff --git a/sw/source/ui/inc/insfnote.hxx b/sw/source/ui/inc/insfnote.hxx
index dc5fdd4f7e..adf30f94f5 100644
--- a/sw/source/ui/inc/insfnote.hxx
+++ b/sw/source/ui/inc/insfnote.hxx
@@ -41,7 +41,7 @@ class SwInsFootNoteDlg: public SvxStandardDialog
{
SwWrtShell &rSh;
- //Alles fuer das/die Zeichen
+ // everything for the character(s)
String aFontName;
CharSet eCharSet;
char cExtChar;
@@ -53,7 +53,7 @@ class SwInsFootNoteDlg: public SvxStandardDialog
Edit aNumberCharEdit;
PushButton aNumberExtChar;
- //Alles fuer die Auswahl Fussnote/Endnote
+ // everything for the selection footnote/endnote
FixedLine aTypeFL;
RadioButton aFtnBtn;
RadioButton aEndNoteBtn;
diff --git a/sw/source/ui/inc/insrule.hxx b/sw/source/ui/inc/insrule.hxx
index f06c057a15..ae142650ea 100644
--- a/sw/source/ui/inc/insrule.hxx
+++ b/sw/source/ui/inc/insrule.hxx
@@ -27,6 +27,9 @@
************************************************************************/
#ifndef _INSRULE_HXX
#define _INSRULE_HXX
+
+#include <vector>
+
#include "num.hxx"
class SwRulerValueSet;
@@ -39,7 +42,7 @@ class SwInsertGrfRulerDlg : public SfxModalDialog
CancelButton aCancelPB;
HelpButton aHelpPB;
- List aGrfNames;
+ std::vector<String> aGrfNames;
String sSimple;
String sRulers;
sal_uInt16 nSelPos;
@@ -56,7 +59,7 @@ public:
String GetGraphicName();
sal_Bool IsSimpleLine() {return nSelPos == 1;}
- sal_Bool HasImages() const {return 0 != aGrfNames.Count();}
+ sal_Bool HasImages() const {return !aGrfNames.empty();}
};
#endif
diff --git a/sw/source/ui/inc/label.hxx b/sw/source/ui/inc/label.hxx
index 4f180627ca..9a330e712c 100644
--- a/sw/source/ui/inc/label.hxx
+++ b/sw/source/ui/inc/label.hxx
@@ -30,12 +30,13 @@
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
-#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
#endif
#include <sfx2/tabdlg.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <labelcfg.hxx>
+#include <vector>
+
class SwLabRec;
class SwLabRecs;
class SwLabItem;
@@ -49,7 +50,7 @@ class SwLabDlg : public SfxTabDialog
SwNewDBMgr* pNewDBMgr;
SwLabPrtPage* pPrtPage;
- SvUShorts aTypeIds;
+ std::vector<sal_uInt16> aTypeIds;
SvStringsDtor aMakes;
SwLabRecs* pRecs;
@@ -73,8 +74,8 @@ public:
SwLabRecs &Recs() { return *pRecs; }
const SwLabRecs &Recs() const { return *pRecs; }
- SvUShorts &TypeIds() { return aTypeIds; }
- const SvUShorts &TypeIds() const { return aTypeIds; }
+ std::vector<sal_uInt16> &TypeIds() { return aTypeIds; }
+ const std::vector<sal_uInt16> &TypeIds() const { return aTypeIds; }
SvStringsDtor &Makes() { return aMakes; }
const SvStringsDtor &Makes() const { return aMakes; }
diff --git a/sw/source/ui/inc/labimg.hxx b/sw/source/ui/inc/labimg.hxx
index c36538b1d3..6dcc8c3a48 100644
--- a/sw/source/ui/inc/labimg.hxx
+++ b/sw/source/ui/inc/labimg.hxx
@@ -50,28 +50,28 @@ public:
virtual SfxPoolItem* Clone(SfxItemPool* = 0) const;
- rtl::OUString aLstMake; //Letzte Auswahl merken.
+ rtl::OUString aLstMake; // remember last selection
rtl::OUString aLstType;
- rtl::OUString sDBName; // Verwendete Datenbank
-
- rtl::OUString aWriting; // Aufschrift
- rtl::OUString aMake; // Etikettenmarke
- rtl::OUString aType; // Etikettentyp
- rtl::OUString aBin; // Druckerschacht
- sal_Int32 lHDist; // Horizontaler Abstand (Benutzer)
- sal_Int32 lVDist; // Vertikaler Abstand (Benutzer)
- sal_Int32 lWidth; // Breite (Benutzer)
- sal_Int32 lHeight; // Hoehe (Benutzer)
- sal_Int32 lLeft; // Rand links (Benutzer)
- sal_Int32 lUpper; // Rand oben (Benutzer)
- sal_Int32 nCols; // Anzahl Spalten (Benutzer)
- sal_Int32 nRows; // Anzahl Zeilen (Benutzer)
- sal_Int32 nCol; // Spalte fuer Einzeldruck
- sal_Int32 nRow; // Zeile fuer Einzeldruck
- sal_Bool bAddr;// Adresse als Aufschrift?
- sal_Bool bCont;// Endlospapier?
- sal_Bool bPage;// Ganze Seite oder einzelnes Etikett?
- sal_Bool bSynchron;// Alle Etiketten synchronisieren
+ rtl::OUString sDBName; // used database
+
+ rtl::OUString aWriting; // label
+ rtl::OUString aMake; // label mark
+ rtl::OUString aType; // label type
+ rtl::OUString aBin; // printer shaft
+ sal_Int32 lHDist; // horizontal distance (user)
+ sal_Int32 lVDist; // vertical distance (user)
+ sal_Int32 lWidth; // width (user)
+ sal_Int32 lHeight; // height (user)
+ sal_Int32 lLeft; // left border (user)
+ sal_Int32 lUpper; // upper border (user)
+ sal_Int32 nCols; // number of columns (user)
+ sal_Int32 nRows; // number of rows (user)
+ sal_Int32 nCol; // column for single print
+ sal_Int32 nRow; // row for single print
+ sal_Bool bAddr;// adress as label?
+ sal_Bool bCont;// continuous paper?
+ sal_Bool bPage;// whole page or single labels?
+ sal_Bool bSynchron;// synchronise all labels
//parts of the business card
rtl::OUString aPrivFirstName;
diff --git a/sw/source/ui/inc/linenum.hxx b/sw/source/ui/inc/linenum.hxx
index a3a87aa11f..ba2ac59548 100644
--- a/sw/source/ui/inc/linenum.hxx
+++ b/sw/source/ui/inc/linenum.hxx
@@ -42,7 +42,7 @@ class SwView;
class SwWrtShell;
/*--------------------------------------------------------------------
- Beschreibung: SingleTabDialog
+ Description: SingleTabDialog
--------------------------------------------------------------------*/
class SwLineNumberingDlg : public SfxSingleTabDialog
{
@@ -58,7 +58,7 @@ public:
};
/*--------------------------------------------------------------------
- Beschreibung: TabPage
+ Description: TabPage
--------------------------------------------------------------------*/
class SwLineNumberingPage : public SfxTabPage
{
diff --git a/sw/source/ui/inc/mailmergehelper.hxx b/sw/source/ui/inc/mailmergehelper.hxx
index dd7d5eac9c..35e1c8c297 100644
--- a/sw/source/ui/inc/mailmergehelper.hxx
+++ b/sw/source/ui/inc/mailmergehelper.hxx
@@ -288,7 +288,7 @@ public:
SwMailMessage();
~SwMailMessage();
- // Attributes
+ // attributes
virtual ::rtl::OUString SAL_CALL getSenderName() throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getSenderAddress() throw (::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getReplyToAddress() throw (::com::sun::star::uno::RuntimeException);
@@ -302,7 +302,7 @@ public:
virtual void SAL_CALL setBody( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& _body )
throw (::com::sun::star::uno::RuntimeException);
- // Methods
+ // methods
virtual void SAL_CALL addRecipient( const ::rtl::OUString& sRecipientAddress ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addCcRecipient( const ::rtl::OUString& sRecipientAddress ) throw (::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL addBccRecipient( const ::rtl::OUString& sRecipientAddress ) throw (::com::sun::star::uno::RuntimeException);
diff --git a/sw/source/ui/inc/mailmrge.hxx b/sw/source/ui/inc/mailmrge.hxx
index b566ecffaf..b018a79830 100644
--- a/sw/source/ui/inc/mailmrge.hxx
+++ b/sw/source/ui/inc/mailmrge.hxx
@@ -147,6 +147,12 @@ public:
~SwMailMergeDlg();
inline sal_uInt16 GetMergeType() { return nMergeType; }
+
+ bool IsSaveIndividualDocs() const { return aSaveIndividualRB.IsChecked(); }
+ bool IsGenerateFromDataBase() const { return aGenerateFromDataBaseCB.IsChecked(); }
+ String GetColumnName() const { return aColumnLB.GetSelectEntry();}
+ String GetPath() const { return aPathED.GetText();}
+
const ::rtl::OUString& GetSaveFilter() const {return m_sSaveFilter;}
inline const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > GetSelection() const { return m_aSelection; }
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet> GetResultSet() const;
diff --git a/sw/source/ui/inc/multmrk.hxx b/sw/source/ui/inc/multmrk.hxx
index 79413fe306..efae555f4a 100644
--- a/sw/source/ui/inc/multmrk.hxx
+++ b/sw/source/ui/inc/multmrk.hxx
@@ -39,7 +39,7 @@
class SwTOXMgr;
/*--------------------------------------------------------------------
- Beschreibung: Markierung fuer Verzeichniseintrag einfuegen
+ Description: insert mark for index entry
--------------------------------------------------------------------*/
class SwMultiTOXMarkDlg : public SvxStandardDialog
diff --git a/sw/source/ui/inc/navicfg.hxx b/sw/source/ui/inc/navicfg.hxx
index 8306ea4549..d5a0db5f45 100644
--- a/sw/source/ui/inc/navicfg.hxx
+++ b/sw/source/ui/inc/navicfg.hxx
@@ -38,7 +38,7 @@ class SwNavigationConfig : public utl::ConfigItem
sal_Int32 nRegionMode; //InsertMode
sal_Int32 nActiveBlock; //ActiveBlock//Expand/CollapsState
sal_Bool bIsSmall; //ShowListBox
- sal_Bool bIsGlobalActive; //GlobalDocMode// Globalansicht fuer GlobalDoc gueltig?
+ sal_Bool bIsGlobalActive; //GlobalDocMode// global view for GlobalDoc valid?
com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
diff --git a/sw/source/ui/inc/navicont.hxx b/sw/source/ui/inc/navicont.hxx
index f0df6c3b1e..9b4b96f245 100644
--- a/sw/source/ui/inc/navicont.hxx
+++ b/sw/source/ui/inc/navicont.hxx
@@ -35,16 +35,16 @@ class SwDocShell;
class TransferDataContainer;
class TransferableDataHelper;
-/* [Beschreibung]
- Navigator-Bookmark zur eindeutigen Identifizierung im Sw
+/*
+ navigator bookmark for distinct identification in Sw
*/
class NaviContentBookmark
{
- String aUrl; // URL inkl. Sprungmarke
- String aDescr; // Description
- long nDocSh; // Adresse der DocShell
- sal_uInt16 nDefDrag; // Description enthaelt defaultDragType
+ String aUrl; // URL including jump mark
+ String aDescr; // description
+ long nDocSh; // adress of DocShell
+ sal_uInt16 nDefDrag; // description contains defaultDragType
public:
NaviContentBookmark();
diff --git a/sw/source/ui/inc/navipi.hxx b/sw/source/ui/inc/navipi.hxx
index d29ed815d4..110775fae3 100644
--- a/sw/source/ui/inc/navipi.hxx
+++ b/sw/source/ui/inc/navipi.hxx
@@ -77,7 +77,7 @@ class SwNavigationPI : public Window,
String sContentFileName;
String aContextArr[3];
String aStatusArr[4];
- Point aBoxBottomLeft; // Pos., wenn Box unten ist
+ Point aBoxBottomLeft; // Pos when Box is at bottom
SfxObjectShellLock *pxObjectShell;
SwView *pContentView;
@@ -95,7 +95,7 @@ class SwNavigationPI : public Window,
long nDocLBIniHeight;
long nWishWidth;
sal_uInt16 nAutoMarkIdx;
- sal_uInt16 nRegionMode; // 0 - URL, 1 - Bereich mit Link 2 - B. ohne Link
+ sal_uInt16 nRegionMode; // 0 - URL, 1 - region with link 2 - region without link
short nZoomIn;
short nZoomOutInit;
short nZoomOut;
@@ -143,7 +143,7 @@ protected:
virtual void DataChanged( const DataChangedEvent& rDCEvt );
- // zum App-Ende rechtzeitig ObjectShellLock loslassen
+ // release ObjectShellLock early enough for app end
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
NumEditAction& GetPageEdit();
@@ -155,7 +155,7 @@ public:
SwNavigationPI(SfxBindings*, SfxChildWindowContext*, Window*);
~SwNavigationPI();
- void GotoPage(); // Seite anspringen; bindbare Funktion
+ void GotoPage(); // jump to page; bindable function
void Update() { FillBox(); }
void UpdateListBox();
diff --git a/sw/source/ui/inc/num.hxx b/sw/source/ui/inc/num.hxx
index 287b8d341b..f0bb1a679b 100644
--- a/sw/source/ui/inc/num.hxx
+++ b/sw/source/ui/inc/num.hxx
@@ -101,7 +101,7 @@ class SwNumPositionTabPage : public SfxTabPage
sal_Bool bModified : 1;
sal_Bool bPreset : 1;
- sal_Bool bInInintControl : 1; //Modify-Fehler umgehen, soll ab 391 behoben sein
+ sal_Bool bInInintControl : 1; // work around modify-error; should be resolved from 391 on
bool bLabelAlignmentPosAndSpaceModeActive;
void InitControls();
diff --git a/sw/source/ui/inc/numpara.hxx b/sw/source/ui/inc/numpara.hxx
index 8bde96eaf6..af4049727b 100644
--- a/sw/source/ui/inc/numpara.hxx
+++ b/sw/source/ui/inc/numpara.hxx
@@ -37,8 +37,8 @@
/* --- class SwParagraphNumTabPage ----------------------------------------
- Mit dieser TabPage werden Numerierungseinstellungen am Absatz bzw. der
- Absatzvorlage vorgenommen.
+ with this TabPage numbering settings at the paragraph / paragraph style
+ are performed.
---------------------------------------------------------------------------*/
class SwParagraphNumTabPage : public SfxTabPage
@@ -63,7 +63,6 @@ class SwParagraphNumTabPage : public SfxTabPage
// --> OD 2008-04-14 #outlinelevel#
const String msOutlineNumbering;
- // <--
sal_Bool bModified : 1;
sal_Bool bCurNumrule : 1;
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx
index dcdd067a54..d9c44363b7 100644
--- a/sw/source/ui/inc/optpage.hxx
+++ b/sw/source/ui/inc/optpage.hxx
@@ -95,7 +95,7 @@ public:
};
/*--------------------------------------------------------
- TabPage Druckereinstellungen Zusaetze
+ TabPage printer settings additions
--------------------------------------------------------- */
class SwAddPrinterTabPage : public SfxTabPage
{
@@ -199,7 +199,7 @@ class SwStdFontTabPage : public SfxTabPage
SwStdFontConfig* pFontConfig;
SwWrtShell* pWrtShell;
LanguageType eLanguage;
- // waren nur defaults vorhanden? wurden sie mit den Boxen ueberschrieben
+ // only defaults were there? they were signed with the boxes
sal_Bool bListDefault :1;
sal_Bool bSetListDefault :1;
sal_Bool bLabelDefault :1;
@@ -301,7 +301,7 @@ public:
};
/*--------------------------------------------------
- TabPage fuer ShadowCrsr
+ TabPage for ShadowCrsr
--------------------------------------------------*/
class SwShdwCrsrOptionsTabPage : public SfxTabPage
{
@@ -352,7 +352,7 @@ public:
};
/*-----------------------------------------------------------------------
- Beschreibung: Markierungsvorschau
+ Description: mark preview
-----------------------------------------------------------------------*/
class SwMarkPreview : public Window
{
@@ -389,7 +389,7 @@ public:
};
/*-----------------------------------------------------------------------
- Beschreibung: Redlining-Optionen
+ Description: redlining options
-----------------------------------------------------------------------*/
class SwRedlineOptionsTabPage : public SfxTabPage
{
@@ -445,7 +445,7 @@ public:
};
/*-------------------------------------------------------
- TabPage Testeinstellungen fuer SW
+ TabPage test settings for SW
--------------------------------------------------------- */
#if OSL_DEBUG_LEVEL > 1
@@ -484,4 +484,4 @@ private:
#endif //PRODUCT
#endif
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/outline.hxx b/sw/source/ui/inc/outline.hxx
index 7c8e37bc3d..083921f865 100644
--- a/sw/source/ui/inc/outline.hxx
+++ b/sw/source/ui/inc/outline.hxx
@@ -44,7 +44,7 @@
#include <vcl/field.hxx>
-#include "swtypes.hxx" //fuer MAXLEVEL
+#include "swtypes.hxx" //for MAXLEVEL
#include <numprevw.hxx>
#include <numberingtypelistbox.hxx>
diff --git a/sw/source/ui/inc/pgfnote.hxx b/sw/source/ui/inc/pgfnote.hxx
index 30efd28e25..d9e92e46a0 100644
--- a/sw/source/ui/inc/pgfnote.hxx
+++ b/sw/source/ui/inc/pgfnote.hxx
@@ -38,7 +38,7 @@
#include <svtools/ctrlbox.hxx>
/*--------------------------------------------------------------------
- Beschreibung: Fussnoteneinstellungs-TabPage
+ Description: footnote settings TabPage
--------------------------------------------------------------------*/
class SwFootNotePage: public SfxTabPage
{
diff --git a/sw/source/ui/inc/popbox.hxx b/sw/source/ui/inc/popbox.hxx
index 198159a70b..41595dc0b1 100644
--- a/sw/source/ui/inc/popbox.hxx
+++ b/sw/source/ui/inc/popbox.hxx
@@ -37,7 +37,7 @@ class SwNavigationPI;
class SwHelpToolBox: public ToolBox, public DropTargetHelper
{
Link aDoubleClickLink;
- Link aRightClickLink; // Link bekommt MouseEvent als Parameter !!!
+ Link aRightClickLink; // link gets mouse event as parameter !!!
using ToolBox::DoubleClick;
diff --git a/sw/source/ui/inc/prcntfld.hxx b/sw/source/ui/inc/prcntfld.hxx
index da7de4676e..0ec702a9e8 100644
--- a/sw/source/ui/inc/prcntfld.hxx
+++ b/sw/source/ui/inc/prcntfld.hxx
@@ -33,7 +33,7 @@
class SW_DLLPUBLIC PercentField : public MetricField
{
- sal_Int64 nRefValue; // 100%-Wert fuer Umrechnung (in Twips)
+ sal_Int64 nRefValue; // 100% value for conversion (in Twips)
sal_Int64 nOldMax;
sal_Int64 nOldMin;
sal_Int64 nOldSpinSize;
diff --git a/sw/source/ui/inc/pview.hxx b/sw/source/ui/inc/pview.hxx
index 875579ce06..92dba1e203 100644
--- a/sw/source/ui/inc/pview.hxx
+++ b/sw/source/ui/inc/pview.hxx
@@ -74,7 +74,7 @@ public:
SwPagePreViewWin( Window* pParent, SwPagePreView& rView );
~SwPagePreViewWin();
- //Ruft ViewShell::Paint
+ // calls ViewShell::Paint
virtual void Paint( const Rectangle& rRect );
virtual void KeyInput( const KeyEvent & );
virtual void Command( const CommandEvent& rCEvt );
@@ -172,12 +172,12 @@ public:
};
/*--------------------------------------------------------------------
- Beschreibung: Sicht auf ein Dokument
+ Description: view of a document
--------------------------------------------------------------------*/
class SW_DLLPUBLIC SwPagePreView: public SfxViewShell
{
- // ViewWindow und Henkel zur Core
- // aktuelle Dispatcher-Shell
+ // ViewWindow and handle to core
+ // current dispatcher shell
SwPagePreViewWin aViewWin;
//viewdata of the previous SwView and the new crsrposition
String sSwViewData,
@@ -185,18 +185,17 @@ class SW_DLLPUBLIC SwPagePreView: public SfxViewShell
sNewCrsrPos;
// to support keyboard the number of the page to go to can be set too
sal_uInt16 nNewPage;
- // Sichtbarer Bereich
+ // visible range
String sPageStr;
Size aDocSz;
Rectangle aVisArea;
- // MDI Bedienelemente
+ // MDI control elements
SwScrollbar *pHScrollbar;
SwScrollbar *pVScrollbar;
ImageButton *pPageUpBtn,
*pPageDownBtn;
- // Dummy-Window zum F�llen der rechten unteren Ecke, wenn beide Scrollbars
- // aktiv sind
+ // dummy window for filling the lower right edge when both scrollbars are active
Window *pScrollFill;
sal_uInt16 mnPageCount;
@@ -284,7 +283,7 @@ public:
sal_uInt16 GetNewPage() const {return nNewPage;}
void SetNewPage(sal_uInt16 nSet) {nNewPage = nSet;}
- // Handler
+ // handler
void Execute(SfxRequest&);
void GetState(SfxItemSet&);
void StateUndo(SfxItemSet&);
@@ -324,7 +323,7 @@ public:
~SwPagePreView();
};
-// ----------------- inline Methoden ----------------------
+// ----------------- inline methods ----------------------
inline void SwPagePreView::AdjustEditWin()
{
OuterResizePixel( Point(), GetFrameWindow()->GetOutputSizePixel() );
diff --git a/sw/source/ui/inc/redlndlg.hxx b/sw/source/ui/inc/redlndlg.hxx
index 714d52f2fe..bb42ab15e5 100644
--- a/sw/source/ui/inc/redlndlg.hxx
+++ b/sw/source/ui/inc/redlndlg.hxx
@@ -44,17 +44,17 @@ class SwChildWinWrapper;
struct SwRedlineDataChild
{
- const SwRedlineData* pChild; // Verweis auf originale gestackte Daten
- const SwRedlineDataChild* pNext; // Verweis auf gestackte Daten
- SvLBoxEntry* pTLBChild; // zugehoeriger TreeListBox-Eintrag
+ const SwRedlineData* pChild; // link to original stacked data
+ const SwRedlineDataChild* pNext; // link to stacked data
+ SvLBoxEntry* pTLBChild; // corresponding TreeListBox entry
};
struct SwRedlineDataParent
{
const SwRedlineData* pData; // RedlineDataPtr
- const SwRedlineDataChild* pNext; // Verweis auf gestackte Daten
- SvLBoxEntry* pTLBParent; // zugehoeriger TreeListBox-Eintrag
- String sComment; // Redline-Kommentar
+ const SwRedlineDataChild* pNext; // link to stacked data
+ SvLBoxEntry* pTLBParent; // corresponding TreeListBox entry
+ String sComment; // redline comment
inline sal_Bool operator==( const SwRedlineDataParent& rObj ) const
{ return (pData && pData->GetSeqNo() == rObj.pData->GetSeqNo()); }
diff --git a/sw/source/ui/inc/regionsw.hxx b/sw/source/ui/inc/regionsw.hxx
index 8133e1855b..206f7358e4 100644
--- a/sw/source/ui/inc/regionsw.hxx
+++ b/sw/source/ui/inc/regionsw.hxx
@@ -62,7 +62,7 @@ namespace sfx2
}
/*************************************************************************
- Dialog "Bereiche bearbeiten"
+ dialog "edit regions"
*************************************************************************/
class SectRepr;
typedef SectRepr* SectReprPtr;
@@ -95,10 +95,9 @@ class SwEditRegionDlg : public SfxModalDialog
FixedText aConditionFT;
ConditionEdit aConditionED;
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // #114856# edit in readonly sections
FixedLine aPropertiesFL;
TriStateBox aEditInReadonlyCB;
- // <--
OKButton aOK;
CancelButton aCancel;
@@ -133,9 +132,8 @@ class SwEditRegionDlg : public SfxModalDialog
DECL_LINK( ChangePasswdHdl, Button * );
DECL_LINK( ChangeProtectHdl, TriStateBox * );
DECL_LINK( ChangeHideHdl, TriStateBox * );
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // #114856# edit in readonly sections
DECL_LINK( ChangeEditInReadonlyHdl, TriStateBox * );
- // <--
DECL_LINK( ChangeDismissHdl, CheckBox * );
DECL_LINK( UseFileHdl, CheckBox* );
DECL_LINK( FileSearchHdl, PushButton* );
@@ -156,7 +154,7 @@ public:
};
/*************************************************************************
- Dialog "Bereich einfuegen"
+ dialog "insert region"
*************************************************************************/
class SwInsertSectionTabPage : public SfxTabPage
{
@@ -183,10 +181,9 @@ class SwInsertSectionTabPage : public SfxTabPage
FixedText aConditionFT;
ConditionEdit aConditionED;
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // #114856# edit in readonly sections
FixedLine aPropertiesFL;
CheckBox aEditInReadonlyCB;
- // <--
String m_sFileName;
String m_sFilterName;
@@ -199,9 +196,8 @@ class SwInsertSectionTabPage : public SfxTabPage
Window* m_pOldDefDlgParent;
DECL_LINK( ChangeHideHdl, CheckBox * );
- // --> FME 2004-06-22 #114856# edit in readonly sections
+ // #114856# edit in readonly sections
DECL_LINK( ChangeEditInReadonlyHdl, CheckBox * );
- // <--
DECL_LINK( ChangeProtectHdl, CheckBox * );
DECL_LINK( ChangePasswdHdl, Button * );
DECL_LINK( NameEditHdl, Edit * );
diff --git a/sw/source/ui/inc/scroll.hxx b/sw/source/ui/inc/scroll.hxx
index 4f888419fe..c99ecaa30e 100644
--- a/sw/source/ui/inc/scroll.hxx
+++ b/sw/source/ui/inc/scroll.hxx
@@ -32,11 +32,11 @@
class SwScrollbar: public ScrollBar
{
Size aDocSz;
- sal_Bool bHori :1; // Horizontal = sal_True, sonst Vertikal
- sal_Bool bAuto :1; // fuer Scrollingmode
+ sal_Bool bHori :1; // horizontal = salTrue, otherwise vertical
+ sal_Bool bAuto :1; // for scrolling mode
sal_Bool bThumbEnabled:1;
- sal_Bool bVisible :1; // Show/Hide sollen nur noch dieses Flag setzen
- sal_Bool bSizeSet :1; // wurde die Groesse bereits gesetzt?
+ sal_Bool bVisible :1; // show/hide should only set this flag
+ sal_Bool bSizeSet :1; // was the size already set?
void AutoShow();
@@ -51,11 +51,11 @@ public:
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize );
sal_Bool IsVisible(sal_Bool bReal) const { return bReal ? ScrollBar::IsVisible() : bVisible; }
- // Aenderung der Dokumentgroesse
+ // changing of document size
void DocSzChgd(const Size &rNewSize);
- // Aenderung des sichtbaren Bereiches
+ // changing of visible region
void ViewPortChgd(const Rectangle &rRectangle);
- // was fuer einer ist es denn ??
+ // what is it??
sal_Bool IsHoriScroll() const { return bHori; }
void SetAuto(sal_Bool bSet);
diff --git a/sw/source/ui/inc/srcview.hxx b/sw/source/ui/inc/srcview.hxx
index 336a9fc18a..8ee18eddc4 100644
--- a/sw/source/ui/inc/srcview.hxx
+++ b/sw/source/ui/inc/srcview.hxx
@@ -49,7 +49,7 @@ class SwSrcView: public SfxViewShell
rtl_TextEncoding eLoadEncoding;
void Init();
- // fuer Readonly-Umschaltung
+ // for read-only switching
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
diff --git a/sw/source/ui/inc/swcont.hxx b/sw/source/ui/inc/swcont.hxx
index 0688dd6732..58111b562d 100644
--- a/sw/source/ui/inc/swcont.hxx
+++ b/sw/source/ui/inc/swcont.hxx
@@ -33,7 +33,7 @@
class SwContentType;
-//Reihenfolge und Anzahl mit ResIds abgleichen!!
+// synchronize order and number with ResIds!!
#define CONTENT_TYPE_OUTLINE 0
#define CONTENT_TYPE_TABLE 1
#define CONTENT_TYPE_FRAME 2
@@ -49,17 +49,17 @@ class SwContentType;
#define CONTENT_TYPE_MAX CONTENT_TYPE_DRAWOBJECT +1
-// Typen fuer das Globaldokument
+// types for global document
#define GLOBAL_CONTENT_REGION 100
#define GLOBAL_CONTENT_INDEX 101
#define GLOBAL_CONTENT_TEXT 102
#define GLOBAL_CONTENT_MAX 3
-// Strings fuer Kontextmenue
+// strings for context menus
#define CONTEXT_COUNT 12
#define GLOBAL_CONTEXT_COUNT 14
-// Modi fuer Drag 'n Drop
+// modes for Drag 'n Drop
#define REGION_MODE_NONE 0
#define REGION_MODE_LINK 1
#define REGION_MODE_EMBEDDED 2
@@ -94,12 +94,12 @@ public:
const String& GetName() const {return sContentName;}
int operator==(const SwContent& /*rCont*/) const
{
- //gleich sind sie nie, sonst fallen sie aus dem Array
+ // they're never equal, otherwise they'd fall out of the array
return sal_False;
}
int operator<(const SwContent& rCont) const
{
- //zuerst nach Position dann nach Name sortieren
+ // at first sort by position and then by name
return nYPosition != rCont.nYPosition ?
nYPosition < rCont.nYPosition :
sContentName < rCont.sContentName;;
diff --git a/sw/source/ui/inc/swdtflvr.hxx b/sw/source/ui/inc/swdtflvr.hxx
index 4e37f6390b..845a7efcb2 100644
--- a/sw/source/ui/inc/swdtflvr.hxx
+++ b/sw/source/ui/inc/swdtflvr.hxx
@@ -58,7 +58,7 @@ namespace nsTransferBufferType
const sal_uInt16 TRNSFR_DDELINK = 0x0010;
const sal_uInt16 TRNSFR_OLE = 0x0020;
const sal_uInt16 TRNSFR_INETFLD = 0x0040;
- const sal_uInt16 TRNSFR_DRAWING = 0x0081; //Drawing ist auch intern!
+ const sal_uInt16 TRNSFR_DRAWING = 0x0081; // drawing is internal too!
}
#define DATA_FLAVOR ::com::sun::star::datatransfer::DataFlavor
@@ -77,7 +77,7 @@ class SwTransferable : public TransferableHelper
const ViewShell *pCreatorView;
SwDocFac *pClpDocFac;
Graphic *pClpGraphic, *pClpBitmap, *pOrigGrf;
- INetBookmark *pBkmk; // URL und Beschreibung!
+ INetBookmark *pBkmk; // URL and description!
ImageMap *pImageMap;
INetImage *pTargetURL;
diff --git a/sw/source/ui/inc/swlbox.hxx b/sw/source/ui/inc/swlbox.hxx
index 265b5ad3c5..6aab6cc84b 100644
--- a/sw/source/ui/inc/swlbox.hxx
+++ b/sw/source/ui/inc/swlbox.hxx
@@ -41,7 +41,7 @@ class Window;
SV_DECL_PTRARR_DEL(SwEntryLst, SwBoxEntry*, 10, 10)
/*--------------------------------------------------------------------
- Beschreibung: SwBoxEntry
+ Description: SwBoxEntry
--------------------------------------------------------------------*/
class SW_DLLPUBLIC SwBoxEntry
{
@@ -62,7 +62,7 @@ public:
};
/*--------------------------------------------------------------------
- Beschreibung: fuer ComboBoxen
+ Description: for combo boxes
--------------------------------------------------------------------*/
typedef sal_uInt16 SwComboBoxStyle;
diff --git a/sw/source/ui/inc/swuiidxmrk.hxx b/sw/source/ui/inc/swuiidxmrk.hxx
index c8ca13b0f7..9b546fbf9d 100644
--- a/sw/source/ui/inc/swuiidxmrk.hxx
+++ b/sw/source/ui/inc/swuiidxmrk.hxx
@@ -52,7 +52,7 @@ class SwWrtShell;
class SwTOXMgr;
class SwTOXMark;
/*--------------------------------------------------------------------
- Beschreibung: Markierung fuer Verzeichniseintrag einfuegen
+ Description: insert mark for index entry
--------------------------------------------------------------------*/
class SwIndexMarkFloatDlg;
class SwIndexMarkModalDlg;
diff --git a/sw/source/ui/inc/tabledlg.hxx b/sw/source/ui/inc/tabledlg.hxx
index 9b26c95762..ec7c5eabe5 100644
--- a/sw/source/ui/inc/tabledlg.hxx
+++ b/sw/source/ui/inc/tabledlg.hxx
@@ -39,7 +39,7 @@ class SwTabCols;
struct TColumn;
/*-------------------------------------------------------
- Tabellendialog
+ table dialog
--------------------------------------------------------- */
class SwTableTabDlg : public SfxTabDialog
{
diff --git a/sw/source/ui/inc/tmpdlg.hxx b/sw/source/ui/inc/tmpdlg.hxx
index eca821e945..dae38cf650 100644
--- a/sw/source/ui/inc/tmpdlg.hxx
+++ b/sw/source/ui/inc/tmpdlg.hxx
@@ -34,7 +34,7 @@ class SfxItemSet;
class SwWrtShell;
/*--------------------------------------------------------------------
- Beschreibung: Der Tabdialog Traeger der TabPages
+ Description: the tab dialog carrier of TabPages
--------------------------------------------------------------------*/
class SwTemplateDlg: public SfxStyleDialog
{
diff --git a/sw/source/ui/inc/toxmgr.hxx b/sw/source/ui/inc/toxmgr.hxx
index 5c2aeb0b70..c419776854 100644
--- a/sw/source/ui/inc/toxmgr.hxx
+++ b/sw/source/ui/inc/toxmgr.hxx
@@ -37,7 +37,7 @@ class SwWrtShell;
class SwForm;
/*--------------------------------------------------------------------
- Beschreibung: Manager fuer Verzeichnisfunktionalitaet
+ Description: manager for directory functionality
--------------------------------------------------------------------*/
//one single method will be sufficient to insert AND upate indexes
class SW_DLLPUBLIC SwTOXDescription
@@ -281,7 +281,7 @@ public:
explicit SwTOXMgr(SwWrtShell* pShell);
//
- // Methoden fuer Verzeichnismarkierungen
+ // methods for directory marks
//
void InsertTOXMark(const SwTOXMarkDescription& rDesc);
@@ -292,7 +292,7 @@ public:
void NextTOXMark(sal_Bool bSame=sal_False);
void PrevTOXMark(sal_Bool bSame=sal_False);
- // Aktuelle TOXmarks holen
+ // get current TOXmarks
sal_uInt16 GetTOXMarks();
sal_uInt16 GetTOXMarkCount();
SwTOXMark* GetTOXMark(sal_uInt16 nId);
@@ -300,7 +300,7 @@ public:
void SetCurTOXMark(sal_uInt16 nId);
//
- // Methoden fuer Verzeichnisse
+ // methods for directories
//
sal_Bool UpdateOrInsertTOX(const SwTOXDescription& rDesc, SwTOXBase** ppBase = 0, const SfxItemSet* pSet = 0);
@@ -310,7 +310,7 @@ public:
};
/*--------------------------------------------------------------------
- Beschreibung: Inlines
+ Description: inlines
--------------------------------------------------------------------*/
inline sal_uInt16 SwTOXMgr::GetTOXMarkCount()
{ return aCurMarks.Count(); }
diff --git a/sw/source/ui/inc/uiitems.hxx b/sw/source/ui/inc/uiitems.hxx
index f34a76b384..1e7f55c7e7 100644
--- a/sw/source/ui/inc/uiitems.hxx
+++ b/sw/source/ui/inc/uiitems.hxx
@@ -37,7 +37,7 @@ class SwNumRule;
class IntlWrapper;
/*--------------------------------------------------------------------
- Beschreibung: Container fuer FootNote
+ Description: container for FootNote
--------------------------------------------------------------------*/
class SW_DLLPUBLIC SwPageFtnInfoItem : public SfxPoolItem
{
diff --git a/sw/source/ui/inc/uinums.hxx b/sw/source/ui/inc/uinums.hxx
index c6571787b0..59d910cd4f 100644
--- a/sw/source/ui/inc/uinums.hxx
+++ b/sw/source/ui/inc/uinums.hxx
@@ -44,8 +44,8 @@ SV_DECL_PTRARR_DEL( _SwNumFmtsAttrs, SfxPoolItemPtr, 5,0 )
class SW_DLLPUBLIC SwNumRulesWithName
{
String aName;
- // die Formate der NumRule muessen! unabhaengig von einem Document sein
- // (Sie sollen immer vorhanden sein!)
+ // the NumRule's formats _have_ to be independent of a document
+ // (They should always be there!)
class SW_DLLPRIVATE _SwNumFmtGlobal
{
SwNumFmt aFmt;
@@ -87,7 +87,7 @@ public:
class SwBaseNumRules
{
public:
- enum { nMaxRules = MAX_NUM_RULES }; // zur Zeit 9 definierte Forms
+ enum { nMaxRules = MAX_NUM_RULES }; // currently 9 defined forms
protected:
SwNumRulesWithName *pNumRules[ MAX_NUM_RULES ];
String sFileName;
diff --git a/sw/source/ui/inc/uitool.hxx b/sw/source/ui/inc/uitool.hxx
index 0534680274..9a1304aa7a 100644
--- a/sw/source/ui/inc/uitool.hxx
+++ b/sw/source/ui/inc/uitool.hxx
@@ -46,28 +46,28 @@ class SwTabCols;
class DateTime;
class SfxViewFrame;
-// Umschalten einer Metric
+// switch a metric
SW_DLLPUBLIC void SetMetric(MetricFormatter& rCtrl, FieldUnit eUnit);
-// BoxInfoAttribut fuellen
+// fill BoxInfoAttribut
SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh);
// SfxItemSets <-> PageDesc
void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc );
void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet);
-// Auffuellen der Tabs mit DefaultTabs
+// fill tabs with default tabs
SW_DLLPUBLIC void MakeDefTabs(SwTwips nDefDist, SvxTabStopItem& rTabs);
-// DefaultTabs loeschen aus dem TabStopArray
+// erase DefaultTabs from TabStopArray
//void EraseDefTabs(SvxTabStopItem& rTabs);
-// Abstand zwischen dem 1. und zweitem Element ermitteln
+// determine space between 1st and 2nd element
SW_DLLPUBLIC sal_uInt16 GetTabDist(const SvxTabStopItem& rTabs);
-// erfrage ob im Set eine Sfx-PageDesc-Kombination vorliegt
-// und setze diesen im Set und loesche die Transport Items
-// (PageBreak & PageModel) aus dem Set
+// determine whether a Sfx-PageDesc combination exists in the set
+// and set this in the set and delete the transport items
+// (PageBreak & PageModel) from the set
void SwToSfxPageDescAttr( SfxItemSet& rSet );
void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet );
diff --git a/sw/source/ui/inc/utlui.hrc b/sw/source/ui/inc/utlui.hrc
index 80970bbfb2..939644c68f 100644
--- a/sw/source/ui/inc/utlui.hrc
+++ b/sw/source/ui/inc/utlui.hrc
@@ -42,7 +42,7 @@
#define STR_HYPERCTRL_SEL (RC_UTLUI_BEGIN + 5)
#define STR_HYPERCTRL_HYP (RC_UTLUI_BEGIN + 6)
-// Namene der Inhaltstypen (RC_UTLUI_BEGIN + 7)
+// names of content types (RC_UTLUI_BEGIN + 7)
#define STR_CONTENT_TYPE_FIRST (RC_UTLUI_BEGIN + 8)
#define STR_CONTENT_TYPE_OUTLINE STR_CONTENT_TYPE_FIRST
#define STR_CONTENT_TYPE_TABLE (RC_UTLUI_BEGIN + 9)
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 57ca1c94b0..6c7828b3ee 100644..100755
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -134,7 +134,7 @@ enum ShellModes
};
/*--------------------------------------------------------------------
- Beschreibung: Anwendung einer Vorlage
+ Description: apply a template
--------------------------------------------------------------------*/
struct SwApplyTemplate
{
@@ -163,11 +163,11 @@ struct SwApplyTemplate
};
/*--------------------------------------------------------------------
- Beschreibung: Sicht auf ein Dokument
+ Description: view of a document
--------------------------------------------------------------------*/
class SW_DLLPUBLIC SwView: public SfxViewShell
{
- //Messehack (MA,MBA)
+ // exhibition hack (MA,MBA)
friend void lcl_SelectShellForDrop( SwView &rView );
friend class TestTemplateItem;
@@ -176,7 +176,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
friend class SwView_Impl;
friend class SwClipboardChangeListener;
- //suchen & ersetzen
+ // search & replace
static SvxSearchDialog *pSrchDlg;
static SvxSearchItem *pSrchItem;
@@ -184,8 +184,8 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
static sal_uInt16 nWebInsertCtrlState;
static sal_uInt16 nInsertObjectCtrlState;
static sal_uInt16 nInsertFieldCtrlState;
- static sal_uInt16 nMoveType; // fuer Buttons unter dem Scrollbar (viewmdi)
- static sal_Int32 nActMark; // aktuelle Sprungmarke fuer unbenannte Merker
+ static sal_uInt16 nMoveType; // for buttons below the scrollbar (viewmdi)
+ static sal_Int32 nActMark; // current jump mark for unknown mark
static sal_Bool bExtra;
static sal_Bool bFound;
@@ -196,37 +196,34 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SvxHtmlOptions aHTMLOpt;
- Timer aTimer; //Fuer verzoegerte ChgLnks waehrend
- //einer Aktion
- String aPageStr; //Statusanzeige, aktuelle Seite
+ Timer aTimer; // for delayed ChgLnks during an action
+ String aPageStr; // status view, current page
String sSwViewData,
//and the new cursor position if the user double click in the PagePreView
sNewCrsrPos;
// to support keyboard the number of the page to go to can be set too
sal_uInt16 nNewPage;
- Point aTabColFromDocPos; //Verschieben von Tabellenspalten aus
- //aus dem Dokument heraus.
+ Point aTabColFromDocPos; // moving table colmns out of the document
SwTxtNode * pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
- Size aDocSz; // aktuelle Dokumentgroesse
- Rectangle aVisArea; // sichtbarer Bereich
+ Size aDocSz; // current document size
+ Rectangle aVisArea; // visible region
SwEditWin *pEditWin;
SwWrtShell *pWrtShell;
- SfxShell *pShell; //aktuelle SubShell auf dem Dispatcher
+ SfxShell *pShell; // current SubShell at the dispatcher
FmFormShell *pFormShell; // DB-FormShell
- SwView_Impl *pViewImpl; // Impl-Daten fuer UNO + Basic
+ SwView_Impl *pViewImpl; // Impl-data for UNO + Basic
- SwScrollbar *pHScrollbar, // MDI Bedienelemente
+ SwScrollbar *pHScrollbar, // MDI control elements
*pVScrollbar;
- Window *pScrollFill; // Dummy-Window zum Fuellen der rechten
- // unteren Ecke, wenn beide Scrollbars
- // aktiv sind
+ Window *pScrollFill; // dummy window for filling the lower right edge
+ // when both scrollbars are active
SvxRuler *pHRuler,
*pVRuler;
@@ -236,7 +233,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
*pPageDownBtn;
SwNaviImageButton *pNaviBtn;
- SwGlossaryHdl *pGlosHdl; // Henkel Textbausteine
+ SwGlossaryHdl *pGlosHdl; // handle text block
SwDrawBase *pDrawActual;
const SwFrmFmt *pLastTableFormat;
@@ -254,7 +251,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
sal_uInt16 nPageCnt;
- // Aktueller Drawmode
+ // current draw mode
sal_uInt16 nDrawSfxId;
String sDrawCustom; //some drawing types are marked with strings!
sal_uInt16 nFormSfxId;
@@ -285,11 +282,11 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
bInMailMerge : 1,
bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
bOldShellWasPagePreView : 1,
- bMakeSelectionVisible : 1 // #b6330459# transport the bookmark selection
- ;
+ bIsPreviewDoubleClick : 1, // #i114045#
+ bMakeSelectionVisible : 1; // transport the bookmark selection
- // Methoden fuers Suchen
- // Suchkontext setzen
+ // methods for searching
+ // set search context
SW_DLLPRIVATE sal_Bool SearchAndWrap(sal_Bool bApi = sal_False);
SW_DLLPRIVATE sal_Bool SearchAll(sal_uInt16* pFound = 0);
SW_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
@@ -299,7 +296,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE sal_Bool IsTextTool() const;
- // Bedienelemente verwalten anlegen
+ // create control elements
SW_DLLPRIVATE void CreateBtns();
SW_DLLPRIVATE DECL_LINK( BtnPage, Button * );
@@ -320,7 +317,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE sal_Bool GetPageScrollUpOffset(SwTwips& rOff) const;
SW_DLLPRIVATE sal_Bool GetPageScrollDownOffset(SwTwips& rOff) const;
- // Scrollbar Movements
+ // scrollbar movements
SW_DLLPRIVATE long PageUp();
SW_DLLPRIVATE long PageDown();
SW_DLLPRIVATE long PageUpCrsr(sal_Bool bSelect);
@@ -337,7 +334,7 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE void CreatePageButtons(sal_Bool bShow);
- // Linguistik-Funktionen
+ // linguistics functions
SW_DLLPRIVATE void HyphenateDocument();
SW_DLLPRIVATE sal_Bool IsDrawTextHyphenate();
SW_DLLPRIVATE void HyphenateDrawText();
@@ -356,16 +353,16 @@ class SW_DLLPUBLIC SwView: public SfxViewShell
SW_DLLPRIVATE void SpellKontext(sal_Bool bOn = sal_True)
{ bCenterCrsr = bOn; bAllwaysShowSel = bOn; }
- // Methoden fuers Printing
+ // methods for printing
SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
SfxTabPage* CreatePrintOptionsPage( Window* pParent,
const SfxItemSet& rSet);
- // fuer Readonly-Umschaltung
+ // for readonly switching
SW_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
SW_DLLPRIVATE void _CheckReadonlyState();
SW_DLLPRIVATE void _CheckReadonlySelection();
- // Methode fuer PageDesc drehen
+ // method for rotating PageDesc
SW_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
SW_DLLPRIVATE void _SetZoom( const Size &rEditSz,
@@ -389,7 +386,7 @@ protected:
int GetSelectionType() const { return nSelectionType; }
void SetSelectionType(int nSet) { nSelectionType = nSet;}
- // fuer die SwWebView
+ // for SwWebView
void SetShell( SfxShell* pS ) { pShell = pS; }
void SetFormShell( FmFormShell* pSh ) { pFormShell = pSh; }
@@ -444,7 +441,7 @@ public:
bool IsValidSelectionForThesaurus() const;
String GetThesaurusLookUpText( bool bSelection ) const;
- // Shell sofort wechseln -> fuer GetSelectionObject
+ // immediately switch shell -> for GetSelectionObject
void StopShellTimer();
inline SwWrtShell& GetWrtShell () const { return *pWrtShell; }
@@ -457,7 +454,7 @@ public:
void ScannerEventHdl( const ::com::sun::star::lang::EventObject& rEventObject );
#endif
- //Handler fuer Textbausteine an die Textshell rausreichen, gfs. anlegen
+ // hand the handler for text blocks to the shell; create if applicable
SwGlossaryHdl* GetGlosHdl();
inline const Rectangle& GetVisArea() const { return aVisArea; }
@@ -509,7 +506,7 @@ public:
sal_Bool HandleWheelCommands( const CommandEvent& );
- // Rahmen einfuegen
+ // insert frames
void InsFrmMode(sal_uInt16 nCols);
void SetZoom( SvxZoomType eZoomType, short nFactor = 100, sal_Bool bViewOnly = sal_False);
@@ -563,7 +560,7 @@ public:
void StateStatusLine(SfxItemSet&);
- // Funktionen fuer Drawing
+ // functions for drawing
void SetDrawFuncPtr(SwDrawBase* pFuncPtr);
inline SwDrawBase* GetDrawFuncPtr(/*sal_Bool bBuf = sal_False*/) const { return pDrawActual; }
void GetDrawState(SfxItemSet &rSet);
@@ -573,7 +570,7 @@ public:
inline sal_Bool IsDrawSelMode() { return bDrawSelMode; }
void SetSelDrawSlot();
inline void FlipDrawSelMode() { bDrawSelMode = !bDrawSelMode; }
- void NoRotate(); // Rotate-Mode abschalten
+ void NoRotate(); // turn off rotate mode
sal_Bool EnterDrawTextMode(const Point& aDocPos);
void LeaveDrawCreate() { nDrawSfxId = nFormSfxId = USHRT_MAX; sDrawCustom.Erase();}
sal_Bool IsDrawMode() { return (nDrawSfxId != USHRT_MAX || nFormSfxId != USHRT_MAX); }
@@ -587,30 +584,30 @@ public:
void StateTabWin(SfxItemSet&);
- // Attribute haben sich geaendert
+ // attributes have changed
DECL_LINK( AttrChangedNotify, SwWrtShell * );
// form control has been activated
DECL_LINK( FormControlActivated, FmFormShell* );
- // Links bearbeiten
+ // edit links
void EditLinkDlg();
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = 0);
void InsertCaption(const InsCaptionOpt *pOpt);
- // Async Aufruf durch Core
+ // Async call by Core
void UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
String GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
- // Shell rausreichen
+ // hand over Shell
SfxShell *GetCurShell() { return pShell; }
SwDocShell *GetDocShell();
inline const SwDocShell *GetDocShell() const;
inline FmFormShell *GetFormShell() { return pFormShell; }
inline const FmFormShell *GetFormShell() const { return pFormShell; }
- //damit in DToren der SubShells ggf. pShell zurueckgesetzt werden kann
+ // so that in the SubShells' DTors pShell can be reset if applicable
void ResetSubShell() { pShell = 0; }
virtual void WriteUserData(String &, sal_Bool bBrowse = sal_False );
diff --git a/sw/source/ui/inc/workctrl.hxx b/sw/source/ui/inc/workctrl.hxx
index b014472cb1..2707794cd4 100644
--- a/sw/source/ui/inc/workctrl.hxx
+++ b/sw/source/ui/inc/workctrl.hxx
@@ -36,8 +36,8 @@
class PopupMenu;
class SwView;
-// doppelter Eintrag! hrc und hxx
-// diese Ids bestimmen, was die Buttons unter dem Scrollbar tun
+// double entry! hrc and hxx
+// these Ids say what the buttons below the scrollbar are doing
#define NID_START 20000
#define NID_NEXT 20000
#define NID_PREV 20001
@@ -186,7 +186,7 @@ class SwNaviImageButton : public ImageButton
};
//----------------------------------------------------------------------------
-// Die ImageButtons muessen sich bei Bedarf den HelpText selbst setzen
+// ImageButtons have to set the HelpText themselves if needed
//----------------------------------------------------------------------------
class SwHlpImageButton : public ImageButton
diff --git a/sw/source/ui/inc/wrap.hxx b/sw/source/ui/inc/wrap.hxx
index 07ec857cb1..689de3c7b6 100644
--- a/sw/source/ui/inc/wrap.hxx
+++ b/sw/source/ui/inc/wrap.hxx
@@ -56,7 +56,7 @@ public:
/*--------------------------------------------------------------------
- Beschreibung: Umlauf-TabPage
+ Description: circulation TabPage
--------------------------------------------------------------------*/
class SwWrapTabPage: public SfxTabPage
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index 8b1cdf5b06..ebed5eedc0 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -70,17 +70,17 @@ namespace com { namespace sun { namespace star { namespace util {
typedef sal_Int32 SelectionType;
namespace nsSelectionType
{
- const SelectionType SEL_TXT = CNT_TXT; // Text, niemals auch Rahmen 0x0001
- const SelectionType SEL_GRF = CNT_GRF; // Grafik 0x0002
- const SelectionType SEL_OLE = CNT_OLE; // OLE 0x0010
- const SelectionType SEL_FRM = 0x000020; // Rahmen, keine Inhaltsform
- const SelectionType SEL_NUM = 0x000040; // NumListe
- const SelectionType SEL_TBL = 0x000080; // Cursor steht in Tabelle
- const SelectionType SEL_TBL_CELLS = 0x000100; // Tabellenzellen sind selektiert
- const SelectionType SEL_DRW = 0x000200; // Zeichenobjekte (Rechteck, Kreis...)
- const SelectionType SEL_DRW_TXT = 0x000400; // Draw-Textobjekte im Editmode
- const SelectionType SEL_BEZ = 0x000800; // Bezierobjekte editieren
- const SelectionType SEL_DRW_FORM = 0x001000; // Zeichenobjekte: DB-Forms
+ const SelectionType SEL_TXT = CNT_TXT; // text, never frames too 0x0001
+ const SelectionType SEL_GRF = CNT_GRF; // graphic 0x0002
+ const SelectionType SEL_OLE = CNT_OLE; // OLE 0x0010
+ const SelectionType SEL_FRM = 0x000020; // frame, no content type
+ const SelectionType SEL_NUM = 0x000040; // NumList
+ const SelectionType SEL_TBL = 0x000080; // cursor is in table
+ const SelectionType SEL_TBL_CELLS = 0x000100; // table cells are selected
+ const SelectionType SEL_DRW = 0x000200; // drawing objects (rectangle, circle...)
+ const SelectionType SEL_DRW_TXT = 0x000400; // draw-textobjects in edit mode
+ const SelectionType SEL_BEZ = 0x000800; // edit ornament objects
+ const SelectionType SEL_DRW_FORM = 0x001000; // drawing objects: DB-Forms
const SelectionType SEL_FOC_FRM_CTRL = 0x002000; // a form control is focused. Neither set nor evaluated by the SwWrtShell itself, only by it's clients.
const SelectionType SEL_MEDIA = 0x004000; // Media object
const SelectionType SEL_EXTRUDED_CUSTOMSHAPE = 0x008000; // extruded custom shape
@@ -115,11 +115,10 @@ public:
SELECTFUNC fnEndDrag;
SELECTFUNC fnKillSel;
- // Alle Selektionen aufheben
+ // reset all selections
long ResetSelect( const Point *, sal_Bool );
- //setzt den Cursorstack nach dem Bewegen mit PageUp/-Down
- //zurueck, falls ein Stack aufgebaut ist
+ // resets the cursorstack after movement with PageUp/-Down if a stack is built up
inline void ResetCursorStack();
SelectionType GetSelectionType() const;
@@ -131,7 +130,7 @@ public:
void EndSelect();
sal_Bool IsInSelect() const { return bInSelect; }
void SetInSelect(sal_Bool bSel = sal_True) { bInSelect = bSel; }
- // Liegt eine Text- oder Rahmenselektion vor?
+ // is there a text- or frameselection?
sal_Bool HasSelection() const { return SwCrsrShell::HasSelection() ||
IsMultiSelection() || IsSelFrmMode() || IsObjSelected(); }
sal_Bool Pop( sal_Bool bOldCrsr = sal_True );
@@ -162,40 +161,38 @@ public:
void EnterSelFrmMode(const Point *pStartDrag = 0);
void LeaveSelFrmMode();
sal_Bool IsSelFrmMode() const { return bLayoutMode; }
- // Selektion von Rahmen aufheben
+ // reset selection of frames
void UnSelectFrm();
void Invalidate();
- // Tabellenzellen selektieren fuer Bearbeiten von Formeln in der Ribbonbar
+ // select table cells for editing of formulas in the ribbonbar
inline void SelTblCells( const Link &rLink, sal_Bool bMark = sal_True );
inline void EndSelTblCells();
- //Wortweisen oder zeilenweisen Selektionsmodus verlassen. Wird
- //in der Regel in MB-Up gerufen.
+ // leave per word or per line selection mode. Is usually called in MB-Up.
sal_Bool IsExtSel() const { return bSelWrd || bSelLn; }
- // erfrage, ob der akt. fnDrag - Pointer auf BeginDrag gesetzt ist
- // Wird fuer MouseMove gebraucht, um die Bugs 55592/55931 zu umgehen.
+ // query whether the active fnDrag pointer is set to BeginDrag
+ // is needed for MouseMove to work around bugs 55592/55931
inline sal_Bool Is_FnDragEQBeginDrag() const;
- //Basisabfragen
+ // base requests
sal_Bool IsInWrd() { return IsInWord(); }
sal_Bool IsSttWrd() { return IsStartWord(); }
sal_Bool IsEndWrd();
sal_Bool IsSttOfPara() const { return IsSttPara(); }
sal_Bool IsEndOfPara() const { return IsEndPara(); }
- //Word bzw. Satz selektieren.
+ // select word / sentense
sal_Bool SelNearestWrd();
sal_Bool SelWrd (const Point * = 0, sal_Bool bProp=sal_False );
- // --> FME 2004-07-30 #i32329# Enhanced selection
+ // #i32329# Enhanced selection
void SelSentence (const Point * = 0, sal_Bool bProp=sal_False );
void SelPara (const Point * = 0, sal_Bool bProp=sal_False );
- // <--
long SelAll();
- //Basiscursortravelling
+ // basecursortravelling
typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
sal_Bool SimpleMove( FNSimpleMove, sal_Bool bSelect );
@@ -233,16 +230,15 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
sal_Bool BwdSentence( sal_Bool bSelect = sal_False )
{ return SimpleMove( &SwWrtShell::_BwdSentence, bSelect ); }
- // --> FME 2004-07-30 #i20126# Enhanced table selection
+ // #i20126# Enhanced table selection
sal_Bool SelectTableRowCol( const Point& rPt, const Point* pEnd = 0, bool bRowDrag = false );
- // <--
sal_Bool SelectTableRow();
sal_Bool SelectTableCol();
sal_Bool SelectTableCell();
sal_Bool SelectTxtAttr( sal_uInt16 nWhich, const SwTxtAttr* pAttr = 0 );
- // Spaltenweise Spruenge
+ // per column jumps
sal_Bool StartOfColumn ( sal_Bool bSelect = sal_False );
sal_Bool EndOfColumn ( sal_Bool bSelect = sal_False );
sal_Bool StartOfNextColumn ( sal_Bool bSelect = sal_False );
@@ -250,18 +246,18 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
sal_Bool StartOfPrevColumn ( sal_Bool bSelect = sal_False );
sal_Bool EndOfPrevColumn ( sal_Bool bSelect = sal_False );
- // setze den Cursor auf die Seite "nPage" an den Anfang
- // zusaetzlich zu der gleichnamigen Implementierung in crsrsh.hxx
- // werden hier alle bestehenden Selektionen vor dem Setzen des
- // Cursors aufgehoben
+ // set the cursor to page "nPage" at the beginning
+ // additionally to a identically named implementation in crsrsh.hxx
+ // here all existing selections are being reset before setting the
+ // cursor
sal_Bool GotoPage( sal_uInt16 nPage, sal_Bool bRecord );
- //setzen des Cursors; merken der alten Position fuer Zurueckblaettern.
+ // setting the cursor; remember the old position for turning back
DECL_LINK( ExecFlyMac, void * );
sal_Bool PageCrsr(SwTwips lOffset, sal_Bool bSelect);
- // Felder Update
+ // update fields
void UpdateInputFlds( SwInputFieldList* pLst = 0, sal_Bool bOnlyInSel = sal_False );
void NoEdit(sal_Bool bHideCrsr = sal_True);
@@ -274,14 +270,13 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
// change current data base and notify
void ChgDBData(const SwDBData& SwDBData);
- // Loeschen
+ // delete
long DelToEndOfLine();
long DelToStartOfLine();
long DelLine();
long DelLeft();
- // loescht auch Rahmen bzw. setzt den Cursor in den Rahmen,
- // wenn bDelFrm == sal_False ist
+ // also deletes the frame or sets the cursor in the frame when bDelFrm == sal_False
long DelRight();
long DelToEndOfPara();
long DelToStartOfPara();
@@ -290,10 +285,10 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
long DelNxtWord();
long DelPrvWord();
- // Prueft, ob eine Wortselektion vorliegt.
- // Gemaess den Regeln fuer intelligentes Cut / Paste
- // werden umgebende Spaces rausgeschnitten.
- // Liefert Art der Wortselektion zurueck (siehe enum)
+ // checks whether a word selection exists.
+ // According to the rules for intelligent Cut / Paste
+ // surrounding spaces are cut out.
+ // returns type of word selection (see enum)
enum word {
NO_WORD = 0,
WORD_SPACE_BEFORE = 1,
@@ -302,10 +297,10 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
};
int IntelligentCut(int nSelectionType, sal_Bool bCut = sal_True);
- // Editieren
+ // edit
void Insert(SwField &);
void Insert(const String &);
- // Graphic
+ // graphic
void Insert( const String &rPath, const String &rFilter,
const Graphic &, SwFlyFrmAttrMgr * = 0,
sal_Bool bRule = sal_False );
@@ -318,11 +313,11 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
void SplitNode( sal_Bool bAutoFormat = sal_False, sal_Bool bCheckTableStart = sal_True );
sal_Bool CanInsert();
- // Verzeichnisse
+ // indexes
void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0);
sal_Bool UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0);
- // Numerierung und Bullets
+ // numbering and bullets
/**
Turns on numbering or bullets.
@@ -335,14 +330,14 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
void BulletOn();
//OLE
- void InsertObject( /*SvInPlaceObjectRef *pObj, */ // != 0 fuer Clipboard
+ void InsertObject( /*SvInPlaceObjectRef *pObj, */ // != 0 for clipboard
const svt::EmbeddedObjectRef&,
- SvGlobalName *pName = 0, // != 0 entspr. Object erzeugen.
+ SvGlobalName *pName = 0, // != 0 create object accordingly
sal_Bool bActivate = sal_True,
- sal_uInt16 nSlotId = 0); // SlotId fuer Dialog
+ sal_uInt16 nSlotId = 0); // SlotId for dialog
sal_Bool InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrmFmt **pFlyFrmFmt = 0 );
- void LaunchOLEObj( long nVerb = 0 ); // Server starten
+ void LaunchOLEObj( long nVerb = 0 ); // start server
sal_Bool IsOLEObj() const { return GetCntType() == CNT_OLE;}
virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset );
virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
@@ -352,12 +347,12 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
virtual void ConnectObj( svt::EmbeddedObjectRef& xIPObj, const SwRect &rPrt,
const SwRect &rFrm );
- // Vorlagen und Formate
+ // styles and formats
- // enum gibt an, was geschehen soll, wenn das Style nicht gefunden wurde
- enum GetStyle { GETSTYLE_NOCREATE, // keins anlegen
- GETSTYLE_CREATESOME, // falls auf PoolId mapt anlegen
- GETSTYLE_CREATEANY }; // ggfs Standard returnen
+ // enum tells when should happen when the style was not found
+ enum GetStyle { GETSTYLE_NOCREATE, // create none
+ GETSTYLE_CREATESOME, // if on PoolId create mapt
+ GETSTYLE_CREATEANY }; // return standard if applicable
SwTxtFmtColl* GetParaStyle(const String &rCollName,
GetStyle eCreate = GETSTYLE_NOCREATE);
@@ -369,7 +364,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
String GetCurPageStyle( const sal_Bool bCalcFrm = sal_True ) const;
- // Aktuelle Vorlage anhand der geltenden Attribute aendern
+ // change current style using the attributes in effect
void QuickUpdateStyle();
enum DoType { UNDO, REDO, REPEAT };
@@ -379,7 +374,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
String GetRepeatString() const;
sal_uInt16 GetDoStrings( DoType eDoType, SfxStringListItem& rStrLstItem ) const;
- //Suchen oder Ersetzen
+ // search and replace
sal_uLong SearchPattern(const com::sun::star::util::SearchOptions& rSearchOpt,
sal_Bool bSearchInNotes,
SwDocPositions eStart, SwDocPositions eEnde,
@@ -400,23 +395,23 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
void AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar = ' ' );
- // Aktion vor Cursorbewegung
- // Hebt gfs. Selektionen auf, triggert Timer und GCAttr()
+ // action ahead of cursor movement
+ // resets selection if applicable, triggers timer and GCAttr()
void MoveCrsr( sal_Bool bWithSelect = sal_False );
- // Eingabefelder updaten
+ // update input fields
sal_Bool StartInputFldDlg(SwField*, sal_Bool bNextButton, Window* pParentWin = 0, ByteString* pWindowState = 0);
// update DropDown fields
sal_Bool StartDropDownFldDlg(SwField*, sal_Bool bNextButton, ByteString* pWindowState = 0);
- //"Handler" fuer Anederungen an der DrawView - fuer Controls.
+ //"Handler" for changes at DrawView - for controls.
virtual void DrawSelChanged( );
- // springe zum Bookmark und setze die "Selections-Flags" wieder richtig
+ // jump to bookmark and set the "selctions-flags" correctly again
sal_Bool GotoMark( const ::sw::mark::IMark* const pMark );
sal_Bool GotoMark( const ::sw::mark::IMark* const pMark, sal_Bool bSelect, sal_Bool bStart );
sal_Bool GotoMark( const ::rtl::OUString& rName );
- sal_Bool GoNextBookmark(); // sal_True, wenn's noch eine gab
+ sal_Bool GoNextBookmark(); // sal_True when there still was one
sal_Bool GoPrevBookmark();
bool GotoFieldmark(::sw::mark::IFieldmark const * const pMark);
@@ -427,46 +422,44 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
// on graphics
sal_Bool SelectNextPrevHyperlink( sal_Bool bNext = sal_True );
- // Zugehoerige SwView ermitteln
+ // determine corresponding SwView
const SwView& GetView() const { return rView; }
SwView& GetView() { return rView; }
- //Weil es sonst keiner macht, gibt es hier eine ExecMacro()
+ // Because nobody else is doing it, here is a ExecMacro()
void ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 );
- // rufe ins dunkle Basic/JavaScript
+ // call into the dark Basic/JavaScript
sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent,
sal_Bool bCheckPtr = sal_False, SbxArray* pArgs = 0,
const Link* pCallBack = 0 );
- // ein Klick aus das angegebene Feld. Der Cursor steht auf diesem.
- // Fuehre die vor definierten Aktionen aus.
+ // a click at the given field. the cursor is on it.
+ // execute the predefined actions.
void ClickToField( const SwField& rFld );
void ClickToINetAttr( const SwFmtINetFmt& rItem, sal_uInt16 nFilter = URLLOAD_NOFILTER );
sal_Bool ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter = URLLOAD_NOFILTER );
inline sal_Bool IsInClickToEdit() const ;
- // fall ein URL-Button selektiert ist, dessen URL returnen, ansonsten
- // einen LeerString
+ // if a URL-Button is selected, return its URL; otherwise an empty string
sal_Bool GetURLFromButton( String& rURL, String& rDescr ) const;
void NavigatorPaste( const NaviContentBookmark& rBkmk,
const sal_uInt16 nAction );
- // die Core erzeugt eine Selektion, das SttSelect muss gerufen werden
+ // Core creates a selection, SttSelect has to be called
virtual void NewCoreSelection();
virtual void ApplyViewOptions( const SwViewOption &rOpt );
- // autom. Update von Vorlagen
+ // automatic update of styles
void AutoUpdateFrame(SwFrmFmt* pFmt, const SfxItemSet& rStyleSet);
void AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet);
- // Link fuers einfuegen von Bereichen uebers Drag&Drop/Clipboard
+ // link for inserting ranges via Drag&Drop/Clipboard
DECL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData* );
- //ctoren, der erstere ist eine Art kontrollierter copy ctor fuer weitere
- //Sichten auf ein Dokument
+ // ctor, the first one is a kind of a controlled copy ctor for more views of a document
SwWrtShell( SwWrtShell&, Window *pWin, SwView &rShell);
SwWrtShell( SwDoc& rDoc, Window *pWin, SwView &rShell,
const SwViewOption *pViewOpt = 0);
@@ -516,7 +509,7 @@ private:
{}
} *pModeStack;
- // Cursor bei PageUp / -Down mitnehmen
+ // carry cursor along when PageUp / -Down
enum PageMove
{
MV_NO,
@@ -555,21 +548,20 @@ private:
SW_DLLPRIVATE sal_Bool PushCrsr(SwTwips lOffset, sal_Bool bSelect);
SW_DLLPRIVATE sal_Bool PopCrsr(sal_Bool bUpdate, sal_Bool bSelect = sal_False);
- // ENDE Cursor bei PageUp / -Down mitnehmen
+ // take END cursor along when PageUp / -Down
SW_DLLPRIVATE sal_Bool _SttWrd();
SW_DLLPRIVATE sal_Bool _EndWrd();
SW_DLLPRIVATE sal_Bool _NxtWrd();
SW_DLLPRIVATE sal_Bool _PrvWrd();
- // --> OD 2008-08-06 #i92468#
+ // #i92468#
SW_DLLPRIVATE sal_Bool _NxtWrdForDelete();
SW_DLLPRIVATE sal_Bool _PrvWrdForDelete();
- // <--
SW_DLLPRIVATE sal_Bool _FwdSentence();
SW_DLLPRIVATE sal_Bool _BwdSentence();
sal_Bool _FwdPara();
SW_DLLPRIVATE sal_Bool _BwdPara();
- // Selektionen
+ // selections
sal_Bool bIns :1;
sal_Bool bInSelect :1;
sal_Bool bExtMode :1;
@@ -581,7 +573,7 @@ private:
sal_Bool bSelWrd :1;
sal_Bool bSelLn :1;
sal_Bool bIsInClickToEdit:1;
- sal_Bool bClearMark :1; // Selektion fuer ChartAutoPilot nicht loeschen
+ sal_Bool bClearMark :1; // don't delete selection for ChartAutoPilot
sal_Bool mbRetainSelection :1; // Do not remove selections
Point aStart;
@@ -589,7 +581,7 @@ private:
SELECTFUNC fnLeaveSelect;
- //setzt den Cursorstack nach dem Bewegen mit PageUp/-Down zurueck.
+ // resets the cursor stack after movement by PageUp/-Down
SW_DLLPRIVATE void _ResetCursorStack();
SW_DLLPRIVATE void SttDragDrop(Timer *);
@@ -607,13 +599,12 @@ private:
SW_DLLPRIVATE long ExtSelWrd(const Point *, sal_Bool bProp=sal_False );
SW_DLLPRIVATE long ExtSelLn(const Point *, sal_Bool bProp=sal_False );
- //Verschieben von Text aus Drag and Drop; Point ist
- //Destination fuer alle Selektionen.
+ // move text from Drag and Drop; Point is destination for all selections.
SW_DLLPRIVATE long MoveText(const Point *, sal_Bool bProp=sal_False );
SW_DLLPRIVATE long BeginFrmDrag(const Point *, sal_Bool bProp=sal_False );
- //nach SSize/Move eines Frames Update; Point ist Destination.
+ // after SSize/Move of a frame update; Point is destination.
SW_DLLPRIVATE long UpdateLayoutFrm(const Point *, sal_Bool bProp=sal_False );
SW_DLLPRIVATE long SttLeaveSelect(const Point *, sal_Bool bProp=sal_False );
diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx
index 21e60a0b47..a7e7e4d932 100644
--- a/sw/source/ui/index/cntex.cxx
+++ b/sw/source/ui/index/cntex.cxx
@@ -353,7 +353,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample(
case TOKEN_ENTRY_NO :
sTokenType.AssignAscii(RTL_CONSTASCII_STRINGPARAM(
"TokenEntryNumber"));
- // fuer Inhaltsverzeichnis Numerierung
+ // numbering for content index
break;
case TOKEN_ENTRY_TEXT :
case TOKEN_ENTRY :
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index ae7dfadea1..16042cf5d1 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -100,8 +100,8 @@ using ::rtl::OUString;
using namespace ::sfx2;
#include <svtools/editbrowsebox.hxx>
-static const sal_Unicode aDeliStart = '['; //fuer die form
-static const sal_Unicode aDeliEnd = ']'; //fuer die form
+static const sal_Unicode aDeliStart = '['; // for the form
+static const sal_Unicode aDeliEnd = ']'; // for the form
#define POS_GRF 0
#define POS_OLE 1
@@ -1762,7 +1762,6 @@ public:
break;
}
}
-//<---
sal_uInt16 GetChapterInfo() const{ return aFormToken.nChapterFormat;}
void SetOutlineLevel( sal_uInt16 nSet ) { aFormToken.nOutlineLevel = nSet;}//i53420
@@ -2588,7 +2587,6 @@ IMPL_LINK(SwTOXEntryTabPage, TokenSelectedHdl, SwFormToken*, pToken)
aChapterEntryLB.SelectEntryPos(2);
break;
}
-//<---
//i53420
aEntryOutlineLevelNF.SetValue(pToken->nOutlineLevel);
@@ -3753,13 +3751,13 @@ void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& )
aParaLayLB.Clear();
aLevelLB.Clear();
- // kein Hyperlink fuer Benutzerverzeichnisse
+ // not hyperlink for user directories
sal_uInt16 i, nSize = m_pCurrentForm->GetFormMax();
- // form-Pattern anzeigen ohne Titel
+ // display form pattern without title
- //1. TemplateEntry anzeigen
+ // display 1st TemplateEntry
String aStr( SW_RES( STR_TITLE ));
if( m_pCurrentForm->GetTemplate( 0 ).Len() )
{
@@ -3793,7 +3791,7 @@ void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& )
aLevelLB.InsertEntry( aCpy );
}
- // Templates initialisieren
+ // initialise templates
const SwTxtFmtColl *pColl;
SwWrtShell& rSh = ((SwMultiTOXTabDialog*)GetTabDialog())->GetWrtShell();
const sal_uInt16 nSz = rSh.GetTxtFmtCollCount();
@@ -3802,7 +3800,7 @@ void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& )
if( !(pColl = &rSh.GetTxtFmtColl( i ))->IsDefault() )
aParaLayLB.InsertEntry( pColl->GetName() );
- // Pool-Collections abfragen und fuer das Verzeichnis setzen
+ // query pool collections and set them for the directory
for( i = 0; i < m_pCurrentForm->GetFormMax(); ++i )
{
aStr = m_pCurrentForm->GetTemplate( i );
@@ -3843,7 +3841,7 @@ IMPL_LINK( SwTOXStylesTabPage, EditStyleHdl, Button *, pBtn )
return 0;
}
/*--------------------------------------------------------------------
- Beschreibung: Vorlagen zuweisen
+ Description: allocate templates
--------------------------------------------------------------------*/
IMPL_LINK( SwTOXStylesTabPage, AssignHdl, Button *, EMPTYARG )
{
@@ -3902,7 +3900,7 @@ IMPL_LINK_INLINE_START( SwTOXStylesTabPage, DoubleClickHdl, Button *, EMPTYARG )
IMPL_LINK_INLINE_END( SwTOXStylesTabPage, DoubleClickHdl, Button *, EMPTYARG )
/*--------------------------------------------------------------------
- Beschreibung: nur wenn selektiert enable
+ Description: enable only when selected
--------------------------------------------------------------------*/
IMPL_LINK( SwTOXStylesTabPage, EnableSelectHdl, ListBox *, EMPTYARG )
{
@@ -3968,9 +3966,9 @@ SwEntryBrowseBox::SwEntryBrowseBox(Window* pParent, const ResId& rId,
xCheckController = new ::svt::CheckBoxCellController(&aCellCheckBox);
//////////////////////////////////////////////////////////////////////
- // HACK: BrowseBox invalidiert nicht ihre Childs, wie es eigentlich sein sollte.
- // Deshalb wird WB_CLIPCHILDREN zurueckgesetzt, wodurch das Invalidieren
- // der Childs erzwungen wird.
+ // HACK: BrowseBox doesn't invalidate its childs, how it should be.
+ // That's why WB_CLIPCHILDREN is reset in order to enforce the
+ // childs' invalidation
WinBits aStyle = GetStyle();
if( aStyle & WB_CLIPCHILDREN )
{
diff --git a/sw/source/ui/index/idxmrk.cxx b/sw/source/ui/index/idxmrk.cxx
index 66a407d1d8..b756918bde 100644
--- a/sw/source/ui/index/idxmrk.cxx
+++ b/sw/source/ui/index/idxmrk.cxx
@@ -55,7 +55,7 @@
#include <wrtsh.hxx>
#include <view.hxx>
#include <multmrk.hxx>
-#include <swundo.hxx> // fuer Undo-Ids
+#include <swundo.hxx> // for Undo-Ids
#include <cmdid.h>
#include <index.hrc>
#include <idxmrk.hrc>
diff --git a/sw/source/ui/index/idxmrk.src b/sw/source/ui/index/idxmrk.src
index 2eaeb63e67..81b7651943 100644
--- a/sw/source/ui/index/idxmrk.src
+++ b/sw/source/ui/index/idxmrk.src
@@ -287,6 +287,14 @@ ModalDialog DLG_EDIT_IDXMARK
#define COL_BUTTONS_2 (COL_BUTTONS+26)
#define WINDOW_HEIGHT 118
IDX_DIALOG_WINDOW
+ #undef IDX_WIN_WIDTH
+ #undef GB_HEIGHT
+ #undef DCB_INDEX_WIDTH
+ #undef PHONETIC_HIDDEN
+ #undef LIST_WIDTH
+ #undef COL_BUTTONS
+ #undef COL_BUTTONS_2
+ #undef WINDOW_HEIGHT
};
ModalDialog DLG_EDIT_IDXMARK_CJK
{
@@ -306,6 +314,14 @@ ModalDialog DLG_EDIT_IDXMARK_CJK
#define COL_BUTTONS_2 (COL_BUTTONS+26)
#define WINDOW_HEIGHT 118
IDX_DIALOG_WINDOW
+ #undef IDX_WIN_WIDTH
+ #undef GB_HEIGHT
+ #undef DCB_INDEX_WIDTH
+ #undef PHONETIC_HIDDEN
+ #undef LIST_WIDTH
+ #undef COL_BUTTONS
+ #undef COL_BUTTONS_2
+ #undef WINDOW_HEIGHT
};
ModelessDialog DLG_INSIDXMARK
{
@@ -328,6 +344,14 @@ ModelessDialog DLG_INSIDXMARK
#define COL_BUTTONS_2 (COL_BUTTONS+26)
#define WINDOW_HEIGHT 138
IDX_DIALOG_WINDOW
+ #undef IDX_WIN_WIDTH
+ #undef GB_HEIGHT
+ #undef DCB_INDEX_WIDTH
+ #undef PHONETIC_HIDDEN
+ #undef LIST_WIDTH
+ #undef COL_BUTTONS
+ #undef COL_BUTTONS_2
+ #undef WINDOW_HEIGHT
};
ModelessDialog DLG_INSIDXMARK_CJK
{
@@ -349,6 +373,14 @@ ModelessDialog DLG_INSIDXMARK_CJK
#define COL_BUTTONS_2 (COL_BUTTONS+26)
#define WINDOW_HEIGHT 138
IDX_DIALOG_WINDOW
+ #undef IDX_WIN_WIDTH
+ #undef GB_HEIGHT
+ #undef DCB_INDEX_WIDTH
+ #undef PHONETIC_HIDDEN
+ #undef LIST_WIDTH
+ #undef COL_BUTTONS
+ #undef COL_BUTTONS_2
+ #undef WINDOW_HEIGHT
};
ModalDialog DLG_NEW_USER_IDX
{
@@ -528,6 +560,7 @@ ModalDialog DLG_EDIT_AUTHMARK
Size = MAP_APPFONT ( 218 , 118 ) ;
#define RADIO_BUTTON_HEIGHT 0
AUTH_DIALOG_WINDOW
+ #undef RADIO_BUTTON_HEIGHT
};
ModelessDialog DLG_INSAUTHMARK
{
@@ -542,6 +575,7 @@ ModelessDialog DLG_INSAUTHMARK
Size = MAP_APPFONT ( 218 , 118 + RADIO_BUTTON_HEIGHT) ;
// Moveable = TRUE ;
AUTH_DIALOG_WINDOW
+ #undef RADIO_BUTTON_HEIGHT
};
ModalDialog DLG_CREATE_AUTH_ENTRY
{
diff --git a/sw/source/ui/index/multmrk.cxx b/sw/source/ui/index/multmrk.cxx
index d314fdb410..a979c1d075 100644
--- a/sw/source/ui/index/multmrk.cxx
+++ b/sw/source/ui/index/multmrk.cxx
@@ -89,7 +89,7 @@ void SwMultiTOXMarkDlg::Apply()
}
/*--------------------------------------------------
- dtor ueberladen
+ overload dtor
--------------------------------------------------*/
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index d80617053e..de17942afd 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -59,7 +59,7 @@
#include <wrtsh.hxx>
#include <view.hxx>
#include <multmrk.hxx>
-#include <swundo.hxx> // fuer Undo-Ids
+#include <swundo.hxx> // for Undo-Ids
#include <cmdid.h>
#include <index.hrc>
#include <idxmrk.hrc>
@@ -95,7 +95,7 @@ using namespace ::comphelper;
using namespace ::com::sun::star;
/*--------------------------------------------------------------------
- Beschreibung: Dialog zum Einfuegen einer Verzeichnismarkierung
+ Description: dialog to insert a directory selection
--------------------------------------------------------------------*/
SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
sal_Bool bNewDlg,
@@ -227,13 +227,12 @@ SwIndexMarkDlg::SwIndexMarkDlg(Window *pParent,
}
/*--------------------------------------------------------------------
- Beschreibung: Controls neu initialisieren mit der aktuellen
- Markierung
+ Description: Newly initialise controls with the new selection
--------------------------------------------------------------------*/
void SwIndexMarkDlg::InitControls()
{
OSL_ENSURE(pSh && pTOXMgr, "no shell?");
- // Inhalts-Verzeichnis
+ // contents index
const SwTOXType* pType = pTOXMgr->GetTOXType(TOX_CONTENT, 0);
OSL_ENSURE(pType, "Kein Verzeichnistyp !!");
String sTmpTypeSelection;
@@ -242,38 +241,38 @@ void SwIndexMarkDlg::InitControls()
aTypeDCB.Clear();
aTypeDCB.InsertEntry(pType->GetTypeName());
- // Stichwort-Verzeichnis
+ // keyword index
pType = pTOXMgr->GetTOXType(TOX_INDEX, 0);
OSL_ENSURE(pType, "Kein Verzeichnistyp !!");
aTypeDCB.InsertEntry(pType->GetTypeName());
- // Benutzerverzeichnisse
+ // user index
sal_uInt16 nCount = pSh->GetTOXTypeCount(TOX_USER);
sal_uInt16 i;
for( i = 0; i < nCount; ++i )
aTypeDCB.InsertEntry( pSh->GetTOXType(TOX_USER, i)->GetTypeName() );
- // KeyWords Primary einlesen
+ // read keywords primary
SvStringsSort aArr;
nCount = pSh->GetTOIKeys( TOI_PRIMARY, aArr );
for(i=0; i < nCount; ++i)
aKeyDCB.InsertEntry( *aArr[ i ] );
- // KeyWords Secondary einlesen
+ // read keywords secondary
nCount = pSh->GetTOIKeys( TOI_SECONDARY, aArr );
for(i=0; i < nCount; ++i)
aKey2DCB.InsertEntry( *aArr[ i ] );
UpdateLanguageDependenciesForPhoneticReading();
- // Aktueller Eintrag
+ // current entry
const SwTOXMark* pMark = pTOXMgr->GetCurTOXMark();
if( pMark && !bNewMark)
{
// Controls-Handling
- // nur wenn mehr als eins vorhanden
- // wenn gleich landet es auf dem gleichen Eintrag
+ // onyl if there are more than one
+ // if equal it lands at the same entry
pSh->SttCrsrMove();
const SwTOXMark* pMoveMark;
@@ -317,7 +316,7 @@ void SwIndexMarkDlg::InitControls()
UpdateDialog();
}
else
- { // aktuelle Selektion (1.Element) anzeigen ????
+ { // display current selection (first element) ????
sal_uInt16 nCnt = pSh->GetCrsrCnt();
if (nCnt < 2)
{
@@ -325,8 +324,8 @@ void SwIndexMarkDlg::InitControls()
aOrgStr = pSh->GetView().GetSelectionTextParam(sal_True, sal_False);
aEntryED.SetText(aOrgStr);
- //alle gleichen Eintraege aufzunehmen darf nur im Body und auch da nur
- //bei vorhandener einfacher Selektion erlaubt werden
+ //to include all equal entries may only be allowed in the body and even there
+ //only when a simple selection exists
const sal_uInt16 nFrmType = pSh->GetFrmType(0,sal_True);
aApplyToAllCB.Show();
aSearchCaseSensitiveCB.Show();
@@ -336,7 +335,7 @@ void SwIndexMarkDlg::InitControls()
SearchTypeHdl(&aApplyToAllCB);
}
- // Verzeichnistyp ist default
+ // index type is default
if( sTmpTypeSelection.Len() &&
LISTBOX_ENTRY_NOTFOUND != aTypeDCB.GetEntryPos( sTmpTypeSelection ) )
aTypeDCB.SelectEntry(sTmpTypeSelection);
@@ -408,7 +407,7 @@ String SwIndexMarkDlg::GetDefaultPhoneticReading( const String& rText )
--------------------------------------------------*/
void SwIndexMarkDlg::Activate()
{
- // aktuelle Selektion (1.Element) anzeigen ????
+ // display current selection (first element) ????
if(bNewMark)
{
sal_uInt16 nCnt = pSh->GetCrsrCnt();
@@ -418,8 +417,8 @@ void SwIndexMarkDlg::Activate()
aOrgStr = pSh->GetView().GetSelectionTextParam(sal_True, sal_False);
aEntryED.SetText(aOrgStr);
- //alle gleichen Eintraege aufzunehmen darf nur im Body und auch da nur
- //bei vorhandener einfacher Selektion erlaubt werden
+ //to include all equal entries may only be allowed in the body and even there
+ //only when a simple selection exists
const sal_uInt16 nFrmType = pSh->GetFrmType(0,sal_True);
aApplyToAllCB.Show();
aSearchCaseSensitiveCB.Show();
@@ -433,7 +432,7 @@ void SwIndexMarkDlg::Activate()
}
/*--------------------------------------------------------------------
- Beschreibung: Ok-Button auswerten
+ Description: evaluate Ok-Button
--------------------------------------------------------------------*/
void SwIndexMarkDlg::Apply()
{
@@ -443,7 +442,7 @@ void SwIndexMarkDlg::Apply()
}
/*--------------------------------------------------------------------
- Beschreibung: Aenderungen uebernehmen
+ Description: apply changes
--------------------------------------------------------------------*/
void SwIndexMarkDlg::InsertUpdate()
{
@@ -482,7 +481,7 @@ void SwIndexMarkDlg::InsertUpdate()
}
/*--------------------------------------------------------------------
- Beschreibung: Marke einfuegen
+ Description: insert mark
--------------------------------------------------------------------*/
static void lcl_SelectSameStrings(SwWrtShell& rSh, sal_Bool bWordOnly, sal_Bool bCaseSensitive)
{
@@ -520,7 +519,7 @@ void SwIndexMarkDlg::InsertMark()
switch(nPos)
{
case POS_CONTENT : break;
- case POS_INDEX: // Stichwortverzeichnismarke
+ case POS_INDEX: // keyword index mark
{
UpdateKeyBoxes();
String aPrim(aKeyDCB.GetText());
@@ -533,7 +532,7 @@ void SwIndexMarkDlg::InsertMark()
aDesc.SetPhoneticReadingOfSecKey(aPhoneticED2.GetText());
}
break;
- default: // Userdefinedverz.-Marke
+ default: // Userdefined index mark
{
String aName(aTypeDCB.GetSelectEntry());
aDesc.SetTOUName(aName);
@@ -546,8 +545,8 @@ void SwIndexMarkDlg::InsertMark()
sal_Bool bCaseSensitive = aSearchCaseSensitiveCB.IsChecked();
pSh->StartAllAction();
- // hier muessen alle gleichen Strings selektiert werden
- // damit der Eintrag auf alle gleichen Strings angewandt wird
+ // all equal strings have to be selected here so that the
+ // entry is apllied to all equal strings
if(bApplyAll)
{
lcl_SelectSameStrings(*pSh, bWordOnly, bCaseSensitive);
@@ -562,7 +561,7 @@ void SwIndexMarkDlg::InsertMark()
}
/*--------------------------------------------------------------------
- Beschreibung: Marke Updaten
+ Description: update mark
--------------------------------------------------------------------*/
void SwIndexMarkDlg::UpdateMark()
{
@@ -604,7 +603,7 @@ void SwIndexMarkDlg::UpdateMark()
}
/*--------------------------------------------------------------------
- Beschreibung: Neue Keys eintragen
+ Description: insert new keys
--------------------------------------------------------------------*/
void SwIndexMarkDlg::UpdateKeyBoxes()
{
@@ -612,7 +611,7 @@ void SwIndexMarkDlg::UpdateKeyBoxes()
sal_uInt16 nPos = aKeyDCB.GetEntryPos(aKey);
if(nPos == LISTBOX_ENTRY_NOTFOUND && aKey.Len() > 0)
- { // neuen Key erzeugen
+ { // create new key
aKeyDCB.InsertEntry(aKey);
}
@@ -620,7 +619,7 @@ void SwIndexMarkDlg::UpdateKeyBoxes()
nPos = aKey2DCB.GetEntryPos(aKey);
if(nPos == LISTBOX_ENTRY_NOTFOUND && aKey.Len() > 0)
- { // neuen Key erzeugen
+ { // create new key
aKey2DCB.InsertEntry(aKey);
}
}
@@ -714,13 +713,13 @@ IMPL_LINK( SwIndexMarkDlg, CloseHdl, Button *, EMPTYARG )
}
/*--------------------------------------------------------------------
- Beschreibung: VerzeichnisTyp auswaehlen nur bei Einfuegen
+ Description: select index type only when inserting
--------------------------------------------------------------------*/
IMPL_LINK( SwIndexMarkDlg, ModifyHdl, ListBox *, pBox )
{
if(&aTypeDCB == pBox)
{
- // Verzeichnistyp setzen
+ // set index type
sal_uInt16 nPos = aTypeDCB.GetEntryPos(aTypeDCB.GetSelectEntry());
sal_Bool bLevelEnable = sal_False,
bKeyEnable = sal_False,
@@ -845,7 +844,7 @@ IMPL_LINK( SwIndexMarkDlg, DelHdl, Button *, EMPTYARG )
}
/*--------------------------------------------------------------------
- Beschreibung: Dialoganzeige erneuern
+ Description: renew dialog view
--------------------------------------------------------------------*/
void SwIndexMarkDlg::UpdateDialog()
{
@@ -860,7 +859,7 @@ void SwIndexMarkDlg::UpdateDialog()
aOrgStr = pMark->GetText();
aEntryED.SetText(aOrgStr);
- // Verzeichnistyp setzen
+ // set index type
sal_Bool bLevelEnable = sal_True,
bKeyEnable = sal_False,
bKey2Enable = sal_False,
@@ -904,10 +903,10 @@ void SwIndexMarkDlg::UpdateDialog()
aPhoneticFT2.Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled);
aPhoneticED2.Enable(bKeyEnable&&bKey2HasText&&bIsPhoneticReadingEnabled);
- // Verzeichnis-Typ setzen
+ // set index type
aTypeDCB.SelectEntry(pMark->GetTOXType()->GetTypeName());
- // Next - Prev - Buttons setzen
+ // set Next - Prev - Buttons
pSh->SttCrsrMove();
if( aPrevBT.IsVisible() )
{
@@ -969,7 +968,7 @@ IMPL_LINK( SwIndexMarkDlg, PhoneticEDModifyHdl, Edit *, pEdit )
}
/*--------------------------------------------------------------------
- Beschreibung: Enable Disable des 2. Schluessels
+ Description: Enable Disable of the 2nd key
--------------------------------------------------------------------*/
IMPL_LINK( SwIndexMarkDlg, KeyDCBModifyHdl, ComboBox *, pBox )
{
@@ -1027,7 +1026,7 @@ IMPL_LINK( SwIndexMarkDlg, KeyDCBModifyHdl, ComboBox *, pBox )
}
/*--------------------------------------------------
- dtor ueberladen
+ overload dtor
--------------------------------------------------*/
SwIndexMarkDlg::~SwIndexMarkDlg()
{
diff --git a/sw/source/ui/index/toxmgr.cxx b/sw/source/ui/index/toxmgr.cxx
index e91c648505..e105c4760a 100644
--- a/sw/source/ui/index/toxmgr.cxx
+++ b/sw/source/ui/index/toxmgr.cxx
@@ -41,7 +41,7 @@
#include <globals.hrc>
/*--------------------------------------------------------------------
- Beschreibung: Handhabung der Verzeichnisse durch TOXMgr
+ Description: handle indexes with TOXMgr
--------------------------------------------------------------------*/
@@ -53,7 +53,7 @@ SwTOXMgr::SwTOXMgr(SwWrtShell* pShell):
}
/*--------------------------------------------------------------------
- Beschreibung: Aktuelle TOXMarks behandeln
+ Description: handle current TOXMarks
--------------------------------------------------------------------*/
@@ -83,7 +83,7 @@ void SwTOXMgr::DeleteTOXMark()
pSh->DeleteTOXMark( pCurTOXMark );
pSh->SetModified();
}
- // zur naechsten wandern
+ // go to next one
pCurTOXMark = pNext;
}
@@ -147,7 +147,7 @@ void SwTOXMgr::InsertTOXMark(const SwTOXMarkDescription& rDesc)
pSh->EndAllAction();
}
/*--------------------------------------------------------------------
- Beschreibung: Update eines TOXMarks
+ Description: Update of TOXMarks
--------------------------------------------------------------------*/
@@ -198,8 +198,8 @@ void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
if(rDesc.GetAltStr())
{
- // JP 26.08.96: Bug 30344 - entweder der Text aus dem Doc oder
- // ein Alternativ-Text, beides gibts nicht!
+ // JP 26.08.96: Bug 30344 - either the text of a Doc or an alternative test,
+ // not both!
sal_Bool bReplace = pCurTOXMark->IsAlternativeText();
if( bReplace )
pCurTOXMark->SetAlternativeText( *rDesc.GetAltStr() );
@@ -215,7 +215,7 @@ void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
}
pSh->SetModified();
pSh->EndAllAction();
- // Bug 36207 pCurTOXMark zeigt hier in den Wald!
+ // Bug 36207 pCurTOXMark points nowhere here!
if(!pCurTOXMark)
{
pSh->Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False );
@@ -226,7 +226,7 @@ void SwTOXMgr::UpdateTOXMark(const SwTOXMarkDescription& rDesc)
/*--------------------------------------------------------------------
- Beschreibung: UserTypeID ermitteln
+ Description: determine UserTypeID
--------------------------------------------------------------------*/
@@ -245,7 +245,7 @@ sal_uInt16 SwTOXMgr::GetUserTypeID(const String& rStr)
}
/*--------------------------------------------------------------------
- Beschreibung: Traveling zwischen den TOXMarks
+ Description: traveling between TOXMarks
--------------------------------------------------------------------*/
@@ -271,7 +271,7 @@ void SwTOXMgr::PrevTOXMark(sal_Bool bSame)
}
/*--------------------------------------------------------------------
- Beschreibung: Stichwortverzeichnis einfuegen
+ Description: insert keyword index
--------------------------------------------------------------------*/
const SwTOXBase* SwTOXMgr::GetCurTOX()
{
@@ -430,8 +430,8 @@ sal_Bool SwTOXMgr::UpdateOrInsertTOX(const SwTOXDescription& rDesc,
if(!pCurTOX || (ppBase && !(*ppBase)) )
{
- // wird ppBase uebergeben, dann wird das TOXBase hier nur erzeugt
- // und dann ueber den Dialog in ein Globaldokument eingefuegt
+ // when ppBase is passed over, TOXBase is only created here
+ // and then inserted in a global document by the dialog
if(ppBase)
(*ppBase) = pNewTOX;
else
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index 0d2fefb5db..4e82474e24 100644
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -36,7 +36,7 @@
#include <hintids.hxx>
#include <view.hxx>
#include <wrtsh.hxx>
-#include <swundo.hxx> // fuer Undo-Ids
+#include <swundo.hxx> // for Undo-Ids
#include <globals.hrc>
#include <splargs.hxx>
@@ -77,7 +77,7 @@ using namespace ::com::sun::star::i18n;
#define CHAR_PAR_BRK ((sal_Char) 0x0D)
//////////////////////////////////////////////////////////////////////
-// Beschreibung: Ggf. Rahmen/Objektshell abschalten
+// Description: Turn off frame/object shell if applicable
static void lcl_ActivateTextShell( SwWrtShell & rWrtSh )
{
@@ -304,7 +304,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
{
nChgLen = nIndex - nChgPos;
nConvChgLen = nPos - nConvChgPos;
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
String aInOrig( rOrigText.copy( nChgPos, nChgLen ) );
#endif
String aInNew( rNewText.Copy( nConvChgPos, nConvChgLen ) );
@@ -314,7 +314,7 @@ void SwHHCWrapper::ChangeText( const String &rNewText,
OSL_ENSURE( rWrtShell.GetCrsr()->HasMark(), "cursor misplaced (nothing selected)" );
rWrtShell.GetCrsr()->GetMark()->nContent.Assign( pStartTxtNode, nChgInNodeStartIndex );
rWrtShell.GetCrsr()->GetPoint()->nContent.Assign( pStartTxtNode, nChgInNodeStartIndex + nChgLen );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
String aSelTxt1( rWrtShell.GetSelTxt() );
#endif
@@ -369,7 +369,7 @@ void SwHHCWrapper::ChangeText_impl( const String &rNewText, sal_Bool bKeepAttrib
// restore those for the new text
rWrtShell.GetCurAttr( aItemSet );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
String aSelTxt1( rWrtShell.GetSelTxt() );
#endif
rWrtShell.Delete();
@@ -380,7 +380,7 @@ void SwHHCWrapper::ChangeText_impl( const String &rNewText, sal_Bool bKeepAttrib
rWrtShell.GetCrsr()->SetMark();
SwPosition *pMark = rWrtShell.GetCrsr()->GetMark();
pMark->nContent = pMark->nContent.GetIndex() - rNewText.Len();
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
String aSelTxt2( rWrtShell.GetSelTxt() );
#endif
@@ -418,7 +418,7 @@ void SwHHCWrapper::ReplaceUnit(
lcl_ActivateTextShell( rWrtShell );
- // Das aktuelle Wort austauschen
+ // replace the current word
rWrtShell.StartAllAction();
// select current unit
@@ -497,7 +497,7 @@ void SwHHCWrapper::ReplaceUnit(
pRuby->SetPosition( bRubyBelow );
pRuby->SetAdjustment( RubyAdjust_CENTER );
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
SwPaM *pPaM = rWrtShell.GetCrsr();
(void)pPaM;
#endif
@@ -672,14 +672,13 @@ sal_Bool SwHHCWrapper::ConvNext_impl( )
{
//! modified version of SvxSpellWrapper::SpellNext
- // Keine Richtungsaenderung, also ist der gewuenschte Bereich ( bStartChk )
- // vollstaendig abgearbeitet.
+ // no change of direction so the desired region is fully processed
if( bStartChk )
bStartDone = sal_True;
else
bEndDone = sal_True;
- if( bIsOtherCntnt && bStartDone && bEndDone ) // Dokument komplett geprueft?
+ if( bIsOtherCntnt && bStartDone && bEndDone ) // document completely checked?
{
bInfoBox = sal_True;
return sal_False;
@@ -695,7 +694,7 @@ sal_Bool SwHHCWrapper::ConvNext_impl( )
}
else if ( bStartDone && bEndDone )
{
- // Bodybereich erledigt, Frage nach Sonderbereich
+ // body region done, ask about special region
if( bIsConvSpecial && HasOtherCnt_impl() )
{
ConvStart_impl( pConvArgs, SVX_SPELL_OTHER );
diff --git a/sw/source/ui/lingu/hyp.cxx b/sw/source/ui/lingu/hyp.cxx
index ea0d7e1433..cc19ed202f 100644
--- a/sw/source/ui/lingu/hyp.cxx
+++ b/sw/source/ui/lingu/hyp.cxx
@@ -56,7 +56,7 @@ using namespace ::com::sun::star;
using ::rtl::OUString;
/*--------------------------------------------------------------------
- Beschreibung: Interaktive Trennung
+ Description: interactive separation
--------------------------------------------------------------------*/
SwHyphWrapper::SwHyphWrapper( SwView* pVw,
@@ -94,7 +94,7 @@ void SwHyphWrapper::SpellStart( SvxSpellArea eSpell )
sal_Bool SwHyphWrapper::SpellContinue()
{
- // Fuer autom. Trennung Aktionen erst am Ende sichtbar machen
+ // for automatic separation, make actions visible only at the end
SwWait *pWait = 0;
if( bAutomatic )
{
@@ -107,7 +107,7 @@ sal_Bool SwHyphWrapper::SpellContinue()
PSH->HyphContinue( &nPageCount, &nPageStart );
SetLast( xHyphWord );
- // Fuer autom. Trennung Aktionen erst am Ende sichtbar machen
+ // for automatic separation, make actions visible only at the end
if( bAutomatic )
{
PSH->EndAllAction();
diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx
index f2269e8893..5c90202016 100644
--- a/sw/source/ui/lingu/olmenu.cxx
+++ b/sw/source/ui/lingu/olmenu.cxx
@@ -166,7 +166,7 @@ LanguageType lcl_CheckLanguage(
aLangList[2] = rSettings.GetLanguage();
// en-US
aLangList[3] = LANGUAGE_ENGLISH_US;
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
lang::Locale a0( SvxCreateLocale( aLangList[0] ) );
lang::Locale a1( SvxCreateLocale( aLangList[1] ) );
lang::Locale a2( SvxCreateLocale( aLangList[2] ) );
@@ -327,9 +327,6 @@ static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl )
Image aRes;
OUString aTmp;
osl::FileBase::getSystemPathFromFileURL( rFileUrl, aTmp );
-#if defined(WNT)
-
-#endif
Graphic aGraphic;
const String aFilterName( RTL_CONSTASCII_USTRINGPARAM( IMP_PNG ) );
if( GRFILTER_OK == GraphicFilter::LoadGraphic( aTmp, aFilterName, aGraphic ) )
@@ -747,8 +744,8 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
of temporary auto correction is now undoable two and
must reside in the same undo group.*/
- // nur aufnehmen, wenn es NICHT schon in der Autokorrektur vorhanden ist
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ // record only if it's NOT already present in autocorrection
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
String aOrigWord( bGrammarResults ? OUString() : xSpellAlt->getWord() ) ;
String aNewWord( aSuggestions[ nAltIdx ] );
diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx
index a18905503c..3e70fccd79 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.cxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.cxx
@@ -87,8 +87,7 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw,
pOutlView = new OutlinerView( this, &(pView->GetEditWin()) );
pOutlView->GetOutliner()->SetRefDevice(pView->GetWrtShell().getIDocumentDeviceAccess()->getPrinter( false ));
- // Hack: Es sollten alle SdrTextObj-Attribute an die EditEngine
- // uebertragen werden.
+ // Hack: all SdrTextObj attributes should be transferred to EditEngine
pOutlView->SetBackgroundColor( Color( COL_WHITE ) );
@@ -141,7 +140,7 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
std::list<SdrTextObj*> aTextObjs;
SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pView->GetDocShell()->GetDoc() );
- for ( std::list<SdrTextObj*>::iterator aIt = aTextObjs.begin(); aIt != aTextObjs.end(); aIt++ )
+ for ( std::list<SdrTextObj*>::iterator aIt = aTextObjs.begin(); aIt != aTextObjs.end(); ++aIt )
{
pTextObj = (*aIt);
if ( pTextObj )
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 49d2c40eaa..74750396ef 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -78,33 +78,32 @@ IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox )
}
- aOkBtn.Enable(!bSelEntries); // neue Textmarke
- aDeleteBtn.Enable(bSelEntries); // loeschbar?
+ aOkBtn.Enable(!bSelEntries); // new text mark
+ aDeleteBtn.Enable(bSelEntries); // deletable?
return 0;
}
/*------------------------------------------------------------------------
- Beschreibung: Callback zum Loeschen einer Textmarke
+ Description: callback to delete a text mark
-----------------------------------------------------------------------*/
IMPL_LINK( SwInsertBookmarkDlg, DeleteHdl, Button *, EMPTYARG )
{
- // Textmarken aus der ComboBox entfernen
+ // remove text marks from the ComboBox
for (sal_uInt16 i = aBookmarkBox.GetSelectEntryCount(); i; i-- )
aBookmarkBox.RemoveEntry(aBookmarkBox.GetSelectEntryPos(i - 1));
aBookmarkBox.SetText(aEmptyStr);
- aDeleteBtn.Enable(sal_False); // keine weiteren Eintraege vorhanden
+ aDeleteBtn.Enable(sal_False); // no further entries there
- aOkBtn.Enable(); // Im OK Handler wird geloescht
+ aOkBtn.Enable(); // the OK handler deletes
return 0;
}
/*------------------------------------------------------------------------
- Beschreibung: Callback fuer OKButton. Fuegt eine neue Textmarke
- an die akt. Position ein. Geloeschte Textmarken werden auch am Modell
- entfernt.
+ Description: callback for OKButton. Inserts a new text mark to the
+ current position. Deleted text marks are also deleted in the model.
-----------------------------------------------------------------------*/
void SwInsertBookmarkDlg::Apply()
{
@@ -120,7 +119,7 @@ void SwInsertBookmarkDlg::Apply()
aReq.Done();
}
- // Textmarke einfuegen
+ // insert text mark
sal_uInt16 nLen = aBookmarkBox.GetText().Len();
SwBoxEntry aTmpEntry(aBookmarkBox.GetText(), 0 );
@@ -140,7 +139,7 @@ void SwInsertBookmarkDlg::Apply()
}
/*------------------------------------------------------------------------
- Beschreibung: CTOR
+ Description: CTOR
-----------------------------------------------------------------------*/
SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRequest& rRequest ) :
@@ -159,7 +158,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( Window *pParent, SwWrtShell &rS, SfxRe
aDeleteBtn.SetClickHdl(LINK(this, SwInsertBookmarkDlg, DeleteHdl));
- // Combobox mit vorhandenen Bookmarks fuellen
+ // fill Combobox with existing bookmarks
IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
sal_uInt16 nId = 0;
for( IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
@@ -225,7 +224,7 @@ sal_uInt16 BookmarkCombo::GetSelectEntryCount() const
}
/*------------------------------------------------------------------------
- Beschreibung: Position in der Listbox (der ComboBox)
+ Description: position inside of the listbox (the ComboBox)
-----------------------------------------------------------------------*/
sal_uInt16 BookmarkCombo::GetSelectEntryPos( sal_uInt16 nSelIndex ) const
{
diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx
index 52267490fd..6eccde9ff6 100644
--- a/sw/source/ui/misc/docfnote.cxx
+++ b/sw/source/ui/misc/docfnote.cxx
@@ -184,7 +184,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
else
{
const SwFtnInfo &rInf = pSh->GetFtnInfo();
- // Position (Seite, Kapitel) setzen
+ // set position (page, chapter)
if ( rInf.ePos == FTNPOS_PAGE )
{
aPosPageBox.Check();
@@ -198,16 +198,16 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
aNumCountBox.RemoveEntry(aNumChapter);
bPosDoc = sal_True;
}
- // Verweistexte
+ // reference tests
aContEdit.SetText(rInf.aQuoVadis);
aContFromEdit.SetText(rInf.aErgoSum);
- // gesammelt wo
+ // collected
SelectNumbering(rInf.eNum);
}
- // Numerierung
- // Art
+ // numbering
+ // art
aNumViewBox.SelectNumberingType( pInf->aFmt.GetNumberingType());
aOffsetFld.SetValue(pInf->nFtnOffset + 1);
aPrefixED.SetText(pInf->GetPrefix());
@@ -222,8 +222,8 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
aFtnCharAnchorTemplBox.SelectEntry( pCharFmt->GetName() );
aFtnCharAnchorTemplBox.SaveValue();
- // Vorlagen - Sonderbereiche
- // Absatz
+ // styles special regions
+ // paragraph
SfxStyleSheetBasePool* pStyleSheetPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA, SWSTYLEBIT_EXTRA);
SfxStyleSheetBase *pStyle = pStyleSheetPool->First();
@@ -255,7 +255,7 @@ void SwEndNoteOptionPage::Reset( const SfxItemSet& )
}
}
- // Seite
+ // page
for( i = RES_POOLPAGE_BEGIN; i < RES_POOLPAGE_END; ++i )
aPageTemplBox.InsertEntry(SwStyleNameMapper::GetUIName( i, aEmptyStr ));
@@ -281,10 +281,9 @@ SfxTabPage *SwEndNoteOptionPage::Create( Window *pParent, const SfxItemSet &rSet
}
/*------------------------------------------------------------------------
- Beschreibung: Unterschiedliche Arten der Numerierung; da die Listbox
- unterschiedlich viele Eintraege hat, hier Funktionen
- fuer das Setzen und Erfragen der gemeinten Art
- der Numerierung.
+ Description: Different kinds of numbering; because the Listbox has
+ varying numbers of entries, here are functions to
+ set and query the intended kind of numbering.
------------------------------------------------------------------------*/
void SwEndNoteOptionPage::SelectNumbering(int eNum)
{
@@ -320,7 +319,7 @@ int SwEndNoteOptionPage::GetNumbering() const
void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell )
{
pSh = &rShell;
- // Zeichenvorlagen sammeln
+ // collect character templates
aFtnCharTextTemplBox.Clear();
aFtnCharAnchorTemplBox.Clear();
::FillCharStyleListBox(aFtnCharTextTemplBox,
@@ -331,10 +330,8 @@ void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell )
}
/*------------------------------------------------------------------------
- Beschreibung: Handler hinter dem Button fuer Sammeln der Fussnote
- auf der Seite.
- In diesem Fall koennen alle Numerierungsarten verwendet
- werden.
+ Description: Handler behind the button to collect the footnote at the
+ page. In this case all kinds of numbering can be used.
------------------------------------------------------------------------*/
@@ -368,10 +365,9 @@ IMPL_LINK( SwEndNoteOptionPage, NumCountHdl, ListBox*, EMPTYARG )
}
/*------------------------------------------------------------------------
- Beschreibung: Handler hinter dem Button fuer Sammeln der Fussnote
- am Kapitel oder Dokumentende.
- In diesem Fall kann keine seitenweise Numerierung verwendet
- werden.
+ Description: Handler behind the button to collect the footnote at the
+ chapter or end of the document. In this case no pagewise
+ numbering can be used.
------------------------------------------------------------------------*/
@@ -428,7 +424,7 @@ sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & )
pInf->SetAnchorCharFmt( lcl_GetCharFormat( pSh,
aFtnCharAnchorTemplBox.GetSelectEntry() ) );
- // Absatzvorlage
+ // paragraph template
sal_uInt16 nPos = aParaTemplBox.GetSelectEntryPos();
if(LISTBOX_ENTRY_NOTFOUND != nPos)
{
@@ -438,7 +434,7 @@ sal_Bool SwEndNoteOptionPage::FillItemSet( SfxItemSet & )
pInf->SetFtnTxtColl(*pColl);
}
- // Seitenvorlage
+ // page template
pInf->ChgPageDesc( pSh->FindPageDescByName(
aPageTemplBox.GetSelectEntry(), sal_True ) );
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 7ebec767ed..52dfd5e5ca 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -180,8 +180,7 @@ void SwGlossaryGroupDlg::Apply()
const String sDelGroup = pDelEntry->GetToken(0, '\t');
if( sDelGroup == aActGroup )
{
- //soll die aktuelle Gruppe geloescht werden, muss die akt. Gruppe
- //umgesetzt werden
+ //when the current group is deleted, the current group has to be relocated
if(aGroupTLB.GetEntryCount())
{
SvLBoxEntry* pFirst = aGroupTLB.First();
@@ -202,7 +201,7 @@ void SwGlossaryGroupDlg::Apply()
}
}
- //erst umbenennen, falls es schon eins gab
+ //don't rename before there was one
if(pRenamedArr && pRenamedArr->Count())
{
sal_uInt16 nCount = pRenamedArr->Count();
@@ -295,8 +294,7 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
}
GlosBibUserData* pUserData = (GlosBibUserData*)pEntry->GetUserData();
String sEntry(pUserData->sGroupName);
- // befindet sich der zu loeschende Name schon unter den
- // den neuen - dann weg damit
+ // if the name to be deleted is among the new ones - get rid of it
sal_Bool bDelete = sal_True;
if(pInsertedArr && pInsertedArr->Count())
{
@@ -313,7 +311,7 @@ IMPL_LINK( SwGlossaryGroupDlg, DeleteHdl, Button*, pButton )
}
}
- // moeglicherweise sollte es schon umbenannt werden?
+ // it should probably be renamed?
if(bDelete)
{
if(pRenamedArr && pRenamedArr->Count())
@@ -364,8 +362,7 @@ IMPL_LINK( SwGlossaryGroupDlg, RenameHdl, Button *, EMPTYARG )
sNewName += String::CreateFromInt32(aPathLB.GetSelectEntryPos());
OSL_ENSURE(!pGlosHdl->FindGroupName(sNewName), "group already available!");
- // befindet sich der umzubenennende Name unter den
- // den neuen - dann austauschen
+ // if the name to be renamed is among the new ones - replace
sal_Bool bDone = sal_False;
if(pInsertedArr && pInsertedArr->Count())
{
@@ -426,7 +423,7 @@ IMPL_LINK( SwGlossaryGroupDlg, ModifyHdl, Edit*, EMPTYARG )
nPos = aGroupTLB.GetEntryPos(sEntry, 0);
- //ist es nicht case sensitive muss man selbst suchen
+ //if it's not case sensitive you have to search for yourself
if( 0xffffffff == nPos)
{
const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
@@ -468,9 +465,9 @@ sal_Bool SwGlossaryGroupDlg::IsDeleteAllowed(const String &rGroup)
{
sal_Bool bDel = (!pGlosHdl->IsReadOnly(&rGroup));
- // OM: befindet sich der Name unter den den neuen Bereichsnamen,
- // dann ist er auch loeschbar! Bei noch nicht existenten Bereichsnamen
- // liefert ReadOnly naemlich sal_True.
+ // OM: if the name is among the new region name, it is deletable
+ // as well! Because for non existing region names ReadOnly issues
+ // sal_True.
if(pInsertedArr && pInsertedArr->Count())
{
diff --git a/sw/source/ui/misc/glosdoc.cxx b/sw/source/ui/misc/glosdoc.cxx
index d06234ddb3..9917a22bd5 100644
--- a/sw/source/ui/misc/glosdoc.cxx
+++ b/sw/source/ui/misc/glosdoc.cxx
@@ -105,7 +105,7 @@ String lcl_CheckFileName( const String& rNewFilePath,
}
/*------------------------------------------------------------------------
- Beschreibung: Liefert den Namen der Default-Gruppe
+ Description: supplies the default group's name
------------------------------------------------------------------------*/
String SwGlossaries::GetDefName()
{
@@ -114,7 +114,7 @@ String SwGlossaries::GetDefName()
}
/*------------------------------------------------------------------------
- Beschreibung: Liefert die Anzahl der Textbausteingruppen
+ Description: supplies the number of text block groups
------------------------------------------------------------------------*/
sal_uInt16 SwGlossaries::GetGroupCnt()
{
@@ -122,12 +122,12 @@ sal_uInt16 SwGlossaries::GetGroupCnt()
}
/*------------------------------------------------------------------------
- Beschreibung: Liefert den Gruppennamen
+ Description: supplies the group's name
------------------------------------------------------------------------*/
sal_Bool SwGlossaries::FindGroupName(String & rGroup)
{
- // enthaelt der Gruppenname keinen Pfad, kann hier ein passender
- // Gruppeneintrag gesucht werden;
+ // if the group name doesn't contain a path, a suitable group entry
+ // can the searched for here;
sal_uInt16 nCount = GetGroupCnt();
sal_uInt16 i;
for(i= 0; i < nCount; i++)
@@ -139,8 +139,8 @@ sal_Bool SwGlossaries::FindGroupName(String & rGroup)
return sal_True;
}
}
- //man darf zweimal suchen, denn bei mehreren Verzeichnissen koennte
- //der caseinsensitive Name mehrfach auftreten
+ // you can search two times because for more directories the case sensitive
+ // name could occur multiple times
const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore();
for(i = 0; i < nCount; i++)
{
@@ -179,12 +179,12 @@ String SwGlossaries::GetGroupTitle( const String& rGroupName )
}
/*------------------------------------------------------------------------
- Beschreibung: Liefert das Textbaustein-Dokument der Gruppe rName
+ Description: supplies the group rName's text block document
------------------------------------------------------------------------*/
SwTextBlocks* SwGlossaries::GetGroupDoc(const String &rName,
sal_Bool bCreate) const
{
- // gfs. in die Liste der Textbausteine eintragen
+ // insert to the list of text blocks if applicable
if(bCreate && m_pGlosArr)
{
const String aName(rName);
@@ -198,7 +198,7 @@ SwTextBlocks* SwGlossaries::GetGroupDoc(const String &rName,
break;
}
if(i == nCount)
- { // Baustein nicht in der Liste
+ { // block not in the list
String *pTmp = new String(aName);
m_pGlosArr->Insert(pTmp, m_pGlosArr->Count());
}
@@ -207,16 +207,16 @@ SwTextBlocks* SwGlossaries::GetGroupDoc(const String &rName,
}
/*------------------------------------------------------------------------
- Beschreibung: Loeschen Textblock
+ Description: delete a text block
------------------------------------------------------------------------*/
void SwGlossaries::PutGroupDoc(SwTextBlocks *pBlock) {
delete pBlock;
}
/*------------------------------------------------------------------------
- Beschreibung: Erzeugt ein neues Dokument mit dem Gruppenname
- Wird temp. auch als File angelegt, damit die
- Gruppen auch spaeter (ohne Zugriff) vorhanden sind.
+ Description: Creates a new document with the group name. temporarly
+ also created as file so that groups remain there later
+ (without access).
------------------------------------------------------------------------*/
sal_Bool SwGlossaries::NewGroupDoc(String& rGroupName, const String& rTitle)
{
@@ -300,7 +300,7 @@ sal_Bool SwGlossaries::RenameGroupDoc(
}
/*------------------------------------------------------------------------
- Beschreibung: Loescht eine Textbausteingruppe
+ Description: Deletes a text block group
------------------------------------------------------------------------*/
sal_Bool SwGlossaries::DelGroupDoc(const String &rName)
{
@@ -316,9 +316,9 @@ sal_Bool SwGlossaries::DelGroupDoc(const String &rName)
aTmp += SwGlossaries::GetExtension();
sFileURL += INET_PATH_TOKEN;
sFileURL += aTmp;
- // Auch, wenn das File nicht existiert, muss es aus der Liste
- // der Textbausteinbereiche entfernt werden
- // Kein && wegen CFfront
+ // Even if the file doesn't exist it hast to be deleted from
+ // the list of text block regions
+ // no && because of CFfront
sal_Bool bRemoved = SWUnoHelper::UCB_DeleteFile( sFileURL );
OSL_ENSURE(bRemoved, "file has not been removed");
RemoveFileFromList( aName );
@@ -326,7 +326,7 @@ sal_Bool SwGlossaries::DelGroupDoc(const String &rName)
}
/*------------------------------------------------------------------------
- Beschreibung: DTOR
+ Description: DTOR
------------------------------------------------------------------------*/
SwGlossaries::~SwGlossaries()
{
@@ -351,7 +351,7 @@ SwGlossaries::~SwGlossaries()
}
/*------------------------------------------------------------------------
- Beschreibung: Bausteindokument einlesen
+ Description: read a block document
------------------------------------------------------------------------*/
SwTextBlocks* SwGlossaries::GetGlosDoc( const String &rName, sal_Bool bCreate ) const
{
@@ -388,7 +388,7 @@ SwTextBlocks* SwGlossaries::GetGlosDoc( const String &rName, sal_Bool bCreate )
}
/*------------------------------------------------------------------------
- Beschreibung: Zugriff auf die Liste der Name; diese wird gfs. eingelesen
+ Description: access to the list of names; read in if applicable
------------------------------------------------------------------------*/
SvStrings* SwGlossaries::GetNameList()
{
@@ -417,7 +417,7 @@ SvStrings* SwGlossaries::GetNameList()
}
if(!m_pGlosArr->Count())
{
- // Der Standard-Baustein steht im ersten Teil des Pfades
+ // the standard block is inside of the path's first part
String *pTmp = new String( SwGlossaries::GetDefName() );
(*pTmp) += GLOS_DELIM;
(*pTmp) += '0';
@@ -428,7 +428,7 @@ SvStrings* SwGlossaries::GetNameList()
}
/*------------------------------------------------------------------------
- Beschreibung: CTOR
+ Description: CTOR
------------------------------------------------------------------------*/
SwGlossaries::SwGlossaries() :
m_pPathArr(0),
@@ -439,11 +439,11 @@ SwGlossaries::SwGlossaries() :
}
/*------------------------------------------------------------------------
- Beschreibung: Neuen Pfad einstellen und internes Array neu aufbauen
+ Description: set new path and recreate internal array
------------------------------------------------------------------------*/
/* --------------------------------------------------
-* #61050# Doppelte Pfade fuehren zu Verwirrung - als raus damit
+* #61050# double paths cause irritation - get rid of it
* --------------------------------------------------*/
sal_Bool lcl_FindSameEntry(const SvStrings& rDirArr, const String& rEntryURL)
{
@@ -499,7 +499,7 @@ void SwGlossaries::UpdateGlosPath(sal_Bool bFull)
(m_sErrPath.Len() && (bPathChanged || m_sOldErrPath != m_sErrPath)) )
{
m_sOldErrPath = m_sErrPath;
- // Falscher Pfad, d.h. AutoText-Verzeichnis existiert nicht
+ // wrong path, that means AutoText directory doesn't exist
ErrorHandler::HandleError( *new StringErrorInfo(
ERR_AUTOPATH_ERROR, m_sErrPath,
@@ -597,7 +597,7 @@ void SwGlossaries::RemoveFileFromList( const String& rGroup )
String SwGlossaries::GetCompleteGroupName( const rtl::OUString& GroupName )
{
sal_uInt16 nCount = GetGroupCnt();
- //wenn der Gruppenname intern erzeugt wurde, dann steht auch hier der Pfad drin
+ // when the group name was created internally the path is here as well
String sGroup(GroupName);
String sGroupName(sGroup.GetToken(0, GLOS_DELIM));
String sPath = sGroup.GetToken(1, GLOS_DELIM);
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index 1e0b5acefb..9c8fd1bd03 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -68,7 +68,7 @@
#include <glossary.hxx>
#include <gloshdl.hxx>
#include <glosbib.hxx>
-#include <initui.hxx> // fuer ::GetGlossaries()
+#include <initui.hxx> // for ::GetGlossaries()
#include <glosdoc.hxx>
#include <macassgn.hxx>
#include <swevent.hxx>
@@ -134,7 +134,7 @@ struct GroupUserData
};
/*------------------------------------------------------------------------
- Beschreibung: Dialog fuer neuen Bausteinnamen
+ Description: dialog for new block name
------------------------------------------------------------------------*/
class SwNewGlosNameDlg : public ModalDialog
{
@@ -192,7 +192,7 @@ SwNewGlosNameDlg::SwNewGlosNameDlg(Window* pParent,
}
/*------------------------------------------------------------------------
- Beschreibung: aktuell eingestellte Gruppe erfragen / setzen
+ Description: query / set currently set group
------------------------------------------------------------------------*/
String SwGlossaryDlg::GetCurrGroup()
{
@@ -249,7 +249,7 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
{
SvtLinguConfig aLocalLinguConfig;
- // Static-Pointer initialisieren
+ // initialise static-pointer
if( !::GetCurrGlosGroup() )
::SetCurrGlosGroup(new String);//(SwGlossaries::GetDefName());
@@ -271,9 +271,9 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
aNameED.SetMaxTextLen(LONG_LENGTH);
FreeResource();
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
- aShowExampleCB.Check( pCfg->IsAutoTextPreview());
+ aShowExampleCB.Check( rCfg.IsAutoTextPreview());
ShowPreviewHdl(&aShowExampleCB);
bIsDocReadOnly = pSh->GetView().GetDocShell()->IsReadOnly() ||
@@ -284,7 +284,7 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
aCategoryBox.SetHelpId(HID_MD_GLOS_CATEGORY);
aCategoryBox.SetStyle(aCategoryBox.GetStyle()|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL|WB_VSCROLL|WB_CLIPCHILDREN|WB_SORT);
aCategoryBox.GetModel()->SetSortMode(SortAscending);
- aCategoryBox.SetHighlightRange(); // ueber volle Breite selektieren
+ aCategoryBox.SetHighlightRange(); // select over full width
aCategoryBox.SetNodeDefaultImages( );
aCategoryBox.SetAccessibleName(SW_RES(STR_ACCESS_SW_CATEGORY));
aCategoryBox.SetAccessibleRelationLabeledBy(&aInsertTipCB);
@@ -294,8 +294,8 @@ SwGlossaryDlg::SwGlossaryDlg(SfxViewFrame* pViewFrame,
SwGlossaryDlg::~SwGlossaryDlg()
{
- SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- pCfg->SetAutoTextPreview(aShowExampleCB.IsChecked()) ;
+ SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
+ rCfg.SetAutoTextPreview(aShowExampleCB.IsChecked()) ;
aCategoryBox.Clear();
aEditBtn.SetPopupMenu(0);
@@ -304,7 +304,7 @@ SwGlossaryDlg::~SwGlossaryDlg()
}
/*------------------------------------------------------------------------
- Beschreibung: Auswahl neue Gruppe
+ Description: select new group
------------------------------------------------------------------------*/
IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
{
@@ -318,7 +318,7 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
(*pGlosGroup) += GLOS_DELIM;
(*pGlosGroup) += String::CreateFromInt32(pGroupData->nPathIdx);
pGlossaryHdl->SetCurGroup(*pGlosGroup);
- // Aktuellen Textbaustein setzen
+ // set current text block
bReadOnly = pGlossaryHdl->IsReadOnly();
EnableShortName( !bReadOnly );
aEditBtn.Enable(!bReadOnly);
@@ -334,13 +334,13 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox )
}
else
ShowAutoText(aEmptyStr, aEmptyStr);
- //Controls aktualisieren
+ // update controls
NameModify(&aShortNameEdit);
if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
{
SfxRequest aReq( pSh->GetView().GetViewFrame(), FN_SET_ACT_GLOSSARY );
String sTemp(*::GetCurrGlosGroup());
- // der nullte Pfad wird nicht aufgezeichnet!
+ // the zeroth path is not being recorded!
if('0' == sTemp.GetToken(1, GLOS_DELIM).GetChar(0))
sTemp = sTemp.GetToken(0, GLOS_DELIM);
aReq.AppendItem(SfxStringItem(FN_SET_ACT_GLOSSARY, sTemp));
@@ -357,7 +357,7 @@ void SwGlossaryDlg::Apply()
{
SfxRequest aReq( pSh->GetView().GetViewFrame(), FN_INSERT_GLOSSARY );
String sTemp(*::GetCurrGlosGroup());
- // der nullte Pfad wird nicht aufgezeichnet!
+ // the zeroth path is not being recorded!
if('0' == sTemp.GetToken(1, GLOS_DELIM).GetChar(0))
sTemp = sTemp.GetToken(0, GLOS_DELIM);
aReq.AppendItem(SfxStringItem(FN_INSERT_GLOSSARY, sTemp));
@@ -373,12 +373,12 @@ void SwGlossaryDlg::Apply()
}
/* --------------------------------------------------
- * existiert der Titel in der ausgewaehlten Gruppe?
+ * does the title exist in the selected group?
* --------------------------------------------------*/
SvLBoxEntry* SwGlossaryDlg::DoesBlockExist(const String& rBlock,
const String& rShort)
{
- //evtl. vorhandenen Eintrag in der TreeListBox suchen
+ // look for possible entry in TreeListBox
SvLBoxEntry* pEntry = aCategoryBox.FirstSelected();
if(pEntry)
{
@@ -415,8 +415,7 @@ IMPL_LINK( SwGlossaryDlg, NameModify, Edit *, pEdit )
sal_Bool bNotFound = !DoesBlockExist(aName, sShortSearch);
if(bNameED)
{
- // ist der Text durch einen Klick in die Listbox in das
- // Edit gekommem?
+ // did the text get in to the Listbbox in the Edit with a click?
if(bNotFound)
{
aShortNameEdit.SetText( lcl_GetValidShortCut( aName ) );
@@ -490,7 +489,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
break;
case FN_GL_DEFINE_TEXT:
bNoAttr = sal_True;
- // Kein break!!!
+ // no break!!!
case FN_GL_DEFINE:
{
const String aStr(aNameED.GetText());
@@ -512,13 +511,13 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
pChild->SetUserData(new String(aShortName));
aNameED.SetText(aStr);
aShortNameEdit.SetText(aShortName);
- NameModify(&aNameED); // fuer Schalten der Buttons
+ NameModify(&aNameED); // for toggling the buttons
if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) )
{
SfxRequest aReq(pSh->GetView().GetViewFrame(), FN_NEW_GLOSSARY);
String sTemp(*::GetCurrGlosGroup());
- // der nullte Pfad wird nicht aufgezeichnet!
+ // the zeroth path is not being recorded!
if('0' == sTemp.GetToken(1, GLOS_DELIM).GetChar(0))
sTemp = sTemp.GetToken(0, GLOS_DELIM);
aReq.AppendItem(SfxStringItem(FN_NEW_GLOSSARY, sTemp));
@@ -626,7 +625,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
SfxFilterMatcher aMatcher( String::CreateFromAscii(SwDocShell::Factory().GetShortName()) );
- SfxFilterMatcherIter aIter( &aMatcher );
+ SfxFilterMatcherIter aIter( aMatcher );
const SfxFilter* pFilter = aIter.First();
while ( pFilter )
{
@@ -659,7 +658,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn )
}
/*--------------------------------------------------------------------
- Beschreibung: Dialog Verwaltung Bereiche
+ Description: dialog manage regions
--------------------------------------------------------------------*/
IMPL_LINK( SwGlossaryDlg, BibHdl, Button *, EMPTYARG )
{
@@ -736,13 +735,13 @@ IMPL_LINK( SwGlossaryDlg, BibHdl, Button *, EMPTYARG )
}
/*------------------------------------------------------------------------
- Beschreibung: Initialisierung; aus Ctor und nach Bearbeiten Bereiche
+ Description: initialisation; from Ctor and after editing regions
------------------------------------------------------------------------*/
void SwGlossaryDlg::Init()
{
aCategoryBox.SetUpdateMode( sal_False );
aCategoryBox.Clear();
- // Textbausteinbereiche anzeigen
+ // display text block regions
const sal_uInt16 nCnt = pGlossaryHdl->GetGroupCnt();
SvLBoxEntry* pSelEntry = 0;
const String sSelStr(::GetCurrGlosGroup()->GetToken(0, GLOS_DELIM));
@@ -772,7 +771,7 @@ void SwGlossaryDlg::Init()
if(sSelStr == pData->sGroupName && nSelPath == nPath)
pSelEntry = pEntry;
- //Eintraege fuer die Gruppen auffuellen
+ // fill entries for the groups
{
pGlossaryHdl->SetCurGroup(sGroupName, sal_False, sal_True);
const sal_uInt16 nCount = pGlossaryHdl->GetGlossaryCnt();
@@ -785,7 +784,7 @@ void SwGlossaryDlg::Init()
}
}
}
- // Aktuelle Gruppe setzen und Textbausteine anzeigen
+ // set current group and display text blocks
if(!pSelEntry)
{
//find a non-readonly group
@@ -823,18 +822,18 @@ void SwGlossaryDlg::Init()
aCategoryBox.SetUpdateMode( sal_True );
aCategoryBox.Update();
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
- aFileRelCB.Check( pCfg->IsSaveRelFile() );
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
+ aFileRelCB.Check( rCfg.IsSaveRelFile() );
aFileRelCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
- aNetRelCB.Check( pCfg->IsSaveRelNet() );
+ aNetRelCB.Check( rCfg.IsSaveRelNet() );
aNetRelCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
- aInsertTipCB.Check( pCfg->IsAutoTextTip() );
+ aInsertTipCB.Check( rCfg.IsAutoTextTip() );
aInsertTipCB.SetClickHdl(LINK(this, SwGlossaryDlg, CheckBoxHdl));
}
IMPL_LINK_INLINE_START( SwGlossaryDlg, EditHdl, Button *, EMPTYARG )
{
-//EndDialog darf nicht im MenuHdl aufgerufen werden
+// EndDialog must not be called in MenuHdl
if(aEditBtn.GetCurItemId() == FN_GL_EDIT )
{
SwTextBlocks *pGroup = ::GetGlossaries()->GetGroupDoc ( GetCurrGrpName () );
@@ -848,7 +847,7 @@ IMPL_LINK_INLINE_START( SwGlossaryDlg, EditHdl, Button *, EMPTYARG )
IMPL_LINK_INLINE_END( SwGlossaryDlg, EditHdl, Button *, EMPTYARG )
/*------------------------------------------------------------------------
- Beschreibung: KeyInput fuer ShortName - Edits ohne Spaces
+ Description: KeyInput for ShortName - Edits without Spaces
------------------------------------------------------------------------*/
IMPL_LINK( SwNewGlosNameDlg, Modify, Edit *, pBox )
{
@@ -883,19 +882,19 @@ IMPL_LINK( SwNewGlosNameDlg, Rename, Button *, EMPTYARG )
IMPL_LINK( SwGlossaryDlg, CheckBoxHdl, CheckBox *, pBox )
{
- SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
sal_Bool bCheck = pBox->IsChecked();
if( pBox == &aInsertTipCB )
- pCfg->SetAutoTextTip(bCheck);
+ rCfg.SetAutoTextTip(bCheck);
else if(pBox == &aFileRelCB)
- pCfg->SetSaveRelFile(bCheck);
+ rCfg.SetSaveRelFile(bCheck);
else
- pCfg->SetSaveRelNet(bCheck);
+ rCfg.SetSaveRelNet(bCheck);
return 0;
}
/* --------------------------------------------------
- * TreeListBox fuer Gruppen und Bausteine
+ * TreeListBox for groups and blocks
* --------------------------------------------------*/
SwGlTreeListBox::SwGlTreeListBox(Window* pParent, const ResId& rResId) :
SvTreeListBox(pParent, rResId),
@@ -924,7 +923,7 @@ void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt )
{
Point aPos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ));
SvLBoxEntry* pEntry = GetEntry( aPos );
- // Hilfe gibt es nur fuer die Gruppennamen
+ // there's only help for groups' names
if(pEntry)
{
SvLBoxTab* pTab;
@@ -1003,7 +1002,7 @@ DragDropMode SwGlTreeListBox::NotifyStartDrag(
sal_Bool SwGlTreeListBox::NotifyAcceptDrop( SvLBoxEntry* pEntry)
{
- // TODO: Readonly - Ueberpruefung fehlt noch!
+ // TODO: Readonly - check still missing!
SvLBoxEntry* pSrcParent = GetParent(pEntry) ? GetParent(pEntry) : pEntry;
SvLBoxEntry* pDestParent =
GetParent(pDragEntry ) ? GetParent(pDragEntry ) : pDragEntry ;
@@ -1018,12 +1017,12 @@ sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget,
)
{
pDragEntry = 0;
- if(!pTarget) //An den Anfang verschieben
+ if(!pTarget) // move to the beginning
{
pTarget = GetEntry(0);
}
- // 1. wird in verschiedene Gruppen verschoben?
- // 2. darf in beiden Gruppen geschrieben werden?
+ // 1. move to different groups?
+ // 2. allowed to write in both groups?
SvLBoxEntry* pSrcParent = GetParent(pEntry);
SvLBoxEntry* pDestParent =
GetParent(pTarget) ? GetParent(pTarget) : pTarget;
@@ -1054,7 +1053,7 @@ sal_Bool SwGlTreeListBox::NotifyMoving( SvLBoxEntry* pTarget,
GetModel()->Remove(pEntry);
}
}
- return sal_False; //sonst wird der Eintrag automatisch vorgenommen
+ return sal_False; // otherwise the entry is being set automatically
}
sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget,
@@ -1064,9 +1063,9 @@ sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget,
)
{
pDragEntry = 0;
- // 1. wird in verschiedene Gruppen verschoben?
- // 2. darf in beiden Gruppen geschrieben werden?
- if(!pTarget) //An den Anfang verschieben
+ // 1. move in different groups?
+ // 2. allowed to write to both groups?
+ if(!pTarget) // move to the beginning
{
pTarget = GetEntry(0);
}
@@ -1101,7 +1100,7 @@ sal_Bool SwGlTreeListBox::NotifyCopying( SvLBoxEntry* pTarget,
pChild->SetUserData(new String(sShortName));
}
}
- return sal_False; //sonst wird der Eintrag automatisch vorgenommen
+ return sal_False; // otherwise the entry is being set automatically
}
String SwGlossaryDlg::GetCurrGrpName() const
diff --git a/sw/source/ui/misc/glossary.hrc b/sw/source/ui/misc/glossary.hrc
index 52208bc962..8f439370c3 100644
--- a/sw/source/ui/misc/glossary.hrc
+++ b/sw/source/ui/misc/glossary.hrc
@@ -26,7 +26,7 @@
************************************************************************/
-// Box Textbausteine
+// Box text blocks
#define FT_SHORTNAME 1
#define ED_SHORTNAME 2
#define FT_NAME 3
@@ -63,7 +63,7 @@
#define FN_GL_REPLACE_TEXT 78
#define WIN_EXAMPLE_DUMMY 79
-// Box Bibliothek Textbausteine
+// Box library text blocks
#define FL_EDIT 1
#define FL_BIB 2
#define ED_BIB 3
@@ -73,10 +73,10 @@
#define BT_OK 100
-// beide
+// both
#define LB_BIB 80
-// Dialog Namensaenderung
+// Dialog name changing
#define FT_ON 1
#define FT_OS 2
#define FT_NN 3
diff --git a/sw/source/ui/misc/glshell.cxx b/sw/source/ui/misc/glshell.cxx
index 4bc35a1b8c..df8465fc54 100644
--- a/sw/source/ui/misc/glshell.cxx
+++ b/sw/source/ui/misc/glshell.cxx
@@ -52,7 +52,7 @@
#include <IDocumentUndoRedo.hxx>
#include <glosdoc.hxx>
#include <shellio.hxx>
-#include <initui.hxx> // fuer ::GetGlossaries()
+#include <initui.hxx> // for ::GetGlossaries()
#include <cmdid.h>
#include <swerror.h>
#include <misc.hrc>
@@ -109,7 +109,7 @@ void lcl_GetState( SwDocShell& rSh, SfxItemSet& rSet )
sal_Bool lcl_Save( SwWrtShell& rSh, const String& rGroupName,
const String& rShortNm, const String& rLongNm )
{
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
SwTextBlocks * pBlock = ::GetGlossaries()->GetGroupDoc( rGroupName );
SvxMacro aStart(aEmptyStr, aEmptyStr);
@@ -120,7 +120,7 @@ sal_Bool lcl_Save( SwWrtShell& rSh, const String& rGroupName,
pGlosHdl->GetMacros( rShortNm, aStart, aEnd, pBlock );
sal_uInt16 nRet = rSh.SaveGlossaryDoc( *pBlock, rLongNm, rShortNm,
- pCfg->IsSaveRelFile(),
+ rCfg.IsSaveRelFile(),
pBlock->IsOnlyTextBlock( rShortNm ) );
if(aStart.GetMacName().Len() || aEnd.GetMacName().Len() )
@@ -216,8 +216,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
SwTextBlocks* pGroup = GetGroupDoc( rGroup );
if( pGroup && pGroup->GetCount() )
{
- // erfrage welche View registriert ist. Im WebWriter gibts es keine
- // normale View
+ // query which view is registered. In WebWriter there is no normal view
sal_uInt16 nViewId = 0 != &SwView::Factory() ? 2 : 6;
String sLongName = pGroup->GetLongName(pGroup->GetIndex( rShortName ));
@@ -240,7 +239,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
pDocSh->SetGroupName( rGroup );
}
- // Dokumenttitel setzen
+ // set document title
SfxViewFrame* pFrame = bShow ? SfxViewFrame::LoadDocument( *xDocSh, nViewId ) : SfxViewFrame::LoadHiddenDocument( *xDocSh, nViewId );
String aDocTitle(SW_RES( STR_GLOSSARY ));
aDocTitle += ' ';
@@ -253,8 +252,8 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
xDocSh->GetWrtShell()->InsertGlossary( *pGroup, rShortName );
if( !xDocSh->GetDoc()->getPrinter( false ) )
{
- // wir erzeugen einen default SfxPrinter.
- // Das ItemSet wird vom Sfx geloescht!
+ // we create a default SfxPrinter.
+ // ItemSet is deleted by Sfx!
SfxItemSet *pSet = new SfxItemSet( xDocSh->GetDoc()->GetAttrPool(),
FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER,
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
@@ -262,7 +261,7 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const String& rGroup, const String& rS
0 );
SfxPrinter* pPrinter = new SfxPrinter( pSet );
- // und haengen ihn ans Dokument.
+ // and append it to the document.
xDocSh->GetDoc()->setPrinter( pPrinter, true, true );
}
diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx
index efbe591d26..14eea457d0 100644
--- a/sw/source/ui/misc/insfnote.cxx
+++ b/sw/source/ui/misc/insfnote.cxx
@@ -56,7 +56,7 @@
static sal_Bool bFootnote = sal_True;
/*------------------------------------------------------------------------
- Beschreibung: Einfuegen der Fussnote durch OK
+ Description: inserting a footnote with OK
------------------------------------------------------------------------*/
void SwInsFootNoteDlg::Apply()
@@ -170,7 +170,7 @@ IMPL_LINK( SwInsFootNoteDlg, NextPrevHdl, Button *, pBtn )
{
Apply();
- // Hier zur naechsten Fuss/Endnote wandern
+ // go to the next foot/endnote here
rSh.ResetSelect(0, sal_False);
if (pBtn == &aNextBT)
rSh.GotoNextFtnAnchor();
diff --git a/sw/source/ui/misc/insrule.cxx b/sw/source/ui/misc/insrule.cxx
index e8074bfc6a..170187bdc0 100644
--- a/sw/source/ui/misc/insrule.cxx
+++ b/sw/source/ui/misc/insrule.cxx
@@ -68,7 +68,7 @@ SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) :
pExampleVS->SetDoubleClickHdl(LINK(this, SwInsertGrfRulerDlg, DoubleClickHdl));
pExampleVS->GrabFocus();
- // Grafiknamen ermitteln
+ // determine graphic name
GalleryExplorer::BeginLocking(GALLERY_THEME_RULERS);
GalleryExplorer::FillObjList( GALLERY_THEME_RULERS, aGrfNames );
pExampleVS->SetHelpId(HID_VS_RULER);
@@ -76,10 +76,10 @@ SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) :
pExampleVS->InsertItem( 1, 1);
pExampleVS->SetItemText( 1, sSimple);
- for(sal_uInt16 i = 1; i <= aGrfNames.Count(); i++)
+ for(sal_uInt16 i = 1; i <= aGrfNames.size(); i++)
{
pExampleVS->InsertItem( i + 1, i);
- pExampleVS->SetItemText( i + 1, *((String*)aGrfNames.GetObject(i-1)));
+ pExampleVS->SetItemText( i + 1, aGrfNames[i-1]);
}
pExampleVS->Show();
@@ -95,9 +95,9 @@ String SwInsertGrfRulerDlg::GetGraphicName()
{
String sRet;
sal_uInt16 nSel = nSelPos - 2; //align selection position with ValueSet index
- if(nSel < aGrfNames.Count())
+ if(nSel < aGrfNames.size())
sRet = URIHelper::SmartRel2Abs(
- INetURLObject(), *(String*) aGrfNames.GetObject(nSel),
+ INetURLObject(), aGrfNames[nSel],
URIHelper::GetMaybeFileHdl());
return sRet;
}
@@ -126,7 +126,7 @@ void SwRulerValueSet::UserDraw( const UserDrawEvent& rUDEvt )
sal_uInt16 nItemId = rUDEvt.GetItemId();
Point aBLPos = aRect.TopLeft();
- // Itemzaehlung beginnt bei 1, und die 1. ist die einfache Linie
+ // item count starts with 1 and the 1st is the simple line
if(nItemId > 1)
{
Graphic aGraphic;
@@ -170,7 +170,7 @@ void SwRulerValueSet::UserDraw( const UserDrawEvent& rUDEvt )
}
else
{
- // Text fuer einfache Linie painten
+ // paint text for simple line
Font aOldFont = pDev->GetFont();
Font aFont = pDev->GetFont();
Size aSize = aFont.GetSize();
diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx
index 72f76f8124..7f6eb4d564 100644
--- a/sw/source/ui/misc/linenum.cxx
+++ b/sw/source/ui/misc/linenum.cxx
@@ -57,7 +57,7 @@ SwLineNumberingDlg::SwLineNumberingDlg(SwView *pVw) :
SfxSingleTabDialog(&pVw->GetViewFrame()->GetWindow(), 0, 0),
pSh(pVw->GetWrtShellPtr())
{
- // TabPage erzeugen
+ // create TabPage
SetTabPage(SwLineNumberingPage::Create(this, *(SfxItemSet*)0));
GetOKButton()->SetClickHdl(LINK(this, SwLineNumberingDlg, OKHdl));
@@ -123,7 +123,7 @@ SwLineNumberingPage::SwLineNumberingPage( Window* pParent,
FreeResource();
SwLineNumberingDlg *pDlg = (SwLineNumberingDlg *)GetParent();
pSh = pDlg->GetWrtShell();
- // Zeichenvorlagen
+ // char styles
::FillCharStyleListBox(aCharStyleLB, pSh->GetView().GetDocShell());
}
@@ -155,31 +155,31 @@ void SwLineNumberingPage::Reset( const SfxItemSet& )
}
}
- // Format
+ // format
sal_uInt16 nSelFmt = rInf.GetNumType().GetNumberingType();
aFormatLB.SelectNumberingType(nSelFmt);
- // Position
+ // position
aPosLB.SelectEntryPos((sal_uInt16)rInf.GetPos());
- // Offset
+ // offset
sal_uInt16 nOffset = rInf.GetPosFromLeft();
if (nOffset == USHRT_MAX)
nOffset = 0;
aOffsetMF.SetValue(aOffsetMF.Normalize(nOffset), FUNIT_TWIP);
- // Numerierungsoffset
+ // numbering offset
aNumIntervalNF.SetValue(rInf.GetCountBy());
- // Teiler
+ // divider
aDivisorED.SetText(rInf.GetDivider());
- // Teileroffset
+ // divider offset
aDivIntervalNF.SetValue(rInf.GetDividerCountBy());
- // Zaehlen
+ // count
aCountEmptyLinesCB.Check(rInf.IsCountBlankLines());
aCountFrameLinesCB.Check(rInf.IsCountInFlys());
aRestartEachPageCB.Check(rInf.IsRestartEachPage());
@@ -193,7 +193,7 @@ void SwLineNumberingPage::Reset( const SfxItemSet& )
}
/*--------------------------------------------------------------------
- Beschreibung: Modify
+ Description: modify
--------------------------------------------------------------------*/
IMPL_LINK( SwLineNumberingPage, ModifyHdl, Edit *, EMPTYARG )
{
@@ -207,7 +207,7 @@ IMPL_LINK( SwLineNumberingPage, ModifyHdl, Edit *, EMPTYARG )
}
/*--------------------------------------------------------------------
- Beschreibung: On/Off
+ Description: On/Off
--------------------------------------------------------------------*/
IMPL_LINK( SwLineNumberingPage, LineOnOffHdl, CheckBox *, EMPTYARG )
{
@@ -243,7 +243,7 @@ sal_Bool SwLineNumberingPage::FillItemSet( SfxItemSet& )
{
SwLineNumberInfo aInf(pSh->GetLineNumberInfo());
- // Zeichenvorlagen
+ // char styles
String sCharFmtName(aCharStyleLB.GetSelectEntry());
SwCharFmt *pCharFmt = pSh->FindCharFmtByName(sCharFmtName);
@@ -260,27 +260,27 @@ sal_Bool SwLineNumberingPage::FillItemSet( SfxItemSet& )
if (pCharFmt)
aInf.SetCharFmt(pCharFmt);
- // Format
+ // format
SvxNumberType aType;
aType.SetNumberingType(aFormatLB.GetSelectedNumberingType());
aInf.SetNumType(aType);
- // Position
+ // position
aInf.SetPos((LineNumberPosition)aPosLB.GetSelectEntryPos());
- // Offset
+ // offset
aInf.SetPosFromLeft((sal_uInt16)aOffsetMF.Denormalize(aOffsetMF.GetValue(FUNIT_TWIP)));
- // Numerierungsoffset
+ // numbering offset
aInf.SetCountBy((sal_uInt16)aNumIntervalNF.GetValue());
- // Teiler
+ // divider
aInf.SetDivider(aDivisorED.GetText());
- // Teileroffset
+ // divider offset
aInf.SetDividerCountBy((sal_uInt16)aDivIntervalNF.GetValue());
- // Zaehlen
+ // count
aInf.SetCountBlankLines(aCountEmptyLinesCB.IsChecked());
aInf.SetCountInFlys(aCountFrameLinesCB.IsChecked());
aInf.SetRestartEachPage(aRestartEachPageCB.IsChecked());
diff --git a/sw/source/ui/misc/num.cxx b/sw/source/ui/misc/num.cxx
index 6507bcfc24..c24f3976fd 100644
--- a/sw/source/ui/misc/num.cxx
+++ b/sw/source/ui/misc/num.cxx
@@ -166,7 +166,7 @@ SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
aRelativeCB.SetClickHdl(LINK(this, SwNumPositionTabPage, RelativeHdl));
aStandardPB.SetClickHdl(LINK(this, SwNumPositionTabPage, StandardHdl));
- // Ebenen einfuegen
+ // insert levels
for(sal_uInt16 i = 1; i <= MAXLEVEL; i++)
aLevelLB.InsertEntry(String::CreateFromInt32(i));
String sEntry(String::CreateFromAscii("1 - "));
@@ -294,7 +294,7 @@ void SwNumPositionTabPage::InitControls()
if(bSameAdjust)
{
- sal_uInt16 nPos = 1; // zentriert
+ sal_uInt16 nPos = 1; // centered
if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_LEFT)
nPos = 0;
else if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT)
@@ -685,7 +685,7 @@ IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pFld )
}
else if(pFld == &aIndentMF)
{
- //jetzt muss mit dem FirstLineOffset auch der AbsLSpace veraendert werden
+ // now AbsLSpace also has to be modified by FirstLineOffset
long nDiff = nValue + aNumFmt.GetFirstLineOffset();
long nAbsLSpace = aNumFmt.GetAbsLSpace();
aNumFmt.SetAbsLSpace(sal_uInt16(nAbsLSpace + nDiff));
@@ -957,7 +957,7 @@ SwSvxNumBulletTabDialog::~SwSvxNumBulletTabDialog()
void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
{
- //Namen der Vorlagen und Metric setzen
+ // set styles' names and metric
String sNumCharFmt, sBulletCharFmt;
SwStyleNameMapper::FillUIName( RES_POOLCHR_NUM_LEVEL, sNumCharFmt );
SwStyleNameMapper::FillUIName( RES_POOLCHR_BUL_LEVEL, sBulletCharFmt );
@@ -985,26 +985,22 @@ void SwSvxNumBulletTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
- // Zeichenvorlagen sammeln
+ // collect char styles
ListBox rCharFmtLB(this);
rCharFmtLB.Clear();
rCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell();
::FillCharStyleListBox(rCharFmtLB, pDocShell);
- List aList;
+
+ std::vector<String> aList;
for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++)
- {
+ aList.push_back( String(rCharFmtLB.GetEntry(j)));
- aList.Insert( new XubString(rCharFmtLB.GetEntry(j)), LIST_APPEND );
- }
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric) ) );
rPage.PageCreated(aSet);
- for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
- delete (XubString*)aList.Remove(i);
- aList.Clear();
}
break;
case RID_SVXPAGE_NUM_POSITION:
diff --git a/sw/source/ui/misc/num.src b/sw/source/ui/misc/num.src
index 3d5f83f4eb..a0540c97c8 100644
--- a/sw/source/ui/misc/num.src
+++ b/sw/source/ui/misc/num.src
@@ -36,7 +36,7 @@
/**************************************************************************/
/* */
-/* TabPage Positionen */
+/* TabPage positions */
/* */
/**************************************************************************/
TabPage TP_NUM_POSITION
@@ -296,7 +296,7 @@ TabPage TP_NUM_POSITION
/**************************************************************************/
/* */
-/* Dialog fuer Test der Svx-Implementation */
+/* dialog for Svx-implementation's test */
/* */
/**************************************************************************/
TabDialog DLG_SVXTEST_NUM_BULLET
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index b69393b0f7..89477a2693 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -60,7 +60,7 @@
#include <viewopt.hxx>
#include <svtools/ctrlbox.hxx>
#include <helpid.h>
-#include <globals.hrc> // fuer Vorlagenname 'keins'
+#include <globals.hrc> // for template name 'none'
#include <misc.hrc>
#include <outline.hrc>
#include <paratr.hxx>
@@ -100,7 +100,7 @@ public:
};
/*------------------------------------------------------------------------
- Beschreibung: selektierten Eintrag merken
+ Description: remember selected entry
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
{
@@ -111,9 +111,9 @@ IMPL_LINK_INLINE_START( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
IMPL_LINK_INLINE_END( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
/*------------------------------------------------------------------------
- Beschreibung: Setzen der vom Benutzer vergebenen Namen
- Parameter: Liste der vom Benutzer vergebenen Namen;
- nicht vom Benutzer benannte Positionen sind 0.
+ Description: set user defined names
+ Parameter: list of user defined names;
+ unknown positions for the user are 0.
------------------------------------------------------------------------*/
void SwNumNamesDlg::SetUserNames(const String *pList[])
{
@@ -133,7 +133,7 @@ void SwNumNamesDlg::SetUserNames(const String *pList[])
}
/*------------------------------------------------------------------------
- Beschreibung: OK-Button freischalten, wenn Text im Edit steht.
+ Description: unlock OK-Button when text is in Edit
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
{
@@ -143,7 +143,7 @@ IMPL_LINK_INLINE_START( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
IMPL_LINK_INLINE_END( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
/*------------------------------------------------------------------------
- Beschreibung: DoubleClickHdl
+ Description: DoubleClickHdl
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG )
{
@@ -183,7 +183,7 @@ sal_uInt16 SwOutlineTabDialog::nNumLevel = 1;
SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
const SfxItemSet* pSwItemSet,
SwWrtShell &rSh) :
- //der UserString wird danach richtig gesetzt
+ // the UserString is set correctly afterwards
SfxTabDialog(pParent, SW_RES(DLG_TAB_OUTLINE), pSwItemSet, sal_False, &aEmptyStr),
aNullStr(C2S("____")),
aFormMenu(SW_RES(MN_FORM)),
@@ -193,7 +193,6 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
{
// --> OD 2008-04-14 #outlinelevel#
SetText( SW_RES( STR_OUTLINE_NUMBERING ) );
- // <--
PushButton* pUserButton = GetUserButton();
pUserButton->SetText(SW_RES(ST_FORM));
pUserButton->SetHelpId(HID_OUTLINE_FORM);
@@ -212,14 +211,14 @@ SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
for( i = 0; i < MAXLEVEL; ++i )
{
- // wurde die Vorlage noch nicht angelegt, dann ist sie noch an dieserPosition
+ // if the style wasn't created yet, it's still at this position
if( !rWrtSh.GetParaStyle( sHeadline =
SwStyleNameMapper::GetUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
sHeadline )) )
aCollNames[i] = sHeadline;
}
- // Erfragen der Gliederungsebenen der Textvorlagen
+ // query the text templates' outlining levels
const sal_uInt16 nCount = rWrtSh.GetTxtFmtCollCount();
for(i = 0; i < nCount; ++i )
{
@@ -266,7 +265,7 @@ IMPL_LINK( SwOutlineTabDialog, CancelHdl, Button *, EMPTYARG )
IMPL_LINK( SwOutlineTabDialog, FormHdl, Button *, pBtn )
{
- //PopupMenu auffuellen
+ // fill PopupMenu
for( sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i )
{
const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
@@ -353,15 +352,13 @@ sal_uInt16 SwOutlineTabDialog::GetLevel(const String &rFmtName) const
short SwOutlineTabDialog::Ok()
{
SfxTabDialog::Ok();
- // bei allen erzeugten Vorlagen die Ebenen setzen, muss
- // geschehen, um evtl. aufgehobene Zuordnungen
- // auch wieder zu loeschen
+ // set levels for all created templates; has to be done in order to
+ // delete possibly cancelled assignments again.
- // --> OD 2006-12-11 #130443#
+ // #130443#
// encapsulate changes into a action to avoid effects on the current cursor
// position during the changes.
rWrtSh.StartAction();
- // <--
const SwNumRule * pOutlineRule = rWrtSh.GetOutlineNumRule();
@@ -409,7 +406,7 @@ short SwOutlineTabDialog::Ok()
SwTxtFmtColl* pColl = rWrtSh.FindTxtFmtCollByName( sHeadline );
if( !pColl )
{
- if(aCollNames[i] != sHeadline)//->added by zhaojianwei
+ if(aCollNames[i] != sHeadline)
{
SwTxtFmtColl* pTxtColl = rWrtSh.GetTxtCollFromPool(
static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i) );
@@ -427,15 +424,14 @@ short SwOutlineTabDialog::Ok()
pTxtColl->SetFmtAttr(aItem);
}
}
- }//<--end,zhaojianwei
+ }
}
}
rWrtSh.SetOutlineNumRule( *pNumRule);
- // --> OD 2006-12-11 #130443#
+ // #i30443#
rWrtSh.EndAction();
- // <--
return RET_OK;
}
@@ -485,8 +481,7 @@ SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxIte
void SwOutlineSettingsTabPage::Update()
{
- // falls eine Vorlage fuer diese Ebene bereits selektiert wurde,
- // diese in der ListBox auswaehlean
+ // if a template was already selected for this level, select it in the ListBox
aCollBox.Enable(USHRT_MAX != nActLevel);
if(USHRT_MAX == nActLevel)
{
@@ -640,7 +635,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox )
sal_uInt8 i;
const String aCollName(pBox->GetSelectEntry());
- //0xFFFF darf hier nicht sein (disable)
+ //0xFFFF not allowed here (disable)
sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
String sOldName( pCollNames[nTmpLevel] );
@@ -652,7 +647,7 @@ IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox )
else
{
pCollNames[nTmpLevel] = aCollName;
- // wird die Vorlage bereits verwendet ?
+ // template already in use?
for( i = 0; i < MAXLEVEL; ++i)
if(i != nTmpLevel && pCollNames[i] == aCollName )
pCollNames[i] = aEmptyStr;
@@ -792,18 +787,18 @@ SwOutlineSettingsTabPage::~SwOutlineSettingsTabPage()
void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
{
pSh = pShell;
- // Erfragen der NumRules dieses Dokumentes
+ // query this document's NumRules
pNumRule = ((SwOutlineTabDialog*)GetTabDialog())->GetNumRule();
pCollNames = ((SwOutlineTabDialog*)GetTabDialog())->GetCollNames();
aPreviewWIN.SetNumRule(pNumRule);
aPreviewWIN.SetOutlineNames(pCollNames);
- // Startwert setzen - nActLevel muss hier 1 sein
+ // set start value - nActLevel must be 1 here
sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
const SwNumFmt& rNumFmt = pNumRule->Get( nTmpLevel );
aStartEdit.SetValue( rNumFmt.GetStart() );
- // Poolformate fuer Ueberschriften anlegen
+ // create pool formats for headlines
String sStr;
sal_uInt16 i;
for( i = 0; i < MAXLEVEL; ++i )
@@ -816,7 +811,7 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
sStr += String::CreateFromInt32(MAXLEVEL);
aLevelLB.InsertEntry( sStr );
- // Erfragen der Gliederungsebenen der Textvorlagen
+ // query the texttemplates' outlining levels
const sal_uInt16 nCount = pSh->GetTxtFmtCollCount();
for( i = 0; i < nCount; ++i )
{
@@ -838,11 +833,11 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
}
aLevelLB.SelectEntryPos(nTmp-1);//nTmp);//#outline level,zhaojianwei
- // Zeichenvorlagen sammeln
+ // collect char styles
aCharFmtLB.Clear();
aCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
- // Zeichenvorlagen
+ // char styles
::FillCharStyleListBox(aCharFmtLB,
pSh->GetView().GetDocShell());
Update();
@@ -932,7 +927,7 @@ sal_uInt16 lcl_DrawGraphic(VirtualDevice* pVDev, const SwNumFmt &rFmt, sal_uInt1
}
/*--------------------------------------------------
- Vorschau der Numerierung painten
+ paint numbering's preview
--------------------------------------------------*/
void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
{
@@ -960,9 +955,9 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
nWidthRelation = nWidthRelation / 4;
}
else
- nWidthRelation = 30; // Kapiteldialog
+ nWidthRelation = 30; // chapter dialog
- //Hoehe pro Ebene
+ // height per level
sal_uInt16 nXStep = sal_uInt16(aSize.Width() / (3 * MAXLEVEL));
if(MAXLEVEL < 10)
nXStep /= 2;
@@ -989,7 +984,7 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
{
nStart++;
}
- if(nStart) // damit moeglichs Vorgaenger und Nachfolger gezeigt werden
+ if(nStart) // so that possible predecessors and successors are showed
nStart--;
SwNumberTree::tNumberVector aNumVector;
@@ -1045,9 +1040,8 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
pVDev->SetFont(aStdFont);
if(pActNum->IsContinusNum())
aNumVector[nLevel] = nPreNum;
- // --> OD 2005-11-17 #128041#
+ // #128041#
String aText(pActNum->MakeNumString( aNumVector ));
- // <--
pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
nBulletWidth = (sal_uInt16)pVDev->GetTextWidth(aText);
nPreNum++;
@@ -1151,9 +1145,8 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
pVDev->SetFont(aStdFont);
if(pActNum->IsContinusNum())
aNumVector[nLevel] = nPreNum;
- // --> OD 2005-11-17 #128041#
+ // #128041#
String aText(pActNum->MakeNumString( aNumVector ));
- // <--
pVDev->DrawText( Point(nXStart, nYStart), aText );
nTextOffset = (sal_uInt16)pVDev->GetTextWidth(aText);
nTextOffset = nTextOffset + nXStep;
diff --git a/sw/source/ui/misc/outline.src b/sw/source/ui/misc/outline.src
index f54025127d..7a427ba9db 100644
--- a/sw/source/ui/misc/outline.src
+++ b/sw/source/ui/misc/outline.src
@@ -106,7 +106,6 @@ TabDialog DLG_TAB_OUTLINE
// --> OD 2008-04-14 #outlinelevel#
// dialog title is now given by resource STR_OUTLINE_NUMBERING
// Text [ en-US ] = "Outline Numbering" ;
- // <--
Moveable = TRUE ;
TabControl 1
{
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 5360988239..4abda6dd57 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -67,9 +67,8 @@ static sal_uInt16 aPageRg[] = {
};
/*------------------------------------------------------------------------
- Beschreibung: Handler fuer umschalten zwischen den unterschiedlichen
- Arten, wie die Hoehe des Fussnotenbereiches angegeben
- werden kann.
+ Description: handler to switch between the different possibilities
+ how the footnote region's height can be set.
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwFootNotePage, HeightPage, Button *, EMPTYARG )
{
@@ -88,7 +87,7 @@ IMPL_LINK_INLINE_START( SwFootNotePage, HeightMetric, Button *, EMPTYARG )
IMPL_LINK_INLINE_END( SwFootNotePage, HeightMetric, Button *, EMPTYARG )
/*------------------------------------------------------------------------
- Beschreibung: Handler Grenzwerte
+ Description: handler limit values
------------------------------------------------------------------------*/
IMPL_LINK( SwFootNotePage, HeightModify, MetricField *, EMPTYARG )
{
@@ -113,10 +112,10 @@ IMPL_LINK( SwFootNotePage, HeightModify, MetricField *, EMPTYARG )
IMPL_LINK( SwFootNotePage, LineWidthChanged_Impl, void *, EMPTYARG )
{
- sal_Int64 nVal = MetricField::ConvertDoubleValue(
+ sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
aLineWidthEdit.GetValue( ),
aLineWidthEdit.GetDecimalDigits( ),
- aLineWidthEdit.GetUnit(), MAP_TWIP );
+ aLineWidthEdit.GetUnit(), MAP_TWIP ));
aLineTypeBox.SetWidth( nVal );
return 0;
@@ -178,8 +177,7 @@ SfxTabPage* SwFootNotePage::Create(Window *pParent, const SfxItemSet &rSet)
void SwFootNotePage::Reset(const SfxItemSet &rSet)
{
- // Falls noch kein Bsp vorhanden Init hier sonst im Activate
- //
+ // if no example exists, otherwise Init here in Activate
SwPageFtnInfo* pDefFtnInfo = 0;
const SwPageFtnInfo* pFtnInfo;
const SfxPoolItem* pItem = SfxTabPage::GetItem(rSet, FN_PARAM_FTN_INFO);
@@ -189,12 +187,12 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
}
else
{
- // wenn "Standard" betaetigt wird, wird das Fussnotenitem geloescht,
- // deswegen muss hier eine Fussnotenstruktur erzeugt werden
+ // when "standard" is being activated the footnote item is deleted,
+ // that's why a footnote structure has to be created here
pDefFtnInfo = new SwPageFtnInfo();
pFtnInfo = pDefFtnInfo;
}
- // Hoehe Fussnotenbereich
+ // footnote area's height
SwTwips lHeight = pFtnInfo->GetHeight();
if(lHeight)
{
@@ -216,9 +214,9 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
// Separator width
aLineWidthEdit.SetModifyHdl( LINK( this, SwFootNotePage, LineWidthChanged_Impl ) );
- sal_Int64 nWidthPt = MetricField::ConvertDoubleValue(
+ sal_Int64 nWidthPt = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
sal_Int64( pFtnInfo->GetLineWidth() ), aLineWidthEdit.GetDecimalDigits(),
- MAP_TWIP, aLineWidthEdit.GetUnit( ) );
+ MAP_TWIP, aLineWidthEdit.GetUnit( ) ));
aLineWidthEdit.SetValue( nWidthPt );
// Separator style
@@ -236,7 +234,7 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
const SfxPoolItem* pColorItem = NULL;
XColorTable* pColorTable = NULL;
- DBG_ASSERT( pDocSh, "DocShell not found!" );
+ OSL_ENSURE( pDocSh, "DocShell not found!" );
if ( pDocSh )
{
@@ -245,7 +243,7 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
pColorTable = ( (SvxColorTableItem*)pColorItem )->GetColorTable();
}
- DBG_ASSERT( pColorTable, "ColorTable not found!" );
+ OSL_ENSURE( pColorTable, "ColorTable not found!" );
if ( pColorTable )
{
@@ -270,15 +268,15 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
aLineTypeBox.SetColor( pFtnInfo->GetLineColor() );
- // Position
+ // position
aLinePosBox.SelectEntryPos( static_cast< sal_uInt16 >(pFtnInfo->GetAdj()) );
- // Breite
+ // width
Fraction aTmp( 100, 1 );
aTmp *= pFtnInfo->GetWidth();
aLineLengthEdit.SetValue( static_cast<long>(aTmp) );
- // Abstand Fussnotenbereich
+ // gap footnote area
aDistEdit.SetValue(aDistEdit.Normalize(pFtnInfo->GetTopDist()),FUNIT_TWIP);
aLineDistEdit.SetValue(
aLineDistEdit.Normalize(pFtnInfo->GetBottomDist()), FUNIT_TWIP);
@@ -287,23 +285,23 @@ void SwFootNotePage::Reset(const SfxItemSet &rSet)
}
/*--------------------------------------------------------------------
- Beschreibung: Attribute in den Set stopfen bei OK
+ Description: stuff attributes into the set, when OK
--------------------------------------------------------------------*/
sal_Bool SwFootNotePage::FillItemSet(SfxItemSet &rSet)
{
SwPageFtnInfoItem aItem((const SwPageFtnInfoItem&)GetItemSet().Get(FN_PARAM_FTN_INFO));
- // Das ist das Original
+ // that's the original
SwPageFtnInfo &rFtnInfo = aItem.GetPageFtnInfo();
- // Hoehe Fussnotenbereich
+ // footnote area's height
if(aMaxHeightBtn.IsChecked())
rFtnInfo.SetHeight( static_cast< SwTwips >(
aMaxHeightEdit.Denormalize(aMaxHeightEdit.GetValue(FUNIT_TWIP))));
else
rFtnInfo.SetHeight(0);
- // Abstand Fussnotenbereich
+ // gap footnote area
rFtnInfo.SetTopDist( static_cast< SwTwips >(
aDistEdit.Denormalize(aDistEdit.GetValue(FUNIT_TWIP))));
rFtnInfo.SetBottomDist( static_cast< SwTwips >(
@@ -313,10 +311,10 @@ sal_Bool SwFootNotePage::FillItemSet(SfxItemSet &rSet)
rFtnInfo.SetLineStyle( ::editeng::SvxBorderStyle( aLineTypeBox.GetSelectEntryStyle() ) );
// Separator width
- long nWidth = MetricField::ConvertDoubleValue(
+ long nWidth = static_cast<long>(MetricField::ConvertDoubleValue(
aLineWidthEdit.GetValue( ),
aLineWidthEdit.GetDecimalDigits( ),
- aLineWidthEdit.GetUnit(), MAP_TWIP );
+ aLineWidthEdit.GetUnit(), MAP_TWIP ));
rFtnInfo.SetLineWidth( nWidth );
// Separator color
@@ -380,7 +378,7 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
lMaxHeight *= 8;
lMaxHeight /= 10;
- // Maximalwerte setzen
+ // set maximum values
HeightModify(0);
}
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index 41ab7dee62..4f00f428be 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -144,16 +144,15 @@ SwTextGridPage::SwTextGridPage(Window *pParent, const SfxItemSet &rSet) :
Link aModifyLk = LINK(this, SwTextGridPage, GridModifyHdl);
aColorLB.SetSelectHdl(aModifyLk);
aPrintCB.SetClickHdl(aModifyLk);
- aRubyBelowCB.SetClickHdl(aModifyLk);
-
+ aRubyBelowCB.SetClickHdl(aModifyLk);
aDisplayCB.SetClickHdl(LINK(this, SwTextGridPage, DisplayGridHdl));
- XColorTable* pColorTbl = XColorTable::GetStdColorTable();
- aColorLB.InsertAutomaticEntry();
- for( sal_uInt16 i = 0; i < pColorTbl->Count(); ++i )
+ XColorTable& rColorTbl = XColorTable::GetStdColorTable();
+ aColorLB.InsertAutomaticEntryColor( Color( COL_AUTO ) );
+ for( sal_uInt16 i = 0; i < rColorTbl.Count(); ++i )
{
- XColorEntry* pEntry = pColorTbl->GetColor( i );
+ XColorEntry* pEntry = rColorTbl.GetColor( i );
Color aColor = pEntry->GetColor();
String sName = pEntry->GetName();
aColorLB.InsertEntry( aColor, sName );
diff --git a/sw/source/ui/misc/redlndlg.cxx b/sw/source/ui/misc/redlndlg.cxx
index aef9050a0d..29897ab135 100644
--- a/sw/source/ui/misc/redlndlg.cxx
+++ b/sw/source/ui/misc/redlndlg.cxx
@@ -31,7 +31,6 @@
#define _SVSTDARR_STRINGSSORTDTOR
-#define _SVSTDARR_USHORTSSORT
#define _SVSTDARR_USHORTS
@@ -99,13 +98,13 @@ SwRedlineAcceptChild::SwRedlineAcceptChild( Window* _pParent,
}
/*--------------------------------------------------------------------
- Beschreibung: Nach Dok-Wechsel Dialog neu initialisieren
+ Description: newly initialise dialog after document switch
--------------------------------------------------------------------*/
sal_Bool SwRedlineAcceptChild::ReInitDlg(SwDocShell *pDocSh)
{
sal_Bool bRet;
- if ((bRet = SwChildWinWrapper::ReInitDlg(pDocSh)) == sal_True) // Sofort aktualisieren, Dok-Wechsel
+ if ((bRet = SwChildWinWrapper::ReInitDlg(pDocSh)) == sal_True) // update immediately, doc switch!
((SwModelessRedlineAcceptDlg*)GetWindow())->Activate();
return bRet;
@@ -126,17 +125,17 @@ void SwModelessRedlineAcceptDlg::Activate()
{
SwView *pView = ::GetActiveView();
- if (!pView) // Kann passieren, wenn man auf eine andere App umschaltet, wenn
- return; // vorher eine Listbox im Dialog den Focus hatte (eigentlich THs Bug)
+ if (!pView) // can happen when switching to another app, when a Listbox in dialog
+ return; // had the focus previously (actually THs Bug)
SwDocShell *pDocSh = pView->GetDocShell();
if (pChildWin->GetOldDocShell() != pDocSh)
- { // Dok-Wechsel
+ { // doc-switch
SwWait aWait( *pDocSh, sal_False );
SwWrtShell* pSh = pView->GetWrtShellPtr();
- pChildWin->SetOldDocShell(pDocSh); // Rekursion vermeiden (durch Modified-Hdl)
+ pChildWin->SetOldDocShell(pDocSh); // avoid recursion (using modified-Hdl)
sal_Bool bMod = pSh->IsModified();
SfxBoolItem aShow(FN_REDLINE_SHOW, sal_True);
@@ -217,7 +216,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) :
pActLB->InsertEntry(sFmtCollSet);
pActLB->InsertEntry(sAutoFormat);
pTPView->ShowUndo(sal_True);
- pTPView->DisableUndo(); // Noch gibts keine UNDO-Events
+ pTPView->DisableUndo(); // no UNDO events yet
}
pActLB->SelectEntryPos(0);
@@ -234,7 +233,7 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) :
pTable->SetTabs(aStaticTabs);
- // Minimalgroesse setzen
+ // set minimum size
Size aMinSz(aTabPagesCTRL.GetMinSizePixel());
Point aPos(aTabPagesCTRL.GetPosPixel());
@@ -255,11 +254,11 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(Dialog *pParent, sal_Bool bAutoFmt) :
pTable->SetDeselectHdl(LINK(this, SwRedlineAcceptDlg, DeselectHdl));
pTable->SetCommandHdl(LINK(this, SwRedlineAcceptDlg, CommandHdl));
- // Flackern der Buttons vermeiden:
+ // avoid flickering of buttons:
aDeselectTimer.SetTimeout(100);
aDeselectTimer.SetTimeoutHdl(LINK(this, SwRedlineAcceptDlg, SelectHdl));
- // Mehrfachselektion der selben Texte vermeiden:
+ // avoid multiple selection of the same texts:
aSelectTimer.SetTimeout(100);
aSelectTimer.SetTimeoutHdl(LINK(this, SwRedlineAcceptDlg, GotoHdl));
}
@@ -283,7 +282,7 @@ void SwRedlineAcceptDlg::Init(sal_uInt16 nStart)
aRedlineParents.DeleteAndDestroy(nStart, aRedlineParents.Count() - nStart);
}
- // Parents einfuegen
+ // insert parents
InsertParents(nStart);
InitAuthors();
@@ -313,7 +312,7 @@ void SwRedlineAcceptDlg::InitAuthors()
sal_Bool bIsNotFormated = sal_False;
sal_uInt16 i;
- // Autoren ermitteln
+ // determine authors
for ( i = 0; i < nCount; i++)
{
const SwRedline& rRedln = pSh->GetRedline(i);
@@ -406,7 +405,7 @@ void SwRedlineAcceptDlg::Resize()
}
/*--------------------------------------------------------------------
- Beschreibung: Nach Aktivierung neu initialisieren
+ Description: newly initialise after activation
--------------------------------------------------------------------*/
void SwRedlineAcceptDlg::Activate()
{
@@ -419,14 +418,14 @@ void SwRedlineAcceptDlg::Activate()
aUsedSeqNo.Remove((sal_uInt16)0, aUsedSeqNo.Count());
- if (!pView) // Kann passieren, wenn man auf eine andere App umschaltet, wenn
- return; // vorher eine Listbox im Dialog den Focus hatte (eigentlich THs Bug)
+ if (!pView) // can happen when switching to another app, when a Listbox in the dialog
+ return; // had the focus previously (actually THs Bug)
- // Hat sich was geaendert?
+ // did something change?
SwWrtShell* pSh = pView->GetWrtShellPtr();
sal_uInt16 nCount = pSh->GetRedlineCount();
- // Anzahl und Pointer ueberpruefen
+ // check the number of pointers
SwRedlineDataParent *pParent = 0;
sal_uInt16 i;
@@ -436,7 +435,7 @@ void SwRedlineAcceptDlg::Activate()
if (i >= aRedlineParents.Count())
{
- // Neue Eintraege wurden angehaengt
+ // new entries have been appended
Init(i);
return;
}
@@ -444,7 +443,7 @@ void SwRedlineAcceptDlg::Activate()
pParent = aRedlineParents[i];
if (&rRedln.GetRedlineData() != pParent->pData)
{
- // Redline-Parents wurden eingefuegt, geaendert oder geloescht
+ // Redline-Parents were inserted, changed or deleted
if ((i = CalcDiff(i, sal_False)) == USHRT_MAX)
return;
continue;
@@ -455,7 +454,7 @@ void SwRedlineAcceptDlg::Activate()
if (!pRedlineData && pBackupData)
{
- // Redline-Childs wurden geloescht
+ // Redline-Childs were deleted
if ((i = CalcDiff(i, sal_True)) == USHRT_MAX)
return;
continue;
@@ -466,7 +465,7 @@ void SwRedlineAcceptDlg::Activate()
{
if (pRedlineData != pBackupData->pChild)
{
- // Redline-Childs wurden eingefuegt, geaendert oder geloescht
+ // Redline-Childs were inserted, changed or deleted
if ((i = CalcDiff(i, sal_True)) == USHRT_MAX)
return;
continue;
@@ -480,12 +479,12 @@ void SwRedlineAcceptDlg::Activate()
if (nCount != aRedlineParents.Count())
{
- // Redlines wurden am Ende geloescht
+ // Redlines were deleted at the end
Init(nCount);
return;
}
- // Kommentar ueberpruefen
+ // check comment
for (i = 0; i < nCount; i++)
{
const SwRedline& rRedln = pSh->GetRedline(i);
@@ -495,7 +494,7 @@ void SwRedlineAcceptDlg::Activate()
{
if (pParent->pTLBParent)
{
- // Nur Kommentar aktualisieren
+ // update only comment
String sComment(rRedln.GetComment());
sComment.SearchAndReplaceAll((sal_Unicode)_LF,(sal_Unicode)' ');
pTable->SetEntryText(sComment, pParent->pTLBParent, 3);
@@ -522,9 +521,9 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild)
SwRedlineDataParent *pParent = aRedlineParents[nStart];
const SwRedline& rRedln = pSh->GetRedline(nStart);
- if (bChild) // Sollte eigentlich nie vorkommen, aber sicher ist sicher...
+ if (bChild) // should actually never happen, but just in case...
{
- // Alle Childs des Eintrags wegwerfen und neu initialisieren
+ // throw away all entry's childs and initialise newly
SwRedlineDataChildPtr pBackupData = (SwRedlineDataChildPtr)pParent->pNext;
SwRedlineDataChildPtr pNext;
@@ -539,28 +538,28 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild)
}
pParent->pNext = 0;
- // Neue Childs einfuegen
+ // insert new childs
InsertChilds(pParent, rRedln, nAutoFmt);
pTable->SetUpdateMode(sal_True);
return nStart;
}
- // Wurden Eintraege geloescht?
+ // have entries been deleted?
const SwRedlineData *pRedlineData = &rRedln.GetRedlineData();
sal_uInt16 i;
for ( i = nStart + 1; i < aRedlineParents.Count(); i++)
{
if (aRedlineParents[i]->pData == pRedlineData)
{
- // Eintraege von nStart bis i-1 entfernen
+ // remove entries from nStart to i-1
RemoveParents(nStart, i - 1);
pTable->SetUpdateMode(sal_True);
return nStart - 1;
}
}
- // Wurden Eintraege eingefuegt?
+ // entries been inserted?
sal_uInt16 nCount = pSh->GetRedlineCount();
pRedlineData = aRedlineParents[nStart]->pData;
@@ -568,7 +567,7 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild)
{
if (&pSh->GetRedline(i).GetRedlineData() == pRedlineData)
{
- // Eintraege von nStart bis i-1 einfuegen
+ // insert entries from nStart to i-1
InsertParents(nStart, i - 1);
pTable->SetUpdateMode(sal_True);
return nStart - 1;
@@ -576,7 +575,7 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, sal_Bool bChild)
}
pTable->SetUpdateMode(sal_True);
- Init(nStart); // Alle Eintraege bis zum Ende abgleichen
+ Init(nStart); // adjust all entries until the end
return USHRT_MAX;
}
@@ -594,7 +593,7 @@ void SwRedlineAcceptDlg::InsertChilds(SwRedlineDataParent *pParent, const SwRedl
{
sal_uInt16 nPos;
- if (pParent->pData->GetSeqNo() && !aUsedSeqNo.Insert(pParent, nPos)) // Gibts schon
+ if (pParent->pData->GetSeqNo() && !aUsedSeqNo.Insert(pParent, nPos)) // already there
{
if (pParent->pTLBParent)
{
@@ -666,14 +665,14 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd)
SvLBoxEntryArr aLBoxArr;
- // Wegen Bug der TLB, die bei Remove den SelectHandler IMMER ruft:
+ // because of Bug of TLB that ALWAYS calls the SelectHandler at Remove:
pTable->SetSelectHdl(aOldSelectHdl);
pTable->SetDeselectHdl(aOldDeselectHdl);
sal_Bool bChildsRemoved = sal_False;
pTable->SelectAll(sal_False);
- // Hinter dem letzten Eintrag Cursor setzen, da sonst Performance-Problem in TLB.
- // TLB wuerde sonst bei jedem Remove den Cursor erneut umsetzen (teuer)
+ // set the cursor after the last entry because otherwise performance problem in TLB.
+ // TLB would otherwise reset the cursor at every Remove (expensive)
sal_uInt16 nPos = Min((sal_uInt16)nCount, (sal_uInt16)aRedlineParents.Count());
SvLBoxEntry *pCurEntry = NULL;
while( ( pCurEntry == NULL ) && ( nPos > 0 ) )
@@ -720,14 +719,14 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd)
}
}
- // TLB von hinten abraeumen
+ // clear TLB from behind
long nIdx = (long)aLBoxArr.Count() - 1L;
while (nIdx >= 0)
pTable->RemoveEntry(aLBoxArr[ static_cast< sal_uInt16 >(nIdx--) ]);
pTable->SetSelectHdl(LINK(this, SwRedlineAcceptDlg, SelectHdl));
pTable->SetDeselectHdl(LINK(this, SwRedlineAcceptDlg, DeselectHdl));
- // Durch Remove wurde leider wieder dauernd von der TLB selektiert...
+ // unfortunately by Remove it was selected from the TLB always again ...
pTable->SelectAll(sal_False);
aRedlineParents.DeleteAndDestroy( nStart, nEnd - nStart + 1);
@@ -741,10 +740,10 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd)
String sParent;
sal_uInt16 nCount = pSh->GetRedlineCount();
- nEnd = Min((sal_uInt16)nEnd, (sal_uInt16)(nCount - 1)); // Handelt auch nEnd=USHRT_MAX (bis zum Ende) ab
+ nEnd = Min((sal_uInt16)nEnd, (sal_uInt16)(nCount - 1)); // also treats nEnd=USHRT_MAX (until the end)
if (nEnd == USHRT_MAX)
- return; // Keine Redlines im Dokument
+ return; // no redlines in the document
RedlinData *pData;
SvLBoxEntry *pParent;
@@ -954,7 +953,7 @@ IMPL_LINK( SwRedlineAcceptDlg, FilterChangedHdl, void*, EMPTYARG )
IMPL_LINK( SwRedlineAcceptDlg, DeselectHdl, void*, EMPTYARG )
{
- // Flackern der Buttons vermeiden:
+ // avoid flickering of buttons:
aDeselectTimer.Start();
return 0;
@@ -1001,7 +1000,7 @@ IMPL_LINK( SwRedlineAcceptDlg, GotoHdl, void*, EMPTYARG )
if (pTable->IsSelected(pActEntry))
{
pSelEntry = pActEntry = pTable->NextSelected(pSelEntry);
- continue; // Nicht zweimal selektieren
+ continue; // don't select twice
}
}
else
@@ -1058,7 +1057,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
sal_uInt16 nPos = GetRedlinePos(*pTopEntry);
- // Bei geschuetzten Bereichen kommentieren disablen
+ // disable commenting for protected areas
if ((pRed = pSh->GotoRedline(nPos, sal_True)) != 0)
{
if( pSh->IsCrsrPtAtEnd() )
@@ -1159,7 +1158,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
String sMsg(((const SvxPostItTextItem&)pOutSet->Get(SID_ATTR_POSTIT_TEXT)).GetValue());
- // Kommentar einfuegen bzw aendern
+ // insert / change comment
pSh->SetRedlineComment(sMsg);
sMsg.SearchAndReplaceAll((sal_Unicode)_LF,(sal_Unicode)' ');
pTable->SetEntryText(sMsg, pEntry, 3);
@@ -1180,11 +1179,11 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
{
bSortDir = sal_True;
if (nRet - MN_SORT_ACTION == 4 && pTable->GetSortedCol() == 0xffff)
- break; // Haben wir schon
+ break; // we already have it
nSortMode = nRet - MN_SORT_ACTION;
if (nSortMode == 4)
- nSortMode = 0xffff; // unsortiert bzw sortiert nach Position
+ nSortMode = 0xffff; // unsorted / sorted by position
if (pTable->GetSortedCol() == nSortMode)
bSortDir = !pTable->GetSortDirection();
@@ -1192,7 +1191,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG )
SwWait aWait( *::GetActiveView()->GetDocShell(), sal_False );
pTable->SortByCol(nSortMode, bSortDir);
if (nSortMode == 0xffff)
- Init(); // Alles neu fuellen
+ Init(); // newly fill everything
}
break;
}
@@ -1209,8 +1208,8 @@ void SwRedlineAcceptDlg::Initialize(const String& rExtraData)
{
sal_uInt16 nPos = rExtraData.Search(C2S("AcceptChgDat:"));
- // Versuche, den Alignment-String "ALIGN:(...)" einzulesen; wenn
- // er nicht vorhanden ist, liegt eine "altere Version vor
+ // try to read the alignment string "ALIGN:(...)"; if none existing,
+ // it's an old version
if (nPos != STRING_NOTFOUND)
{
sal_uInt16 n1 = rExtraData.Search('(', nPos);
@@ -1219,7 +1218,7 @@ void SwRedlineAcceptDlg::Initialize(const String& rExtraData)
sal_uInt16 n2 = rExtraData.Search(')', n1);
if (n2 != STRING_NOTFOUND)
{
- // Alignment-String herausschneiden
+ // cut out the alignment string
String aStr = rExtraData.Copy(nPos, n2 - nPos + 1);
aStr.Erase(0, n1 - nPos + 1);
diff --git a/sw/source/ui/misc/srtdlg.cxx b/sw/source/ui/misc/srtdlg.cxx
index 6d8c8f0270..c115b1c194 100644
--- a/sw/source/ui/misc/srtdlg.cxx
+++ b/sw/source/ui/misc/srtdlg.cxx
@@ -95,8 +95,7 @@ void lcl_ClearLstBoxAndDelUserData( ListBox& rLstBox )
}
/*--------------------------------------------------------------------
- Beschreibung: Fuer Tabellenselektion sel. Zeilen und Spalten
- feststellen
+ Description: determine lines and columns for table selection
--------------------------------------------------------------------*/
sal_Bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY )
{
@@ -106,7 +105,7 @@ sal_Bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY )
_FndBox aFndBox( 0, 0 );
- // suche alle Boxen / Lines
+ // look for all boxes / lines
{
SwSelBoxes aSelBoxes;
::GetTblSel( rSh, aSelBoxes );
@@ -123,7 +122,7 @@ sal_Bool lcl_GetSelTbl( SwWrtShell &rSh, sal_uInt16& rX, sal_uInt16& rY )
}
/*--------------------------------------------------------------------
- Beschreibung: Init-Liste
+ Description: init list
--------------------------------------------------------------------*/
SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
@@ -212,7 +211,7 @@ SwSortDlg::SwSortDlg(Window* pParent, SwWrtShell &rShell) :
aColLbl.SetText(aColTxt);
}
- // Initialisieren
+ // initialise
Link aLk = LINK(this,SwSortDlg, CheckHdl);
aKeyCB1.SetClickHdl( aLk );
aKeyCB2.SetClickHdl( aLk );
@@ -313,12 +312,11 @@ sal_Unicode SwSortDlg::GetDelimChar() const
}
/*--------------------------------------------------------------------
- Beschreibung: An die Core weiterreichen
+ Description: pass on to the Core
--------------------------------------------------------------------*/
void SwSortDlg::Apply()
{
- // Alte Einstellung speichern
- //
+ // save all settings
bCheck1 = aKeyCB1.IsChecked();
bCheck2 = aKeyCB2.IsChecked();
bCheck3 = aKeyCB3.IsChecked();
diff --git a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
index 0e16b9ebaa..d00a3ae13f 100644
--- a/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
+++ b/sw/source/ui/misc/swmodalredlineacceptdlg.cxx
@@ -35,7 +35,6 @@
#define _SVSTDARR_STRINGSSORTDTOR
-#define _SVSTDARR_USHORTSSORT
#define _SVSTDARR_USHORTS
@@ -76,14 +75,14 @@ SwModalRedlineAcceptDlg::SwModalRedlineAcceptDlg(Window *pParent) :
pImplDlg = new SwRedlineAcceptDlg(this, sal_True);
pImplDlg->Initialize(GetExtraData());
- pImplDlg->Activate(); // Zur Initialisierung der Daten
+ pImplDlg->Activate(); // for data's initialisation
FreeResource();
}
SwModalRedlineAcceptDlg::~SwModalRedlineAcceptDlg()
{
- AcceptAll(sal_False); // Alles uebriggebliebene ablehnen
+ AcceptAll(sal_False); // refuse everything remaining
pImplDlg->FillInfo(GetExtraData());
delete pImplDlg;
@@ -106,7 +105,7 @@ void SwModalRedlineAcceptDlg::AcceptAll( sal_Bool bAccept )
if (pFilterTP->IsDate() || pFilterTP->IsAuthor() ||
pFilterTP->IsRange() || pFilterTP->IsAction())
{
- pFilterTP->CheckDate(sal_False); // Alle Filter abschalten
+ pFilterTP->CheckDate(sal_False); // turn off all filters
pFilterTP->CheckAuthor(sal_False);
pFilterTP->CheckRange(sal_False);
pFilterTP->CheckAction(sal_False);
diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx
index f41bc49c9d..6aac405678 100644
--- a/sw/source/ui/misc/titlepage.cxx
+++ b/sw/source/ui/misc/titlepage.cxx
@@ -73,14 +73,6 @@ namespace
return bRet;
}
- bool lcl_SkipNPages(SwWrtShell *pSh, sal_uInt16 nNoPages)
- {
- bool bAllOk = true;
- for (sal_uInt16 nI = 0; nI < nNoPages && bAllOk; ++nI)
- bAllOk = pSh->SttNxtPg();
- return bAllOk;
- }
-
void lcl_ChangePage(SwWrtShell *pSh, sal_uInt16 nNewNumber,
const SwPageDesc *pNewDesc)
{
diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx
index 992aa94484..cc462ddb15 100644
--- a/sw/source/ui/ribbar/inputwin.cxx
+++ b/sw/source/ui/ribbar/inputwin.cxx
@@ -165,7 +165,7 @@ void SwInputWindow::CleanupUglyHackWithUndo()
{
SW_MOD()->GetUndoOptions().SetUndoCount(0);
}
- m_bResetUndo = sal_False;
+ m_bResetUndo = false; // #i117122# once is enough :)
}
}
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 3056cb315f..87e2d2f689 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -1247,16 +1247,17 @@ IMPL_LINK(SwBaseShell, GraphicArrivedHdl, SwCrsrShell* , EMPTYARG )
SwWrtShell &rSh = GetShell();
if( CNT_GRF == rSh.SwEditShell::GetCntType() &&
GRAPHIC_NONE != ( nGrfType = rSh.GetGraphicType() ) &&
- aGrfUpdateSlots.Count() )
+ !aGrfUpdateSlots.empty() )
{
sal_Bool bProtect = 0 != rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT);
SfxViewFrame* pVFrame = GetView().GetViewFrame();
sal_uInt16 nSlot;
- for( sal_uInt16 n = 0; n < aGrfUpdateSlots.Count(); ++n )
+ std::set<sal_uInt16>::iterator it;
+ for( it = aGrfUpdateSlots.begin(); it != aGrfUpdateSlots.end(); ++it )
{
sal_Bool bSetState = sal_False;
sal_Bool bState = sal_False;
- switch( nSlot = aGrfUpdateSlots[ n ] )
+ switch( nSlot = *it )
{
case SID_IMAP:
case SID_IMAP_EXEC:
@@ -1328,7 +1329,7 @@ IMPL_LINK(SwBaseShell, GraphicArrivedHdl, SwCrsrShell* , EMPTYARG )
pVFrame->GetBindings().SetState( aBool );
}
}
- aGrfUpdateSlots.RemoveAt( 0, aGrfUpdateSlots.Count() );
+ aGrfUpdateSlots.clear();
}
return 0;
}
@@ -1417,7 +1418,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
break;
case SID_IMAP:
{
- // --> OD 2006-11-08 #i59688#
+ // #i59688#
// improve efficiency:
// If selected object is protected, item has to disabled.
const sal_Bool bProtect = 0 != rSh.IsSelObjProtected(FLYPROTECT_CONTENT|FLYPROTECT_PARENT);
@@ -1433,7 +1434,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
const sal_Bool bIsGraphicSelection =
rSh.GetSelectionType() == nsSelectionType::SEL_GRF;
- // --> OD 2006-11-08 #i59688#
+ // #i59688#
// avoid unnecessary loading of selected graphic.
// The graphic is only needed, if the dialog is open.
//wenn die Grafik ausgeswappt ist, dann muss der
@@ -1461,9 +1462,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
rSet.Put(aBool);
}
}
- // <--
}
- // <--
}
break;
case SID_IMAP_EXEC:
@@ -1512,7 +1511,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
sal_Bool bDisable = sal_False;
if( !bHas && !bOk )
bDisable = sal_True;
- // --> OD 2006-11-08 #i59688#
+ // #i59688#
// avoid unnecessary loading of selected graphic.
// The graphic is only needed, if the dialog is open.
// wenn die Grafik ausgeswappt ist, dann muss der Status
@@ -1523,23 +1522,20 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
{
if( AddGrfUpdateSlot( nWhich ))
rSh.GetGraphic(sal_False); // start the loading
- // --> OD 2007-07-04 #i75481#
+ // #i75481#
bDisable = sal_True;
- // <--
}
else if( bHas && bOk )
bDisable = !lcl_UpdateContourDlg( rSh, nSel );
else if( bOk )
{
- // --> OD 2007-07-04 #i75481#
+ // #i75481#
// apply fix #i59688# only for selected graphics
if ( nSel & nsSelectionType::SEL_GRF )
bDisable = GRAPHIC_NONE == rSh.GetGraphicType();
else
bDisable = GRAPHIC_NONE == rSh.GetIMapGraphic().GetType();
- // <--
}
- // <--
if( bDisable )
rSet.DisableItem( nWhich );
@@ -1849,15 +1845,14 @@ void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
break;
case FN_WRAP_ANCHOR_ONLY:
aWrap.SetAnchorOnly(!aWrap.IsAnchorOnly());
- // --> OD 2006-06-02 #b6432130#
+ //
// keep previous wrapping
- // --> OD 2006-09-21 #138144# - adjust fix #b6432130#
+ //
// switch to wrap SURROUND_PARALLEL, if previous wrap is SURROUND_NONE
if ( nOldSurround != SURROUND_NONE )
{
nSurround = nOldSurround;
}
- // <--
break;
case FN_FRAME_WRAP_CONTOUR:
aWrap.SetContour(!aWrap.IsContour());
@@ -2699,12 +2694,12 @@ void SwBaseShell::GetGalleryState( SfxItemSet &rSet )
{
int nSel = rSh.GetSelectionType();
SfxStringListItem aLst( nWhich );
- List *pLst = aLst.GetList();
+ std::vector<String> &rLst = aLst.GetList();
nParagraphPos = nGraphicPos = nOlePos = nFramePos = nTablePos =
nTableRowPos = nTableCellPos = nPagePos =
nHeaderPos = nFooterPos = 0;
sal_uInt8 nPos = 1;
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_PAGE ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_PAGE ) );
nPagePos = nPos++;
sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
sal_Bool bHtmlMode = 0 != (nHtmlMode & HTMLMODE_ON);
@@ -2712,57 +2707,57 @@ void SwBaseShell::GetGalleryState( SfxItemSet &rSet )
if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_FULL_STYLES)) &&
(nSel & nsSelectionType::SEL_TXT) )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_PARAGRAPH ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_PARAGRAPH ) );
nParagraphPos = nPos++;
}
if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_SOME_STYLES)) &&
nSel & (nsSelectionType::SEL_TBL|nsSelectionType::SEL_TBL_CELLS) )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_TABLE ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_TABLE ) );
nTablePos = nPos++;
if(!bHtmlMode)
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_TABLE_ROW ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_TABLE_ROW ) );
nTableRowPos = nPos++;
}
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_TABLE_CELL), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_TABLE_CELL) );
nTableCellPos = nPos++;
}
if(!bHtmlMode)
{
if ( nSel & nsSelectionType::SEL_FRM )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_FRAME ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_FRAME ) );
nFramePos = nPos++;
}
if ( nSel & nsSelectionType::SEL_GRF )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_GRAPHIC ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_GRAPHIC ) );
nGraphicPos = nPos++;
}
if ( nSel & nsSelectionType::SEL_OLE )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_OLE ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_OLE ) );
nOlePos = nPos++;
}
const sal_uInt16 nType = rSh.GetFrmType(0,sal_True);
if ( nType & FRMTYPE_HEADER )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_HEADER ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_HEADER ) );
nHeaderPos = nPos++;
}
if ( nType & FRMTYPE_FOOTER )
{
- pLst->Insert( (void*) new SW_RESSTR( STR_SWBG_FOOTER ), pLst->Count() );
+ rLst.push_back( SW_RESSTR( STR_SWBG_FOOTER ) );
nFooterPos = nPos;
}
}
- if ( pLst->Count() )
- rSet.Put( aLst );
- else
+ if ( rLst.empty() )
rSet.DisableItem( nWhich );
+ else
+ rSet.Put( aLst );
break;
}
}
diff --git a/sw/source/ui/shells/drawdlg.cxx b/sw/source/ui/shells/drawdlg.cxx
index 9e82ea68d4..d3f5152635 100644
--- a/sw/source/ui/shells/drawdlg.cxx
+++ b/sw/source/ui/shells/drawdlg.cxx
@@ -101,7 +101,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
OSL_ENSURE(pDlg, "Dialogdiet fail!");
const SvxColorTableItem* pColorItem = (const SvxColorTableItem*)
GetView().GetDocShell()->GetItem(SID_COLOR_TABLE);
- if(pColorItem->GetColorTable() == XColorTable::GetStdColorTable())
+ if(pColorItem->GetColorTable() == &XColorTable::GetStdColorTable())
pDlg->DontDeleteColorTable();
if (pDlg->Execute() == RET_OK)
{
diff --git a/sw/source/ui/shells/drawsh.cxx b/sw/source/ui/shells/drawsh.cxx
index 6152846ae9..be3917ff5f 100644
--- a/sw/source/ui/shells/drawsh.cxx
+++ b/sw/source/ui/shells/drawsh.cxx
@@ -464,7 +464,7 @@ void SwDrawShell::GetFormTextState(SfxItemSet& rSet)
else
{
if ( pDlg )
- pDlg->SetColorTable(XColorTable::GetStdColorTable());
+ pDlg->SetColorTable(&XColorTable::GetStdColorTable());
pDrView->GetAttributes( rSet );
}
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index 7d027bb208..74d68739b1 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -280,7 +280,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
pSh->StartAllAction();
- // --> OD 2004-07-14 #i30451#
+ // #i30451#
pSh->StartUndo(UNDO_INSFMTATTR);
pSdrView->SetGeoAttrToMarked(*pOutSet);
@@ -363,7 +363,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
rBind.InvalidateAll(sal_False);
- // --> OD 2004-07-14 #i30451#
+ // #i30451#
pSh->EndUndo( UNDO_INSFMTATTR );
pSh->EndAllAction();
@@ -648,7 +648,6 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
break;
}
}
- // <--
}
return nRet;
}
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index a3fe8afa76..2de79a4679 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -900,11 +900,10 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet)
case SID_PASTE_SPECIAL:
rSet.DisableItem( SID_PASTE_SPECIAL );
break;
- // --> OD 2008-06-20 #151110#
+ // #151110#
case SID_CLIPBOARD_FORMAT_ITEMS:
rSet.DisableItem( SID_CLIPBOARD_FORMAT_ITEMS );
break;
- // <--
}
nWhich = aIter.NextWhich();
}
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 830c67b8ef..aa757f6b9c 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -304,7 +304,7 @@ void SwDrawTextShell::GetFormTextState(SfxItemSet& rSet)
else
{
if ( pDlg )
- pDlg->SetColorTable(XColorTable::GetStdColorTable());
+ pDlg->SetColorTable(&XColorTable::GetStdColorTable());
pDrView->GetAttributes( rSet );
}
@@ -696,7 +696,7 @@ void SwDrawTextShell::ExecRotateTransliteration( SfxRequest & rReq )
pOLV->TransliterateText( m_aRotateCase.getNextMode() );
}
-}
+}
/*--------------------------------------------------------------------
Beschreibung: Sonderzeichen einfuegen (siehe SDraw: FUBULLET.CXX)
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 73ab13ccf6..3c079303e7 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -49,10 +49,9 @@
#include <sfx2/request.hxx>
#include <sfx2/objface.hxx>
#include <svx/hlnkitem.hxx>
-// --> OD 2009-07-07 #i73249#
+// #i73249#
#include <svx/svdview.hxx>
#include <vcl/msgbox.hxx>
-// <--
#include <doc.hxx>
#include <fmturl.hxx>
@@ -86,9 +85,8 @@
#include <shells.hrc>
#include "swabstdlg.hxx"
#include "misc.hrc"
-// --> OD 2009-07-14 #i73249#
+// #i73249#
#include <svx/dialogs.hrc>
-// <--
#include <sfx2/filedlghelper.hxx>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
@@ -741,7 +739,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
rReq.SetReturnValue(SfxBoolItem(nSlot, bMirror));
}
break;
- // --> OD 2009-07-14 #i73249#
+ // #i73249#
case FN_TITLE_DESCRIPTION_SHAPE:
{
bUpdateMgr = sal_False;
@@ -773,7 +771,6 @@ void SwFrameShell::Execute(SfxRequest &rReq)
}
}
break;
- // <--
default:
OSL_ENSURE( !this, "wrong dispatcher" );
return;
@@ -1015,7 +1012,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
rSet.DisableItem( nWhich );
}
break;
- // --> OD 2009-07-07 #i73249#
+ // #i73249#
case FN_TITLE_DESCRIPTION_SHAPE:
{
SwWrtShell &rWrtSh = GetShell();
@@ -1028,7 +1025,6 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
}
break;
- // <--
default:
/* do nothing */;
break;
diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx
index 2d826fec42..739bd4c15c 100644
--- a/sw/source/ui/shells/grfsh.cxx
+++ b/sw/source/ui/shells/grfsh.cxx
@@ -212,14 +212,13 @@ void SwGrfShell::Execute(SfxRequest &rReq)
}
else
{
- // --> OD 2005-02-09 #119353# - robust
+ // #119353# - robust
const GraphicObject* pGrfObj = rSh.GetGraphicObj();
if ( pGrfObj )
{
aSet.Put( SvxBrushItem( *pGrfObj, GPOS_LT,
SID_ATTR_GRAF_GRAPHIC ) );
}
- // <--
}
aSet.Put( SfxBoolItem( FN_PARAM_GRF_CONNECT, sGrfNm.Len() > 0 ) );
@@ -496,7 +495,7 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq )
case SID_GRFFILTER_SOLARIZE:
if( GRAPHIC_BITMAP == nGrfType )
{
- // --> OD 2005-02-09 #119353# - robust
+ // #119353# - robust
const GraphicObject* pFilterObj( GetShell().GetGraphicObj() );
if ( pFilterObj )
{
@@ -506,7 +505,6 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq )
GetShell().ReRead( aEmptyStr, aEmptyStr,
&aFilterObj.GetGraphic() );
}
- // <--
}
break;
@@ -526,6 +524,9 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
rSh.GetCurAttr( aCoreSet );
sal_Bool bParentCntProt = 0 != rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT );
sal_Bool bIsGrfCntnt = CNT_GRF == GetShell().GetCntType();
+// const GraphicObject* pGrfObj = ( bIsGrfCntnt ? rSh.GetGraphicObj() : NULL );
+// sal_Bool bIsRenderGraphicGrfCntnt = ( pGrfObj && pGrfObj->IsRenderGraphic() );
+
SetGetStateSet( &rSet );
@@ -622,12 +623,12 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
case SID_ATTR_GRAF_TRANSPARENCE:
if( !bParentCntProt )
{
- // --> OD 2005-02-09 #119353# - robust
- const GraphicObject* pGrfObj = rSh.GetGraphicObj();
- if ( pGrfObj )
+ // #119353# - robust
+ const GraphicObject* pGrafObj = rSh.GetGraphicObj();
+ if ( pGrafObj )
{
- if( pGrfObj->IsAnimated() ||
- GRAPHIC_GDIMETAFILE == pGrfObj->GetType() )
+ if( pGrafObj->IsAnimated() ||
+ GRAPHIC_GDIMETAFILE == pGrafObj->GetType() )
bDisable = sal_True;
else
rSet.Put( SfxUInt16Item( nWhich, ((SwTransparencyGrf&)
@@ -679,7 +680,6 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
bDisable = eGraphicType != GRAPHIC_BITMAP;
}
}
- // <--
}
break;
@@ -703,7 +703,4 @@ SwGrfShell::SwGrfShell(SwView &_rView) :
SetHelpId(SW_GRFSHELL);
}
-
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx
index fec296968e..e17f6a56b5 100644
--- a/sw/source/ui/shells/langhelper.cxx
+++ b/sw/source/ui/shells/langhelper.cxx
@@ -377,16 +377,16 @@ namespace SwLangHelper
}
else // change language for all text
{
- SvUShortsSort aAttribs;
+ std::set<sal_uInt16> aAttribs;
for (sal_uInt16 i = 0; i < 3; ++i)
{
rWrtSh.SetDefault( SvxLanguageItem( LANGUAGE_NONE, aLangWhichId_Writer[i] ) );
- aAttribs.Insert( aLangWhichId_Writer[i] );
+ aAttribs.insert( aLangWhichId_Writer[i] );
}
// set all language attributes to default
// (for all text in the document - which should be selected by now...)
- rWrtSh.ResetAttr( &aAttribs );
+ rWrtSh.ResetAttr( aAttribs );
}
}
@@ -414,11 +414,11 @@ namespace SwLangHelper
}
else
{
- SvUShortsSort aAttribs;
- aAttribs.Insert( RES_CHRATR_LANGUAGE );
- aAttribs.Insert( RES_CHRATR_CJK_LANGUAGE );
- aAttribs.Insert( RES_CHRATR_CTL_LANGUAGE );
- rWrtSh.ResetAttr( &aAttribs );
+ std::set<sal_uInt16> aAttribs;
+ aAttribs.insert( RES_CHRATR_LANGUAGE );
+ aAttribs.insert( RES_CHRATR_CJK_LANGUAGE );
+ aAttribs.insert( RES_CHRATR_CTL_LANGUAGE );
+ rWrtSh.ResetAttr( aAttribs );
}
}
diff --git a/sw/source/ui/shells/listsh.cxx b/sw/source/ui/shells/listsh.cxx
index e9d341ac69..b78ae22cd3 100644
--- a/sw/source/ui/shells/listsh.cxx
+++ b/sw/source/ui/shells/listsh.cxx
@@ -74,7 +74,7 @@ SFX_IMPL_INTERFACE(SwListShell, SwBaseShell, SW_RES(STR_SHELLNAME_LIST))
TYPEINIT1(SwListShell,SwBaseShell)
-// --> FME 2005-01-04 #i35572# Functionality of Numbering/Bullet toolbar
+// #i35572# Functionality of Numbering/Bullet toolbar
// for outline numbered paragraphs should match the functions for outlines
// available in the navigator. Therefore the code in the following
// function is quite similar the the code in SwContentTree::ExecCommand.
@@ -143,7 +143,6 @@ void lcl_OutlineUpDownWithSubPoints( SwWrtShell& rSh, bool bMove, bool bUp )
rSh.Pop( sal_False );
}
}
-// <--
void SwListShell::Execute(SfxRequest &rReq)
{
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index 8c0759a8f5..465955155b 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -141,7 +141,7 @@ const sal_uInt16 aUITableAttrRange[] =
RES_FRAMEDIR, RES_FRAMEDIR,
RES_ROW_SPLIT, RES_ROW_SPLIT,
FN_TABLE_BOX_TEXTDIRECTION, FN_TABLE_BOX_TEXTDIRECTION,
-// --> collapsing borders FME 2005-05-27 #i29550#
+// #i29550#
RES_COLLAPSING_BORDERS, RES_COLLAPSING_BORDERS,
// <-- collapsing borders
0
@@ -438,7 +438,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet,
RES_UL_SPACE,
RES_SHADOW,
RES_FRAMEDIR,
- // --> collapsing borders FME 2005-05-27 #i29550#
+ // #i29550#
RES_COLLAPSING_BORDERS,
// <-- collapsing borders
0
@@ -892,7 +892,6 @@ void SwTableShell::Execute(SfxRequest &rReq)
ItemSetToTableParam( aSet, rSh );
rSh.EndUndo( nUndoId );
}
- // <--
bCallDone = sal_True;
break;
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index de64856e4f..5a2b40be50 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -172,9 +172,9 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
sal_Unicode cIns = FN_INSERT_HARD_SPACE == nSlot ? CHAR_HARDBLANK
: CHAR_HARDHYPHEN;
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- SvxAutoCorrect* pACorr = pACfg->GetAutoCorrect();
- if( pACorr && pACfg->IsAutoFmtByInput() &&
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ SvxAutoCorrect* pACorr = rACfg.GetAutoCorrect();
+ if( pACorr && rACfg.IsAutoFmtByInput() &&
pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
AddNonBrkSpace | ChgOrdinalNumber |
ChgToEnEmDash | SetINetAttr | Autocorrect ))
@@ -310,7 +310,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
INetURLObject(), sClassLocation,
URIHelper::GetMaybeFileHdl()) ) ) );
uno::Sequence< beans::PropertyValue > aSeq;
- if ( aCommandList.Count() )
+ if ( aCommandList.size() )
{
aCommandList.FillSequence( aSeq );
xSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PluginCommands")), uno::makeAny( aSeq ) );
@@ -513,8 +513,8 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
sal_Bool bSingleCol = sal_False;
if( 0!= dynamic_cast< SwWebDocShell*>( GetView().GetDocShell()) )
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- sal_uInt16 nExport = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ sal_uInt16 nExport = rHtmlOpt.GetExportMode();
if( HTML_CFG_MSIE == nExport ||
HTML_CFG_HTML32 == nExport ||
HTML_CFG_MSIE_40 == nExport ||
@@ -751,11 +751,10 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
rSh.Push();
const sal_Bool bCrsrInHidden = rSh.SelectHiddenRange();
- // --> OD 2009-08-05 #i103839#, #b6855246#
+ // #i103839#
// Do not call method <SwCrsrShell::Pop(..)> with 1st parameter = <sal_False>
// in order to avoid that the view jumps to the visible cursor.
rSh.Pop();
- // <--
while ( nWhich )
{
@@ -800,8 +799,8 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
rSet.DisableItem( nWhich );
else if(SID_INSERT_FLOATINGFRAME == nWhich && nHtmlMode&HTMLMODE_ON)
{
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- sal_uInt16 nExport = pHtmlOpt->GetExportMode();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ sal_uInt16 nExport = rHtmlOpt.GetExportMode();
if(HTML_CFG_MSIE_40 != nExport && HTML_CFG_WRITER != nExport )
rSet.DisableItem(nWhich);
}
@@ -1161,13 +1160,12 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
rSh.ClearMark();
- // --> FME 2007-07-09 #i75891#
+ // #i75891#
// SETATTR_DONTEXPAND does not work if there are already hard attributes.
// Therefore we have to restore the font attributes.
rSh.SetMark();
rSh.SetAttr( aRestoreSet );
rSh.ClearMark();
- // <--
rSh.UpdateAttr();
aFont = aNewFontItem;
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index a1cce6c575..016037ae18 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -490,7 +490,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
// #i78856, reset all attributes but not the language attributes
// (for this build an array of all relevant attributes and
// remove the languages from that)
- SvUShortsSort aAttribs;
+ std::set<sal_uInt16> aAttribs;
sal_uInt16 aResetableSetRange[] = {
RES_FRMATR_BEGIN, RES_FRMATR_END-1,
@@ -510,11 +510,11 @@ void SwTextShell::Execute(SfxRequest &rReq)
sal_uInt16 nL = pUShorts[1] - pUShorts[0] + 1;
sal_uInt16 nE = pUShorts[0];
for (sal_uInt16 i = 0; i < nL; ++i)
- aAttribs.Insert( nE++ );
+ aAttribs.insert( aAttribs.end(), nE++ );
pUShorts += 2;
}
- rWrtSh.ResetAttr( &aAttribs );
+ rWrtSh.ResetAttr( aAttribs );
rReq.Done();
break;
}
@@ -604,7 +604,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
case FN_AUTOFORMAT_REDLINE_APPLY:
{
- SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags());
+ SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags());
// das muss fuer die Nachbearbeitung immer sal_False sein
aFlags.bAFmtByInput = sal_False;
aFlags.bWithRedlining = sal_True;
@@ -648,7 +648,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
case FN_AUTOFORMAT_APPLY:
{
- SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get()->GetAutoCorrect()->GetSwFlags());
+ SvxSwAutoFmtFlags aFlags(SvxAutoCorrCfg::Get().GetAutoCorrect()->GetSwFlags());
// das muss fuer die Nachbearbeitung immer sal_False sein
aFlags.bAFmtByInput = sal_False;
rWrtSh.AutoFormat( &aFlags );
@@ -657,11 +657,11 @@ void SwTextShell::Execute(SfxRequest &rReq)
break;
case FN_AUTOFORMAT_AUTO:
{
- SvxAutoCorrCfg* pACfg = SvxAutoCorrCfg::Get();
- sal_Bool bSet = pItem ? ((const SfxBoolItem*)pItem)->GetValue() : !pACfg->IsAutoFmtByInput();
- if( bSet != pACfg->IsAutoFmtByInput() )
+ SvxAutoCorrCfg& rACfg = SvxAutoCorrCfg::Get();
+ sal_Bool bSet = pItem ? ((const SfxBoolItem*)pItem)->GetValue() : !rACfg.IsAutoFmtByInput();
+ if( bSet != rACfg.IsAutoFmtByInput() )
{
- pACfg->SetAutoFmtByInput( bSet );
+ rACfg.SetAutoFmtByInput( bSet );
GetView().GetViewFrame()->GetBindings().Invalidate( nSlot );
if ( !pItem )
rReq.AppendItem( SfxBoolItem( GetPool().GetWhich(nSlot), bSet ) );
@@ -673,7 +673,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
// erstmal auf Blank defaulten
sal_Unicode cChar = ' ';
- rWrtSh.AutoCorrect( *SvxAutoCorrCfg::Get()->GetAutoCorrect(), cChar );
+ rWrtSh.AutoCorrect( *SvxAutoCorrCfg::Get().GetAutoCorrect(), cChar );
rReq.Done();
}
break;
@@ -809,9 +809,9 @@ void SwTextShell::Execute(SfxRequest &rReq)
rWrtSh.SelWrd();
}
//now remove the attribute
- SvUShortsSort aAttribs;
- aAttribs.Insert( RES_TXTATR_INETFMT );
- rWrtSh.ResetAttr( &aAttribs );
+ std::set<sal_uInt16> aAttribs;
+ aAttribs.insert( RES_TXTATR_INETFMT );
+ rWrtSh.ResetAttr( aAttribs );
if(!bSel)
{
rWrtSh.Pop(sal_False);
@@ -819,6 +819,9 @@ void SwTextShell::Execute(SfxRequest &rReq)
}
}
break;
+ case FN_EDIT_HEADER_FOOTER:
+ rWrtSh.ToggleHeaderFooterEdit();
+ break;
case SID_ATTR_BRUSH_CHAR :
case SID_ATTR_CHAR_SCALEWIDTH :
case SID_ATTR_CHAR_ROTATED :
@@ -977,7 +980,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
rReq.Done( *pSet );
::SfxToSwPageDescAttr( rWrtSh, *pSet );
- // --> OD 2006-12-06 #i56253#
+ // #i56253#
// enclose all undos.
// Thus, check conditions, if actions will be performed.
const bool bUndoNeeded( pSet->Count() ||
@@ -987,7 +990,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
rWrtSh.StartUndo( UNDO_INSATTR );
}
- // <--
if( pSet->Count() )
{
rWrtSh.StartAction();
@@ -1013,12 +1015,11 @@ void SwTextShell::Execute(SfxRequest &rReq)
//if it's set to something different than USHRT_MAX
sal_Bool bStart = ((SfxBoolItem&)pSet->Get(FN_NUMBER_NEWSTART)).GetValue();
- // --> OD 2007-06-11 #b6560525#
+ //
// Default value for restart value has to be USHRT_MAX
// in order to indicate that the restart value of the list
// style has to be used on restart.
sal_uInt16 nNumStart = USHRT_MAX;
- // <--
if( SFX_ITEM_SET == pSet->GetItemState(FN_NUMBER_NEWSTART_AT) )
{
nNumStart = ((SfxUInt16Item&)pSet->Get(FN_NUMBER_NEWSTART_AT)).GetValue();
@@ -1032,12 +1033,11 @@ void SwTextShell::Execute(SfxRequest &rReq)
rWrtSh.SetNodeNumStart(nNumStart);
rWrtSh.SetNumRuleStart(sal_False);
}
- // --> OD 2006-12-06 #i56253#
+ // #i56253#
if ( bUndoNeeded )
{
rWrtSh.EndUndo( UNDO_INSATTR );
}
- // <--
}
delete pDlg;
@@ -1048,13 +1048,12 @@ void SwTextShell::Execute(SfxRequest &rReq)
String sContinuedListId;
const SwNumRule* pRule =
rWrtSh.SearchNumRule( false, true, false, -1, sContinuedListId );
- // --> OD 2009-08-26 #i86492#
+ // #i86492#
// Search also for bullet list
if ( !pRule )
{
pRule = rWrtSh.SearchNumRule( false, false, false, -1, sContinuedListId );
}
- // <--
if ( pRule )
{
rWrtSh.SetCurNumRule( *pRule, false, sContinuedListId );
@@ -1428,7 +1427,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
break;
case FN_AUTOFORMAT_AUTO:
{
- rSet.Put( SfxBoolItem( nWhich, SvxAutoCorrCfg::Get()->IsAutoFmtByInput() ));
+ rSet.Put( SfxBoolItem( nWhich, SvxAutoCorrCfg::Get().IsAutoFmtByInput() ));
}
break;
case FN_GLOSSARY_DLG:
@@ -1569,6 +1568,24 @@ void SwTextShell::GetState( SfxItemSet &rSet )
}
}
break;
+ case FN_EDIT_HEADER_FOOTER:
+ {
+ SfxBoolItem aBool( nWhich, rSh.IsHeaderFooterEdit() );
+ rSet.Put( aBool );
+
+ bool bHasHeaderFooter = false;
+ for ( sal_uInt16 i = 0; !bHasHeaderFooter && i < rSh.GetPageDescCnt(); i++ )
+ {
+ const SwPageDesc& rPageDesc = rSh.GetPageDesc( i );
+ bHasHeaderFooter = rPageDesc.GetMaster().GetHeader().IsActive() ||
+ rPageDesc.GetMaster().GetFooter().IsActive() ||
+ rPageDesc.GetLeft().GetHeader().IsActive() ||
+ rPageDesc.GetLeft().GetFooter().IsActive();
+ }
+ if ( !bHasHeaderFooter )
+ rSet.DisableItem( nWhich );
+ }
+ break;
case SID_TRANSLITERATE_HALFWIDTH:
case SID_TRANSLITERATE_FULLWIDTH:
case SID_TRANSLITERATE_HIRAGANA:
@@ -1648,7 +1665,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
case FN_NUM_CONTINUE:
{
{
- // --> OD 2009-08-26 #i86492#
+ // #i86492#
// Search also for bullet list
String aDummy;
const SwNumRule* pRule =
@@ -1657,7 +1674,6 @@ void SwTextShell::GetState( SfxItemSet &rSet )
{
pRule = rSh.SearchNumRule( false, false, false, -1, aDummy );
}
- // <--
if ( !pRule )
rSet.DisableItem(nWhich);
}
@@ -1680,10 +1696,10 @@ void SwTextShell::GetState( SfxItemSet &rSet )
}
}
-/* -----------------------------2002/07/05 10:31------------------------------
- Switch on/off header of footer of a page style - if an empty name is
- given all styles are changed
- ---------------------------------------------------------------------------*/
+/*
+ * Switch on/off header of footer of a page style - if an empty name is
+ * given all styles are changed
+ */
void SwTextShell::ChangeHeaderOrFooter(
const String& rStyleName, sal_Bool bHeader, sal_Bool bOn, sal_Bool bShowWarning)
{
@@ -1703,7 +1719,7 @@ void SwTextShell::ChangeHeaderOrFooter(
{
if( (bShowWarning && !bOn && GetActiveView() && GetActiveView() == &GetView() &&
(bHeader && aDesc.GetMaster().GetHeader().IsActive())) ||
- (!bHeader && aDesc.GetMaster().GetFooter().IsActive()))
+ (!bHeader && aDesc.GetMaster().GetFooter().IsActive()) )
{
bShowWarning = sal_False;
//Actions have to be closed while the dialog is showing
@@ -1737,9 +1753,13 @@ void SwTextShell::ChangeHeaderOrFooter(
rSh.ChgPageDesc( nFrom, aDesc );
if( !bCrsrSet && bOn )
+ {
+ if ( !rSh.IsHeaderFooterEdit() )
+ rSh.ToggleHeaderFooterEdit();
bCrsrSet = rSh.SetCrsrInHdFt(
!rStyleName.Len() ? USHRT_MAX : nFrom,
bHeader );
+ }
}
}
}
diff --git a/sw/source/ui/shells/txtnum.cxx b/sw/source/ui/shells/txtnum.cxx
index b69efbf4f2..b43c546871 100644
--- a/sw/source/ui/shells/txtnum.cxx
+++ b/sw/source/ui/shells/txtnum.cxx
@@ -137,9 +137,8 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
else
{
SwNumRule aRule( GetShell().GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
SvxNumRule aSvxRule = aRule.MakeSvxNumRule();
const bool bRightToLeft = GetShell().IsInRightToLeftText( 0 );
@@ -154,13 +153,12 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
aFmt.SetLSpace(720);
aFmt.SetAbsLSpace(n * 720);
}
- // --> FME 2005-01-21 #i38904# Default alignment for
+ // #i38904# Default alignment for
// numbering/bullet should be rtl in rtl paragraph:
if ( bRightToLeft )
{
aFmt.SetNumAdjust( SVX_ADJUST_RIGHT );
}
- // <--
aSvxRule.SetLevel( n, aFmt, sal_False );
}
aSvxRule.SetFeatureFlag(NUM_ENABLE_EMBEDDED_BMP, sal_False);
@@ -191,9 +189,8 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
SwNumRule aSetRule( pCurRule
? pCurRule->GetName()
: GetShell().GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
aSetRule.SetSvxRule( *pSetRule, GetShell().GetDoc());
aSetRule.SetAutoRule( sal_True );
// No start of new list, if an existing list style is edited.
@@ -210,9 +207,8 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
rReq.Done();
SvxNumRule* pSetRule = ((SvxNumBulletItem*)pItem)->GetNumRule();
SwNumRule aSetRule( GetShell().GetUniqueNumRuleName(),
- // --> OD 2008-06-06 #i89178#
+ // #i89178#
numfunc::GetDefaultPositionAndSpaceMode() );
- // <--
aSetRule.SetSvxRule(*pSetRule, GetShell().GetDoc());
aSetRule.SetAutoRule( sal_True );
// start new list
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 50f10d22fd..6cbd2186af 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1527,8 +1527,8 @@ sal_Bool SwTextFlowPage::FillItemSet( SfxItemSet& rSet )
void SwTextFlowPage::Reset( const SfxItemSet& rSet )
{
const SfxPoolItem* pItem;
- SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
- sal_Bool bFlowAllowed = !bHtmlMode || pHtmlOpt->IsPrintLayoutExtension();
+ SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
+ sal_Bool bFlowAllowed = !bHtmlMode || rHtmlOpt.IsPrintLayoutExtension();
if(bFlowAllowed)
{
// Einfuegen der vorhandenen Seitenvorlagen in die Listbox
diff --git a/sw/source/ui/table/tablepg.hxx b/sw/source/ui/table/tablepg.hxx
index 90d528fae1..d816a5a3c0 100644
--- a/sw/source/ui/table/tablepg.hxx
+++ b/sw/source/ui/table/tablepg.hxx
@@ -171,9 +171,6 @@ public:
};
-/*-----------------12.12.96 11.48-------------------
- Textfluss
---------------------------------------------------*/
class SwTextFlowPage : public SfxTabPage
{
FixedLine aFlowFL;
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index b07888572c..9223715b49 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -197,9 +197,9 @@ rtl_TextEncoding lcl_GetStreamCharSet(rtl_TextEncoding eLoadEncoding)
rtl_TextEncoding eRet = eLoadEncoding;
if(RTL_TEXTENCODING_DONTKNOW == eRet)
{
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
const sal_Char *pCharSet =
- rtl_getBestMimeCharsetFromTextEncoding( pHtmlOptions->GetTextEncoding() );
+ rtl_getBestMimeCharsetFromTextEncoding( rHtmlOptions.GetTextEncoding() );
eRet = rtl_getTextEncodingFromMimeCharset( pCharSet );
}
return eRet;
@@ -779,9 +779,9 @@ void SwSrcView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
void SwSrcView::Load(SwDocShell* pDocShell)
{
- SvxHtmlOptions* pHtmlOptions = SvxHtmlOptions::Get();
+ SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get();
const sal_Char *pCharSet =
- rtl_getBestMimeCharsetFromTextEncoding( pHtmlOptions->GetTextEncoding() );
+ rtl_getBestMimeCharsetFromTextEncoding( rHtmlOptions.GetTextEncoding() );
rtl_TextEncoding eDestEnc = rtl_getTextEncodingFromMimeCharset( pCharSet );
aEditWin.SetReadonly(pDocShell->IsReadOnly());
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index c0eb7f426d..77f87ee869 100644..100755
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -756,7 +756,8 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
nRightBorderDistance( 0 ),
bInMailMerge(sal_False),
bInDtor(sal_False),
- bOldShellWasPagePreView(sal_False)
+ bOldShellWasPagePreView(sal_False),
+ bIsPreviewDoubleClick(sal_False)
{
// According to discussion with MBA and further
// investigations, no old SfxViewShell will be set as parameter <pOldSh>,
@@ -813,6 +814,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos();
nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage();
bOldShellWasPagePreView = sal_True;
+ bIsPreviewDoubleClick = sNewCrsrPos.Len() > 0 || nNewPage != USHRT_MAX;
}
else if( pExistingSh->IsA( TYPE( SwSrcView ) ) )
bOldShellWasSrcView = sal_True;
@@ -1262,7 +1264,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >& rSequence, sal_Bool bBrowse )
{
- if(GetDocShell()->IsPreview())
+ if(GetDocShell()->IsPreview()||bIsPreviewDoubleClick)
return;
bool bIsOwnDocument = lcl_IsOwnDocument( *this );
sal_Int32 nLength = rSequence.getLength();
diff --git a/sw/source/ui/uiview/view.src b/sw/source/ui/uiview/view.src
index e006ee71ae..3adcc5435c 100644
--- a/sw/source/ui/uiview/view.src
+++ b/sw/source/ui/uiview/view.src
@@ -142,7 +142,6 @@ String STR_NUM_OUTLINE
{
Text [ en-US ] = "Outline ";
};//<-end,zhaojianwei
-// <--
String STR_ERROR_NOLANG
{
Text [ en-US ] = "No language is selected in the proofed section." ;
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index e733a989d3..c0e7f03bdf 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -176,9 +176,9 @@ static void lcl_SetAllTextToDefaultLanguage( SwWrtShell &rWrtSh, sal_uInt16 nWhi
rWrtSh.ExtendedSelectAll();
// set language attribute to default for all text
- SvUShortsSort aAttribs;
- aAttribs.Insert( nWhichId );
- rWrtSh.ResetAttr( &aAttribs );
+ std::set<sal_uInt16> aAttribs;
+ aAttribs.insert( nWhichId );
+ rWrtSh.ResetAttr( aAttribs );
rWrtSh.Pop( sal_False );
rWrtSh.LockView( sal_False );
@@ -222,7 +222,7 @@ int SwView::InsertGraphic( const String &rPath, const String &rFilter,
else
{
if( !pFlt )
- pFlt = GraphicFilter::GetGraphicFilter();
+ pFlt = &GraphicFilter::GetGraphicFilter();
nRes = GraphicFilter::LoadGraphic( rPath, rFilter, aGrf, pFlt );
}
@@ -420,11 +420,11 @@ sal_Bool SwView::InsertGraphicDlg( SfxRequest& rReq )
rSh.StartUndo(UNDO_INSERT, &aRewriter);
- int nError = InsertGraphic( aFileName, aFilterName, bAsLink, GraphicFilter::GetGraphicFilter() );
+ int nError = InsertGraphic( aFileName, aFilterName, bAsLink, &GraphicFilter::GetGraphicFilter() );
// Format ist ungleich Current Filter, jetzt mit auto. detection
if( nError == GRFILTER_FORMATERROR )
- nError = InsertGraphic( aFileName, aEmptyStr, bAsLink, GraphicFilter::GetGraphicFilter() );
+ nError = InsertGraphic( aFileName, aEmptyStr, bAsLink, &GraphicFilter::GetGraphicFilter() );
if ( rSh.IsFrmSelected() )
{
SwFrmFmt* pFmt = pDoc->FindFrmFmtByName( sGraphicFormat );
@@ -1863,7 +1863,7 @@ sal_Bool SwView::JumpToSwMark( const String& rMark )
else if( 0 != ( pINet = pWrtShell->FindINetAttr( sMark ) ))
bRet = pWrtShell->GotoINetAttr( *pINet->GetTxtINetFmt() );
- // #b6330459# make selection visible later
+ // make selection visible later
if ( aVisArea.IsEmpty() )
bMakeSelectionVisible = sal_True;
@@ -2035,7 +2035,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe
else
{
::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo());
- nErrno = pDocSh->InsertFrom( *pMedium ) ? 0 : ERR_SWG_READ_ERROR;
+ nErrno = pDocSh->ImportFrom( *pMedium, true ) ? 0 : ERR_SWG_READ_ERROR;
}
}
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index b3e8d6ea2e..c127e9c3ae 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -413,10 +413,11 @@ void SwView::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
#if OSL_DEBUG_LEVEL > 1
if(nSlot)
{
- ByteString sStr( "nSlot: " );
- sStr += ByteString::CreateFromInt32( nSlot );
- sStr += " wrong Dispatcher (viewsrch.cxx)";
- OSL_FAIL(sStr.GetBuffer() );
+ rtl::OStringBuffer sStr(RTL_CONSTASCII_STRINGPARAM("nSlot: "));
+ sStr.append(static_cast<sal_Int32>(nSlot));
+ sStr.append(RTL_CONSTASCII_STRINGPARAM(
+ " wrong Dispatcher (viewsrch.cxx)"));
+ OSL_FAIL(sStr.getStr());
}
#endif
return;
@@ -589,17 +590,68 @@ void SwView::Replace()
{
if (GetPostItMgr()->HasActiveSidebarWin())
GetPostItMgr()->Replace(pSrchItem);
- sal_Bool bReplaced = pWrtShell->SwEditShell::Replace( pSrchItem->GetReplaceString(),
- pSrchItem->GetRegExp());
- if( bReplaced && pReplList && pReplList->Count() && pWrtShell->HasSelection() )
+ sal_Bool bReqReplace = true;
+
+ if(pWrtShell->HasSelection())
+ {
+ /* check that the selection match the search string*/
+ //save state
+ SwPosition aStartPos = (* pWrtShell->GetSwCrsr()->Start());
+ SwPosition aEndPos = (* pWrtShell->GetSwCrsr()->End());
+ sal_Bool bHasSelection = pSrchItem->GetSelection();
+ sal_uInt16 nOldCmd = pSrchItem->GetCommand();
+
+ //set state for checking if current selection has a match
+ pSrchItem->SetCommand( SVX_SEARCHCMD_FIND );
+ pSrchItem->SetSelection(true);
+
+ //check if it matchs
+ SwSearchOptions aOpts( pWrtShell, pSrchItem->GetBackward() );
+ if( ! FUNC_Search(aOpts) )
+ {
+
+ //no matching therefore should not replace selection
+ // => remove selection
+
+ if(! pSrchItem->GetBackward() )
+ {
+ (* pWrtShell->GetSwCrsr()->Start()) = aStartPos;
+ (* pWrtShell->GetSwCrsr()->End()) = aEndPos;
+ }
+ else
+ {
+ (* pWrtShell->GetSwCrsr()->Start()) = aEndPos;
+ (* pWrtShell->GetSwCrsr()->End()) = aStartPos;
+ }
+ bReqReplace = false;
+ }
+
+ //set back old search state
+ pSrchItem->SetCommand( nOldCmd );
+ pSrchItem->SetSelection(bHasSelection);
+ }
+ /*
+ * remove current selection
+ * otherwise it is always replaced
+ * no matter if the search string exists or not in the selection
+ * Now the selection is removed and the next matching string is selected
+ */
+
+ if( bReqReplace )
{
- SfxItemSet aReplSet( pWrtShell->GetAttrPool(),
- aTxtFmtCollSetRange );
- if( pReplList->Get( aReplSet ).Count() )
+
+ sal_Bool bReplaced = pWrtShell->SwEditShell::Replace( pSrchItem->GetReplaceString(),
+ pSrchItem->GetRegExp());
+ if( bReplaced && pReplList && pReplList->Count() && pWrtShell->HasSelection() )
{
- ::SfxToSwPageDescAttr( *pWrtShell, aReplSet );
- pWrtShell->SwEditShell::SetAttr( aReplSet );
+ SfxItemSet aReplSet( pWrtShell->GetAttrPool(),
+ aTxtFmtCollSetRange );
+ if( pReplList->Get( aReplSet ).Count() )
+ {
+ ::SfxToSwPageDescAttr( *pWrtShell, aReplSet );
+ pWrtShell->SwEditShell::SetAttr( aReplSet );
+ }
}
}
}
diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx
index 348907f528..4c60bffa80 100644
--- a/sw/source/ui/uiview/viewtab.cxx
+++ b/sw/source/ui/uiview/viewtab.cxx
@@ -603,7 +603,6 @@ void SwView::ExecTabWin( SfxRequest& rReq )
rSh.GetCurAttr( aSet );
const SvxLRSpaceItem& rLR =
static_cast<const SvxLRSpaceItem&>(aSet.Get(RES_LR_SPACE));
- // <--
SwPosition aPos(*pNumRuleNodeFromDoc);
// #i90078#
@@ -611,7 +610,6 @@ void SwView::ExecTabWin( SfxRequest& rReq )
// #i42921# invalidate state of indent in order to get a ruler update.
aParaMargin.SetWhich( nSlot );
GetViewFrame()->GetBindings().SetState( aParaMargin );
- // <--
}
else if( pColl && pColl->IsAutoUpdateFmt() )
{
@@ -1086,7 +1084,6 @@ void SwView::StateTabWin(SfxItemSet& rSet)
// #i42922# Mouse move of numbering label
// has to consider the left indent of the paragraph
pNumRuleNodeFromDoc->GetLeftMarginWithNum( sal_True ) );
- // <--
short nFLOffset;
pNumRuleNodeFromDoc->GetFirstLineOfsWithNum( nFLOffset );
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index 907aaa2130..7c0792706e 100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -49,6 +49,7 @@
#include <svx/zoomitem.hxx>
#include <unomod.hxx>
#include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
#include "swmodule.hxx"
#include "cfgitems.hxx"
@@ -116,9 +117,8 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_USE_OLD_PRINTER_METRICS,
HANDLE_PROTECT_FORM,
HANDLE_TABS_RELATIVE_TO_INDENT,
- // --> OD 2008-06-05 #i89181#
+ // #i89181#
HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
- // <--
HANDLE_MODIFYPASSWORDINFO,
HANDLE_MATH_BASELINE_ALIGNMENT,
HANDLE_INVERT_BORDER_SPACING,
@@ -175,7 +175,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo()
{ RTL_CONSTASCII_STRINGPARAM("UseOldPrinterMetrics"), HANDLE_USE_OLD_PRINTER_METRICS, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("TabsRelativeToIndent"), HANDLE_TABS_RELATIVE_TO_INDENT, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("ProtectForm"), HANDLE_PROTECT_FORM, CPPUTYPE_BOOLEAN, 0, 0},
- // --> OD 2008-06-05 #i89181#
+ // #i89181#
{ RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("MathBaselineAlignment"), HANDLE_MATH_BASELINE_ALIGNMENT, CPPUTYPE_BOOLEAN, 0, 0},
@@ -274,18 +274,15 @@ uno::Sequence< uno::Type > SAL_CALL SwXDocumentSettings::getTypes( )
return aBaseTypes;
}
+namespace
+{
+ class theSwXDocumentSettingsImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXDocumentSettingsImplementationId > {};
+}
+
uno::Sequence< sal_Int8 > SAL_CALL SwXDocumentSettings::getImplementationId( )
throw (RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXDocumentSettingsImplementationId::get().getSeq();
}
void SwXDocumentSettings::_preSetValues ()
@@ -666,14 +663,13 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
mpDoc->set(IDocumentSettingAccess::PROTECT_FORM, bTmp);
}
break;
- // --> OD 2008-06-05 #i89181#
+ // #i89181#
case HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
{
sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
mpDoc->set(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, bTmp);
}
break;
- // <--
case HANDLE_MODIFYPASSWORDINFO:
{
uno::Sequence< beans::PropertyValue > aInfo;
@@ -1027,14 +1023,13 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue.setValue( &bTmp, ::getBooleanCppuType() );
}
break;
- // --> OD 2008-06-05 #i89181#
+ // #i89181#
case HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
{
sal_Bool bTmp = mpDoc->get(IDocumentSettingAccess::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST);
rValue.setValue( &bTmp, ::getBooleanCppuType() );
}
break;
- // <--
case HANDLE_MODIFYPASSWORDINFO:
{
rValue <<= mpDocSh->GetModifyPasswordInfo();
diff --git a/sw/source/ui/uno/SwXFilterOptions.cxx b/sw/source/ui/uno/SwXFilterOptions.cxx
index 8d8aa1c4b3..fbebe8df71 100644
--- a/sw/source/ui/uno/SwXFilterOptions.cxx
+++ b/sw/source/ui/uno/SwXFilterOptions.cxx
@@ -185,7 +185,7 @@ uno::Reference<uno::XInterface> SAL_CALL SwXFilterOptions_createInstance(
const uno::Reference<lang::XMultiServiceFactory>& )
{
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
return (::cppu::OWeakObject*) new SwXFilterOptions;
}
diff --git a/sw/source/ui/uno/detreg.cxx b/sw/source/ui/uno/detreg.cxx
index d7dcf4bea9..3e471200db 100644
--- a/sw/source/ui/uno/detreg.cxx
+++ b/sw/source/ui/uno/detreg.cxx
@@ -37,14 +37,7 @@ using namespace ::com::sun::star::lang;
extern "C" {
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char** ppEnvironmentTypeName,
- uno_Environment** /*ppEnvironment*/ )
-{
- *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
-}
-
-SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL swd_component_getFactory(
const sal_Char* pImplementationName,
void* pServiceManager,
void* /*pRegistryKey*/ )
diff --git a/sw/source/ui/uno/dlelstnr.cxx b/sw/source/ui/uno/dlelstnr.cxx
index 8eaa8993eb..0505141470 100644
--- a/sw/source/ui/uno/dlelstnr.cxx
+++ b/sw/source/ui/uno/dlelstnr.cxx
@@ -155,9 +155,9 @@ void SAL_CALL SwLinguServiceEventListener::disposing(
{
SolarMutexGuard aGuard;
- if (xLngSvcMgr.is() && rEventObj.Source == xLngSvcMgr)
+ if (xLngSvcMgr.is() && rEventObj.Source == xLngSvcMgr)
xLngSvcMgr = 0;
- if (xLngSvcMgr.is() && rEventObj.Source == xGCIterator)
+ if (xLngSvcMgr.is() && rEventObj.Source == xGCIterator)
xGCIterator = 0;
}
diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index 601bd439e9..320d59a66b 100644
--- a/sw/source/ui/uno/swdetect.cxx
+++ b/sw/source/ui/uno/swdetect.cxx
@@ -455,7 +455,6 @@ UNOSEQUENCE< UNOOUSTRING > SAL_CALL SwFilterDetect::getSupportedServiceNames() t
/* Helper for XServiceInfo */
UNOSEQUENCE< UNOOUSTRING > SwFilterDetect::impl_getStaticSupportedServiceNames()
{
- UNOMUTEXGUARD aGuard( UNOMUTEX::getGlobalMutex() );
UNOSEQUENCE< UNOOUSTRING > seqServiceNames( 3 );
seqServiceNames.getArray() [0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ExtendedTypeDetection" ));
seqServiceNames.getArray() [1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.text.FormatDetector" ));
diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx
index db0727ea66..2fc1ed9499 100644
--- a/sw/source/ui/uno/unoatxt.cxx
+++ b/sw/source/ui/uno/unoatxt.cxx
@@ -61,9 +61,8 @@
#include <swmodule.hxx>
#include <svl/smplhint.hxx>
#include <svl/macitem.hxx>
-
#include <editeng/acorrcfg.hxx>
-
+#include <comphelper/servicehelper.hxx>
#include <memory>
@@ -76,7 +75,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXAutoTextContainer_createInstance(
{
//the module may not be loaded
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
static uno::Reference< uno::XInterface > xAText = (cppu::OWeakObject*)new SwXAutoTextContainer();;
return xAText;
}
@@ -256,10 +255,14 @@ uno::Sequence< OUString > SwXAutoTextContainer::getSupportedServiceNames(void) t
return SwXAutoTextContainer_getSupportedServiceNames();
}
+namespace
+{
+ class theSwXAutoTextGroupUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXAutoTextGroupUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXAutoTextGroup::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXAutoTextGroupUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXAutoTextGroup::getSomething( const uno::Sequence< sal_Int8 >& rId )
@@ -415,12 +418,12 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const
pOnlyTxt = &sOnlyTxt;
}
- const SvxAutoCorrCfg* pCfg = SvxAutoCorrCfg::Get();
+ const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get();
SwDoc* pGDoc = pGlosGroup->GetDoc();
// Bis es eine Option dafuer gibt, base util::URL loeschen
- if(pCfg->IsSaveRelFile())
+ if(rCfg.IsSaveRelFile())
{
INetURLObject aTemp(pGlosGroup->GetFileName());
pGlosGroup->SetBaseURL( aTemp.GetMainURL(INetURLObject::NO_DECODE));
@@ -747,10 +750,14 @@ uno::Sequence< OUString > SwXAutoTextGroup::getSupportedServiceNames(void) throw
return aRet;
}
+namespace
+{
+ class theSwXAutoTextEntryUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXAutoTextEntryUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXAutoTextEntry::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXAutoTextEntryUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXAutoTextEntry::getSomething( const uno::Sequence< sal_Int8 >& rId )
diff --git a/sw/source/ui/uno/unodefaults.cxx b/sw/source/ui/uno/unodefaults.cxx
index 32bb7e7c37..9220477aa1 100644
--- a/sw/source/ui/uno/unodefaults.cxx
+++ b/sw/source/ui/uno/unodefaults.cxx
@@ -54,9 +54,8 @@ SfxItemPool* SwSvxUnoDrawPool::getModelPool( sal_Bool /*bReadOnly*/ ) throw()
// it contains draw model item pool as secondary pool.
//SdrModel* pModel = m_pDoc->MakeDrawModel();
//return &pModel->GetItemPool();
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
m_pDoc->GetOrCreateDrawModel();
- // <--
return &(m_pDoc->GetAttrPool());
}
return 0;
diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx
index 966fb7605a..dcb3e91e31 100644
--- a/sw/source/ui/uno/unodispatch.cxx
+++ b/sw/source/ui/uno/unodispatch.cxx
@@ -33,7 +33,7 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
#include <svx/dataaccessdescriptor.hxx>
-
+#include <comphelper/servicehelper.hxx>
#include <unodispatch.hxx>
#include <unobaseclass.hxx>
#include <view.hxx>
@@ -160,10 +160,14 @@ void SwXDispatchProviderInterceptor::disposing( const lang::EventObject& )
m_xIntercepted = NULL;
}
+namespace
+{
+ class theSwXDispatchProviderInterceptorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXDispatchProviderInterceptorUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXDispatchProviderInterceptor::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXDispatchProviderInterceptorUnoTunnelId::get().getSeq();
}
sal_Int64 SwXDispatchProviderInterceptor::getSomething(
diff --git a/sw/source/ui/uno/unodoc.cxx b/sw/source/ui/uno/unodoc.cxx
index 400c2c5be2..070c42928b 100644
--- a/sw/source/ui/uno/unodoc.cxx
+++ b/sw/source/ui/uno/unodoc.cxx
@@ -66,7 +66,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance(
throw( uno::Exception )
{
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
SfxObjectShell* pShell = new SwDocShell( _nCreationFlags );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
@@ -95,7 +95,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwWebDocument_createInstance(
throw( uno::Exception )
{
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
SfxObjectShell* pShell = new SwWebDocShell( SFX_CREATE_MODE_STANDARD );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
@@ -122,7 +122,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwGlobalDocument_createInstance(
throw( uno::Exception )
{
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
SfxObjectShell* pShell = new SwGlobalDocShell( SFX_CREATE_MODE_STANDARD );
return uno::Reference< uno::XInterface >( pShell->GetModel() );
}
diff --git a/sw/source/ui/uno/unofreg.cxx b/sw/source/ui/uno/unofreg.cxx
index 2382a654bd..38f3b5b814 100644
--- a/sw/source/ui/uno/unofreg.cxx
+++ b/sw/source/ui/uno/unofreg.cxx
@@ -130,7 +130,12 @@ extern uno::Sequence< OUString > SAL_CALL SwXMailMerge_getSupportedServiceNames(
extern OUString SAL_CALL SwXMailMerge_getImplementationName() throw();
extern uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance(const uno::Reference< XMultiServiceFactory > & rSMgr) throw( uno::Exception );
-// --> OD 2007-05-24 #i73788#
+// Layout dump filter
+extern uno::Sequence< OUString > SAL_CALL LayoutDumpFilter_getSupportedServiceNames() throw();
+extern OUString SAL_CALL LayoutDumpFilter_getImplementationName() throw();
+extern uno::Reference< uno::XInterface > SAL_CALL LayoutDumpFilter_createInstance( const uno::Reference< XMultiServiceFactory > &rSMgr ) throw( uno::Exception );
+
+// #i73788#
#include "cppuhelper/implementationentry.hxx"
namespace comp_FinalThreadManager {
@@ -141,21 +146,12 @@ com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL _crea
com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > const & context );
}
-// <--
-//
#ifdef __cplusplus
extern "C"
{
#endif
-SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName,
- uno_Environment ** /*ppEnv*/ )
-{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
-}
-
static ::cppu::ImplementationEntry const entries[] = {
{ &comp_FinalThreadManager::_create,
&comp_FinalThreadManager::_getImplementationName,
@@ -164,7 +160,7 @@ static ::cppu::ImplementationEntry const entries[] = {
{ 0, 0, 0, 0, 0, 0 }
};
-SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
+SAL_DLLPUBLIC_EXPORT void * SAL_CALL sw_component_getFactory(
const sal_Char * pImplName,
void * pServiceManager,
void * pRegistryKey )
@@ -362,6 +358,14 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
SwUnoModule_createInstance,
SwUnoModule_getSupportedServiceNames() );
}
+ else if( LayoutDumpFilter_getImplementationName().equalsAsciiL(
+ pImplName, nImplNameLen ) )
+ {
+ xFactory = ::cppu::createSingleFactory( xMSF,
+ LayoutDumpFilter_getImplementationName(),
+ LayoutDumpFilter_createInstance,
+ LayoutDumpFilter_getSupportedServiceNames() );
+ }
else if( comp_FinalThreadManager::_getImplementationName().equalsAsciiL(
pImplName, nImplNameLen ) )
{
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index 32a83bd42a..8c1048dede 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -240,7 +240,6 @@ namespace
DelayedFileDeletion& operator=( const DelayedFileDeletion& ); // never implemented
};
- DBG_NAME( DelayedFileDeletion )
//------------------------------------------------------
DelayedFileDeletion::DelayedFileDeletion( const Reference< XModel >& _rxModel, const String& _rTemporaryFile )
:
@@ -248,8 +247,6 @@ namespace
,m_sTemporaryFile( _rTemporaryFile )
,m_nPendingDeleteAttempts( 0 )
{
- DBG_CTOR( DelayedFileDeletion, NULL );
-
osl_incrementInterlockedCount( &m_refCount );
try
{
@@ -364,7 +361,6 @@ namespace
//------------------------------------------------------
DelayedFileDeletion::~DelayedFileDeletion( )
{
- DBG_DTOR( DelayedFileDeletion, NULL );
}
}
@@ -1241,7 +1237,7 @@ uno::Reference< uno::XInterface > SAL_CALL SwXMailMerge_createInstance(
SolarMutexGuard aGuard;
//the module may not be loaded
- SwDLL::Init();
+ SwGlobals::ensure();
uno::Reference< uno::XInterface > xRef = (cppu::OWeakObject *) new SwXMailMerge();
return xRef;
}
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index 8139a07c2b..fd32cc555f 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -748,6 +748,8 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
aOpt.setBrowseMode( bVal );
pView->GetWrtShell().ApplyViewOptions( aOpt );
pView->RecheckBrowseMode();
+ if(mpViewOption)
+ mpViewOption->setBrowseMode(bVal);
}
}
break;
diff --git a/sw/source/ui/uno/unomodule.cxx b/sw/source/ui/uno/unomodule.cxx
index 12f4736eb1..7391b48356 100644
--- a/sw/source/ui/uno/unomodule.cxx
+++ b/sw/source/ui/uno/unomodule.cxx
@@ -71,7 +71,7 @@ void SAL_CALL SwUnoModule::dispatchWithNotification( const util::URL& aURL, cons
uno::Reference< uno::XInterface > xThis(static_cast< frame::XNotifyingDispatch* >(this));
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete );
sal_Int16 aState = frame::DispatchResultState::DONTKNOW;
@@ -138,7 +138,7 @@ REFERENCE< XDISPATCH > SAL_CALL SwUnoModule::queryDispatch(
REFERENCE< XDISPATCH > xReturn;
SolarMutexGuard aGuard;
- SwDLL::Init();
+ SwGlobals::ensure();
const SfxSlot* pSlot = SW_MOD()->GetInterface()->GetSlot( aURL.Complete );
if ( pSlot )
xReturn = REFERENCE< XDISPATCH >(static_cast< XDISPATCH* >(this), uno::UNO_QUERY);
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 6892867bbf..1011e783e6 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -113,9 +113,8 @@
#include <osl/file.hxx>
#include <comphelper/storagehelper.hxx>
-// --> FME 2004-06-08 #i12836# enhanced pdf export
+// #i12836# enhanced pdf export
#include <EnhancedPDFExportHelper.hxx>
-// <--
#include <numrule.hxx>
#include <editeng/langitem.hxx>
@@ -143,6 +142,8 @@
#include <svx/svdoutl.hxx>
#include <svl/languageoptions.hxx>
#include <svx/svdview.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::text;
@@ -164,8 +165,6 @@ using ::osl::FileBase;
#define SW_CREATE_MARKER_TABLE 0x06
#define SW_CREATE_DRAW_DEFAULTS 0x07
-#include <comphelper/processfactory.hxx>
-
/******************************************************************************
*
******************************************************************************/
@@ -221,10 +220,14 @@ void lcl_DisposeView( SfxViewFrame* pToClose, SwDocShell* pDocShell )
}
}
+namespace
+{
+ class theSwXTextDocumentUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextDocumentUnoTunnelId > {};
+}
+
const Sequence< sal_Int8 > & SwXTextDocument::getUnoTunnelId()
{
- static Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextDocumentUnoTunnelId::get().getSeq();
}
sal_Int64 SAL_CALL SwXTextDocument::getSomething( const Sequence< sal_Int8 >& rId )
@@ -1354,10 +1357,13 @@ Reference< drawing::XDrawPage > SwXTextDocument::getDrawPage(void) throw( Runti
throw RuntimeException();
if(!pxXDrawPage)
{
- // simplified this creation, keeping original below as reference
- // for the case that it did something by purpose
((SwXTextDocument*)this)->pDrawPage = new SwXDrawPage(pDocShell->GetDoc());
((SwXTextDocument*)this)->pxXDrawPage = new Reference< drawing::XDrawPage >(pDrawPage);
+ // Create a Reference to trigger the complete initialization of the
+ // object. Otherwise in some corner cases it would get initialized
+ // at ::InitNewDoc -> which would get called during
+ // close() or dispose() -> n#681746
+ uno::Reference<lang::XComponent> xComp( *pxXDrawPage, uno::UNO_QUERY );
}
return *pxXDrawPage;
}
@@ -1484,11 +1490,10 @@ void SwXTextDocument::InitNewDoc()
if(pxXDrawPage)
{
- // --> OD 2008-07-23 #i91798#, #i91895#
+ // #i91798#, #i91895#
// dispose XDrawPage here. We are the owner and know that it is no longer in a valid condition.
uno::Reference<lang::XComponent> xComp( *pxXDrawPage, uno::UNO_QUERY );
xComp->dispose();
- // <--
pDrawPage->InvalidateSwDoc();
delete pxXDrawPage;
pxXDrawPage = 0;
@@ -1684,7 +1689,7 @@ Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServic
if (rServiceName.lastIndexOf( C2U(".OLE2Shape") ) == rServiceName.getLength() - 10)
throw ServiceNotRegisteredException(); // declare service to be not registered with this factory
- // --> OD 2006-02-22 #b6382898#
+ //
// the XML import is allowed to create instances of com.sun.star.drawing.OLE2Shape.
// Thus, a temporary service name is introduced to make this possible.
OUString aTmpServiceName( rServiceName );
@@ -1695,7 +1700,6 @@ Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServic
}
//hier den Draw - Service suchen
Reference< XInterface > xTmp = SvxFmMSFactory::createInstance(aTmpServiceName);
- // <--
if(bShape)
{
nIndex = COM_SUN_STAR__DRAWING_LENGTH;
@@ -1931,9 +1935,8 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
// must thus create an SdrModel, if we don't have an
// SdrModel and we are leaving the default at false,
// we don't need to make an SdrModel and can do nothing
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetOrCreateDrawModel() );
- // <--
pDrawDoc->SetAutoControlFocus ( bAuto );
}
}
@@ -1953,14 +1956,13 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
// SdrModel and we are leaving the default at true,
// we don't need to make an SdrModel and can do
// nothing
- // --> OD 2005-08-08 #i52858# - method name changed
+ // #i52858# - method name changed
pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetOrCreateDrawModel() );
- // <--
pDrawDoc->SetOpenInDesignMode ( bMode );
}
}
break;
- // --> FME 2005-02-25 #i42634# New property to set the bInReading
+ // #i42634# New property to set the bInReading
// flag at the document, used during binary import
case WID_DOC_LOCK_UPDATES :
{
@@ -1970,11 +1972,10 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
pDoc->SetInReading( bBool );
}
break;
- // <--
case WID_DOC_BUILDID:
aValue >>= maBuildId;
break;
- // --> OD 2006-03-21 #b6375613#
+ //
case WID_APPLY_WORKAROUND_FOR_B6375613:
{
bool bApplyWorkaroundForB6375613( false );
@@ -1982,7 +1983,6 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName,
pDocShell->GetDoc()->SetApplyWorkaroundForB6375613( bApplyWorkaroundForB6375613 );
}
break;
- // <--
default:
{
@@ -2139,13 +2139,12 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName)
case WID_DOC_HAS_VALID_SIGNATURES:
aAny <<= hasValidSignatures();
break;
- // --> OD 2006-03-21 #b6375613#
+ //
case WID_APPLY_WORKAROUND_FOR_B6375613:
{
aAny <<= pDocShell->GetDoc()->ApplyWorkaroundForB6375613();
}
break;
- // <--
default:
{
@@ -2574,9 +2573,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
bStateChanged = true;
}
- // --> FME 2005-05-23 #122919# Force field update before PDF export:
+ // #122919# Force field update before PDF export
pViewShell->ViewShell::UpdateFlds(sal_True);
- // <--
if( bStateChanged )
pRenderDocShell->EnableSetModified( sal_True );
@@ -2693,14 +2691,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
uno::Sequence< beans::PropertyValue > aRenderer;
if (m_pRenderData)
{
- // --> TL, OD 2010-09-07 #i114210#
+ // #i114210#
// determine the correct page number from the renderer index
// --> OD 2010-10-01 #i114875
// consider brochure print
const sal_uInt16 nPage = bPrintProspect
? nRenderer + 1
: m_pRenderData->GetPagesToPrint()[ nRenderer ];
- // <--
// get paper tray to use ...
sal_Int32 nPrinterPaperTray = -1;
@@ -2925,7 +2922,7 @@ void SAL_CALL SwXTextDocument::render(
// should be set for printing as well ...
pVwSh->SetPDFExportOption( sal_True );
- // --> FME 2004-06-08 #i12836# enhanced pdf export
+ // #i12836# enhanced pdf export
//
// First, we have to export hyperlinks, notes, and outline to pdf.
// During this process, additional information required for tagging
@@ -2939,7 +2936,6 @@ void SAL_CALL SwXTextDocument::render(
{
SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, sal_False );
}
- // <--
SwPrintData const& rSwPrtOptions =
*m_pRenderData->GetSwPrtOptions();
@@ -2948,7 +2944,7 @@ void SAL_CALL SwXTextDocument::render(
else // normal printing and PDF export
pVwSh->PrintOrPDFExport( pOut, rSwPrtOptions, nRenderer );
- // --> FME 2004-10-08 #i35176#
+ // #i35176#
//
// After printing the last page, we take care for the links coming
// from the EditEngine. The links are generated during the painting
@@ -2958,7 +2954,6 @@ void SAL_CALL SwXTextDocument::render(
{
SwEnhancedPDFExportHelper aHelper( *pWrtShell, *pOut, aPageRange, bIsSkipEmptyPages, sal_True );
}
- // <--
pVwSh->SetPDFExportOption( sal_False );
@@ -3769,7 +3764,7 @@ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich)
{
switch(nWhich)
{
- // --> OD 2005-08-08 #i52858#
+ // #i52858#
// assure that Draw model is created, if it doesn't exist.
case SW_CREATE_DASH_TABLE :
if(!xDashTable.is())
@@ -3801,7 +3796,6 @@ Reference<XInterface> SwXDocumentPropertyHelper::GetDrawTable(short nWhich)
xMarkerTable = SvxUnoMarkerTable_createInstance( m_pDoc->GetOrCreateDrawModel() );
xRet = xMarkerTable;
break;
- // <--
case SW_CREATE_DRAW_DEFAULTS:
if(!xDrawDefaults.is())
xDrawDefaults = (cppu::OWeakObject*)new SwSvxUnoDrawPool(m_pDoc);
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 1c1fca686e..3d09fe4f5d 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -85,6 +85,7 @@
#include <switerator.hxx>
#include "swdtflvr.hxx"
#include <vcl/svapp.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -186,17 +187,14 @@ Sequence< uno::Type > SAL_CALL SwXTextView::getTypes( ) throw(uno::RuntimeExcep
return aBaseTypes;
}
+namespace
+{
+ class theSwXTextViewImplementationId : public rtl::Static< UnoTunnelIdInit, theSwXTextViewImplementationId > {};
+}
+
Sequence< sal_Int8 > SAL_CALL SwXTextView::getImplementationId( ) throw(uno::RuntimeException)
{
- SolarMutexGuard aGuard;
- static Sequence< sal_Int8 > aId( 16 );
- static sal_Bool bInit = sal_False;
- if(!bInit)
- {
- rtl_createUuid( (sal_uInt8 *)(aId.getArray() ), 0, sal_True );
- bInit = sal_True;
- }
- return aId;
+ return theSwXTextViewImplementationId::get().getSeq();
}
void SAL_CALL SwXTextView::acquire( )throw()
@@ -1924,10 +1922,14 @@ Sequence< OUString > SwXTextViewCursor::getSupportedServiceNames(void) throw( Ru
return aRet;
}
+namespace
+{
+ class theSwXTextViewCursorUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXTextViewCursorUnoTunnelId > {};
+}
+
const uno::Sequence< sal_Int8 > & SwXTextViewCursor::getUnoTunnelId()
{
- static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId();
- return aSeq;
+ return theSwXTextViewCursorUnoTunnelId::get().getSeq();
}
//XUnoTunnel
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index a63193ac55..c78672d61c 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -3107,14 +3107,14 @@ void NaviContentBookmark::Copy( TransferDataContainer& rData ) const
{
rtl_TextEncoding eSysCSet = gsl_getSystemTextEncoding();
- ByteString sStr( aUrl, eSysCSet );
- sStr += static_cast< char >(NAVI_BOOKMARK_DELIM);
- sStr += ByteString( aDescr, eSysCSet );
- sStr += static_cast< char >(NAVI_BOOKMARK_DELIM);
- sStr += ByteString::CreateFromInt32( nDefDrag );
- sStr += static_cast< char >(NAVI_BOOKMARK_DELIM);
- sStr += ByteString::CreateFromInt32( nDocSh );
- rData.CopyByteString( SOT_FORMATSTR_ID_SONLK, sStr );
+ rtl::OStringBuffer sStrBuf(rtl::OUStringToOString(aUrl, eSysCSet));
+ sStrBuf.append(static_cast<char>(NAVI_BOOKMARK_DELIM));
+ sStrBuf.append(rtl::OUStringToOString(aDescr, eSysCSet));
+ sStrBuf.append(static_cast<char>(NAVI_BOOKMARK_DELIM));
+ sStrBuf.append(static_cast<sal_Int32>(nDefDrag));
+ sStrBuf.append(static_cast<char>(NAVI_BOOKMARK_DELIM));
+ sStrBuf.append(static_cast<sal_Int32>(nDocSh));
+ rData.CopyByteString(SOT_FORMATSTR_ID_SONLK, sStrBuf.makeStringAndClear());
}
sal_Bool NaviContentBookmark::Paste( TransferableDataHelper& rData )
diff --git a/sw/source/ui/utlui/initui.cxx b/sw/source/ui/utlui/initui.cxx
index 5663af9604..e1c974a1e0 100644
--- a/sw/source/ui/utlui/initui.cxx
+++ b/sw/source/ui/utlui/initui.cxx
@@ -153,9 +153,8 @@ ShellResource::ShellResource()
aGetRefFld_Up( SW_RES( STR_GETREFFLD_UP ) ),
aGetRefFld_Down( SW_RES( STR_GETREFFLD_DOWN ) ),
- // --> OD 2007-09-13 #i81002#
+ // #i81002#
aGetRefFld_RefItemNotFound( SW_RES( STR_GETREFFLD_REFITEMNOTFOUND ) ),
- // <--
aStrAllPageHeadFoot( SW_RES( STR_ALLPAGE_HEADFOOT ) ),
aStrNone( SW_RES( STR_TEMPLATE_NONE )),
aFixedStr( SW_RES( STR_FIELD_FIXED )),
diff --git a/sw/source/ui/vba/service.cxx b/sw/source/ui/vba/service.cxx
index 291f0e8989..7bdc724169 100644
--- a/sw/source/ui/vba/service.cxx
+++ b/sw/source/ui/vba/service.cxx
@@ -63,25 +63,15 @@ namespace vbaeventshelper
extern sdecl::ServiceDecl const serviceDecl;
}
-extern "C"
+extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL vbaswobj_component_getFactory(
+ const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
+ registry::XRegistryKey * pRegistryKey )
{
- SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
- {
- OSL_TRACE("In component_getImplementationEnv");
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
- }
-
- SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
- const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager,
- registry::XRegistryKey * pRegistryKey )
- {
- OSL_TRACE("In component_getFactory for %s", pImplName );
- void* pRet = component_getFactoryHelper(
- pImplName, pServiceManager, pRegistryKey, globals::serviceDecl, document::serviceDecl, wrapformat::serviceDecl, vbaeventshelper::serviceDecl );
+ void* pRet = component_getFactoryHelper(pImplName, pServiceManager,
+ pRegistryKey, globals::serviceDecl, document::serviceDecl,
+ wrapformat::serviceDecl, vbaeventshelper::serviceDecl );
OSL_TRACE("Ret is 0x%x", pRet);
return pRet;
- }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/vba/vbaapplication.cxx b/sw/source/ui/vba/vbaapplication.cxx
index 140da0b697..9d8a055744 100644
--- a/sw/source/ui/vba/vbaapplication.cxx
+++ b/sw/source/ui/vba/vbaapplication.cxx
@@ -59,7 +59,7 @@ using ::rtl::OUString;
#define OWN_JOIN 1
// #TODO is this defined somewhere else?
-#if ( defined UNX ) || ( defined OS2 ) //unix
+#if ( defined UNX )
#define FILE_PATH_SEPERATOR "/"
#else // windows
#define FILE_PATH_SEPERATOR "\\"
@@ -99,7 +99,9 @@ uno::Reference< word::XWindow > SAL_CALL
SwVbaApplication::getActiveWindow() throw (uno::RuntimeException)
{
// #FIXME sofar can't determine Parent
- return new SwVbaWindow( uno::Reference< XHelperInterface >(), mxContext, getCurrentDocument() );
+ uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_SET_THROW );
+ uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW );
+ return new SwVbaWindow( uno::Reference< XHelperInterface >(), mxContext, xModel, xController );
}
uno::Reference<word::XSystem > SAL_CALL
@@ -165,12 +167,12 @@ SwVbaApplication::ListGalleries( const uno::Any& index ) throw (uno::RuntimeExce
sal_Bool SAL_CALL SwVbaApplication::getDisplayAutoCompleteTips() throw (css::uno::RuntimeException)
{
- return SvxAutoCorrCfg::Get()->IsAutoTextTip();
+ return SvxAutoCorrCfg::Get().IsAutoTextTip();
}
void SAL_CALL SwVbaApplication::setDisplayAutoCompleteTips( sal_Bool _displayAutoCompleteTips ) throw (css::uno::RuntimeException)
{
- SvxAutoCorrCfg::Get()->SetAutoTextTip( _displayAutoCompleteTips );
+ SvxAutoCorrCfg::Get().SetAutoTextTip( _displayAutoCompleteTips );
}
sal_Int32 SAL_CALL SwVbaApplication::getEnableCancelKey() throw (css::uno::RuntimeException)
diff --git a/sw/source/ui/vba/vbacell.cxx b/sw/source/ui/vba/vbacell.cxx
index cbba50de68..2aada3408a 100644
--- a/sw/source/ui/vba/vbacell.cxx
+++ b/sw/source/ui/vba/vbacell.cxx
@@ -87,7 +87,7 @@ void SAL_CALL SwVbaCell::setHeightRule( ::sal_Int32 _heightrule ) throw (css::un
void SAL_CALL SwVbaCell::SetWidth( float width, sal_Int32 /*rulestyle*/ ) throw (css::uno::RuntimeException)
{
// FIXME: handle the argument: rulestyle
- setWidth( width );
+ setWidth( static_cast<sal_Int32>(width) );
}
void SAL_CALL SwVbaCell::SetHeight( float height, sal_Int32 heightrule ) throw (css::uno::RuntimeException)
diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index 36b9d8e104..119becfee2 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -126,7 +126,7 @@ SwVbaDocument::Range( const uno::Any& rStart, const uno::Any& rEnd ) throw ( uno
xStart = mxTextDocument->getText()->getStart();
xEnd = mxTextDocument->getText()->getEnd();
}
- catch( uno::Exception )
+ catch(const uno::Exception&)
{
DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString());
}
@@ -503,7 +503,7 @@ SwVbaDocument::getFormControls()
// implementation detail
xFormControls.set( xIndexAccess->getByIndex(0), uno::UNO_QUERY_THROW );
}
- catch( uno::Exception& )
+ catch(const uno::Exception&)
{
}
return xFormControls;
diff --git a/sw/source/ui/vba/vbaeventshelper.cxx b/sw/source/ui/vba/vbaeventshelper.cxx
index e837785be3..e7f4ec2366 100644
--- a/sw/source/ui/vba/vbaeventshelper.cxx
+++ b/sw/source/ui/vba/vbaeventshelper.cxx
@@ -27,6 +27,7 @@
************************************************************************/
#include "vbaeventshelper.hxx"
+#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/script/vba/VBAEventId.hpp>
#include <vbahelper/helperdecl.hxx>
@@ -39,12 +40,13 @@ using namespace ::ooo::vba;
SwVbaEventsHelper::SwVbaEventsHelper( uno::Sequence< css::uno::Any > const& aArgs, uno::Reference< uno::XComponentContext > const& xContext ) :
VbaEventsHelperBase( aArgs, xContext )
{
- registerEventHandler( DOCUMENT_NEW, "Document_New", EVENTHANDLER_DOCUMENT );
- registerEventHandler( AUTO_NEW, "AutoNew", EVENTHANDLER_GLOBAL );
- registerEventHandler( DOCUMENT_OPEN, "Document_Open", EVENTHANDLER_DOCUMENT );
- registerEventHandler( AUTO_OPEN, "AutoOpen", EVENTHANDLER_GLOBAL );
- registerEventHandler( DOCUMENT_CLOSE, "Document_Close", EVENTHANDLER_DOCUMENT );
- registerEventHandler( AUTO_CLOSE, "AutoClose", EVENTHANDLER_GLOBAL );
+ using namespace ::com::sun::star::script::ModuleType;
+ registerEventHandler( DOCUMENT_NEW, DOCUMENT, "Document_New" );
+ registerEventHandler( AUTO_NEW, NORMAL, "AutoNew" );
+ registerEventHandler( DOCUMENT_OPEN, DOCUMENT, "Document_Open" );
+ registerEventHandler( AUTO_OPEN, NORMAL, "AutoOpen" );
+ registerEventHandler( DOCUMENT_CLOSE, DOCUMENT, "Document_Close" );
+ registerEventHandler( AUTO_CLOSE, NORMAL, "AutoClose" );
}
SwVbaEventsHelper::~SwVbaEventsHelper()
@@ -77,7 +79,7 @@ uno::Sequence< uno::Any > SwVbaEventsHelper::implBuildArgumentList( const EventH
}
void SwVbaEventsHelper::implPostProcessEvent( EventQueue& /*rEventQueue*/,
- const EventHandlerInfo& /*rInfo*/, bool /*bSuccess*/, bool /*bCancel*/ ) throw (uno::RuntimeException)
+ const EventHandlerInfo& /*rInfo*/, bool /*bCancel*/ ) throw (uno::RuntimeException)
{
// nothing to do after any event
}
diff --git a/sw/source/ui/vba/vbaeventshelper.hxx b/sw/source/ui/vba/vbaeventshelper.hxx
index a5817eef2d..3c291a78b4 100644
--- a/sw/source/ui/vba/vbaeventshelper.hxx
+++ b/sw/source/ui/vba/vbaeventshelper.hxx
@@ -44,7 +44,7 @@ public:
protected:
virtual bool implPrepareEvent( EventQueue& rEventQueue, const EventHandlerInfo& rInfo, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::uno::RuntimeException);
virtual css::uno::Sequence< css::uno::Any > implBuildArgumentList( const EventHandlerInfo& rInfo, const css::uno::Sequence< css::uno::Any >& rArgs ) throw (css::lang::IllegalArgumentException);
- virtual void implPostProcessEvent( EventQueue& rEventQueue, const EventHandlerInfo& rInfo, bool bSuccess, bool bCancel ) throw (css::uno::RuntimeException);
+ virtual void implPostProcessEvent( EventQueue& rEventQueue, const EventHandlerInfo& rInfo, bool bCancel ) throw (css::uno::RuntimeException);
virtual ::rtl::OUString implGetDocumentModuleName( const EventHandlerInfo& rInfo, const css::uno::Sequence< css::uno::Any >& rArgs ) const throw (css::lang::IllegalArgumentException);
};
diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx
index 0ff4295a12..27a682ebe7 100644
--- a/sw/source/ui/vba/vbafield.cxx
+++ b/sw/source/ui/vba/vbafield.cxx
@@ -556,7 +556,8 @@ sal_Int32 SAL_CALL SwVbaFields::Update() throw (uno::RuntimeException)
uno::Reference< util::XRefreshable > xRef( xSupp->getTextFields(), uno::UNO_QUERY_THROW );
xRef->refresh();
nUpdate = 0;
- }catch( uno::Exception )
+ }
+ catch(const uno::Exception&)
{
nUpdate = 1;
}
diff --git a/sw/source/ui/vba/vbarevisions.cxx b/sw/source/ui/vba/vbarevisions.cxx
index 85f4d8b112..e9ebc7e3b4 100644
--- a/sw/source/ui/vba/vbarevisions.cxx
+++ b/sw/source/ui/vba/vbarevisions.cxx
@@ -65,7 +65,7 @@ RevisionCollectionHelper( const uno::Reference< frame::XModel >& xModel, const u
// XElementAccess
virtual uno::Type SAL_CALL getElementType( ) throw (uno::RuntimeException) { return beans::XPropertySet::static_type(0); }
- virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return ( mRevisionMap.size() > 0 ); }
+ virtual ::sal_Bool SAL_CALL hasElements( ) throw (uno::RuntimeException) { return ( !mRevisionMap.empty() ); }
// XIndexAccess
virtual ::sal_Int32 SAL_CALL getCount( ) throw (uno::RuntimeException) { return mRevisionMap.size(); }
virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException )
diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx
index 072c39485a..de37466c18 100644
--- a/sw/source/ui/vba/vbatablehelper.cxx
+++ b/sw/source/ui/vba/vbatablehelper.cxx
@@ -221,7 +221,7 @@ sal_Int32 SwVbaTableHelper::GetColWidth( sal_Int32 nCol, sal_Int32 nRow, sal_Boo
sal_Int32 nTableWidth = getTableWidth( );
double dAbsWidth = ( (double)nWidth / UNO_TABLE_COLUMN_SUM ) * (double) nTableWidth;
- return ( sal_Int32 )Millimeter::getInPoints( dAbsWidth );
+ return ( sal_Int32 )Millimeter::getInPoints( static_cast<int>(dAbsWidth) );
}
sal_Int32 SwVbaTableHelper::GetColWidth( SwTabCols& rCols, sal_Int32 nNum ) throw (uno::RuntimeException)
diff --git a/sw/source/ui/vba/vbawindow.cxx b/sw/source/ui/vba/vbawindow.cxx
index cb245e9b2a..43cf4764d2 100644
--- a/sw/source/ui/vba/vbawindow.cxx
+++ b/sw/source/ui/vba/vbawindow.cxx
@@ -41,7 +41,12 @@
using namespace ::com::sun::star;
using namespace ::ooo::vba;
-SwVbaWindow::SwVbaWindow( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< frame::XModel >& xModel ) : WindowImpl_BASE( xParent, xContext, xModel )
+SwVbaWindow::SwVbaWindow(
+ const uno::Reference< XHelperInterface >& xParent,
+ const uno::Reference< uno::XComponentContext >& xContext,
+ const uno::Reference< frame::XModel >& xModel,
+ const uno::Reference< frame::XController >& xController ) throw (uno::RuntimeException) :
+ WindowImpl_BASE( xParent, xContext, xModel, xController )
{
}
diff --git a/sw/source/ui/vba/vbawindow.hxx b/sw/source/ui/vba/vbawindow.hxx
index 6490b48094..f69fa3803d 100644
--- a/sw/source/ui/vba/vbawindow.hxx
+++ b/sw/source/ui/vba/vbawindow.hxx
@@ -39,8 +39,12 @@ typedef cppu::ImplInheritanceHelper1< VbaWindowBase, ov::word::XWindow > WindowI
class SwVbaWindow : public WindowImpl_BASE
{
public:
- SwVbaWindow( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::frame::XModel >& xModel );
-
+ SwVbaWindow(
+ const css::uno::Reference< ov::XHelperInterface >& xParent,
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Reference< css::frame::XModel >& xModel,
+ const css::uno::Reference< css::frame::XController >& xController )
+ throw (css::uno::RuntimeException);
// Attributes
virtual css::uno::Any SAL_CALL getView() throw (css::uno::RuntimeException);
diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx
index 44385b000d..561226ff3f 100644
--- a/sw/source/ui/wrtsh/delete.cxx
+++ b/sw/source/ui/wrtsh/delete.cxx
@@ -34,10 +34,9 @@
#include <crsskip.hxx>
#include <swcrsr.hxx>
#include <editeng/lrspitem.hxx> // #i23725#
-// --> OD 2006-07-10 #134369#
+// #134369#
#include <view.hxx>
#include <drawbase.hxx>
-// <--
inline void SwWrtShell::OpenMark()
{
@@ -203,12 +202,11 @@ long SwWrtShell::DelLeft()
if( SwCrsrShell::IsSttPara())
{
- // --> FME 2007-02-15 #i4032# Don't actually call a 'delete' if we
+ // #i4032# Don't actually call a 'delete' if we
// changed the table cell, compare DelRight().
const SwStartNode * pSNdOld = pWasInTblNd ?
GetSwCrsr()->GetNode()->FindTableBoxStartNode() :
0;
- // <--
/* If the cursor is at the beginning of a paragraph, try to step
backwards. On failure we are done. */
@@ -225,11 +223,10 @@ long SwWrtShell::DelLeft()
GetSwCrsr()->GetNode()->FindTableBoxStartNode() :
0;
- // --> FME 2007-02-15 #i4032# Don't actually call a 'delete' if we
+ // #i4032# Don't actually call a 'delete' if we
// changed the table cell, compare DelRight().
if ( pSNdOld != pSNdNew )
return 0;
- // <--
OpenMark();
SwCrsrShell::Right(1,CRSR_SKIP_CHARS);
@@ -329,13 +326,12 @@ long SwWrtShell::DelRight()
if ( SwCrsrShell::IsEndPara() )
{
- // --> FME 2005-01-28 #i41424# Introduced a couple of
+ // #i41424# Introduced a couple of
// Push()-Pop() pairs here. The reason for this is that a
// Right()-Left() combination does not make sure, that
// the cursor will be in its initial state, because there
// may be a numbering in front of the next paragraph.
SwCrsrShell::Push();
- // <--
if ( SwCrsrShell::Right(1, CRSR_SKIP_CHARS) )
{
@@ -385,11 +381,10 @@ long SwWrtShell::DelRight()
LeaveSelFrmMode();
UnSelectFrm();
- // --> OD 2006-07-06 #134369#
+ // #134369#
OSL_ENSURE( !IsFrmSelected(),
"<SwWrtShell::DelRight(..)> - <SwWrtShell::UnSelectFrm()> should unmark all objects" );
- // <--
- // --> OD 2006-07-10 #134369#
+ // #134369#
// leave draw mode, if necessary.
{
if (GetView().GetDrawFuncPtr())
@@ -402,12 +397,10 @@ long SwWrtShell::DelRight()
GetView().LeaveDrawCreate();
}
}
- // <--
}
- // --> OD 2006-07-07 #134369#
+ // #134369#
// <IsFrmSelected()> can't be true - see above.
- // <--
{
nSelection = GetSelectionType();
if ( nsSelectionType::SEL_FRM & nSelection ||
@@ -505,9 +498,9 @@ long SwWrtShell::DelNxtWord()
EnterStdMode();
SetMark();
if(IsEndWrd() && !IsSttWrd())
- _NxtWrdForDelete(); // --> OD 2008-08-06 #i92468#
+ _NxtWrdForDelete(); // #i92468#
if(IsSttWrd() || IsEndPara())
- _NxtWrdForDelete(); // --> OD 2008-08-06 #i92468#
+ _NxtWrdForDelete(); // #i92468#
else
_EndWrd();
@@ -531,11 +524,11 @@ long SwWrtShell::DelPrvWord()
EnterStdMode();
SetMark();
if ( !IsSttWrd() ||
- !_PrvWrdForDelete() ) // --> OD 2008-08-06 #i92468#
+ !_PrvWrdForDelete() ) // #i92468#
{
if( IsEndWrd() )
{
- if ( _PrvWrdForDelete() ) // --> OD 2008-08-06 #i92468#
+ if ( _PrvWrdForDelete() ) // #i92468#
{
// skip over all-1 spaces
short n = -1;
@@ -547,7 +540,7 @@ long SwWrtShell::DelPrvWord()
}
}
else if( IsSttPara())
- _PrvWrdForDelete(); // --> OD 2008-08-06 #i92468#
+ _PrvWrdForDelete(); // #i92468#
else
_SttWrd();
}
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 6647dc061d..0eed2a4af4 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -881,7 +881,7 @@ long SwWrtShell::EndDrag(const Point * /*pPt*/, sal_Bool )
return 1;
}
-// --> FME 2004-07-30 #i32329# Enhanced table selection
+// #i32329# Enhanced table selection
sal_Bool SwWrtShell::SelectTableRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag )
{
MV_KONTEXT(this);
@@ -894,7 +894,6 @@ sal_Bool SwWrtShell::SelectTableRowCol( const Point& rPt, const Point* pEnd, boo
}
return sal_False;
}
-// <--
/*------------------------------------------------------------------------
Beschreibung: Selektion einer Tabellenzeile / Spalte
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 69c240773c..5f8d8cfaec 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -144,7 +144,7 @@ using namespace com::sun::star;
SvxAutoCorrect* lcl_IsAutoCorr()
{
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
if( pACorr && !pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
AddNonBrkSpace | ChgOrdinalNumber |
ChgToEnEmDash | SetINetAttr | Autocorrect ))
@@ -563,7 +563,6 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
// --> #i972#
if ( bStarMath && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) )
AlignFormulaToBaseline( xRef.GetObject() );
- // <--
if (pFlyFrmFmt)
*pFlyFrmFmt = pFmt;
@@ -703,7 +702,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
aSz.Width = aSize.Width();
aSz.Height = aSize.Height();
xObj->setVisualAreaSize( nAspect, aSz );
- // --> OD 2005-05-02 #i48419# - action 'UpdateReplacement' doesn't
+ // #i48419# - action 'UpdateReplacement' doesn't
// have to change the modified state of the document.
// This is only a workaround for the defect, that this action
// modifies a document after load, because unnecessarily the
@@ -731,7 +730,6 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
GetDoc()->GetDocShell()->EnableSetModified( sal_True );
}
}
- // <--
}
// TODO/LATER: this is only a workaround,
@@ -748,11 +746,11 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
if ( !pCli )
{
- if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
+ if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
|| bLinkingChart
// TODO/LATER: ResizeOnPrinterChange
//|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
- // --> OD #i117189# - refine condition for non-resizable objects
+ // --> OD #i117189# - refine condition for non-resizable objects
// non-resizable objects need to be set the size back by this method
|| ( bNoTxtFrmPrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
{
@@ -874,7 +872,6 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
: GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
}
- // <--
aArea.Width ( _aVisArea.Width() );
aArea.Height( _aVisArea.Height() );
RequestObjectResize( aArea, xObj.GetObject() );
@@ -1085,7 +1082,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
// retrieve numbering rule at paragraph
// style, which is found at current cursor position in the document.
SwNumRule* pCollRule = pDoc->FindNumRulePtr(pColl->GetNumRule().GetValue());
- // --> OD 2005-10-25 #125993# - The outline numbering rule isn't allowed
+ // #125993# - The outline numbering rule isn't allowed
// to be derived from a parent paragraph style to a derived one.
// Thus check, if the found outline numbering rule is directly
// set at the paragraph style <pColl>. If not, set <pCollRule> to NULL
@@ -1137,7 +1134,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
else
{
- // --> OD 2009-08-27 #i101234#
+ // #i101234#
// activate outline numbering, because from the precondition
// it's known, that <SwEdit::HasNumber()> == sal_False
bActivateOutlineRule = true;
@@ -1146,7 +1143,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
else if ( !pNumRule )
{
- // --> OD 2009-08-27 #i101234#
+ // #i101234#
// Check, if corresponding list level of the outline numbering
// has already a numbering format set.
nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//<-end,zhaojianwei,need further consideration
@@ -1162,7 +1159,6 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
// turning on outline numbering at current cursor position
bContinueFoundNumRule = true;
}
- // <--
}
else
{
@@ -1263,20 +1259,18 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
else
{
- // --> OD 2009-08-27 #i95907#
+ // #i95907#
const SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode(
numfunc::GetDefaultPositionAndSpaceMode() );
SwNumRule aNumRule( GetUniqueNumRuleName(), ePosAndSpaceMode );
- // <--
// Zeichenvorlage an die Numerierung haengen
SwCharFmt* pChrFmt;
SwDocShell* pDocSh = GetView().GetDocShell();
- // --> OD 2008-06-03 #i63395#
+ // #i63395#
// Only apply user defined default bullet font
const Font* pFnt = numfunc::IsDefBulletFontUserDefined()
? &numfunc::GetDefBulletFont()
: 0;
- // <--
if (bNum)
{
@@ -1302,7 +1296,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
if (! bNum)
{
- // --> OD 2008-06-03 #i63395#
+ // #i63395#
// Only apply user defined default bullet font
if ( pFnt )
{
@@ -1315,7 +1309,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
aFmt.SetSuffix(::rtl::OUString());
}
- // --> OD 2009-08-26 #i95907#
+ // #i95907#
if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
if(bHtml && nLvl)
@@ -1329,29 +1323,26 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
aFmt.SetAbsLSpace(nWidthOfTabs + nLvl * 720);
}
}
- // <--
- // --> FME 2005-01-21 #i38904# Default alignment for
+ // #i38904# Default alignment for
// numbering/bullet should be rtl in rtl paragraph:
if ( bRightToLeft )
{
aFmt.SetNumAdjust( SVX_ADJUST_RIGHT );
}
- // <--
aNumRule.Set( nLvl, aFmt );
}
- // --> OD 2009-08-26 #i95907#
+ // #i95907#
if ( pTxtNode &&
ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
const SwTwips nTxtNodeIndent = pTxtNode->GetAdditionalIndentForStartingNewList();
- // <--
if ( ( nTxtNodeIndent + nWidthOfTabs ) != 0 )
{
- // --> OD 2010-05-05 #i111172#
+ // #i111172#
// If text node is already inside a list, assure that the indents
// are the same. Thus, adjust the indent change value by subtracting
// indents of to be applied list style.
@@ -1364,11 +1355,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
nIndentChange -= aFmt.GetIndentAt() + aFmt.GetFirstLineIndent();
}
}
- // <--
aNumRule.ChangeIndent( nIndentChange );
}
}
- // <--
// reset indent attribute on applying list style
// start new list
SetCurNumRule( aNumRule, true, String(), true );
@@ -1413,10 +1402,9 @@ void SwWrtShell::NumOrBulletOff()
DelNumRules();
}
- // --> OD 2005-10-24 #126346# - Cursor can not be anymore in front of
+ // #126346# - Cursor can not be anymore in front of
// a label, because numbering/bullet is switched off.
SetInFrontOfLabel( sal_False );
- // <--
}
}
// <- #i29560#
@@ -1498,7 +1486,7 @@ SelectionType SwWrtShell::GetSelectionType() const
if ( IsTableMode() )
nCnt |= (nsSelectionType::SEL_TBL | nsSelectionType::SEL_TBL_CELLS);
- // --> FME 2005-01-12 #i39855#
+ // #i39855#
// Do not pop up numbering toolbar, if the text node has a numbering
// of type SVX_NUM_NUMBER_NONE.
const SwNumRule* pNumRule = GetCurNumRule();
@@ -1514,7 +1502,6 @@ SelectionType SwWrtShell::GetSelectionType() const
nCnt |= nsSelectionType::SEL_NUM;
}
}
- // <--
return nCnt;
}
diff --git a/sw/source/ui/wrtsh/wrtsh4.cxx b/sw/source/ui/wrtsh/wrtsh4.cxx
index f455338d17..8d064af62d 100644
--- a/sw/source/ui/wrtsh/wrtsh4.cxx
+++ b/sw/source/ui/wrtsh/wrtsh4.cxx
@@ -153,7 +153,7 @@ sal_Bool SwWrtShell::_PrvWrd()
return bRet;
}
-// --> OD 2008-08-06 #i92468#
+// #i92468#
// method code of <SwWrtShell::_NxtWrd()> before fix for issue i72162
sal_Bool SwWrtShell::_NxtWrdForDelete()
{
@@ -199,8 +199,6 @@ sal_Bool SwWrtShell::_PrvWrdForDelete()
Combine();
return sal_True;
}
-// <--
-
sal_Bool SwWrtShell::_FwdSentence()
{
@@ -219,8 +217,6 @@ sal_Bool SwWrtShell::_FwdSentence()
return 1;
}
-
-
sal_Bool SwWrtShell::_BwdSentence()
{
Push();
@@ -230,11 +226,6 @@ sal_Bool SwWrtShell::_BwdSentence()
Pop(sal_False);
return 0;
}
- if(IsSttPara())
- {
- Pop();
- return 1;
- }
if( !GoStartSentence() && !IsSttPara() )
// nicht gefunden --> an den Absatz Anfang
SwCrsrShell::MovePara( fnParaCurr, fnParaStart );
@@ -243,7 +234,6 @@ sal_Bool SwWrtShell::_BwdSentence()
return 1;
}
-
sal_Bool SwWrtShell::_FwdPara()
{
Push();
@@ -266,7 +256,6 @@ sal_Bool SwWrtShell::_BwdPara()
{
SttPara();
}
- // <--
ClearMark();
Combine();
diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml
index e643158b25..9cd6d3cece 100755
--- a/sw/uiconfig/sglobal/menubar/menubar.xml
+++ b/sw/uiconfig/sglobal/menubar/menubar.xml
@@ -90,6 +90,7 @@
<menu:menuitem menu:id=".uno:EditGlossary"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ChangeDatabaseField"/>
+ <menu:menuitem menu:id=".uno:EditHeaderFooter"/>
<menu:menuitem menu:id=".uno:FieldDialog"/>
<menu:menuitem menu:id=".uno:EditFootnote"/>
<menu:menuitem menu:id=".uno:IndexEntryDialog"/>
diff --git a/sw/uiconfig/sglobal/toolbar/findbar.xml b/sw/uiconfig/sglobal/toolbar/findbar.xml
index 078c0fc5be..f1b00a5da4 100644
--- a/sw/uiconfig/sglobal/toolbar/findbar.xml
+++ b/sw/uiconfig/sglobal/toolbar/findbar.xml
@@ -4,5 +4,5 @@
<toolbar:toolbaritem xlink:href=".uno:FindText"/>
<toolbar:toolbaritem xlink:href=".uno:DownSearch"/>
<toolbar:toolbaritem xlink:href=".uno:UpSearch"/>
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:visible="false"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/>
</toolbar:toolbar>
diff --git a/sw/uiconfig/sglobal/toolbar/standardbar.xml b/sw/uiconfig/sglobal/toolbar/standardbar.xml
index 33792ed7d0..c1b38e3870 100644
--- a/sw/uiconfig/sglobal/toolbar/standardbar.xml
+++ b/sw/uiconfig/sglobal/toolbar/standardbar.xml
@@ -30,12 +30,12 @@
<toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="20330"/>
<toolbar:toolbaritem xlink:href=".uno:InsertDraw" toolbar:helpid="10244"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Navigator" toolbar:helpid="10366"/>
<toolbar:toolbaritem xlink:href=".uno:Gallery" toolbar:helpid="5960"/>
<toolbar:toolbaritem xlink:href=".uno:ViewDataSourceBrowser" toolbar:helpid="6660"/>
<toolbar:toolbaritem xlink:href=".uno:ControlCodes" toolbar:helpid="20224"/>
- <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000"/>
+ <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:HelpIndex"/>
<toolbar:toolbaritem xlink:href=".uno:ExtendedHelp" toolbar:visible="false" toolbar:helpid="5402"/>
diff --git a/sw/uiconfig/sweb/toolbar/findbar.xml b/sw/uiconfig/sweb/toolbar/findbar.xml
index 0338d31561..c2e10c2a7f 100644
--- a/sw/uiconfig/sweb/toolbar/findbar.xml
+++ b/sw/uiconfig/sweb/toolbar/findbar.xml
@@ -4,5 +4,5 @@
<toolbar:toolbaritem xlink:href=".uno:FindText"/>
<toolbar:toolbaritem xlink:href=".uno:DownSearch"/>
<toolbar:toolbaritem xlink:href=".uno:UpSearch"/>
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:visible="false"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/>
</toolbar:toolbar>
diff --git a/sw/uiconfig/sweb/toolbar/standardbar.xml b/sw/uiconfig/sweb/toolbar/standardbar.xml
index 109f6e50de..a5d0299208 100644
--- a/sw/uiconfig/sweb/toolbar/standardbar.xml
+++ b/sw/uiconfig/sweb/toolbar/standardbar.xml
@@ -33,12 +33,12 @@
<toolbar:toolbaritem xlink:href=".uno:InsertGraphic" toolbar:helpid="10241"/>
<toolbar:toolbaritem xlink:href=".uno:Config" toolbar:helpid="10593"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Navigator" toolbar:helpid="10366"/>
<toolbar:toolbaritem xlink:href=".uno:Gallery" toolbar:helpid="5960"/>
<toolbar:toolbaritem xlink:href=".uno:ViewDataSourceBrowser" toolbar:helpid="6660"/>
<toolbar:toolbaritem xlink:href=".uno:ControlCodes" toolbar:helpid="20224"/>
- <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000"/>
+ <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:HelpIndex"/>
<toolbar:toolbaritem xlink:href=".uno:ExtendedHelp" toolbar:visible="false" toolbar:helpid="5402"/>
diff --git a/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml
index 7e5f14f5d5..d5e073f1d8 100755
--- a/sw/uiconfig/swform/menubar/menubar.xml
+++ b/sw/uiconfig/swform/menubar/menubar.xml
@@ -90,6 +90,7 @@
<menu:menuitem menu:id=".uno:EditGlossary"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ChangeDatabaseField"/>
+ <menu:menuitem menu:id=".uno:EditHeaderFooter"/>
<menu:menuitem menu:id=".uno:FieldDialog"/>
<menu:menuitem menu:id=".uno:EditFootnote"/>
<menu:menuitem menu:id=".uno:IndexEntryDialog"/>
diff --git a/sw/uiconfig/swform/toolbar/standardbar.xml b/sw/uiconfig/swform/toolbar/standardbar.xml
index 33792ed7d0..c1b38e3870 100644
--- a/sw/uiconfig/swform/toolbar/standardbar.xml
+++ b/sw/uiconfig/swform/toolbar/standardbar.xml
@@ -30,12 +30,12 @@
<toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="20330"/>
<toolbar:toolbaritem xlink:href=".uno:InsertDraw" toolbar:helpid="10244"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Navigator" toolbar:helpid="10366"/>
<toolbar:toolbaritem xlink:href=".uno:Gallery" toolbar:helpid="5960"/>
<toolbar:toolbaritem xlink:href=".uno:ViewDataSourceBrowser" toolbar:helpid="6660"/>
<toolbar:toolbaritem xlink:href=".uno:ControlCodes" toolbar:helpid="20224"/>
- <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000"/>
+ <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:HelpIndex"/>
<toolbar:toolbaritem xlink:href=".uno:ExtendedHelp" toolbar:visible="false" toolbar:helpid="5402"/>
diff --git a/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml
index 7e5f14f5d5..d5e073f1d8 100755
--- a/sw/uiconfig/swreport/menubar/menubar.xml
+++ b/sw/uiconfig/swreport/menubar/menubar.xml
@@ -90,6 +90,7 @@
<menu:menuitem menu:id=".uno:EditGlossary"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ChangeDatabaseField"/>
+ <menu:menuitem menu:id=".uno:EditHeaderFooter"/>
<menu:menuitem menu:id=".uno:FieldDialog"/>
<menu:menuitem menu:id=".uno:EditFootnote"/>
<menu:menuitem menu:id=".uno:IndexEntryDialog"/>
diff --git a/sw/uiconfig/swreport/toolbar/standardbar.xml b/sw/uiconfig/swreport/toolbar/standardbar.xml
index 33792ed7d0..c1b38e3870 100644
--- a/sw/uiconfig/swreport/toolbar/standardbar.xml
+++ b/sw/uiconfig/swreport/toolbar/standardbar.xml
@@ -30,12 +30,12 @@
<toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="20330"/>
<toolbar:toolbaritem xlink:href=".uno:InsertDraw" toolbar:helpid="10244"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Navigator" toolbar:helpid="10366"/>
<toolbar:toolbaritem xlink:href=".uno:Gallery" toolbar:helpid="5960"/>
<toolbar:toolbaritem xlink:href=".uno:ViewDataSourceBrowser" toolbar:helpid="6660"/>
<toolbar:toolbaritem xlink:href=".uno:ControlCodes" toolbar:helpid="20224"/>
- <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000"/>
+ <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:HelpIndex"/>
<toolbar:toolbaritem xlink:href=".uno:ExtendedHelp" toolbar:visible="false" toolbar:helpid="5402"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index 02107d0088..e7b7d7f3bc 100755
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -93,6 +93,7 @@
<menu:menuitem menu:id=".uno:EditGlossary"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ChangeDatabaseField"/>
+ <menu:menuitem menu:id=".uno:EditHeaderFooter"/>
<menu:menuitem menu:id=".uno:FieldDialog"/>
<menu:menuitem menu:id=".uno:EditFootnote"/>
<menu:menuitem menu:id=".uno:IndexEntryDialog"/>
diff --git a/sw/uiconfig/swriter/toolbar/findbar.xml b/sw/uiconfig/swriter/toolbar/findbar.xml
index 0338d31561..c2e10c2a7f 100644
--- a/sw/uiconfig/swriter/toolbar/findbar.xml
+++ b/sw/uiconfig/swriter/toolbar/findbar.xml
@@ -4,5 +4,5 @@
<toolbar:toolbaritem xlink:href=".uno:FindText"/>
<toolbar:toolbaritem xlink:href=".uno:DownSearch"/>
<toolbar:toolbaritem xlink:href=".uno:UpSearch"/>
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:visible="false"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/>
</toolbar:toolbar>
diff --git a/sw/uiconfig/swriter/toolbar/standardbar.xml b/sw/uiconfig/swriter/toolbar/standardbar.xml
index 33792ed7d0..c1b38e3870 100644
--- a/sw/uiconfig/swriter/toolbar/standardbar.xml
+++ b/sw/uiconfig/swriter/toolbar/standardbar.xml
@@ -30,12 +30,12 @@
<toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="20330"/>
<toolbar:toolbaritem xlink:href=".uno:InsertDraw" toolbar:helpid="10244"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Navigator" toolbar:helpid="10366"/>
<toolbar:toolbaritem xlink:href=".uno:Gallery" toolbar:helpid="5960"/>
<toolbar:toolbaritem xlink:href=".uno:ViewDataSourceBrowser" toolbar:helpid="6660"/>
<toolbar:toolbaritem xlink:href=".uno:ControlCodes" toolbar:helpid="20224"/>
- <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000"/>
+ <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:HelpIndex"/>
<toolbar:toolbaritem xlink:href=".uno:ExtendedHelp" toolbar:visible="false" toolbar:helpid="5402"/>
diff --git a/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml
index ff139ef365..584955e7aa 100755
--- a/sw/uiconfig/swxform/menubar/menubar.xml
+++ b/sw/uiconfig/swxform/menubar/menubar.xml
@@ -91,6 +91,7 @@
<menu:menuitem menu:id=".uno:EditGlossary"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:ChangeDatabaseField"/>
+ <menu:menuitem menu:id=".uno:EditHeaderFooter"/>
<menu:menuitem menu:id=".uno:FieldDialog"/>
<menu:menuitem menu:id=".uno:EditFootnote"/>
<menu:menuitem menu:id=".uno:IndexEntryDialog"/>
diff --git a/sw/uiconfig/swxform/toolbar/findbar.xml b/sw/uiconfig/swxform/toolbar/findbar.xml
index 0338d31561..c2e10c2a7f 100644
--- a/sw/uiconfig/swxform/toolbar/findbar.xml
+++ b/sw/uiconfig/swxform/toolbar/findbar.xml
@@ -4,5 +4,5 @@
<toolbar:toolbaritem xlink:href=".uno:FindText"/>
<toolbar:toolbaritem xlink:href=".uno:DownSearch"/>
<toolbar:toolbaritem xlink:href=".uno:UpSearch"/>
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:visible="false"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog"/>
</toolbar:toolbar>
diff --git a/sw/uiconfig/swxform/toolbar/standardbar.xml b/sw/uiconfig/swxform/toolbar/standardbar.xml
index 935aff9d20..1da9beff47 100644
--- a/sw/uiconfig/swxform/toolbar/standardbar.xml
+++ b/sw/uiconfig/swxform/toolbar/standardbar.xml
@@ -30,12 +30,12 @@
<toolbar:toolbaritem xlink:href=".uno:InsertTable" toolbar:helpid="20330"/>
<toolbar:toolbaritem xlink:href=".uno:InsertDraw" toolbar:helpid="10244"/>
<toolbar:toolbarseparator/>
- <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961"/>
+ <toolbar:toolbaritem xlink:href=".uno:SearchDialog" toolbar:helpid="5961" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Navigator" toolbar:helpid="10366"/>
<toolbar:toolbaritem xlink:href=".uno:Gallery" toolbar:helpid="5960"/>
<toolbar:toolbaritem xlink:href=".uno:ViewDataSourceBrowser" toolbar:helpid="6660"/>
<toolbar:toolbaritem xlink:href=".uno:ControlCodes" toolbar:helpid="20224"/>
- <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000"/>
+ <toolbar:toolbaritem xlink:href=".uno:Zoom" toolbar:helpid="10000" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:HelpIndex"/>
<toolbar:toolbaritem xlink:href=".uno:ExtendedHelp" toolbar:visible="false" toolbar:helpid="5402"/>
diff --git a/sw/util/msword.component b/sw/util/msword.component
index 54e638ebf8..5457603dd9 100644
--- a/sw/util/msword.component
+++ b/sw/util/msword.component
@@ -25,7 +25,8 @@
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
-<component xmlns="http://openoffice.org/2010/uno-components" loader="com.sun.star.loader.SharedLibrary">
+<component loader="com.sun.star.loader.SharedLibrary" prefix="msword"
+ xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.Writer.RtfExport">
<service name="com.sun.star.comp.Writer.RtfExport"/>
</implementation>
diff --git a/sw/util/sw.component b/sw/util/sw.component
index e76cec637d..643576c536 100644
--- a/sw/util/sw.component
+++ b/sw/util/sw.component
@@ -25,8 +25,7 @@
* for a copy of the LGPLv3 License.
*
**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
+<component loader="com.sun.star.loader.SharedLibrary" prefix="sw"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="SwXAutoTextContainer">
<service name="com.sun.star.text.AutoTextContainer"/>
@@ -101,4 +100,7 @@
<implementation name="com.sun.star.util.comp.FinalThreadManager">
<service name="com.sun.star.util.JobManager"/>
</implementation>
+ <implementation name="com.sun.star.comp.Writer.LayoutDump">
+ <service name="com.sun.star.comp.Writer.LayoutDump"/>
+ </implementation>
</component>
diff --git a/sw/util/swd.component b/sw/util/swd.component
index c89c007ec3..74182f74d1 100644
--- a/sw/util/swd.component
+++ b/sw/util/swd.component
@@ -26,7 +26,7 @@
*
**********************************************************************-->
-<component loader="com.sun.star.loader.SharedLibrary"
+<component loader="com.sun.star.loader.SharedLibrary" prefix="swd"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.writer.FormatDetector">
<service name="com.sun.star.frame.ExtendedTypeDetection"/>
diff --git a/sw/util/vbaswobj.component b/sw/util/vbaswobj.component
index e6c6fe4a41..b281a4bb72 100644
--- a/sw/util/vbaswobj.component
+++ b/sw/util/vbaswobj.component
@@ -26,7 +26,7 @@
*
**********************************************************************-->
-<component loader="com.sun.star.loader.SharedLibrary"
+<component loader="com.sun.star.loader.SharedLibrary" prefix="vbaswobj"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="SwVbaDocument">
<service name="ooo.vba.word.Document"/>