2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 23:08:29 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 12:33:09 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 12:33:09 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 12:33:09 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 12:33:09 +00:00
|
|
|
* 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.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 12:33:09 +00:00
|
|
|
* 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).
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
2008-04-10 12:33:09 +00:00
|
|
|
* 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.
|
2000-09-18 23:08:29 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 20:01:09 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sw.hxx"
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
#include "hintids.hxx"
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/lrspitem.hxx>
|
|
|
|
#include <editeng/boxitem.hxx>
|
|
|
|
#include <editeng/brshitem.hxx>
|
|
|
|
#include <editeng/frmdiritem.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <fmtornt.hxx>
|
|
|
|
#include <fmtfsize.hxx>
|
2004-01-13 10:09:05 +00:00
|
|
|
#include <fmtlsplt.hxx>
|
|
|
|
#include <fmtrowsplt.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include <tabcol.hxx>
|
|
|
|
#include <frmatr.hxx>
|
|
|
|
#include <cellfrm.hxx>
|
|
|
|
#include <tabfrm.hxx>
|
|
|
|
#include <cntfrm.hxx>
|
|
|
|
#include <txtfrm.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <svx/svxids.hrc>
|
2010-11-25 14:31:08 +01:00
|
|
|
#include <doc.hxx>
|
|
|
|
#include <IDocumentUndoRedo.hxx>
|
2000-09-18 23:08:29 +00:00
|
|
|
#include "pam.hxx"
|
|
|
|
#include "swcrsr.hxx"
|
|
|
|
#include "viscrs.hxx"
|
|
|
|
#include "swtable.hxx"
|
|
|
|
#include "htmltbl.hxx"
|
|
|
|
#include "tblsel.hxx"
|
|
|
|
#include "swtblfmt.hxx"
|
|
|
|
#include "docary.hxx"
|
|
|
|
#include "ndindex.hxx"
|
|
|
|
#include "undobj.hxx"
|
2010-12-17 09:02:23 +01:00
|
|
|
#include "switerator.hxx"
|
2010-12-15 09:14:15 +01:00
|
|
|
#include <UndoTable.hxx>
|
|
|
|
|
2011-03-25 15:51:54 +01:00
|
|
|
using ::editeng::SvxBorderLine;
|
2007-09-27 07:41:55 +00:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
extern void ClearFEShellTabCols();
|
|
|
|
|
|
|
|
//siehe auch swtable.cxx
|
|
|
|
#define COLFUZZY 20L
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
inline sal_Bool IsSame( long nA, long nB ) { return Abs(nA-nB) <= COLFUZZY; }
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
class SwTblFmtCmp
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SwFrmFmt *pOld,
|
|
|
|
*pNew;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Int16 nType;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTblFmtCmp( SwFrmFmt *pOld, SwFrmFmt *pNew, sal_Int16 nType );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
static SwFrmFmt *FindNewFmt( SvPtrarr &rArr, SwFrmFmt*pOld, sal_Int16 nType );
|
2000-09-18 23:08:29 +00:00
|
|
|
static void Delete( SvPtrarr &rArr );
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTblFmtCmp::SwTblFmtCmp( SwFrmFmt *pO, SwFrmFmt *pN, sal_Int16 nT )
|
2000-09-18 23:08:29 +00:00
|
|
|
: pOld ( pO ), pNew ( pN ), nType( nT )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SwFrmFmt *SwTblFmtCmp::FindNewFmt( SvPtrarr &rArr, SwFrmFmt *pOld, sal_Int16 nType )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < rArr.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwTblFmtCmp *pCmp = (SwTblFmtCmp*)rArr[i];
|
|
|
|
if ( pCmp->pOld == pOld && pCmp->nType == nType )
|
|
|
|
return pCmp->pNew;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwTblFmtCmp::Delete( SvPtrarr &rArr )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < rArr.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
delete (SwTblFmtCmp*)rArr[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
void lcl_GetStartEndCell( const SwCursor& rCrsr,
|
|
|
|
SwLayoutFrm *&prStart, SwLayoutFrm *&prEnd )
|
|
|
|
{
|
2011-03-14 16:51:14 +00:00
|
|
|
OSL_ENSURE( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( sal_False ),
|
2000-09-18 23:08:29 +00:00
|
|
|
"Tabselection nicht auf Cnt." );
|
|
|
|
|
|
|
|
Point aPtPos, aMkPos;
|
CWS-TOOLING: integrate CWS odfmetadata2
2009-06-22 11:48:36 +0200 mst r273206 : - connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx:
+ add "include ustrbuf.hxx" to work around warning caused by
solaris <sys/kstat.h> declaring a global "long l ;"
2009-06-19 14:25:25 +0200 mst r273159 : - scp2/source/ooo/file_library_ooo.scp:
+ fix MinGW build
2009-06-08 12:52:33 +0200 mst r272727 : - redland/raptor-1.4.18.patch.mingw, redland/raptor/makefile.mk:
+ disable parsers that do not build on MinGW (thanks for patch by tono)
2009-05-15 17:31:07 +0200 mst r271957 : fix typos
2009-05-15 17:28:57 +0200 mst r271956 : #i101965#
- offapi/com/sun/star/text/TextPortion:
+ add missing properties:
SoftPageBreak, DocumentIndexMark, ReferenceMark, Footnote, TextField
+ fix read-only status of properties: Bookmark, IsStart, IsCollapsed
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
2009-05-07 14:41:38 +0200 mst r271669 : - sw/inc/{fmtftn.hxx,unocoll.hxx,doc.hxx,editsh.hxx,ftninfo.hxx},
sw/source/core/layout/{flowfrm.cxx,ftnfrm.cxx},
sw/source/core/doc/docftn.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/txtnode/atrftn.cxx, sw/source/core/unocore/unocoll.cxx,
sw/source/ui/fldui/fldref.cxx:
+ fix warning ... the hard way
+ also fix signature of SwDoc::SetCurFtn
2009-05-05 19:52:55 +0200 mst r271556 : - sw/inc/undobj.hxx:
+ make some members const
2009-05-05 19:34:40 +0200 mst r271555 : - sw/inc/rolbck.hxx, sw/source/core/undo/rolbck.cxx:
+ make some members const
2009-05-05 19:13:14 +0200 mst r271553 : - sw/inc/{undobj.hxx,rolbck.hxx},
sw/source/core/undo/{unbkmk.cxx,rolbck.cxx}:
+ fix rebase merge error
+ rename SwHstryBookmark to SwHistoryBookmark
+ clean up SwUndoBookmark
2009-05-05 19:05:53 +0200 mst r271552 : - sw/source/core/unocore/unoportenum.cxx:
+ fix annoying assertion
2009-05-05 15:34:48 +0200 mst r271522 : CWS-TOOLING: rebase CWS odfmetadata2 to trunk@271427 (milestone: DEV300:m47)
2009-05-04 12:37:01 +0200 mst r271444 : trivial
2009-04-22 13:30:37 +0200 mst r271102 : - sfx2/inc/sfx2/dinfdlg.hxx:
+ trivial change
2009-04-21 16:46:58 +0200 mst r271043 : - sw/inc/hintids.hxx:
+ introduce some predicates for the various hints, and use them
2009-04-21 16:19:03 +0200 mst r271041 : - sw/inc/undobj.hxx,
sw/source/core/doc/{docfly.cxx,docfmt.cxx,docftn.cxx,doctxm.cxx},
sw/source/core/undo/{unattr.cxx,unins.cxx}:
+ clean up unattr.cxx:
remove/fix casts, prefix members, use auto_ptr, etc.
2009-04-21 15:34:23 +0200 mst r271039 : - sw/inc/{rolbck.hxx,undobj.hxx},
sw/source/core/doc/docfmt.cxx,
sw/source/core/txtnode/{thints.cxx,txtedt.cxx},
sw/source/core/undo/{rolbck.cxx,undel.cxx,undobj.cxx,unins.cxx,unmove.cxx,
unovwr.cxx,unsect.cxx,unspnd.cxx,untbl.cxx,untblk.cxx,unattr.cxx}:
+ clean up SwHistory, SwRegHistory and SwHistoryHint etc.:
remove/fix casts, prefix members, remove wrong const annotations,
use auto_ptr, remove unused members, etc.
2009-04-20 19:17:36 +0200 mst r271013 : - sw/inc/ndhints.hxx,
sw/source/core/text/{itrtxt.cxx,txtftn.cxx,itratr.cxx,porfly.cxx,
txtfrm.cxx,txtdrop.cxx,frmform.cxx},
sw/source/core/txtnode/{ndtxt.cxx,ndhints.cxx,thints.cxx,txtedt.cxx},
sw/source/core/edit/acorrect.cxx,
sw/source/core/doc/{docedt.cxx,docfmt.cxx},
sw/source/filter/html/swhtml.cxx:
+ clean up SwHintsArray and its subclasses: remove/fix casts, prefix members
2009-04-20 18:42:07 +0200 mst r271007 : - sw/source/core/text/txtio.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/undo/rolbck.cxx:
+ remove JP_NEWCORE dead code
2009-04-20 18:38:09 +0200 mst r271006 : - sw/source/core/unocore/unochart.cxx:
+ silence unxlngi warning (debug=t)
2009-04-20 16:36:13 +0200 mst r270991 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx, sw/source/ui/fldui/flddinf.hxx:
+ trivial cleanups
2009-04-20 15:28:52 +0200 mst r270990 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx:
+ fix bug: replaying a macro with a DocumentInfoItem removes all
user-defined properties
2009-03-10 15:08:20 +0100 mst r269273 : - sfx2/source/doc/Metadatable.cxx:
+ add missing SolarMutex guards
2009-03-10 14:46:29 +0100 mst r269272 : - unoxml/source/rdf/librdf_repository.cxx:
+ never free rdf_world because that would call libxm2 xmlCleanupParser
(and, to add insult to injury, other libxml2 functions later...)
2009-03-06 19:02:44 +0100 mst r269041 : argh! undo...
2009-03-06 19:00:58 +0100 mst r269040 : fix #i99931#
- sw/source/ui/uno/unomod.cxx:
+ SwXViewSettings::_getSingleValue returns uninitialized memory
for the ZoomType property if the value is PAGE_WIDTH_EXACT
2009-03-06 18:59:28 +0100 mst r269039 : - sw/inc/ndtxt.hxx, sw/source/core/txtnode/ndtxt.cxx,
sw/source/core/unocore/unoportenum.cxx:
+ fix some more wntmsci12 warnings...
2009-03-06 18:56:46 +0100 mst r269038 : - sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx:
+ work around spurious warning on unxsoli4 debug=t
2009-03-05 14:02:01 +0100 mst r268902 : - sw/inc/txatbase.hxx:
+ back to c-style casts, they also compile on wntmsci12...
2009-03-05 10:23:25 +0100 mst r268882 : - comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ revert change of return type of comphelper_getProcessComponentContext
to Reference: does not build on wntmsci12
2009-03-04 19:08:09 +0100 mst r268861 : - sw/source/core/txtnode/{atrtox.cxx,ndtxt.cxx}:
+ fix initialization
2009-03-04 14:37:30 +0100 mst r268831 : - solenv/inc/target.mk:
+ fix CLASSPATH so complex tests run (fix by sb)
2009-03-04 14:36:30 +0100 mst r268830 : - sw/inc/unoobj.hxx,
sw/source/core/unocore/{unoparagraph.cxx,unoobj.cxx,unoobj2.cxx}:
+ SwXParaFrameEnumeration constructor now takes SwPaM, not SwUnoCrsr
+ move SwParaSelection into unoparagraph.cxx, as it is only used there
+ bugfix: replace SwUnoCrsrs on stack with SwCursors
2009-03-04 14:34:46 +0100 mst r268829 : - sw/inc/pam.hxx, sw/source/core/crsr/pam.cxx,
sw/source/core/edit/eddel.cxx, sw/source/core/doc/docredln.cxx,
sw/source/core/undo/{untbl.cxx,undel.cxx}, sw/source/filter/rtf/swparrtf.cxx:
+ clean up SwPaM: prefix members
+ new constructor SwPosition(SwCntntNode&, xub_StrLen)
+ fix several broken SwPosition and SwPaM constructors
+ SwPam::DeleteMark now actually resets the unused position to default
2009-03-02 12:07:09 +0100 mst r268646 : - sw/inc/fmtcol.hxx:
+ fix annoying warning (gcc 4)
2009-03-02 12:06:27 +0100 mst r268645 : - odk/util/check.pl, odk/examples/DevelopersGuide/Text/TextDocuments.java:
+ rename module from FieldMaster to fieldmaster
2009-02-27 19:49:56 +0100 mst r268614 : - sfx2/inc/sfx2/Metadatable.hxx, sfx2/prj/d.lst,
sfx2/source/doc/{Metadatable.cxx,makefile.mk},
sw/inc/{SwMetadatable.hxx,unoobj.hxx,undobj.hxx,ndtxt.hxx},
sw/source/core/doc/{SwMetadatable.cxx,makefile.mk,docnew.cxx},
sw/source/core/undo/{untbl.cxx,unins.cxx},
sw/source/core/unocore/unoparagraph.cxx, sw/source/ui/app/docsh.cxx:
+ move Metadatable implementation from sw to sfx2
2009-02-27 17:58:55 +0100 mst r268608 : - sw/inc/{SwMetadatable.hxx,undobj.hxx}, sw/source/core/doc/SwMetadatable.cxx,
sw/source/core/undo/{untbl.cxx,unins.cxx,undel.cxx}:
+ CreateUndo now returns an opaque MetadatableUndo object
2009-02-27 13:15:44 +0100 mst r268587 : - sw/inc/ndtxt.hxx, sw/source/core/doc/docfmt.cxx,
sw/source/core/text/{itratr.cxx,porlay.cxx},
sw/source/core/txtnode/{txtedt.cxx,ndtxt.cxx,thints.cxx}:
+ clean up SwTxtNode: fix casts, prefix members
+ factor out inline function SwTxtNode::TryDeleteSwpHints()
2009-02-27 13:14:30 +0100 mst r268586 : - svx/inc/svx/emphitem.hxx:
+ fix borken header guard
2009-02-27 13:13:56 +0100 mst r268585 : - sfx2/source/bastyp/progress.cxx:
+ fix use of compiler specific macro
2009-02-27 11:00:32 +0100 mst r268564 : - sw/inc/{txatbase.hxx,txtatr.hxx,txtinet.hxx,txtfld.hxx,txtftn.hxx,
txtflcnt.hxx,txttxmrk.hxx,txtrfmrk.hxx},
sw/source/core/txtnode/{atrtox.cxx,atrref.cxx,atrflyin.cxx,atrftn.cxx,
txtatr2.cxx,txatbase.cxx,atrfld.cxx,txtedt.cxx},
sw/source/core/text/atrstck.cxx, sw/source/core/access/acchyperlink.cxx,
sw/source/core/doc/visiturl.cxx, sw/source/ui/wrtsh/wrtsh2.cxx:
+ clean up SwTxtAttr and its subclasses: remove/fix casts, prefix members
+ SwTxtINetFmt: remove unused member bColor
- sw/source/core/text/txtfld.cxx:
+ move SwTxtFld methods to atrfld.cxx
2009-02-27 10:58:44 +0100 mst r268563 : - sfx2/inc/sfx2/sfxbasemodel.hxx:
+ don't privately inherit BaseMutex, ScModelObj wants to access it
2009-02-27 10:58:02 +0100 mst r268562 : - xmloff/source/core/{RDFaExportHelper.cxx,RDFaImportHelper.cxx}:
+ arrrgh!!! someone thought it would be a good idea to have 2 different
versions of boost in external! and they're NOT compatible!!!
insert an ugly fragile hack that maybe works with both...
2009-02-26 17:42:26 +0100 mst r268544 : - comphelper/inc/comphelper/storagehelper.hxx.
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ someone made IsValidZipEntryFileName a static method and didn't tell me
2009-02-26 15:52:56 +0100 mst r268529 : redland: split up patches
2009-02-26 13:17:56 +0100 mst r268509 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
#i95863#
- sw/inc/segdefs{,_}.hxx:
+ remove obsolete files
- sw/source/ui/inc/itemdef.hxx:
+ remove itemdef.hxx
- sw/source/ui/app/[apphdl.cxx,docsh.cxx}, sw/source/ui/misc/glshell.cxx,
sw/source/ui/shells/*.cxx, sw/source/ui/uiview/*.cxx, sw/source/ui/web/*.cxx:
+ use sfx2/msg.hxx instead of itemdef.hxx
- sw/source/core/edit/eddel.cxx:
+ @ JP: SwEditShell::Replace:
you're right, deleting the text to be replaced first, and then inserting
a space, and then replacing that space is unnecessary.
whew, i'm so happy that we finally answered that question after 11 years.
- sw/inc/edimp.hxx:
+ remove FOREACHCURSOR_START, FOREACHCURSOR_END
- sw/inc/{swcrsr.hxx,unocrsr.hxx,viscrs.hxx},
sw/source/core/crsr/{crsrsh.cxx,swcrsr.cxx,trvlreg.cxx,trvltbl.cxx,
unocrsr.cxx,viscrs.cxx},
sw/source/core/doc/{docbm.cxx,doccorr.cxx},
sw/source/core/docnode/{ndtbl.cxx,ndtbl1.cxx},
sw/source/core/edit/editsh.cxx,
sw/source/core/frmedt/{fefly1.cxx,fetab.cxx,tblsel.cxx},
sw/source/core/layout/trvlfrm.cxx,
sw/source/core/unocore/{unochart.cxx,unoobj2.cxx,unoparagraph.cxx,
unoportenum.cxx,unotbl.cxx},
sw/source/core/view/vprint.cxx:
+ remove the hideous virtual operator SwFooCursor*
+ make SwCursor::IsReadOnlyAvailable() virtual
+ make SwUnoCrsr::Clone() virtual
+ refactor SwCursor methods IsSelOver(), LeftRight(), UpDown(), GotoTable():
replace dynamic_cast<...>(this) with new virtual methods
2009-02-26 13:14:58 +0100 mst r268508 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
- sw/source/filter/xml/swxml.cxx:
+ XMLReader::Read: load RDF metadata of the ODF document
- sw/source/filter/xml/wrtxml.cxx:
+ SwXMLWriter::_Write: write RDF metadata of the ODF document if ODF >= 1.2
#i90620#: import xml:id in text tables (does not actually work yet)
- sw/source/filter/xml/xmltbli{.hxx,.cxx}:
+ SwXMLTableCellAttrTokens,aTableCellAttrTokenMap: add XML_TOK_TABLE_XMLID
+ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl: attribute xml:id
+ SwXMLTableCellContext_Impl::CreateChildContext: attribute xml:id
+ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl: attribute xml:id
+ SwXMLTableContext::SwXMLTableContext: attribute xml:id
fix #i98530#
- sw/inc/unoport.hxx, sw/source/core/unocore/unoport.cxx:
+ SwXTextPortion: make constructor params const&
- sw/source/core/unocore/unoportenum.cxx:
+ refactor to remove some code duplication
+ fix bug: paragraph w/out hints: bookmark before frame gets lost
#i97274# handle invalid tables
- sw/source/core/layout/tabfrm.cxx, sw/source/filter/xml/xmltbli.cxx:
+ SwXMLTableContext::MakeTable():
check that the table actually contains cells,
and abort (removing the inserted table nodes) if not
2009-02-26 13:11:48 +0100 mst r268507 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
refactor SwXTextRange and SwXParagraph
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoobj2.cxx:
+ remove 3 constructors of SwXTextRange
+ new method SwXTextRange::CreateParentXText
+ refactor SwXTextRange::CreateTextRangeFromPosition and
SwXTextRange::getText
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph no longer uses a cursor; it registers directly at SwTxtNode
+ replace SwXParagraph::GetCrsr with SwXParagraph::GetTxtNode
- sw/source/core/unocore/unotext.cxx, sw/source/ui/uno/unotxvw.cxx:
+ adapt to new SwXParagraph
#i90620#
- sw/inc/SwMetadatable.hxx,
sw/source/core/doc/SwMetadatable.cxx:
+ new files: base classes sw::Metadatable and sw::MetadatableMixin;
also, 2 implementations of IXmlIdRegistry:
sw::XmlIdRegistryDocument and sw::XmlIdRegistryClipboard
+ setMetadataReference: handle empty stream name as auto-detect
- sw/source/core/doc/makefile.mk:
+ add SwMetadatable
add a XmlIdRegistry to SwDoc
- sw/inc/doc.hxx:
+ SwDoc: add member m_pXmlIdRegistry, method GetXmlIdRegistry()
- sw/source/core/doc/docnew.cxx:
+ initialize XmlIdRegistry in SwDoc::GetXmlIdRegistry, not in constructor,
because the constructor is not told whether the SwDoc is a clipboard
- sw/inc/docsh.hxx, sw/source/ui/app/docsh.cxx:
+ SwDocShell: override GetXmlIdRegistry()
#i91563#: make the SwTxtNode metadatable
- sw/inc/ndtxt.hxx
+ SwTxtNode inherits sw::Metadatable
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph inherits sw::MetadatableMixin
#i91563#: handle SwTxtNode's metadata for delete
- sw/source/core/txtnode/ndtxt.cxx:
+ SwTxtNode::SplitCntntNode: handle XmlId
+ SwTxtNode::JoinNext: merge XmlIds
- sw/source/core/doc/docedt.cxx:
+ lcl_GetJoinFlags: document postcondition
+ SwDoc::Delete: remove XmlId only if SwTxtNode _becomes_ empty
#i91563#: handle SwTxtNode's metadata for delete with undo
- sw/inc/undobj.hxx
+ SwUndoDelete: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
- sw/source/core/undo/undel.cxx:
+ SwUndoDelete::SaveCntnt: save XmlIds for start and end SwTxtNode
+ SwUndoDelete::SaveCntnt: remove XmlId only if SwTxtNode _becomes_ empty
+ SwUndoDelete::Undo: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndcopy.cxx:
+ SwTxtNode::MakeCopy: register copy at XmlIdRegistry
#i91563#: handle SwTxtNode's metadata for find/replace with undo
- sw/source/core/undo/unins.cxx:
+ _UnReplaceData: rename members: add prefix m_
+ _UnReplaceData: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ _UnReplaceData::_UnReplaceData: save XmlIds for start and end SwTxtNode
+ _UnReplaceData::Undo: restore saved XmlIds for start and end SwTxtNode
#i91563#: handle SwTxtNode's metadata for table-to-text with undo
- sw/source/core/undo/untbl.cxx:
+ SwTblToTxtSave: rename members: add prefix m_
+ SwTblToTxtSave: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ SwTblToTxtSave::SwTblToTxtSave: save XmlIds for start and end SwTxtNode
+ SwTblToTxtSave::SwTblToTxtSave, SwNodes::UndoTableToText:
always store the index of the first SwTxtNode in the cell, instead of
the index of the first SwTxtNode in case of the first cell in a row,
and the cell start node in other cases
+ SwNodes::UndoTableToText: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndtbl.cxx:
+ lcl_DelBox: simplify for refactored start index handling in SwTblToTxtSave
2009-02-26 13:02:28 +0100 mst r268505 : migration of cws odfmetadata2 from CVS (resync to m42): module sd
- sd/source/ui/table/tableobjectbar.cxx,sd/source/ui/view/*.cxx:
+ remove invocations of SFX_DECL_TYPE
- sd/source/ui/slideshow/SlideShowRestarter.cxx,
sd/source/ui/toolpanel/LayoutMenu.cxx,
sd/source/ui/unoidl/DrawController.cxx,
sd/source/ui/view/{ViewShellBase.cxx,ViewTabBar.cxx,frmview.cxx}:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
2009-02-26 13:01:24 +0100 mst r268504 : migration of cws odfmetadata2 from CVS (resync to m42): module starmath
- starmath/source/document.cxx:
+ don't touch SfxObjectShell's privates
2009-02-26 13:00:37 +0100 mst r268503 : migration of cws odfmetadata2 from CVS (resync to m42): module sfx2
#i90620#
- sfx2/inc/sfx2/XmlIdRegistry.hxx:
+ new file: interfaces sfx2::IXmlIdRegistry and sfx2::IXmlIdRegistrySupplier
and a couple of utility functions
- sfx2/inc/sfx2/DocumentMetadataAccess.hxx,
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ new class sfx2::DocumentMetadataAccess, implements XDocumentMetadataAccess
+ the URI of the DocumentMetadataAccess is now the URI from which the
document was loaded; for a new document, use a vnd.sun.star.tdoc URI
+ add new function sfx2::createBaseURI()
+ prevent using reserved file names
+ try not to recurse into embedded subdocuments
- sfx2/source/doc/makefile.mk:
+ add DocumentMetadataAccess
- sfx2/util/makefile.mk:
+ link libsfx2 against libxml2 (needed for xmlValidateNCName)
- sfx2/source/doc/makefile.mk:
+ add LIBXML_CFLAGS to CFLAGS
- sfx2/prj/build.lst:
+ add dependence on libxml2
- sfx2/prj/d.lst:
+ add XmlIdRegistry.hxx, DocumentMetadataAccess.hxx
- sfx2/inc/sfx2/objsh.hxx, sfx2/source/doc/objxtor.cxx:
+ make SfxObjectShell's members private
+ new method SfxObjectShell::GetAutoStyleFilterIndex
+ SfxObjectShell inherits sfx2::IXmlIdRegistrySupplier
- sfx2/source/dialog/templdlg.cxx, sfx2/source/doc/sfxbasemodel.cxx:
+ don't touch SfxObjectShell's privates
- sfx2/inc/sfx2/sfxbasemodel.hxx, sfx2/source/doc/sfxbasemodel.cxx:
+ SfxBaseModel inherits BaseMutex instead of IMPL_SfxBaseModel_MutexContainer
+ SfxBaseModel implements additional interface XDocumentMetadataAccess
+ IMPL_SfxBaseModel_DataContainer has new member:
a sfx2::DocumentMetadataAccess
+ implementation of XDocumentMetadataAccess forwards to
the sfx2::DocumentMetadataAccess member
- sfx2/qa/complex/DocumentMetadataAccessTest.java,
sfx2/qa/complex/{tests.sce,makefile.mk},
sfx2/qa/complex/testdocuments/TESTRDFA.odt:
+ add complex test: DocumentMetadataAccessTest
+ add RDFa test document
#i95863#
- sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx:
+ refactor SfxDocumentItem so it no longer requires a XDocumentInfo
+ move struct CustomProperty to implementation file
+ remove class SfxDocumentUserPage
+ QueryValue,PutValue: remove MID_DOCINFO_FIELD*
- sfx2/source/doc/objserv.cxx:
+ adapt to SfxDocumentItem change
- sfx2/inc/sfx2/sfx.hrc, sfx2/sdi/sfxslots.sdi, sfx2/inc/sfx2/msg.hxx:
+ remove MID_DOCINFO_FIELD*
+ put all invocations of SFX_DECL_TYPE in msg.hxx, and undef SFX_DECL_TYPE
- sfx2/source/doc/objxtor.cxx:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
- sfx2/source/doc/docfile.cxx:
+ SfxMedium::SfxMedium: don't dereference NULL, throw exception instead
- sfx2/source/doc/objstor.cxx:
+ SfxObjectShell::DoLoad: fix bug: DocumentBaseURI is not initialized
2009-02-26 12:58:07 +0100 mst r268502 : migration of cws odfmetadata2 from CVS (resync to m42): module xmloff
#i90620#: implement RDFa import (interface change)
- xmloff/inc/xmloff/xmlimp.hxx. xmloff/source/core/xmlimp.cxx:
+ make SvXMLImport::GetAbsoluteReference() const
+ add SvXMLImport::GetComponentContext()
+ SvXMLImport::_InitCtor(): add RDFa namespace
+ add SvXMLImport::AddRDFa()
+ SvXMLImport::endDocument() inserts RDFa into document repository
- xmloff/inc/xmloff/xmltoken.hxx, xmloff/source/core/xmltoken.cxx:
+ new tokens for RDFa: XML_ABOUT, XML_DATATYPE
- xmloff/inc/RDFaImportHelper.hxx, xmloff/source/core/RDFaImportHelper.cxx:
+ new class RDFaImportHelper
+ adapt the code to the bleak reality of broken C++ implementations
+ handle empty xhtml:about attributes properly, which are actually
valid relative URIs
+ work around broken SvXMLImport::GetAbsoluteReference
- xmloff/source/core/makefile.mk:
+ add RDFaImportHelper.cxx
#i90620#: implement RDFa export
- xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ add SvXMLExport::EnsureNamespace(), and a stack of namespace maps
+ add SvXMLExport::GetComponentContext()
+ add SvXMLExport::AddAttributesRDFa()
- xmloff/inc/RDFaExportHelper.hxx, xmloff/source/core/RDFaExportHelper.cxx:
+ new class RDFaExportHelper
+ don't use std::map::data_type, which is actually called
std::map::mapped_type by libstdc++
- xmloff/source/core/makefile.mk:
+ add RDFaExportHelper.cxx
#i91563#
- xmloff/inc/xmloff/txtimp.hxx, xmloff/source/text/txtimp.cxx:
+ XMLTextPAttrTokens: add RDFa tokens
- xmloff/source/text/txtparai{.hxx,.cxx}:
+ import RDFa for text:p
- xmloff/source/text/txtparae.cxx:
+ export RDFa for text:p
interface change: use XHTML namespace instead of RDFA
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlimp.cxx,xmlexp.cxx,RDFaExportHelper.cxx},
xmloff/source/text/txtimp.cxx:
+ use XHTML namespace instead of RDFA
#i91565#, #i91566#: (preliminary) import for text:meta, text:meta-field
- xmloff/source/text/txtparai.cxx:
+ new class XMLMetaImportContextBase with subclasses to import
text:meta and text:meta-field
- xmloff/source/text/XMLTextMarkImportContext.cxx:
+ change XMLTextMarkImportContext::CreateAndInsertMark to handle marks
with no name (text:meta)
#i91565#, #i91566#: (preliminary) export for text:meta, text:meta-field
- xmloff/inc/txtflde.hxx, xmloff/source/text/txtflde.cxx:
+ add FIELD_ID_META to FieldIdEnum
+ new method XMLTextFieldExport::ExportMetaField()
+ change XMLTextFieldExport::ExportField{,AutoStyle,Helper}
to take additional parameter for progress bar
- xmloff/inc/xmloff/txtparae.hxx, xmloff/source/text/txtparae.cxx:
+ make XMLTextParagraphExport::exportTextRangeEnumeration() public
+ new method XMLTextParagraphExport::exportMeta()
#i90620#
- xmloff/inc/xmloff/xmlimp.hxx, xmloff/source/core/xmlimp.cxx,
xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ rename SvXML{Im,Ex}port::GetStreamPath() to GetStreamName()
+ fix xml:id {im,ex}port for embedded documents and non-packages
+ adapt to API change: XMetadatable
#i90620# GRDDL
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlexp.cxx}:
+ add GRDDL namespace
+ add token XML_TRANSFORMATION
+ add grddl:transformation attribute to root elements for meta.xml,
content.xml and styles.xml
2009-02-26 12:54:40 +0100 mst r268501 : migration of cws odfmetadata2 from CVS (resync to m42): module unoxml
#i90620#
- unoxml/source/rdf/librdf_repository.cxx:
+ librdf_Repository::importGraph: allocate buffer sized length of stream
+ switch from one librdf_world per repository to a single static world
because redland has global variables with a brain-damaged life-cycle...
+ exportGraph: use new raptor 1.4.18 feature to disable writing
an xml:base attribute in RDF/XML files
- unoxml/source/rdf/librdf_repository.cxx:
unoxml/qa/complex/RDFRepositoryTest.java:
+ adapt to predicate is URI change
+ adapt to RDFa API change
+ adapt to API change: RDFa has multiple predicates...
+ adapt to API change: XMetadatable derives from XURI
+ allow xhtml:datatype without xhtml:content
+ adapt to API change: attribute MetadataReference is StringPair
- unoxml/source/rdf/CURI.cxx:
+ add some more URI constants
2009-02-26 12:53:32 +0100 mst r268500 : migration of cws odfmetadata2 from CVS (resync to m42): module package
- package/inc/ImplValidCharacters.hxx:
+ remove (moved to comphelper)
2009-02-26 12:52:49 +0100 mst r268499 : migration of cws odfmetadata2 from CVS (resync to m42): module comphelper
- comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ add getProcessComponentContext()
+ change return type of comphelper_getProcessComponentContext to Reference
- comphelper/inc/comphelper/stl_types.hxx:
+ add OUStringBufferAppender
+ add algorithm intersperse
- comphelper/source/misc/string.cxx:
+ rewrite convertCommaSeparated with intersperse and OUStringBufferAppender
- comphelper/inc/comphelper/stlunosequence.hxx:
+ fix bug: begin() on empty sequence != end()
2009-02-26 12:50:47 +0100 mst r268498 : migration of cws odfmetadata2 from CVS (resync to m42): module offapi
#i96209#
- offapi/com/sun/star/text/fieldmaster/*.idl:
+ rename module from FieldMaster to fieldmaster
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
#i90620#
- offapi/com/sun/star/rdf/{XMetadatable.idl,XDocumentMetadataAccess.idl}:
+ API change: XMetadatable derives from XURI
+ API change: replace XmlId (string) with MetadataReference (StringPair)
- offapi/com/sun/star/rdf/{Statement.idl,XDocumentRepository.idl,
XNamedGraph.idl,XRepository.idl}:
+ the predicate of a statement is a URI, not a Resource
- offapi/com/sun/star/rdf/XDocumentMetadataAccess.idl:
+ rename: s/Package/Document/
+ remove uuid
+ remove everything related to mapping
+ graph names are now generated from base URI and file names
+ load methods: improve error handling with XInteractionHandler
- offapi/com/sun/star/rdf/XDocumentRepository.idl:
+ change: RDFa permits using multiple predicates in one attribute
+ setStatementRDFa: subject is now XResource, object is now XMetadatable
- offapi/com/sun/star/rdf/URIs.idl:
+ add some more URI constants
- offapi/com/sun/star/rdf:
+ fix @since tags and replace <method> with <member>
2009-02-26 12:47:24 +0100 mst r268497 : migration of cws odfmetadata2 from CVS (resync to m42): module redland
fix #i93768#
- redland/raptor-1.4.17.patch, redland/raptor/makefile.mk:
+ disable GRDDL parser to prevent call to libxslt
xsltSetDefaultSecurityPrefs, which breaks xmlhelp
- redland/raptor/makefile.mk, redland/raptor-1.4.17.patch,
redland/raptor-1.4.18.patch:
+ upgrade raptor to 1.4.18
+ deactivate serializer for RSS/Atom (does not build)
- redland/rasqal/makefile.mk, redland/rasqal-0.9.15.patch,
redland/rasqal-0.9.16.patch,
+ upgrade rasqal to 0.9.16
- redland/redland/makefile.mk, redland/redland-1.0.7.patch,
redland/redland-1.0.8.patch:
+ upgrade redland to 1.0.8
- redland/redlandversion.mk:
+ the librasqal SONAME has changed
2009-07-02 09:05:03 +00:00
|
|
|
const SwShellCrsr* pShCrsr = dynamic_cast<const SwShellCrsr*>(&rCrsr);
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pShCrsr )
|
|
|
|
{
|
|
|
|
aPtPos = pShCrsr->GetPtPos();
|
|
|
|
aMkPos = pShCrsr->GetMkPos();
|
|
|
|
}
|
|
|
|
|
2008-01-29 07:38:03 +00:00
|
|
|
// robust:
|
|
|
|
SwCntntNode* pPointNd = rCrsr.GetCntntNode();
|
2011-01-17 15:06:54 +01:00
|
|
|
SwCntntNode* pMarkNd = rCrsr.GetCntntNode(sal_False);
|
2008-01-29 07:38:03 +00:00
|
|
|
|
2010-06-13 15:22:56 +02:00
|
|
|
SwFrm* pPointFrm = pPointNd ? pPointNd->getLayoutFrm( pPointNd->GetDoc()->GetCurrentLayout(), &aPtPos ) : 0;
|
|
|
|
SwFrm* pMarkFrm = pMarkNd ? pMarkNd->getLayoutFrm( pMarkNd->GetDoc()->GetCurrentLayout(), &aMkPos ) : 0;
|
2008-01-29 07:38:03 +00:00
|
|
|
|
|
|
|
prStart = pPointFrm ? pPointFrm->GetUpper() : 0;
|
|
|
|
prEnd = pMarkFrm ? pMarkFrm->GetUpper() : 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool lcl_GetBoxSel( const SwCursor& rCursor, SwSelBoxes& rBoxes,
|
|
|
|
sal_Bool bAllCrsr = sal_False )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
CWS-TOOLING: integrate CWS odfmetadata2
2009-06-22 11:48:36 +0200 mst r273206 : - connectivity/source/drivers/mozab/mozillasrc/MNSInclude.hxx:
+ add "include ustrbuf.hxx" to work around warning caused by
solaris <sys/kstat.h> declaring a global "long l ;"
2009-06-19 14:25:25 +0200 mst r273159 : - scp2/source/ooo/file_library_ooo.scp:
+ fix MinGW build
2009-06-08 12:52:33 +0200 mst r272727 : - redland/raptor-1.4.18.patch.mingw, redland/raptor/makefile.mk:
+ disable parsers that do not build on MinGW (thanks for patch by tono)
2009-05-15 17:31:07 +0200 mst r271957 : fix typos
2009-05-15 17:28:57 +0200 mst r271956 : #i101965#
- offapi/com/sun/star/text/TextPortion:
+ add missing properties:
SoftPageBreak, DocumentIndexMark, ReferenceMark, Footnote, TextField
+ fix read-only status of properties: Bookmark, IsStart, IsCollapsed
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
2009-05-07 14:41:38 +0200 mst r271669 : - sw/inc/{fmtftn.hxx,unocoll.hxx,doc.hxx,editsh.hxx,ftninfo.hxx},
sw/source/core/layout/{flowfrm.cxx,ftnfrm.cxx},
sw/source/core/doc/docftn.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/txtnode/atrftn.cxx, sw/source/core/unocore/unocoll.cxx,
sw/source/ui/fldui/fldref.cxx:
+ fix warning ... the hard way
+ also fix signature of SwDoc::SetCurFtn
2009-05-05 19:52:55 +0200 mst r271556 : - sw/inc/undobj.hxx:
+ make some members const
2009-05-05 19:34:40 +0200 mst r271555 : - sw/inc/rolbck.hxx, sw/source/core/undo/rolbck.cxx:
+ make some members const
2009-05-05 19:13:14 +0200 mst r271553 : - sw/inc/{undobj.hxx,rolbck.hxx},
sw/source/core/undo/{unbkmk.cxx,rolbck.cxx}:
+ fix rebase merge error
+ rename SwHstryBookmark to SwHistoryBookmark
+ clean up SwUndoBookmark
2009-05-05 19:05:53 +0200 mst r271552 : - sw/source/core/unocore/unoportenum.cxx:
+ fix annoying assertion
2009-05-05 15:34:48 +0200 mst r271522 : CWS-TOOLING: rebase CWS odfmetadata2 to trunk@271427 (milestone: DEV300:m47)
2009-05-04 12:37:01 +0200 mst r271444 : trivial
2009-04-22 13:30:37 +0200 mst r271102 : - sfx2/inc/sfx2/dinfdlg.hxx:
+ trivial change
2009-04-21 16:46:58 +0200 mst r271043 : - sw/inc/hintids.hxx:
+ introduce some predicates for the various hints, and use them
2009-04-21 16:19:03 +0200 mst r271041 : - sw/inc/undobj.hxx,
sw/source/core/doc/{docfly.cxx,docfmt.cxx,docftn.cxx,doctxm.cxx},
sw/source/core/undo/{unattr.cxx,unins.cxx}:
+ clean up unattr.cxx:
remove/fix casts, prefix members, use auto_ptr, etc.
2009-04-21 15:34:23 +0200 mst r271039 : - sw/inc/{rolbck.hxx,undobj.hxx},
sw/source/core/doc/docfmt.cxx,
sw/source/core/txtnode/{thints.cxx,txtedt.cxx},
sw/source/core/undo/{rolbck.cxx,undel.cxx,undobj.cxx,unins.cxx,unmove.cxx,
unovwr.cxx,unsect.cxx,unspnd.cxx,untbl.cxx,untblk.cxx,unattr.cxx}:
+ clean up SwHistory, SwRegHistory and SwHistoryHint etc.:
remove/fix casts, prefix members, remove wrong const annotations,
use auto_ptr, remove unused members, etc.
2009-04-20 19:17:36 +0200 mst r271013 : - sw/inc/ndhints.hxx,
sw/source/core/text/{itrtxt.cxx,txtftn.cxx,itratr.cxx,porfly.cxx,
txtfrm.cxx,txtdrop.cxx,frmform.cxx},
sw/source/core/txtnode/{ndtxt.cxx,ndhints.cxx,thints.cxx,txtedt.cxx},
sw/source/core/edit/acorrect.cxx,
sw/source/core/doc/{docedt.cxx,docfmt.cxx},
sw/source/filter/html/swhtml.cxx:
+ clean up SwHintsArray and its subclasses: remove/fix casts, prefix members
2009-04-20 18:42:07 +0200 mst r271007 : - sw/source/core/text/txtio.cxx, sw/source/core/edit/edattr.cxx,
sw/source/core/undo/rolbck.cxx:
+ remove JP_NEWCORE dead code
2009-04-20 18:38:09 +0200 mst r271006 : - sw/source/core/unocore/unochart.cxx:
+ silence unxlngi warning (debug=t)
2009-04-20 16:36:13 +0200 mst r270991 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx, sw/source/ui/fldui/flddinf.hxx:
+ trivial cleanups
2009-04-20 15:28:52 +0200 mst r270990 : - sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx,
sfx2/source/doc/objserv.cxx:
+ fix bug: replaying a macro with a DocumentInfoItem removes all
user-defined properties
2009-03-10 15:08:20 +0100 mst r269273 : - sfx2/source/doc/Metadatable.cxx:
+ add missing SolarMutex guards
2009-03-10 14:46:29 +0100 mst r269272 : - unoxml/source/rdf/librdf_repository.cxx:
+ never free rdf_world because that would call libxm2 xmlCleanupParser
(and, to add insult to injury, other libxml2 functions later...)
2009-03-06 19:02:44 +0100 mst r269041 : argh! undo...
2009-03-06 19:00:58 +0100 mst r269040 : fix #i99931#
- sw/source/ui/uno/unomod.cxx:
+ SwXViewSettings::_getSingleValue returns uninitialized memory
for the ZoomType property if the value is PAGE_WIDTH_EXACT
2009-03-06 18:59:28 +0100 mst r269039 : - sw/inc/ndtxt.hxx, sw/source/core/txtnode/ndtxt.cxx,
sw/source/core/unocore/unoportenum.cxx:
+ fix some more wntmsci12 warnings...
2009-03-06 18:56:46 +0100 mst r269038 : - sd/source/ui/slidesorter/model/SlsPageEnumerationProvider.cxx:
+ work around spurious warning on unxsoli4 debug=t
2009-03-05 14:02:01 +0100 mst r268902 : - sw/inc/txatbase.hxx:
+ back to c-style casts, they also compile on wntmsci12...
2009-03-05 10:23:25 +0100 mst r268882 : - comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ revert change of return type of comphelper_getProcessComponentContext
to Reference: does not build on wntmsci12
2009-03-04 19:08:09 +0100 mst r268861 : - sw/source/core/txtnode/{atrtox.cxx,ndtxt.cxx}:
+ fix initialization
2009-03-04 14:37:30 +0100 mst r268831 : - solenv/inc/target.mk:
+ fix CLASSPATH so complex tests run (fix by sb)
2009-03-04 14:36:30 +0100 mst r268830 : - sw/inc/unoobj.hxx,
sw/source/core/unocore/{unoparagraph.cxx,unoobj.cxx,unoobj2.cxx}:
+ SwXParaFrameEnumeration constructor now takes SwPaM, not SwUnoCrsr
+ move SwParaSelection into unoparagraph.cxx, as it is only used there
+ bugfix: replace SwUnoCrsrs on stack with SwCursors
2009-03-04 14:34:46 +0100 mst r268829 : - sw/inc/pam.hxx, sw/source/core/crsr/pam.cxx,
sw/source/core/edit/eddel.cxx, sw/source/core/doc/docredln.cxx,
sw/source/core/undo/{untbl.cxx,undel.cxx}, sw/source/filter/rtf/swparrtf.cxx:
+ clean up SwPaM: prefix members
+ new constructor SwPosition(SwCntntNode&, xub_StrLen)
+ fix several broken SwPosition and SwPaM constructors
+ SwPam::DeleteMark now actually resets the unused position to default
2009-03-02 12:07:09 +0100 mst r268646 : - sw/inc/fmtcol.hxx:
+ fix annoying warning (gcc 4)
2009-03-02 12:06:27 +0100 mst r268645 : - odk/util/check.pl, odk/examples/DevelopersGuide/Text/TextDocuments.java:
+ rename module from FieldMaster to fieldmaster
2009-02-27 19:49:56 +0100 mst r268614 : - sfx2/inc/sfx2/Metadatable.hxx, sfx2/prj/d.lst,
sfx2/source/doc/{Metadatable.cxx,makefile.mk},
sw/inc/{SwMetadatable.hxx,unoobj.hxx,undobj.hxx,ndtxt.hxx},
sw/source/core/doc/{SwMetadatable.cxx,makefile.mk,docnew.cxx},
sw/source/core/undo/{untbl.cxx,unins.cxx},
sw/source/core/unocore/unoparagraph.cxx, sw/source/ui/app/docsh.cxx:
+ move Metadatable implementation from sw to sfx2
2009-02-27 17:58:55 +0100 mst r268608 : - sw/inc/{SwMetadatable.hxx,undobj.hxx}, sw/source/core/doc/SwMetadatable.cxx,
sw/source/core/undo/{untbl.cxx,unins.cxx,undel.cxx}:
+ CreateUndo now returns an opaque MetadatableUndo object
2009-02-27 13:15:44 +0100 mst r268587 : - sw/inc/ndtxt.hxx, sw/source/core/doc/docfmt.cxx,
sw/source/core/text/{itratr.cxx,porlay.cxx},
sw/source/core/txtnode/{txtedt.cxx,ndtxt.cxx,thints.cxx}:
+ clean up SwTxtNode: fix casts, prefix members
+ factor out inline function SwTxtNode::TryDeleteSwpHints()
2009-02-27 13:14:30 +0100 mst r268586 : - svx/inc/svx/emphitem.hxx:
+ fix borken header guard
2009-02-27 13:13:56 +0100 mst r268585 : - sfx2/source/bastyp/progress.cxx:
+ fix use of compiler specific macro
2009-02-27 11:00:32 +0100 mst r268564 : - sw/inc/{txatbase.hxx,txtatr.hxx,txtinet.hxx,txtfld.hxx,txtftn.hxx,
txtflcnt.hxx,txttxmrk.hxx,txtrfmrk.hxx},
sw/source/core/txtnode/{atrtox.cxx,atrref.cxx,atrflyin.cxx,atrftn.cxx,
txtatr2.cxx,txatbase.cxx,atrfld.cxx,txtedt.cxx},
sw/source/core/text/atrstck.cxx, sw/source/core/access/acchyperlink.cxx,
sw/source/core/doc/visiturl.cxx, sw/source/ui/wrtsh/wrtsh2.cxx:
+ clean up SwTxtAttr and its subclasses: remove/fix casts, prefix members
+ SwTxtINetFmt: remove unused member bColor
- sw/source/core/text/txtfld.cxx:
+ move SwTxtFld methods to atrfld.cxx
2009-02-27 10:58:44 +0100 mst r268563 : - sfx2/inc/sfx2/sfxbasemodel.hxx:
+ don't privately inherit BaseMutex, ScModelObj wants to access it
2009-02-27 10:58:02 +0100 mst r268562 : - xmloff/source/core/{RDFaExportHelper.cxx,RDFaImportHelper.cxx}:
+ arrrgh!!! someone thought it would be a good idea to have 2 different
versions of boost in external! and they're NOT compatible!!!
insert an ugly fragile hack that maybe works with both...
2009-02-26 17:42:26 +0100 mst r268544 : - comphelper/inc/comphelper/storagehelper.hxx.
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ someone made IsValidZipEntryFileName a static method and didn't tell me
2009-02-26 15:52:56 +0100 mst r268529 : redland: split up patches
2009-02-26 13:17:56 +0100 mst r268509 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
#i95863#
- sw/inc/segdefs{,_}.hxx:
+ remove obsolete files
- sw/source/ui/inc/itemdef.hxx:
+ remove itemdef.hxx
- sw/source/ui/app/[apphdl.cxx,docsh.cxx}, sw/source/ui/misc/glshell.cxx,
sw/source/ui/shells/*.cxx, sw/source/ui/uiview/*.cxx, sw/source/ui/web/*.cxx:
+ use sfx2/msg.hxx instead of itemdef.hxx
- sw/source/core/edit/eddel.cxx:
+ @ JP: SwEditShell::Replace:
you're right, deleting the text to be replaced first, and then inserting
a space, and then replacing that space is unnecessary.
whew, i'm so happy that we finally answered that question after 11 years.
- sw/inc/edimp.hxx:
+ remove FOREACHCURSOR_START, FOREACHCURSOR_END
- sw/inc/{swcrsr.hxx,unocrsr.hxx,viscrs.hxx},
sw/source/core/crsr/{crsrsh.cxx,swcrsr.cxx,trvlreg.cxx,trvltbl.cxx,
unocrsr.cxx,viscrs.cxx},
sw/source/core/doc/{docbm.cxx,doccorr.cxx},
sw/source/core/docnode/{ndtbl.cxx,ndtbl1.cxx},
sw/source/core/edit/editsh.cxx,
sw/source/core/frmedt/{fefly1.cxx,fetab.cxx,tblsel.cxx},
sw/source/core/layout/trvlfrm.cxx,
sw/source/core/unocore/{unochart.cxx,unoobj2.cxx,unoparagraph.cxx,
unoportenum.cxx,unotbl.cxx},
sw/source/core/view/vprint.cxx:
+ remove the hideous virtual operator SwFooCursor*
+ make SwCursor::IsReadOnlyAvailable() virtual
+ make SwUnoCrsr::Clone() virtual
+ refactor SwCursor methods IsSelOver(), LeftRight(), UpDown(), GotoTable():
replace dynamic_cast<...>(this) with new virtual methods
2009-02-26 13:14:58 +0100 mst r268508 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
- sw/source/filter/xml/swxml.cxx:
+ XMLReader::Read: load RDF metadata of the ODF document
- sw/source/filter/xml/wrtxml.cxx:
+ SwXMLWriter::_Write: write RDF metadata of the ODF document if ODF >= 1.2
#i90620#: import xml:id in text tables (does not actually work yet)
- sw/source/filter/xml/xmltbli{.hxx,.cxx}:
+ SwXMLTableCellAttrTokens,aTableCellAttrTokenMap: add XML_TOK_TABLE_XMLID
+ SwXMLTableCellContext_Impl::SwXMLTableCellContext_Impl: attribute xml:id
+ SwXMLTableCellContext_Impl::CreateChildContext: attribute xml:id
+ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl: attribute xml:id
+ SwXMLTableContext::SwXMLTableContext: attribute xml:id
fix #i98530#
- sw/inc/unoport.hxx, sw/source/core/unocore/unoport.cxx:
+ SwXTextPortion: make constructor params const&
- sw/source/core/unocore/unoportenum.cxx:
+ refactor to remove some code duplication
+ fix bug: paragraph w/out hints: bookmark before frame gets lost
#i97274# handle invalid tables
- sw/source/core/layout/tabfrm.cxx, sw/source/filter/xml/xmltbli.cxx:
+ SwXMLTableContext::MakeTable():
check that the table actually contains cells,
and abort (removing the inserted table nodes) if not
2009-02-26 13:11:48 +0100 mst r268507 : migration of cws odfmetadata2 from CVS (resync to m42): module sw
refactor SwXTextRange and SwXParagraph
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoobj2.cxx:
+ remove 3 constructors of SwXTextRange
+ new method SwXTextRange::CreateParentXText
+ refactor SwXTextRange::CreateTextRangeFromPosition and
SwXTextRange::getText
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph no longer uses a cursor; it registers directly at SwTxtNode
+ replace SwXParagraph::GetCrsr with SwXParagraph::GetTxtNode
- sw/source/core/unocore/unotext.cxx, sw/source/ui/uno/unotxvw.cxx:
+ adapt to new SwXParagraph
#i90620#
- sw/inc/SwMetadatable.hxx,
sw/source/core/doc/SwMetadatable.cxx:
+ new files: base classes sw::Metadatable and sw::MetadatableMixin;
also, 2 implementations of IXmlIdRegistry:
sw::XmlIdRegistryDocument and sw::XmlIdRegistryClipboard
+ setMetadataReference: handle empty stream name as auto-detect
- sw/source/core/doc/makefile.mk:
+ add SwMetadatable
add a XmlIdRegistry to SwDoc
- sw/inc/doc.hxx:
+ SwDoc: add member m_pXmlIdRegistry, method GetXmlIdRegistry()
- sw/source/core/doc/docnew.cxx:
+ initialize XmlIdRegistry in SwDoc::GetXmlIdRegistry, not in constructor,
because the constructor is not told whether the SwDoc is a clipboard
- sw/inc/docsh.hxx, sw/source/ui/app/docsh.cxx:
+ SwDocShell: override GetXmlIdRegistry()
#i91563#: make the SwTxtNode metadatable
- sw/inc/ndtxt.hxx
+ SwTxtNode inherits sw::Metadatable
- sw/inc/unoobj.hxx, sw/source/core/unocore/unoparagraph.cxx:
+ SwXParagraph inherits sw::MetadatableMixin
#i91563#: handle SwTxtNode's metadata for delete
- sw/source/core/txtnode/ndtxt.cxx:
+ SwTxtNode::SplitCntntNode: handle XmlId
+ SwTxtNode::JoinNext: merge XmlIds
- sw/source/core/doc/docedt.cxx:
+ lcl_GetJoinFlags: document postcondition
+ SwDoc::Delete: remove XmlId only if SwTxtNode _becomes_ empty
#i91563#: handle SwTxtNode's metadata for delete with undo
- sw/inc/undobj.hxx
+ SwUndoDelete: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
- sw/source/core/undo/undel.cxx:
+ SwUndoDelete::SaveCntnt: save XmlIds for start and end SwTxtNode
+ SwUndoDelete::SaveCntnt: remove XmlId only if SwTxtNode _becomes_ empty
+ SwUndoDelete::Undo: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndcopy.cxx:
+ SwTxtNode::MakeCopy: register copy at XmlIdRegistry
#i91563#: handle SwTxtNode's metadata for find/replace with undo
- sw/source/core/undo/unins.cxx:
+ _UnReplaceData: rename members: add prefix m_
+ _UnReplaceData: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ _UnReplaceData::_UnReplaceData: save XmlIds for start and end SwTxtNode
+ _UnReplaceData::Undo: restore saved XmlIds for start and end SwTxtNode
#i91563#: handle SwTxtNode's metadata for table-to-text with undo
- sw/source/core/undo/untbl.cxx:
+ SwTblToTxtSave: rename members: add prefix m_
+ SwTblToTxtSave: new members m_pMetadataUndoStart, m_pMetadataUndoEnd
+ SwTblToTxtSave::SwTblToTxtSave: save XmlIds for start and end SwTxtNode
+ SwTblToTxtSave::SwTblToTxtSave, SwNodes::UndoTableToText:
always store the index of the first SwTxtNode in the cell, instead of
the index of the first SwTxtNode in case of the first cell in a row,
and the cell start node in other cases
+ SwNodes::UndoTableToText: restore saved XmlIds for start and end SwTxtNode
- sw/source/core/docnode/ndtbl.cxx:
+ lcl_DelBox: simplify for refactored start index handling in SwTblToTxtSave
2009-02-26 13:02:28 +0100 mst r268505 : migration of cws odfmetadata2 from CVS (resync to m42): module sd
- sd/source/ui/table/tableobjectbar.cxx,sd/source/ui/view/*.cxx:
+ remove invocations of SFX_DECL_TYPE
- sd/source/ui/slideshow/SlideShowRestarter.cxx,
sd/source/ui/toolpanel/LayoutMenu.cxx,
sd/source/ui/unoidl/DrawController.cxx,
sd/source/ui/view/{ViewShellBase.cxx,ViewTabBar.cxx,frmview.cxx}:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
2009-02-26 13:01:24 +0100 mst r268504 : migration of cws odfmetadata2 from CVS (resync to m42): module starmath
- starmath/source/document.cxx:
+ don't touch SfxObjectShell's privates
2009-02-26 13:00:37 +0100 mst r268503 : migration of cws odfmetadata2 from CVS (resync to m42): module sfx2
#i90620#
- sfx2/inc/sfx2/XmlIdRegistry.hxx:
+ new file: interfaces sfx2::IXmlIdRegistry and sfx2::IXmlIdRegistrySupplier
and a couple of utility functions
- sfx2/inc/sfx2/DocumentMetadataAccess.hxx,
sfx2/source/doc/DocumentMetadataAccess.cxx:
+ new class sfx2::DocumentMetadataAccess, implements XDocumentMetadataAccess
+ the URI of the DocumentMetadataAccess is now the URI from which the
document was loaded; for a new document, use a vnd.sun.star.tdoc URI
+ add new function sfx2::createBaseURI()
+ prevent using reserved file names
+ try not to recurse into embedded subdocuments
- sfx2/source/doc/makefile.mk:
+ add DocumentMetadataAccess
- sfx2/util/makefile.mk:
+ link libsfx2 against libxml2 (needed for xmlValidateNCName)
- sfx2/source/doc/makefile.mk:
+ add LIBXML_CFLAGS to CFLAGS
- sfx2/prj/build.lst:
+ add dependence on libxml2
- sfx2/prj/d.lst:
+ add XmlIdRegistry.hxx, DocumentMetadataAccess.hxx
- sfx2/inc/sfx2/objsh.hxx, sfx2/source/doc/objxtor.cxx:
+ make SfxObjectShell's members private
+ new method SfxObjectShell::GetAutoStyleFilterIndex
+ SfxObjectShell inherits sfx2::IXmlIdRegistrySupplier
- sfx2/source/dialog/templdlg.cxx, sfx2/source/doc/sfxbasemodel.cxx:
+ don't touch SfxObjectShell's privates
- sfx2/inc/sfx2/sfxbasemodel.hxx, sfx2/source/doc/sfxbasemodel.cxx:
+ SfxBaseModel inherits BaseMutex instead of IMPL_SfxBaseModel_MutexContainer
+ SfxBaseModel implements additional interface XDocumentMetadataAccess
+ IMPL_SfxBaseModel_DataContainer has new member:
a sfx2::DocumentMetadataAccess
+ implementation of XDocumentMetadataAccess forwards to
the sfx2::DocumentMetadataAccess member
- sfx2/qa/complex/DocumentMetadataAccessTest.java,
sfx2/qa/complex/{tests.sce,makefile.mk},
sfx2/qa/complex/testdocuments/TESTRDFA.odt:
+ add complex test: DocumentMetadataAccessTest
+ add RDFa test document
#i95863#
- sfx2/inc/sfx2/dinfdlg.hxx, sfx2/source/dialog/dinfdlg.cxx:
+ refactor SfxDocumentItem so it no longer requires a XDocumentInfo
+ move struct CustomProperty to implementation file
+ remove class SfxDocumentUserPage
+ QueryValue,PutValue: remove MID_DOCINFO_FIELD*
- sfx2/source/doc/objserv.cxx:
+ adapt to SfxDocumentItem change
- sfx2/inc/sfx2/sfx.hrc, sfx2/sdi/sfxslots.sdi, sfx2/inc/sfx2/msg.hxx:
+ remove MID_DOCINFO_FIELD*
+ put all invocations of SFX_DECL_TYPE in msg.hxx, and undef SFX_DECL_TYPE
- sfx2/source/doc/objxtor.cxx:
+ fix abuses of comphelper_getProcessComponentContext (missing release)
- sfx2/source/doc/docfile.cxx:
+ SfxMedium::SfxMedium: don't dereference NULL, throw exception instead
- sfx2/source/doc/objstor.cxx:
+ SfxObjectShell::DoLoad: fix bug: DocumentBaseURI is not initialized
2009-02-26 12:58:07 +0100 mst r268502 : migration of cws odfmetadata2 from CVS (resync to m42): module xmloff
#i90620#: implement RDFa import (interface change)
- xmloff/inc/xmloff/xmlimp.hxx. xmloff/source/core/xmlimp.cxx:
+ make SvXMLImport::GetAbsoluteReference() const
+ add SvXMLImport::GetComponentContext()
+ SvXMLImport::_InitCtor(): add RDFa namespace
+ add SvXMLImport::AddRDFa()
+ SvXMLImport::endDocument() inserts RDFa into document repository
- xmloff/inc/xmloff/xmltoken.hxx, xmloff/source/core/xmltoken.cxx:
+ new tokens for RDFa: XML_ABOUT, XML_DATATYPE
- xmloff/inc/RDFaImportHelper.hxx, xmloff/source/core/RDFaImportHelper.cxx:
+ new class RDFaImportHelper
+ adapt the code to the bleak reality of broken C++ implementations
+ handle empty xhtml:about attributes properly, which are actually
valid relative URIs
+ work around broken SvXMLImport::GetAbsoluteReference
- xmloff/source/core/makefile.mk:
+ add RDFaImportHelper.cxx
#i90620#: implement RDFa export
- xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ add SvXMLExport::EnsureNamespace(), and a stack of namespace maps
+ add SvXMLExport::GetComponentContext()
+ add SvXMLExport::AddAttributesRDFa()
- xmloff/inc/RDFaExportHelper.hxx, xmloff/source/core/RDFaExportHelper.cxx:
+ new class RDFaExportHelper
+ don't use std::map::data_type, which is actually called
std::map::mapped_type by libstdc++
- xmloff/source/core/makefile.mk:
+ add RDFaExportHelper.cxx
#i91563#
- xmloff/inc/xmloff/txtimp.hxx, xmloff/source/text/txtimp.cxx:
+ XMLTextPAttrTokens: add RDFa tokens
- xmloff/source/text/txtparai{.hxx,.cxx}:
+ import RDFa for text:p
- xmloff/source/text/txtparae.cxx:
+ export RDFa for text:p
interface change: use XHTML namespace instead of RDFA
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlimp.cxx,xmlexp.cxx,RDFaExportHelper.cxx},
xmloff/source/text/txtimp.cxx:
+ use XHTML namespace instead of RDFA
#i91565#, #i91566#: (preliminary) import for text:meta, text:meta-field
- xmloff/source/text/txtparai.cxx:
+ new class XMLMetaImportContextBase with subclasses to import
text:meta and text:meta-field
- xmloff/source/text/XMLTextMarkImportContext.cxx:
+ change XMLTextMarkImportContext::CreateAndInsertMark to handle marks
with no name (text:meta)
#i91565#, #i91566#: (preliminary) export for text:meta, text:meta-field
- xmloff/inc/txtflde.hxx, xmloff/source/text/txtflde.cxx:
+ add FIELD_ID_META to FieldIdEnum
+ new method XMLTextFieldExport::ExportMetaField()
+ change XMLTextFieldExport::ExportField{,AutoStyle,Helper}
to take additional parameter for progress bar
- xmloff/inc/xmloff/txtparae.hxx, xmloff/source/text/txtparae.cxx:
+ make XMLTextParagraphExport::exportTextRangeEnumeration() public
+ new method XMLTextParagraphExport::exportMeta()
#i90620#
- xmloff/inc/xmloff/xmlimp.hxx, xmloff/source/core/xmlimp.cxx,
xmloff/inc/xmloff/xmlexp.hxx, xmloff/source/core/xmlexp.cxx:
+ rename SvXML{Im,Ex}port::GetStreamPath() to GetStreamName()
+ fix xml:id {im,ex}port for embedded documents and non-packages
+ adapt to API change: XMetadatable
#i90620# GRDDL
- xmloff/inc/xmlnmspe.hxx, xmloff/inc/xmloff/xmltoken.hxx,
xmloff/source/core/{xmltoken.cxx,xmlexp.cxx}:
+ add GRDDL namespace
+ add token XML_TRANSFORMATION
+ add grddl:transformation attribute to root elements for meta.xml,
content.xml and styles.xml
2009-02-26 12:54:40 +0100 mst r268501 : migration of cws odfmetadata2 from CVS (resync to m42): module unoxml
#i90620#
- unoxml/source/rdf/librdf_repository.cxx:
+ librdf_Repository::importGraph: allocate buffer sized length of stream
+ switch from one librdf_world per repository to a single static world
because redland has global variables with a brain-damaged life-cycle...
+ exportGraph: use new raptor 1.4.18 feature to disable writing
an xml:base attribute in RDF/XML files
- unoxml/source/rdf/librdf_repository.cxx:
unoxml/qa/complex/RDFRepositoryTest.java:
+ adapt to predicate is URI change
+ adapt to RDFa API change
+ adapt to API change: RDFa has multiple predicates...
+ adapt to API change: XMetadatable derives from XURI
+ allow xhtml:datatype without xhtml:content
+ adapt to API change: attribute MetadataReference is StringPair
- unoxml/source/rdf/CURI.cxx:
+ add some more URI constants
2009-02-26 12:53:32 +0100 mst r268500 : migration of cws odfmetadata2 from CVS (resync to m42): module package
- package/inc/ImplValidCharacters.hxx:
+ remove (moved to comphelper)
2009-02-26 12:52:49 +0100 mst r268499 : migration of cws odfmetadata2 from CVS (resync to m42): module comphelper
- comphelper/inc/comphelper/processfactory.hxx,
comphelper/source/processfactory/processfactory.cxx:
+ add getProcessComponentContext()
+ change return type of comphelper_getProcessComponentContext to Reference
- comphelper/inc/comphelper/stl_types.hxx:
+ add OUStringBufferAppender
+ add algorithm intersperse
- comphelper/source/misc/string.cxx:
+ rewrite convertCommaSeparated with intersperse and OUStringBufferAppender
- comphelper/inc/comphelper/stlunosequence.hxx:
+ fix bug: begin() on empty sequence != end()
2009-02-26 12:50:47 +0100 mst r268498 : migration of cws odfmetadata2 from CVS (resync to m42): module offapi
#i96209#
- offapi/com/sun/star/text/fieldmaster/*.idl:
+ rename module from FieldMaster to fieldmaster
- offapi/type_reference/{typelibrary_history.txt,types.rdb}:
+ update reference types.rdb
#i90620#
- offapi/com/sun/star/rdf/{XMetadatable.idl,XDocumentMetadataAccess.idl}:
+ API change: XMetadatable derives from XURI
+ API change: replace XmlId (string) with MetadataReference (StringPair)
- offapi/com/sun/star/rdf/{Statement.idl,XDocumentRepository.idl,
XNamedGraph.idl,XRepository.idl}:
+ the predicate of a statement is a URI, not a Resource
- offapi/com/sun/star/rdf/XDocumentMetadataAccess.idl:
+ rename: s/Package/Document/
+ remove uuid
+ remove everything related to mapping
+ graph names are now generated from base URI and file names
+ load methods: improve error handling with XInteractionHandler
- offapi/com/sun/star/rdf/XDocumentRepository.idl:
+ change: RDFa permits using multiple predicates in one attribute
+ setStatementRDFa: subject is now XResource, object is now XMetadatable
- offapi/com/sun/star/rdf/URIs.idl:
+ add some more URI constants
- offapi/com/sun/star/rdf:
+ fix @since tags and replace <method> with <member>
2009-02-26 12:47:24 +0100 mst r268497 : migration of cws odfmetadata2 from CVS (resync to m42): module redland
fix #i93768#
- redland/raptor-1.4.17.patch, redland/raptor/makefile.mk:
+ disable GRDDL parser to prevent call to libxslt
xsltSetDefaultSecurityPrefs, which breaks xmlhelp
- redland/raptor/makefile.mk, redland/raptor-1.4.17.patch,
redland/raptor-1.4.18.patch:
+ upgrade raptor to 1.4.18
+ deactivate serializer for RSS/Atom (does not build)
- redland/rasqal/makefile.mk, redland/rasqal-0.9.15.patch,
redland/rasqal-0.9.16.patch,
+ upgrade rasqal to 0.9.16
- redland/redland/makefile.mk, redland/redland-1.0.7.patch,
redland/redland-1.0.8.patch:
+ upgrade redland to 1.0.8
- redland/redlandversion.mk:
+ the librasqal SONAME has changed
2009-07-02 09:05:03 +00:00
|
|
|
const SwTableCursor* pTblCrsr =
|
|
|
|
dynamic_cast<const SwTableCursor*>(&rCursor);
|
2000-09-18 23:08:29 +00:00
|
|
|
if( pTblCrsr )
|
|
|
|
::GetTblSelCrs( *pTblCrsr, rBoxes );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const SwPaM *pCurPam = &rCursor, *pSttPam = pCurPam;
|
|
|
|
do {
|
|
|
|
const SwNode* pNd = pCurPam->GetNode()->FindTableBoxStartNode();
|
|
|
|
if( pNd )
|
|
|
|
{
|
|
|
|
SwTableBox* pBox = (SwTableBox*)pNd->FindTableNode()->GetTable().
|
|
|
|
GetTblBox( pNd->GetIndex() );
|
|
|
|
rBoxes.Insert( pBox );
|
|
|
|
}
|
|
|
|
} while( bAllCrsr &&
|
|
|
|
pSttPam != ( pCurPam = (SwPaM*)pCurPam->GetNext()) );
|
|
|
|
}
|
|
|
|
return 0 != rBoxes.Count();
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
#* Class : SwDoc
|
|
|
|
#* Methoden : SetRowHeight(), GetRowHeight()
|
|
|
|
#***********************************************************************/
|
|
|
|
//Die Zeilenhoehe wird ausgehend von der Selektion ermittelt/gesetzt.
|
|
|
|
//Ausgehend von jeder Zelle innerhalb der Selektion werden nach oben alle
|
|
|
|
//Zeilen abgeklappert, die oberste Zeile erhaelt den gewuenschten Wert alle
|
|
|
|
//tieferliegenden Zeilen einen entsprechenden Wert der sich aus der
|
|
|
|
//Relation der alten und neuen Groesse der obersten Zeile und ihrer
|
|
|
|
//eigenen Groesse ergiebt.
|
|
|
|
//Alle veraenderten Zeilen erhalten ggf. ein eigenes FrmFmt.
|
|
|
|
//Natuerlich darf jede Zeile nur einmal angefasst werden.
|
|
|
|
|
|
|
|
inline void InsertLine( SvPtrarr& rLineArr, SwTableLine* pLine )
|
|
|
|
{
|
2010-01-22 15:25:50 +00:00
|
|
|
if( USHRT_MAX == rLineArr.GetPos( pLine ) )
|
|
|
|
rLineArr.Insert( pLine, rLineArr.Count() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool lcl_IsAnLower( const SwTableLine *pLine, const SwTableLine *pAssumed )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwTableLine *pTmp = pAssumed->GetUpper() ?
|
|
|
|
pAssumed->GetUpper()->GetUpper() : 0;
|
|
|
|
while ( pTmp )
|
|
|
|
{
|
|
|
|
if ( pTmp == pLine )
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
pTmp = pTmp->GetUpper() ? pTmp->GetUpper()->GetUpper() : 0;
|
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
struct LinesAndTable
|
|
|
|
{
|
|
|
|
SvPtrarr &rLines;
|
|
|
|
const SwTable &rTable;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bInsertLines;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
LinesAndTable( SvPtrarr &rL, const SwTable &rTbl ) :
|
2011-01-17 15:06:54 +01:00
|
|
|
rLines( rL ), rTable( rTbl ), bInsertLines( sal_True ) {}
|
2000-09-18 23:08:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool _FindLine( const _FndLine*& rpLine, void* pPara );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool _FindBox( const _FndBox*& rpBox, void* pPara )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( rpBox->GetLines().Count() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
((LinesAndTable*)pPara)->bInsertLines = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
((_FndBox*)rpBox)->GetLines().ForEach( _FindLine, pPara );
|
|
|
|
if ( ((LinesAndTable*)pPara)->bInsertLines )
|
|
|
|
{
|
|
|
|
const SwTableLines &rLines = rpBox->GetBox()
|
|
|
|
? rpBox->GetBox()->GetTabLines()
|
|
|
|
: ((LinesAndTable*)pPara)->rTable.GetTabLines();
|
|
|
|
if ( rpBox->GetLines().Count() == rLines.Count() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
::InsertLine( ((LinesAndTable*)pPara)->rLines,
|
|
|
|
(SwTableLine*)rLines[i] );
|
|
|
|
}
|
|
|
|
else
|
2011-01-17 15:06:54 +01:00
|
|
|
((LinesAndTable*)pPara)->bInsertLines = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( rpBox->GetBox() )
|
|
|
|
::InsertLine( ((LinesAndTable*)pPara)->rLines,
|
|
|
|
(SwTableLine*)rpBox->GetBox()->GetUpper() );
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool _FindLine( const _FndLine*& rpLine, void* pPara )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
((_FndLine*)rpLine)->GetBoxes().ForEach( _FindBox, pPara );
|
2011-01-17 15:06:54 +01:00
|
|
|
return sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2004-01-13 10:09:05 +00:00
|
|
|
void lcl_CollectLines( SvPtrarr &rArr, const SwCursor& rCursor, bool bRemoveLines )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
//Zuerst die selektierten Boxen einsammeln.
|
|
|
|
SwSelBoxes aBoxes;
|
|
|
|
if( !::lcl_GetBoxSel( rCursor, aBoxes ))
|
|
|
|
return ;
|
|
|
|
|
|
|
|
//Die selektierte Struktur kopieren.
|
2002-03-21 12:13:35 +00:00
|
|
|
const SwTable &rTable = aBoxes[0]->GetSttNd()->FindTableNode()->GetTable();
|
|
|
|
LinesAndTable aPara( rArr, rTable );
|
2003-03-27 14:45:43 +00:00
|
|
|
_FndBox aFndBox( 0, 0 );
|
|
|
|
{
|
2007-09-27 07:41:55 +00:00
|
|
|
_FndPara aTmpPara( aBoxes, &aFndBox );
|
|
|
|
((SwTableLines&)rTable.GetTabLines()).ForEach( &_FndLineCopyCol, &aTmpPara );
|
2003-03-27 14:45:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//Diejenigen Lines einsammeln, die nur selektierte Boxen enthalten.
|
2000-09-18 23:08:29 +00:00
|
|
|
const _FndBox *pTmp = &aFndBox;
|
|
|
|
::_FindBox( pTmp, &aPara );
|
|
|
|
|
2004-01-13 10:09:05 +00:00
|
|
|
// Remove lines, that have a common superordinate row.
|
|
|
|
// (Not for row split)
|
|
|
|
if ( bRemoveLines )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < rArr.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-01-13 10:09:05 +00:00
|
|
|
SwTableLine *pUpLine = (SwTableLine*)rArr[i];
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 k = 0; k < rArr.Count(); ++k )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-01-13 10:09:05 +00:00
|
|
|
if ( k != i && ::lcl_IsAnLower( pUpLine, (SwTableLine*)rArr[k] ) )
|
|
|
|
{
|
|
|
|
rArr.Remove( k );
|
|
|
|
if ( k <= i )
|
|
|
|
--i;
|
|
|
|
--k;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2004-01-13 10:09:05 +00:00
|
|
|
void lcl_ProcessRowAttr( SvPtrarr& rFmtCmp, SwTableLine* pLine, const SfxPoolItem& rNew )
|
|
|
|
{
|
|
|
|
SwFrmFmt *pNewFmt;
|
|
|
|
if ( 0 != (pNewFmt = SwTblFmtCmp::FindNewFmt( rFmtCmp, pLine->GetFrmFmt(), 0 )))
|
|
|
|
pLine->ChgFrmFmt( (SwTableLineFmt*)pNewFmt );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwFrmFmt *pOld = pLine->GetFrmFmt();
|
|
|
|
SwFrmFmt *pNew = pLine->ClaimFrmFmt();
|
2008-06-13 08:41:49 +00:00
|
|
|
pNew->SetFmtAttr( rNew );
|
2004-01-13 10:09:05 +00:00
|
|
|
rFmtCmp.Insert( new SwTblFmtCmp( pOld, pNew, 0 ), rFmtCmp.Count());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
void lcl_ProcessBoxSize( SvPtrarr &rFmtCmp, SwTableBox *pBox, const SwFmtFrmSize &rNew );
|
|
|
|
|
|
|
|
void lcl_ProcessRowSize( SvPtrarr &rFmtCmp, SwTableLine *pLine, const SwFmtFrmSize &rNew )
|
|
|
|
{
|
2004-01-13 10:09:05 +00:00
|
|
|
lcl_ProcessRowAttr( rFmtCmp, pLine, rNew );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTableBoxes &rBoxes = pLine->GetTabBoxes();
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < rBoxes.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
::lcl_ProcessBoxSize( rFmtCmp, rBoxes[i], rNew );
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void lcl_ProcessBoxSize( SvPtrarr &rFmtCmp, SwTableBox *pBox, const SwFmtFrmSize &rNew )
|
|
|
|
{
|
|
|
|
SwTableLines &rLines = pBox->GetTabLines();
|
|
|
|
if ( rLines.Count() )
|
|
|
|
{
|
|
|
|
SwFmtFrmSize aSz( rNew );
|
|
|
|
aSz.SetHeight( rNew.GetHeight() ? rNew.GetHeight() / rLines.Count() : 0 );
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < rLines.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
::lcl_ProcessRowSize( rFmtCmp, rLines[i], aSz );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-01-13 10:09:05 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* void SwDoc::SetRowSplit()
|
|
|
|
******************************************************************************/
|
|
|
|
void SwDoc::SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew )
|
|
|
|
{
|
|
|
|
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
|
|
|
|
if( pTblNd )
|
|
|
|
{
|
|
|
|
SvPtrarr aRowArr( 25, 50 ); //Zum sammeln Lines.
|
|
|
|
::lcl_CollectLines( aRowArr, rCursor, false );
|
|
|
|
|
|
|
|
if( aRowArr.Count() )
|
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
if (GetIDocumentUndoRedo().DoesUndo())
|
2004-01-13 10:09:05 +00:00
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
|
2004-01-13 10:09:05 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SvPtrarr aFmtCmp( Max( sal_uInt8(255), sal_uInt8(aRowArr.Count()) ), 255 );
|
2004-01-13 10:09:05 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for( sal_uInt16 i = 0; i < aRowArr.Count(); ++i )
|
2004-01-13 10:09:05 +00:00
|
|
|
::lcl_ProcessRowAttr( aFmtCmp, (SwTableLine*)aRowArr[i], rNew );
|
|
|
|
|
|
|
|
SwTblFmtCmp::Delete( aFmtCmp );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* SwTwips SwDoc::GetRowSplit() const
|
|
|
|
******************************************************************************/
|
|
|
|
void SwDoc::GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) const
|
|
|
|
{
|
|
|
|
rpSz = 0;
|
|
|
|
|
|
|
|
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
|
|
|
|
if( pTblNd )
|
|
|
|
{
|
|
|
|
SvPtrarr aRowArr( 25, 50 ); //Zum sammeln der Lines.
|
|
|
|
::lcl_CollectLines( aRowArr, rCursor, false );
|
|
|
|
|
|
|
|
if( aRowArr.Count() )
|
|
|
|
{
|
|
|
|
rpSz = &(SwFmtRowSplit&)((SwTableLine*)aRowArr[0])->
|
|
|
|
GetFrmFmt()->GetRowSplit();
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 1; i < aRowArr.Count() && rpSz; ++i )
|
2004-01-13 10:09:05 +00:00
|
|
|
{
|
|
|
|
if ( (*rpSz).GetValue() != ((SwTableLine*)aRowArr[i])->GetFrmFmt()->GetRowSplit().GetValue() )
|
|
|
|
rpSz = 0;
|
|
|
|
}
|
|
|
|
if ( rpSz )
|
|
|
|
rpSz = new SwFmtRowSplit( *rpSz );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* void SwDoc::SetRowHeight( SwTwips nNew )
|
|
|
|
******************************************************************************/
|
|
|
|
void SwDoc::SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew )
|
|
|
|
{
|
|
|
|
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
|
|
|
|
if( pTblNd )
|
|
|
|
{
|
|
|
|
SvPtrarr aRowArr( 25, 50 ); //Zum sammeln Lines.
|
2004-01-13 10:09:05 +00:00
|
|
|
::lcl_CollectLines( aRowArr, rCursor, true );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( aRowArr.Count() )
|
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
if (GetIDocumentUndoRedo().DoesUndo())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SvPtrarr aFmtCmp( Max( sal_uInt8(255), sal_uInt8(aRowArr.Count()) ), 255 );
|
|
|
|
for ( sal_uInt16 i = 0; i < aRowArr.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
::lcl_ProcessRowSize( aFmtCmp, (SwTableLine*)aRowArr[i], rNew );
|
|
|
|
SwTblFmtCmp::Delete( aFmtCmp );
|
|
|
|
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* SwTwips SwDoc::GetRowHeight() const
|
|
|
|
******************************************************************************/
|
|
|
|
void SwDoc::GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) const
|
|
|
|
{
|
|
|
|
rpSz = 0;
|
|
|
|
|
|
|
|
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
|
|
|
|
if( pTblNd )
|
|
|
|
{
|
|
|
|
SvPtrarr aRowArr( 25, 50 ); //Zum sammeln der Lines.
|
2004-01-13 10:09:05 +00:00
|
|
|
::lcl_CollectLines( aRowArr, rCursor, true );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( aRowArr.Count() )
|
|
|
|
{
|
|
|
|
rpSz = &(SwFmtFrmSize&)((SwTableLine*)aRowArr[0])->
|
|
|
|
GetFrmFmt()->GetFrmSize();
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 1; i < aRowArr.Count() && rpSz; ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( *rpSz != ((SwTableLine*)aRowArr[i])->GetFrmFmt()->GetFrmSize() )
|
|
|
|
rpSz = 0;
|
|
|
|
}
|
|
|
|
if ( rpSz )
|
|
|
|
rpSz = new SwFmtFrmSize( *rpSz );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, sal_Bool bTstOnly )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bRet = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
|
|
|
|
if( pTblNd )
|
|
|
|
{
|
|
|
|
SvPtrarr aRowArr( 25, 50 ); //Zum sammeln der Lines.
|
2004-01-13 10:09:05 +00:00
|
|
|
::lcl_CollectLines( aRowArr, rCursor, true );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( 1 < aRowArr.Count() )
|
|
|
|
{
|
|
|
|
if( !bTstOnly )
|
|
|
|
{
|
|
|
|
long nHeight = 0;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 i;
|
2003-12-01 16:02:29 +00:00
|
|
|
|
|
|
|
for ( i = 0; i < aRowArr.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-12-17 09:02:23 +01:00
|
|
|
SwIterator<SwFrm,SwFmt> aIter( *((SwTableLine*)aRowArr[i])->GetFrmFmt() );
|
|
|
|
SwFrm* pFrm = aIter.First();
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pFrm )
|
|
|
|
{
|
|
|
|
nHeight = Max( nHeight, pFrm->Frm().Height() );
|
2010-12-17 09:02:23 +01:00
|
|
|
pFrm = aIter.Next();
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
SwFmtFrmSize aNew( ATT_MIN_SIZE, 0, nHeight );
|
|
|
|
|
2010-11-25 14:31:08 +01:00
|
|
|
if (GetIDocumentUndoRedo().DoesUndo())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().AppendUndo(
|
|
|
|
new SwUndoAttrTbl(*pTblNd));
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SvPtrarr aFmtCmp( Max( sal_uInt8(255), sal_uInt8(aRowArr.Count()) ), 255 );
|
2000-09-18 23:08:29 +00:00
|
|
|
for( i = 0; i < aRowArr.Count(); ++i )
|
|
|
|
::lcl_ProcessRowSize( aFmtCmp, (SwTableLine*)aRowArr[i], aNew );
|
|
|
|
SwTblFmtCmp::Delete( aFmtCmp );
|
|
|
|
|
|
|
|
SetModified();
|
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
bRet = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* void SwDoc::SetRowBackground()
|
|
|
|
******************************************************************************/
|
|
|
|
void SwDoc::SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew )
|
|
|
|
{
|
|
|
|
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
|
|
|
|
if( pTblNd )
|
|
|
|
{
|
|
|
|
SvPtrarr aRowArr( 25, 50 ); //Zum sammeln Lines.
|
2004-01-13 10:09:05 +00:00
|
|
|
::lcl_CollectLines( aRowArr, rCursor, true );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( aRowArr.Count() )
|
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
if (GetIDocumentUndoRedo().DoesUndo())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SvPtrarr aFmtCmp( Max( sal_uInt8(255), sal_uInt8(aRowArr.Count()) ), 255 );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for( sal_uInt16 i = 0; i < aRowArr.Count(); ++i )
|
2004-01-13 10:09:05 +00:00
|
|
|
::lcl_ProcessRowAttr( aFmtCmp, (SwTableLine*)aRowArr[i], rNew );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SwTblFmtCmp::Delete( aFmtCmp );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* SwTwips SwDoc::GetRowBackground() const
|
|
|
|
******************************************************************************/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwDoc::GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bRet = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
|
|
|
|
if( pTblNd )
|
|
|
|
{
|
|
|
|
SvPtrarr aRowArr( 25, 50 ); //Zum sammeln Lines.
|
2004-01-13 10:09:05 +00:00
|
|
|
::lcl_CollectLines( aRowArr, rCursor, true );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( aRowArr.Count() )
|
|
|
|
{
|
|
|
|
rToFill = ((SwTableLine*)aRowArr[0])->GetFrmFmt()->GetBackground();
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
bRet = sal_True;
|
|
|
|
for ( sal_uInt16 i = 1; i < aRowArr.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( rToFill != ((SwTableLine*)aRowArr[i])->GetFrmFmt()->GetBackground() )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
bRet = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
#* Class : SwDoc
|
|
|
|
#* Methoden : SetTabBorders(), GetTabBorders()
|
|
|
|
#***********************************************************************/
|
|
|
|
inline void InsertCell( SvPtrarr& rCellArr, SwCellFrm* pCellFrm )
|
|
|
|
{
|
2010-01-22 15:25:50 +00:00
|
|
|
if( USHRT_MAX == rCellArr.GetPos( pCellFrm ) )
|
|
|
|
rCellArr.Insert( pCellFrm, rCellArr.Count() );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
void lcl_CollectCells( SvPtrarr &rArr, const SwRect &rUnion,
|
|
|
|
SwTabFrm *pTab )
|
|
|
|
{
|
|
|
|
SwLayoutFrm *pCell = pTab->FirstCell();
|
|
|
|
do
|
|
|
|
{
|
|
|
|
// Wenn in der Zelle ein spaltiger Bereich sitzt, muessen wir
|
|
|
|
// uns erst wieder zur Zelle hochhangeln
|
|
|
|
while ( !pCell->IsCellFrm() )
|
|
|
|
pCell = pCell->GetUpper();
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( pCell, "Frame ist keine Zelle." );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( rUnion.IsOver( pCell->Frm() ) )
|
|
|
|
::InsertCell( rArr, (SwCellFrm*)pCell );
|
|
|
|
//Dafuer sorgen, dass die Zelle auch verlassen wird (Bereiche)
|
|
|
|
SwLayoutFrm *pTmp = pCell;
|
|
|
|
do
|
|
|
|
{ pTmp = pTmp->GetNextLayoutLeaf();
|
|
|
|
} while ( pCell->IsAnLower( pTmp ) );
|
|
|
|
pCell = pTmp;
|
|
|
|
} while( pCell && pTab->IsAnLower( pCell ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
|
|
|
|
{
|
2007-04-26 08:38:08 +00:00
|
|
|
SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode();
|
|
|
|
SwTableNode* pTblNd = pCntNd ? pCntNd->FindTableNode() : 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pTblNd )
|
|
|
|
return ;
|
|
|
|
|
|
|
|
SwLayoutFrm *pStart, *pEnd;
|
|
|
|
::lcl_GetStartEndCell( rCursor, pStart, pEnd );
|
|
|
|
|
|
|
|
SwSelUnions aUnions;
|
|
|
|
::MakeSelUnions( aUnions, pStart, pEnd );
|
|
|
|
|
|
|
|
if( aUnions.Count() )
|
|
|
|
{
|
|
|
|
SwTable& rTable = pTblNd->GetTable();
|
2010-11-25 14:31:08 +01:00
|
|
|
if (GetIDocumentUndoRedo().DoesUndo())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().AppendUndo( new SwUndoAttrTbl(*pTblNd) );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SvPtrarr aFmtCmp( 255, 255 );
|
|
|
|
const SvxBoxItem* pSetBox;
|
|
|
|
const SvxBoxInfoItem *pSetBoxInfo;
|
|
|
|
|
|
|
|
const SvxBorderLine* pLeft = 0;
|
|
|
|
const SvxBorderLine* pRight = 0;
|
|
|
|
const SvxBorderLine* pTop = 0;
|
|
|
|
const SvxBorderLine* pBottom = 0;
|
|
|
|
const SvxBorderLine* pHori = 0;
|
|
|
|
const SvxBorderLine* pVert = 0;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bHoriValid = sal_True, bVertValid = sal_True,
|
|
|
|
bTopValid = sal_True, bBottomValid = sal_True,
|
|
|
|
bLeftValid = sal_True, bRightValid = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
// JP 21.07.95: die Flags im BoxInfo-Item entscheiden, wann eine
|
|
|
|
// BorderLine gueltig ist!!
|
2011-01-17 15:06:54 +01:00
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_BORDER_INNER, sal_False,
|
2000-09-18 23:08:29 +00:00
|
|
|
(const SfxPoolItem**)&pSetBoxInfo) )
|
|
|
|
{
|
|
|
|
pHori = pSetBoxInfo->GetHori();
|
|
|
|
pVert = pSetBoxInfo->GetVert();
|
|
|
|
|
|
|
|
bHoriValid = pSetBoxInfo->IsValid(VALID_HORI);
|
|
|
|
bVertValid = pSetBoxInfo->IsValid(VALID_VERT);
|
|
|
|
|
|
|
|
// wollen wir die auswerten ??
|
|
|
|
bTopValid = pSetBoxInfo->IsValid(VALID_TOP);
|
|
|
|
bBottomValid = pSetBoxInfo->IsValid(VALID_BOTTOM);
|
|
|
|
bLeftValid = pSetBoxInfo->IsValid(VALID_LEFT);
|
|
|
|
bRightValid = pSetBoxInfo->IsValid(VALID_RIGHT);
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( RES_BOX, sal_False,
|
2000-09-18 23:08:29 +00:00
|
|
|
(const SfxPoolItem**)&pSetBox) )
|
|
|
|
{
|
|
|
|
pLeft = pSetBox->GetLeft();
|
|
|
|
pRight = pSetBox->GetRight();
|
|
|
|
pTop = pSetBox->GetTop();
|
|
|
|
pBottom = pSetBox->GetBottom();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// nicht gesetzt, also keine gueltigen Werte
|
2011-01-17 15:06:54 +01:00
|
|
|
bTopValid = bBottomValid = bLeftValid = bRightValid = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
pSetBox = 0;
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bFirst = sal_True;
|
|
|
|
for ( sal_uInt16 i = 0; i < aUnions.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwSelUnion *pUnion = aUnions[i];
|
|
|
|
SwTabFrm *pTab = pUnion->GetTable();
|
|
|
|
const SwRect &rUnion = pUnion->GetUnion();
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bLast = i == aUnions.Count() - 1 ? sal_True : sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SvPtrarr aCellArr( 255, 255 );
|
|
|
|
::lcl_CollectCells( aCellArr, pUnion->GetUnion(), pTab );
|
|
|
|
|
|
|
|
//Alle Zellenkanten, die mit dem UnionRect uebereinstimmen oder
|
|
|
|
//darueber hinausragen sind Aussenkanten. Alle anderen sind
|
|
|
|
//Innenkanten.
|
|
|
|
//neu: Die Aussenkanten koennen abhaengig davon, ob es sich um eine
|
|
|
|
//Start/Mittlere/Folge -Tabelle (bei Selektionen ueber FollowTabs)
|
|
|
|
//handelt doch keine Aussenkanten sein.
|
|
|
|
//Aussenkanten werden links, rechts, oben und unten gesetzt.
|
|
|
|
//Innenkanten werden nur oben und links gesetzt.
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 j = 0; j < aCellArr.Count(); ++j )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwCellFrm *pCell = (SwCellFrm*)aCellArr[j];
|
2004-04-21 08:54:44 +00:00
|
|
|
const sal_Bool bVert = pTab->IsVertical();
|
|
|
|
const sal_Bool bRTL = pTab->IsRightToLeft();
|
2002-12-02 11:24:28 +00:00
|
|
|
sal_Bool bTopOver, bLeftOver, bRightOver, bBottomOver;
|
|
|
|
if ( bVert )
|
|
|
|
{
|
|
|
|
bTopOver = pCell->Frm().Right() >= rUnion.Right();
|
|
|
|
bLeftOver = pCell->Frm().Top() <= rUnion.Top();
|
|
|
|
bRightOver = pCell->Frm().Bottom() >= rUnion.Bottom();
|
|
|
|
bBottomOver = pCell->Frm().Left() <= rUnion.Left();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bTopOver = pCell->Frm().Top() <= rUnion.Top();
|
|
|
|
bLeftOver = pCell->Frm().Left() <= rUnion.Left();
|
|
|
|
bRightOver = pCell->Frm().Right() >= rUnion.Right();
|
|
|
|
bBottomOver = pCell->Frm().Bottom() >= rUnion.Bottom();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( bRTL )
|
|
|
|
{
|
|
|
|
sal_Bool bTmp = bRightOver;
|
|
|
|
bRightOver = bLeftOver;
|
|
|
|
bLeftOver = bTmp;
|
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Grundsaetzlich nichts setzen in HeadlineRepeats.
|
2006-02-09 14:00:20 +00:00
|
|
|
if ( pTab->IsFollow() &&
|
|
|
|
( pTab->IsInHeadline( *pCell ) ||
|
2011-02-07 20:21:18 +01:00
|
|
|
// Same holds for follow flow rows.
|
2006-02-09 14:00:20 +00:00
|
|
|
pCell->IsInFollowFlowRow() ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
SvxBoxItem aBox( pCell->GetFmt()->GetBox() );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Int16 nType = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Obere Kante
|
|
|
|
if( bTopValid )
|
|
|
|
{
|
2002-12-02 11:24:28 +00:00
|
|
|
if ( bFirst && bTopOver )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
aBox.SetLine( pTop, BOX_LINE_TOP );
|
|
|
|
nType |= 0x0001;
|
|
|
|
}
|
|
|
|
else if ( bHoriValid )
|
|
|
|
{
|
|
|
|
aBox.SetLine( 0, BOX_LINE_TOP );
|
|
|
|
nType |= 0x0002;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Linke Kante
|
2002-12-02 11:24:28 +00:00
|
|
|
if ( bLeftOver )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if( bLeftValid )
|
|
|
|
{
|
|
|
|
aBox.SetLine( pLeft, BOX_LINE_LEFT );
|
|
|
|
nType |= 0x0004;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( bVertValid )
|
|
|
|
{
|
|
|
|
aBox.SetLine( pVert, BOX_LINE_LEFT );
|
|
|
|
nType |= 0x0008;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Rechte Kante
|
|
|
|
if( bRightValid )
|
|
|
|
{
|
2002-12-02 11:24:28 +00:00
|
|
|
if ( bRightOver )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
aBox.SetLine( pRight, BOX_LINE_RIGHT );
|
|
|
|
nType |= 0x0010;
|
|
|
|
}
|
|
|
|
else if ( bVertValid )
|
|
|
|
{
|
|
|
|
aBox.SetLine( 0, BOX_LINE_RIGHT );
|
|
|
|
nType |= 0x0020;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Untere Kante
|
2002-12-02 11:24:28 +00:00
|
|
|
if ( bLast && bBottomOver )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if( bBottomValid )
|
|
|
|
{
|
|
|
|
aBox.SetLine( pBottom, BOX_LINE_BOTTOM );
|
|
|
|
nType |= 0x0040;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if( bHoriValid )
|
|
|
|
{
|
|
|
|
aBox.SetLine( pHori, BOX_LINE_BOTTOM );
|
|
|
|
nType |= 0x0080;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( pSetBox )
|
|
|
|
{
|
2011-03-14 16:51:14 +00:00
|
|
|
static sal_uInt16 const aBorders[] = {
|
2000-09-18 23:08:29 +00:00
|
|
|
BOX_LINE_BOTTOM, BOX_LINE_TOP,
|
|
|
|
BOX_LINE_RIGHT, BOX_LINE_LEFT };
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16* pBrd = aBorders;
|
2007-09-27 07:41:55 +00:00
|
|
|
for( int k = 0; k < 4; ++k, ++pBrd )
|
2000-09-18 23:08:29 +00:00
|
|
|
aBox.SetDistance( pSetBox->GetDistance( *pBrd ), *pBrd );
|
|
|
|
}
|
|
|
|
|
|
|
|
SwTableBox *pBox = (SwTableBox*)pCell->GetTabBox();
|
|
|
|
SwFrmFmt *pNewFmt;
|
|
|
|
if ( 0 != (pNewFmt = SwTblFmtCmp::FindNewFmt( aFmtCmp, pBox->GetFrmFmt(), nType )))
|
|
|
|
pBox->ChgFrmFmt( (SwTableBoxFmt*)pNewFmt );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwFrmFmt *pOld = pBox->GetFrmFmt();
|
|
|
|
SwFrmFmt *pNew = pBox->ClaimFrmFmt();
|
2008-06-13 08:41:49 +00:00
|
|
|
pNew->SetFmtAttr( aBox );
|
2000-09-18 23:08:29 +00:00
|
|
|
aFmtCmp.Insert( new SwTblFmtCmp( pOld, pNew, nType ), aFmtCmp.Count());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
bFirst = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2007-09-27 07:41:55 +00:00
|
|
|
SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout();
|
|
|
|
if( pTableLayout )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-06-13 15:22:56 +02:00
|
|
|
SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
|
|
|
|
|
2007-09-27 07:41:55 +00:00
|
|
|
pTableLayout->BordersChanged(
|
2011-01-17 15:06:54 +01:00
|
|
|
pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
SwTblFmtCmp::Delete( aFmtCmp );
|
|
|
|
::ClearFEShellTabCols();
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void lcl_SetLineStyle( SvxBorderLine *pToSet,
|
|
|
|
const Color *pColor, const SvxBorderLine *pBorderLine)
|
|
|
|
{
|
|
|
|
if ( pBorderLine )
|
|
|
|
{
|
|
|
|
if ( !pColor )
|
|
|
|
{
|
|
|
|
Color aTmp( pToSet->GetColor() );
|
|
|
|
*pToSet = *pBorderLine;
|
|
|
|
pToSet->SetColor( aTmp );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
*pToSet = *pBorderLine;
|
|
|
|
}
|
|
|
|
if ( pColor )
|
|
|
|
pToSet->SetColor( *pColor );
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
|
2011-01-17 15:06:54 +01:00
|
|
|
const Color* pColor, sal_Bool bSetLine,
|
2000-09-18 23:08:29 +00:00
|
|
|
const SvxBorderLine* pBorderLine )
|
|
|
|
{
|
2007-04-26 08:38:08 +00:00
|
|
|
SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode();
|
|
|
|
SwTableNode* pTblNd = pCntNd ? pCntNd->FindTableNode() : 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pTblNd )
|
|
|
|
return ;
|
|
|
|
|
|
|
|
SwLayoutFrm *pStart, *pEnd;
|
|
|
|
::lcl_GetStartEndCell( rCursor, pStart, pEnd );
|
|
|
|
|
|
|
|
SwSelUnions aUnions;
|
|
|
|
::MakeSelUnions( aUnions, pStart, pEnd );
|
|
|
|
|
|
|
|
if( aUnions.Count() )
|
|
|
|
{
|
|
|
|
SwTable& rTable = pTblNd->GetTable();
|
2010-11-25 14:31:08 +01:00
|
|
|
if (GetIDocumentUndoRedo().DoesUndo())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd));
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for( sal_uInt16 i = 0; i < aUnions.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwSelUnion *pUnion = aUnions[i];
|
|
|
|
SwTabFrm *pTab = pUnion->GetTable();
|
|
|
|
SvPtrarr aCellArr( 255, 255 );
|
|
|
|
::lcl_CollectCells( aCellArr, pUnion->GetUnion(), pTab );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 j = 0; j < aCellArr.Count(); ++j )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwCellFrm *pCell = ( SwCellFrm* )aCellArr[j];
|
|
|
|
|
|
|
|
//Grundsaetzlich nichts setzen in HeadlineRepeats.
|
2004-05-03 12:44:40 +00:00
|
|
|
if ( pTab->IsFollow() && pTab->IsInHeadline( *pCell ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
((SwTableBox*)pCell->GetTabBox())->ClaimFrmFmt();
|
|
|
|
SwFrmFmt *pFmt = pCell->GetFmt();
|
|
|
|
SvxBoxItem aBox( pFmt->GetBox() );
|
|
|
|
|
|
|
|
if ( !pBorderLine && bSetLine )
|
|
|
|
aBox = *(SvxBoxItem*)::GetDfltAttr( RES_BOX );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( aBox.GetTop() )
|
|
|
|
::lcl_SetLineStyle( (SvxBorderLine*)aBox.GetTop(),
|
|
|
|
pColor, pBorderLine );
|
|
|
|
if ( aBox.GetBottom() )
|
|
|
|
::lcl_SetLineStyle( (SvxBorderLine*)aBox.GetBottom(),
|
|
|
|
pColor, pBorderLine );
|
|
|
|
if ( aBox.GetLeft() )
|
|
|
|
::lcl_SetLineStyle( (SvxBorderLine*)aBox.GetLeft(),
|
|
|
|
pColor, pBorderLine );
|
|
|
|
if ( aBox.GetRight() )
|
|
|
|
::lcl_SetLineStyle( (SvxBorderLine*)aBox.GetRight(),
|
|
|
|
pColor, pBorderLine );
|
|
|
|
}
|
2008-06-13 08:41:49 +00:00
|
|
|
pFmt->SetFmtAttr( aBox );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-09-27 07:41:55 +00:00
|
|
|
SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout();
|
|
|
|
if( pTableLayout )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-06-13 15:22:56 +02:00
|
|
|
SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
|
|
|
|
|
2007-09-27 07:41:55 +00:00
|
|
|
pTableLayout->BordersChanged(
|
2011-01-17 15:06:54 +01:00
|
|
|
pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
::ClearFEShellTabCols();
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const
|
|
|
|
{
|
2007-04-26 08:38:08 +00:00
|
|
|
SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode();
|
|
|
|
SwTableNode* pTblNd = pCntNd ? pCntNd->FindTableNode() : 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pTblNd )
|
|
|
|
return ;
|
|
|
|
|
|
|
|
SwLayoutFrm *pStart, *pEnd;
|
|
|
|
::lcl_GetStartEndCell( rCursor, pStart, pEnd );
|
|
|
|
|
|
|
|
SwSelUnions aUnions;
|
|
|
|
::MakeSelUnions( aUnions, pStart, pEnd );
|
|
|
|
|
|
|
|
if( aUnions.Count() )
|
|
|
|
{
|
|
|
|
SvxBoxItem aSetBox ((const SvxBoxItem &) rSet.Get(RES_BOX ));
|
|
|
|
SvxBoxInfoItem aSetBoxInfo((const SvxBoxInfoItem&) rSet.Get(SID_ATTR_BORDER_INNER));
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bTopSet = sal_False,
|
|
|
|
bBottomSet = sal_False,
|
|
|
|
bLeftSet = sal_False,
|
|
|
|
bRightSet = sal_False,
|
|
|
|
bHoriSet = sal_False,
|
|
|
|
bVertSet = sal_False,
|
|
|
|
bDistanceSet = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
aSetBoxInfo.ResetFlags();
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < aUnions.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwSelUnion *pUnion = aUnions[i];
|
|
|
|
const SwTabFrm *pTab = pUnion->GetTable();
|
|
|
|
const SwRect &rUnion = pUnion->GetUnion();
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_Bool bFirst = i == 0 ? sal_True : sal_False;
|
|
|
|
const sal_Bool bLast = i == aUnions.Count() - 1 ? sal_True : sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
SvPtrarr aCellArr( 255, 255 );
|
|
|
|
::lcl_CollectCells( aCellArr, rUnion, (SwTabFrm*)pTab );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 j = 0; j < aCellArr.Count(); ++j )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwCellFrm *pCell = (const SwCellFrm*)aCellArr[j];
|
2004-04-21 08:54:44 +00:00
|
|
|
const sal_Bool bVert = pTab->IsVertical();
|
|
|
|
const sal_Bool bRTL = pTab->IsRightToLeft();
|
2002-12-02 11:24:28 +00:00
|
|
|
sal_Bool bTopOver, bLeftOver, bRightOver, bBottomOver;
|
|
|
|
if ( bVert )
|
|
|
|
{
|
|
|
|
bTopOver = pCell->Frm().Right() >= rUnion.Right();
|
|
|
|
bLeftOver = pCell->Frm().Top() <= rUnion.Top();
|
|
|
|
bRightOver = pCell->Frm().Bottom() >= rUnion.Bottom();
|
|
|
|
bBottomOver = pCell->Frm().Left() <= rUnion.Left();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bTopOver = pCell->Frm().Top() <= rUnion.Top();
|
|
|
|
bLeftOver = pCell->Frm().Left() <= rUnion.Left();
|
|
|
|
bRightOver = pCell->Frm().Right() >= rUnion.Right();
|
|
|
|
bBottomOver = pCell->Frm().Bottom() >= rUnion.Bottom();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( bRTL )
|
|
|
|
{
|
|
|
|
sal_Bool bTmp = bRightOver;
|
|
|
|
bRightOver = bLeftOver;
|
|
|
|
bLeftOver = bTmp;
|
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwFrmFmt *pFmt = pCell->GetFmt();
|
|
|
|
const SvxBoxItem &rBox = pFmt->GetBox();
|
|
|
|
|
|
|
|
//Obere Kante
|
2002-12-02 11:24:28 +00:00
|
|
|
if ( bFirst && bTopOver )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if (aSetBoxInfo.IsValid(VALID_TOP))
|
|
|
|
{
|
|
|
|
if ( !bTopSet )
|
2011-01-17 15:06:54 +01:00
|
|
|
{ bTopSet = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBox.SetLine( rBox.GetTop(), BOX_LINE_TOP );
|
|
|
|
}
|
|
|
|
else if ((aSetBox.GetTop() && rBox.GetTop() &&
|
|
|
|
!(*aSetBox.GetTop() == *rBox.GetTop())) ||
|
2011-01-17 15:06:54 +01:00
|
|
|
((!aSetBox.GetTop()) ^ (!rBox.GetTop()))) // XOR-Ausdruck ist sal_True, wenn genau einer der beiden Pointer 0 ist
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
aSetBoxInfo.SetValid(VALID_TOP, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBox.SetLine( 0, BOX_LINE_TOP );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Linke Kante
|
2002-12-02 11:24:28 +00:00
|
|
|
if ( bLeftOver )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if (aSetBoxInfo.IsValid(VALID_LEFT))
|
|
|
|
{
|
|
|
|
if ( !bLeftSet )
|
2011-01-17 15:06:54 +01:00
|
|
|
{ bLeftSet = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBox.SetLine( rBox.GetLeft(), BOX_LINE_LEFT );
|
|
|
|
}
|
|
|
|
else if ((aSetBox.GetLeft() && rBox.GetLeft() &&
|
|
|
|
!(*aSetBox.GetLeft() == *rBox.GetLeft())) ||
|
|
|
|
((!aSetBox.GetLeft()) ^ (!rBox.GetLeft())))
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
aSetBoxInfo.SetValid(VALID_LEFT, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBox.SetLine( 0, BOX_LINE_LEFT );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (aSetBoxInfo.IsValid(VALID_VERT))
|
|
|
|
{
|
|
|
|
if ( !bVertSet )
|
2011-01-17 15:06:54 +01:00
|
|
|
{ bVertSet = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBoxInfo.SetLine( rBox.GetLeft(), BOXINFO_LINE_VERT );
|
|
|
|
}
|
|
|
|
else if ((aSetBoxInfo.GetVert() && rBox.GetLeft() &&
|
|
|
|
!(*aSetBoxInfo.GetVert() == *rBox.GetLeft())) ||
|
|
|
|
((!aSetBoxInfo.GetVert()) ^ (!rBox.GetLeft())))
|
2011-01-17 15:06:54 +01:00
|
|
|
{ aSetBoxInfo.SetValid( VALID_VERT, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBoxInfo.SetLine( 0, BOXINFO_LINE_VERT );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Rechte Kante
|
2002-12-02 11:24:28 +00:00
|
|
|
if ( aSetBoxInfo.IsValid(VALID_RIGHT) && bRightOver )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( !bRightSet )
|
2011-01-17 15:06:54 +01:00
|
|
|
{ bRightSet = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBox.SetLine( rBox.GetRight(), BOX_LINE_RIGHT );
|
|
|
|
}
|
|
|
|
else if ((aSetBox.GetRight() && rBox.GetRight() &&
|
|
|
|
!(*aSetBox.GetRight() == *rBox.GetRight())) ||
|
|
|
|
(!aSetBox.GetRight() ^ !rBox.GetRight()))
|
2011-01-17 15:06:54 +01:00
|
|
|
{ aSetBoxInfo.SetValid( VALID_RIGHT, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBox.SetLine( 0, BOX_LINE_RIGHT );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//Untere Kante
|
2002-12-02 11:24:28 +00:00
|
|
|
if ( bLast && bBottomOver )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
if ( aSetBoxInfo.IsValid(VALID_BOTTOM) )
|
|
|
|
{
|
|
|
|
if ( !bBottomSet )
|
2011-01-17 15:06:54 +01:00
|
|
|
{ bBottomSet = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBox.SetLine( rBox.GetBottom(), BOX_LINE_BOTTOM );
|
|
|
|
}
|
|
|
|
else if ((aSetBox.GetBottom() && rBox.GetBottom() &&
|
|
|
|
!(*aSetBox.GetBottom() == *rBox.GetBottom())) ||
|
|
|
|
(!aSetBox.GetBottom() ^ !rBox.GetBottom()))
|
2011-01-17 15:06:54 +01:00
|
|
|
{ aSetBoxInfo.SetValid( VALID_BOTTOM, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBox.SetLine( 0, BOX_LINE_BOTTOM );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//in allen Zeilen ausser der letzten werden die
|
|
|
|
// horiz. Linien aus der Bottom-Linie entnommen
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (aSetBoxInfo.IsValid(VALID_HORI))
|
|
|
|
{
|
|
|
|
if ( !bHoriSet )
|
2011-01-17 15:06:54 +01:00
|
|
|
{ bHoriSet = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBoxInfo.SetLine( rBox.GetBottom(), BOXINFO_LINE_HORI );
|
|
|
|
}
|
|
|
|
else if ((aSetBoxInfo.GetHori() && rBox.GetBottom() &&
|
|
|
|
!(*aSetBoxInfo.GetHori() == *rBox.GetBottom())) ||
|
|
|
|
((!aSetBoxInfo.GetHori()) ^ (!rBox.GetBottom())))
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
aSetBoxInfo.SetValid( VALID_HORI, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBoxInfo.SetLine( 0, BOXINFO_LINE_HORI );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Abstand zum Text
|
|
|
|
if (aSetBoxInfo.IsValid(VALID_DISTANCE))
|
|
|
|
{
|
2011-03-14 16:51:14 +00:00
|
|
|
static sal_uInt16 const aBorders[] = {
|
2000-09-18 23:08:29 +00:00
|
|
|
BOX_LINE_BOTTOM, BOX_LINE_TOP,
|
|
|
|
BOX_LINE_RIGHT, BOX_LINE_LEFT };
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16* pBrd = aBorders;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( !bDistanceSet ) // bei 1. Durchlauf erstmal setzen
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
bDistanceSet = sal_True;
|
2007-09-27 07:41:55 +00:00
|
|
|
for( int k = 0; k < 4; ++k, ++pBrd )
|
2000-09-18 23:08:29 +00:00
|
|
|
aSetBox.SetDistance( rBox.GetDistance( *pBrd ),
|
|
|
|
*pBrd );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2007-09-27 07:41:55 +00:00
|
|
|
for( int k = 0; k < 4; ++k, ++pBrd )
|
2000-09-18 23:08:29 +00:00
|
|
|
if( aSetBox.GetDistance( *pBrd ) !=
|
|
|
|
rBox.GetDistance( *pBrd ) )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
aSetBoxInfo.SetValid( VALID_DISTANCE, sal_False );
|
|
|
|
aSetBox.SetDistance( (sal_uInt16) 0 );
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
rSet.Put( aSetBox );
|
|
|
|
rSet.Put( aSetBoxInfo );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
#* Class : SwDoc
|
|
|
|
#* Methoden : SetBoxAttr
|
|
|
|
#***********************************************************************/
|
|
|
|
void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew )
|
|
|
|
{
|
|
|
|
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
|
|
|
|
SwSelBoxes aBoxes;
|
2011-01-17 15:06:54 +01:00
|
|
|
if( pTblNd && ::lcl_GetBoxSel( rCursor, aBoxes, sal_True ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwTable& rTable = pTblNd->GetTable();
|
2010-11-25 14:31:08 +01:00
|
|
|
if (GetIDocumentUndoRedo().DoesUndo())
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 14:31:08 +01:00
|
|
|
GetIDocumentUndoRedo().AppendUndo( new SwUndoAttrTbl(*pTblNd) );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
SvPtrarr aFmtCmp( Max( sal_uInt8(255), sal_uInt8(aBoxes.Count()) ), 255 );
|
|
|
|
for ( sal_uInt16 i = 0; i < aBoxes.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwTableBox *pBox = aBoxes[i];
|
|
|
|
|
|
|
|
SwFrmFmt *pNewFmt;
|
|
|
|
if ( 0 != (pNewFmt = SwTblFmtCmp::FindNewFmt( aFmtCmp, pBox->GetFrmFmt(), 0 )))
|
|
|
|
pBox->ChgFrmFmt( (SwTableBoxFmt*)pNewFmt );
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwFrmFmt *pOld = pBox->GetFrmFmt();
|
|
|
|
SwFrmFmt *pNew = pBox->ClaimFrmFmt();
|
2008-06-13 08:41:49 +00:00
|
|
|
pNew->SetFmtAttr( rNew );
|
2000-09-18 23:08:29 +00:00
|
|
|
aFmtCmp.Insert( new SwTblFmtCmp( pOld, pNew, 0 ), aFmtCmp.Count());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-09-27 07:41:55 +00:00
|
|
|
SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout();
|
|
|
|
if( pTableLayout )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-06-13 15:22:56 +02:00
|
|
|
SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() );
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
|
|
|
|
|
2007-09-27 07:41:55 +00:00
|
|
|
pTableLayout->Resize(
|
2011-01-17 15:06:54 +01:00
|
|
|
pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
SwTblFmtCmp::Delete( aFmtCmp );
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
#* Class : SwDoc
|
2004-04-21 08:54:44 +00:00
|
|
|
#* Methoden : GetBoxAttr()
|
2000-09-18 23:08:29 +00:00
|
|
|
#***********************************************************************/
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bRet = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
|
|
|
|
SwSelBoxes aBoxes;
|
|
|
|
if( pTblNd && lcl_GetBoxSel( rCursor, aBoxes ))
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
bRet = sal_True;
|
|
|
|
sal_Bool bOneFound = sal_False;
|
|
|
|
const sal_uInt16 nWhich = rToFill.Which();
|
|
|
|
for( sal_uInt16 i = 0; i < aBoxes.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-04-21 08:54:44 +00:00
|
|
|
switch ( nWhich )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2004-04-21 08:54:44 +00:00
|
|
|
case RES_BACKGROUND:
|
|
|
|
{
|
|
|
|
const SvxBrushItem &rBack =
|
|
|
|
aBoxes[i]->GetFrmFmt()->GetBackground();
|
|
|
|
if( !bOneFound )
|
|
|
|
{
|
|
|
|
(SvxBrushItem&)rToFill = rBack;
|
2011-01-17 15:06:54 +01:00
|
|
|
bOneFound = sal_True;
|
2004-04-21 08:54:44 +00:00
|
|
|
}
|
|
|
|
else if( rToFill != rBack )
|
2011-01-17 15:06:54 +01:00
|
|
|
bRet = sal_False;
|
2004-04-21 08:54:44 +00:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
break;
|
2004-04-21 08:54:44 +00:00
|
|
|
|
|
|
|
case RES_FRAMEDIR:
|
|
|
|
{
|
|
|
|
const SvxFrameDirectionItem& rDir =
|
|
|
|
aBoxes[i]->GetFrmFmt()->GetFrmDir();
|
|
|
|
if( !bOneFound )
|
|
|
|
{
|
|
|
|
(SvxFrameDirectionItem&)rToFill = rDir;
|
2011-01-17 15:06:54 +01:00
|
|
|
bOneFound = sal_True;
|
2004-04-21 08:54:44 +00:00
|
|
|
}
|
|
|
|
else if( rToFill != rDir )
|
2011-01-17 15:06:54 +01:00
|
|
|
bRet = sal_False;
|
2004-04-21 08:54:44 +00:00
|
|
|
}
|
2011-01-28 13:19:04 +01:00
|
|
|
case RES_VERT_ORIENT:
|
|
|
|
{
|
|
|
|
const SwFmtVertOrient& rOrient =
|
|
|
|
aBoxes[i]->GetFrmFmt()->GetVertOrient();
|
|
|
|
if( !bOneFound )
|
|
|
|
{
|
|
|
|
(SwFmtVertOrient&)rToFill = rOrient;
|
2011-03-14 16:51:14 +00:00
|
|
|
bOneFound = sal_True;
|
2011-01-28 13:19:04 +01:00
|
|
|
}
|
|
|
|
else if( rToFill != rOrient )
|
2011-03-14 16:51:14 +00:00
|
|
|
bRet = sal_False;
|
2011-01-28 13:19:04 +01:00
|
|
|
}
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2004-04-21 08:54:44 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
if ( sal_False == bRet )
|
2004-04-21 08:54:44 +00:00
|
|
|
break;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return bRet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
#* Class : SwDoc
|
|
|
|
#* Methoden : SetBoxAlign, SetBoxAlign
|
|
|
|
#***********************************************************************/
|
2011-01-17 15:06:54 +01:00
|
|
|
void SwDoc::SetBoxAlign( const SwCursor& rCursor, sal_uInt16 nAlign )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2010-11-25 17:08:45 +01:00
|
|
|
OSL_ENSURE( nAlign == text::VertOrientation::NONE ||
|
2007-09-27 07:41:55 +00:00
|
|
|
nAlign == text::VertOrientation::CENTER ||
|
|
|
|
nAlign == text::VertOrientation::BOTTOM, "wrong alignment" );
|
|
|
|
SwFmtVertOrient aVertOri( 0, nAlign );
|
2000-09-18 23:08:29 +00:00
|
|
|
SetBoxAttr( rCursor, aVertOri );
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 SwDoc::GetBoxAlign( const SwCursor& rCursor ) const
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nAlign = USHRT_MAX;
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode();
|
|
|
|
SwSelBoxes aBoxes;
|
|
|
|
if( pTblNd && ::lcl_GetBoxSel( rCursor, aBoxes ))
|
2011-01-17 15:06:54 +01:00
|
|
|
for( sal_uInt16 i = 0; i < aBoxes.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
const SwFmtVertOrient &rOri =
|
|
|
|
aBoxes[i]->GetFrmFmt()->GetVertOrient();
|
|
|
|
if( USHRT_MAX == nAlign )
|
2011-01-17 15:06:54 +01:00
|
|
|
nAlign = static_cast<sal_uInt16>(rOri.GetVertOrient());
|
2000-09-18 23:08:29 +00:00
|
|
|
else if( rOri.GetVertOrient() != nAlign )
|
|
|
|
{
|
|
|
|
nAlign = USHRT_MAX;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nAlign;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
#* Class : SwDoc
|
|
|
|
#* Methoden : AdjustCellWidth()
|
|
|
|
#***********************************************************************/
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 lcl_CalcCellFit( const SwLayoutFrm *pCell )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwTwips nRet = 0;
|
|
|
|
const SwFrm *pFrm = pCell->Lower(); //Die ganze Zelle.
|
2002-11-05 14:51:18 +00:00
|
|
|
SWRECTFN( pCell )
|
2000-09-18 23:08:29 +00:00
|
|
|
while ( pFrm )
|
|
|
|
{
|
2002-11-05 14:51:18 +00:00
|
|
|
const SwTwips nAdd = (pFrm->Frm().*fnRect->fnGetWidth)() -
|
|
|
|
(pFrm->Prt().*fnRect->fnGetWidth)();
|
2006-01-20 12:47:28 +00:00
|
|
|
|
2011-02-07 20:21:18 +01:00
|
|
|
// pFrm does not necessarily have to be a SwTxtFrm!
|
2006-01-20 12:47:28 +00:00
|
|
|
const SwTwips nCalcFitToContent = pFrm->IsTxtFrm() ?
|
|
|
|
((SwTxtFrm*)pFrm)->CalcFitToContent() :
|
|
|
|
(pFrm->Prt().*fnRect->fnGetWidth)();
|
|
|
|
|
|
|
|
nRet = Max( nRet, nCalcFitToContent + nAdd );
|
2000-09-18 23:08:29 +00:00
|
|
|
pFrm = pFrm->GetNext();
|
|
|
|
}
|
|
|
|
//Umrandung und linker/rechter Rand wollen mit kalkuliert werden.
|
2002-11-05 14:51:18 +00:00
|
|
|
nRet += (pCell->Frm().*fnRect->fnGetWidth)() -
|
|
|
|
(pCell->Prt().*fnRect->fnGetWidth)();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Um Rechenungenauikeiten, die spaeter bei SwTable::SetTabCols enstehen,
|
|
|
|
//auszugleichen, addieren wir noch ein bischen.
|
|
|
|
nRet += COLFUZZY;
|
2011-01-17 15:06:54 +01:00
|
|
|
return (sal_uInt16)Max( long(MINLAY), nRet );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*Die Zelle ist in der Selektion, wird aber nicht von den TabCols beschrieben.
|
|
|
|
*Das bedeutet, dass die Zelle aufgrund der zweidimensionalen Darstellung von
|
|
|
|
*anderen Zellen "geteilt" wurde. Wir muessen also den Wunsch- bzw. Minimalwert
|
|
|
|
*der Zelle auf die Spalten, durch die sie geteilt wurde verteilen.
|
|
|
|
*
|
|
|
|
*Dazu sammeln wir zuerst die Spalten - nicht die Spaltentrenner! - ein, die
|
|
|
|
*sich mit der Zelle ueberschneiden. Den Wunschwert der Zelle verteilen wir
|
|
|
|
*dann anhand des Betrages der Ueberschneidung auf die Zellen.
|
|
|
|
*Wenn eine Zelle bereits einen groesseren Wunschwert angemeldet hat, so bleibt
|
|
|
|
*dieser erhalten, kleinere Wuensche werden ueberschrieben.
|
|
|
|
*/
|
|
|
|
|
2011-10-29 13:24:48 +02:00
|
|
|
void lcl_CalcSubColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols &rCols,
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwLayoutFrm *pCell, const SwLayoutFrm *pTab,
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bWishValues )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nWish = bWishValues ?
|
2000-09-18 23:08:29 +00:00
|
|
|
::lcl_CalcCellFit( pCell ) :
|
2011-01-17 15:06:54 +01:00
|
|
|
MINLAY + sal_uInt16(pCell->Frm().Width() - pCell->Prt().Width());
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2002-11-05 14:51:18 +00:00
|
|
|
SWRECTFN( pTab )
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0 ; i <= rCols.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
long nColLeft = i == 0 ? rCols.GetLeft() : rCols[i-1];
|
|
|
|
long nColRight = i == rCols.Count() ? rCols.GetRight() : rCols[i];
|
|
|
|
nColLeft += rCols.GetLeftMin();
|
|
|
|
nColRight += rCols.GetLeftMin();
|
|
|
|
|
|
|
|
//Werte auf die Verhaeltnisse der Tabelle (Follows) anpassen.
|
2011-01-17 15:06:54 +01:00
|
|
|
if ( rCols.GetLeftMin() != sal_uInt16((pTab->Frm().*fnRect->fnGetLeft)()) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2002-11-05 14:51:18 +00:00
|
|
|
const long nDiff = (pTab->Frm().*fnRect->fnGetLeft)() - rCols.GetLeftMin();
|
2000-09-18 23:08:29 +00:00
|
|
|
nColLeft += nDiff;
|
|
|
|
nColRight += nDiff;
|
|
|
|
}
|
2002-11-05 14:51:18 +00:00
|
|
|
const long nCellLeft = (pCell->Frm().*fnRect->fnGetLeft)();
|
|
|
|
const long nCellRight = (pCell->Frm().*fnRect->fnGetRight)();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Ueberschneidungsbetrag ermitteln.
|
|
|
|
long nWidth = 0;
|
|
|
|
if ( nColLeft <= nCellLeft && nColRight >= (nCellLeft+COLFUZZY) )
|
|
|
|
nWidth = nColRight - nCellLeft;
|
|
|
|
else if ( nColLeft <= (nCellRight-COLFUZZY) && nColRight >= nCellRight )
|
|
|
|
nWidth = nCellRight - nColLeft;
|
|
|
|
else if ( nColLeft >= nCellLeft && nColRight <= nCellRight )
|
|
|
|
nWidth = nColRight - nColLeft;
|
2008-01-15 12:49:23 +00:00
|
|
|
if ( nWidth && pCell->Frm().Width() )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
long nTmp = nWidth * nWish / pCell->Frm().Width();
|
2011-01-17 15:06:54 +01:00
|
|
|
if ( sal_uInt16(nTmp) > rToFill[i] )
|
|
|
|
rToFill[i] = sal_uInt16(nTmp);
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*Besorgt neue Werte zu Einstellung der TabCols.
|
|
|
|
*Es wird nicht ueber die Eintrage in den TabCols itereriert, sondern
|
|
|
|
*quasi ueber die Zwischenraeume, die ja die Zellen beschreiben.
|
|
|
|
*
|
2011-01-17 15:06:54 +01:00
|
|
|
*bWishValues == sal_True: Es werden zur aktuellen Selektion bzw. zur aktuellen
|
2000-09-18 23:08:29 +00:00
|
|
|
* Zelle die Wunschwerte aller betroffen Zellen ermittelt.
|
|
|
|
* Sind mehrere Zellen in einer Spalte, so wird der
|
|
|
|
* groesste Wunschwert als Ergebnis geliefert.
|
|
|
|
* Fuer die TabCol-Eintraege, zu denen keine Zellen
|
|
|
|
* ermittelt wurden, werden 0-en eingetragen.
|
|
|
|
*
|
2011-01-17 15:06:54 +01:00
|
|
|
*bWishValues == sal_False: Die Selektion wird senkrecht ausgedehnt. Zu jeder
|
2000-09-18 23:08:29 +00:00
|
|
|
* Spalte in den TabCols, die sich mit der Selektion
|
|
|
|
* schneidet wird der Minimalwert ermittelt.
|
|
|
|
*/
|
|
|
|
|
2011-10-29 13:24:48 +02:00
|
|
|
void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols &rCols,
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwLayoutFrm *pStart, const SwLayoutFrm *pEnd,
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bWishValues )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwSelUnions aUnions;
|
|
|
|
::MakeSelUnions( aUnions, pStart, pEnd,
|
2007-09-27 07:41:55 +00:00
|
|
|
bWishValues ? nsSwTblSearchType::TBLSEARCH_NONE : nsSwTblSearchType::TBLSEARCH_COL );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i2 = 0; i2 < aUnions.Count(); ++i2 )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
SwSelUnion *pSelUnion = aUnions[i2];
|
|
|
|
const SwTabFrm *pTab = pSelUnion->GetTable();
|
|
|
|
const SwRect &rUnion = pSelUnion->GetUnion();
|
|
|
|
|
2002-11-05 14:51:18 +00:00
|
|
|
SWRECTFN( pTab )
|
|
|
|
sal_Bool bRTL = pTab->IsRightToLeft();
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
const SwLayoutFrm *pCell = pTab->FirstCell();
|
|
|
|
do
|
2006-01-20 12:47:28 +00:00
|
|
|
{
|
2007-06-26 09:41:33 +00:00
|
|
|
if ( pCell->IsCellFrm() && pCell->FindTabFrm() == pTab && ::IsFrmInTblSel( rUnion, pCell ) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2002-11-05 14:51:18 +00:00
|
|
|
const long nCLeft = (pCell->Frm().*fnRect->fnGetLeft)();
|
|
|
|
const long nCRight = (pCell->Frm().*fnRect->fnGetRight)();
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bNotInCols = sal_True;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i <= rCols.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nFit = rToFill[i];
|
2000-09-18 23:08:29 +00:00
|
|
|
long nColLeft = i == 0 ? rCols.GetLeft() : rCols[i-1];
|
|
|
|
long nColRight = i == rCols.Count() ? rCols.GetRight() : rCols[i];
|
2002-11-05 14:51:18 +00:00
|
|
|
|
|
|
|
if ( bRTL )
|
|
|
|
{
|
|
|
|
long nTmpRight = nColRight;
|
|
|
|
nColRight = rCols.GetRight() - nColLeft;
|
|
|
|
nColLeft = rCols.GetRight() - nTmpRight;
|
|
|
|
}
|
2006-08-14 15:04:54 +00:00
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
nColLeft += rCols.GetLeftMin();
|
|
|
|
nColRight += rCols.GetLeftMin();
|
|
|
|
|
|
|
|
//Werte auf die Verhaeltnisse der Tabelle (Follows) anpassen.
|
|
|
|
long nLeftA = nColLeft;
|
|
|
|
long nRightA = nColRight;
|
2011-01-17 15:06:54 +01:00
|
|
|
if ( rCols.GetLeftMin() != sal_uInt16((pTab->Frm().*fnRect->fnGetLeft)()) )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2002-11-05 14:51:18 +00:00
|
|
|
const long nDiff = (pTab->Frm().*fnRect->fnGetLeft)() - rCols.GetLeftMin();
|
2000-09-18 23:08:29 +00:00
|
|
|
nLeftA += nDiff;
|
|
|
|
nRightA += nDiff;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Wir wollen nicht allzu genau hinsehen.
|
|
|
|
if ( ::IsSame(nCLeft, nLeftA) && ::IsSame(nCRight, nRightA))
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
bNotInCols = sal_False;
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( bWishValues )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nWish = ::lcl_CalcCellFit( pCell );
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( nWish > nFit )
|
|
|
|
nFit = nWish;
|
|
|
|
}
|
|
|
|
else
|
2011-01-17 15:06:54 +01:00
|
|
|
{ const sal_uInt16 nMin = MINLAY + sal_uInt16(pCell->Frm().Width() -
|
2000-09-18 23:08:29 +00:00
|
|
|
pCell->Prt().Width());
|
|
|
|
if ( !nFit || nMin < nFit )
|
|
|
|
nFit = nMin;
|
|
|
|
}
|
|
|
|
if ( rToFill[i] < nFit )
|
|
|
|
rToFill[i] = nFit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( bNotInCols )
|
|
|
|
::lcl_CalcSubColValues( rToFill, rCols, pCell, pTab, bWishValues );
|
|
|
|
}
|
2008-01-15 12:49:23 +00:00
|
|
|
do {
|
|
|
|
pCell = pCell->GetNextLayoutLeaf();
|
|
|
|
}while( pCell && pCell->Frm().Width() == 0 );
|
2007-06-26 09:41:33 +00:00
|
|
|
} while ( pCell && pTab->IsAnLower( pCell ) );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
void SwDoc::AdjustCellWidth( const SwCursor& rCursor, sal_Bool bBalance )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
// pruefe ob vom aktuellen Crsr der Point/Mark in einer Tabelle stehen
|
2007-04-26 08:38:08 +00:00
|
|
|
SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode();
|
|
|
|
SwTableNode* pTblNd = pCntNd ? pCntNd->FindTableNode() : 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
if( !pTblNd )
|
|
|
|
return ;
|
|
|
|
|
|
|
|
SwLayoutFrm *pStart, *pEnd;
|
|
|
|
::lcl_GetStartEndCell( rCursor, pStart, pEnd );
|
|
|
|
|
|
|
|
//TabCols besorgen, den ueber diese stellen wir die Tabelle neu ein.
|
|
|
|
SwFrm* pBoxFrm = pStart;
|
2008-01-29 07:38:03 +00:00
|
|
|
while( pBoxFrm && !pBoxFrm->IsCellFrm() )
|
2000-09-18 23:08:29 +00:00
|
|
|
pBoxFrm = pBoxFrm->GetUpper();
|
|
|
|
|
2008-01-29 07:38:03 +00:00
|
|
|
if ( !pBoxFrm )
|
|
|
|
return; // robust
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
SwTabCols aTabCols;
|
|
|
|
GetTabCols( aTabCols, 0, (SwCellFrm*)pBoxFrm );
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
if ( ! aTabCols.Count() )
|
|
|
|
return;
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt8 nTmp = (sal_uInt8)Max( sal_uInt16(255), sal_uInt16(aTabCols.Count() + 1) );
|
2011-10-29 13:24:48 +02:00
|
|
|
std::vector<sal_uInt16> aWish( nTmp, nTmp ),
|
2000-09-18 23:08:29 +00:00
|
|
|
aMins( nTmp, nTmp );
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 i;
|
2003-12-01 16:02:29 +00:00
|
|
|
|
|
|
|
for ( i = 0; i <= aTabCols.Count(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2011-10-29 13:24:48 +02:00
|
|
|
aWish.push_back( 0 );
|
|
|
|
aMins.push_back( 0 );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
::lcl_CalcColValues( aWish, aTabCols, pStart, pEnd, sal_True );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Es ist Robuster wenn wir die Min-Werte fuer die ganze Tabelle berechnen.
|
|
|
|
const SwTabFrm *pTab = pStart->ImplFindTabFrm();
|
|
|
|
pStart = (SwLayoutFrm*)pTab->FirstCell();
|
|
|
|
pEnd = (SwLayoutFrm*)pTab->FindLastCntnt()->GetUpper();
|
|
|
|
while( !pEnd->IsCellFrm() )
|
|
|
|
pEnd = pEnd->GetUpper();
|
2011-01-17 15:06:54 +01:00
|
|
|
::lcl_CalcColValues( aMins, aTabCols, pStart, pEnd, sal_False );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
if( bBalance )
|
|
|
|
{
|
|
|
|
//Alle Spalten, die makiert sind haben jetzt einen Wunschwert
|
|
|
|
//eingtragen. Wir addieren die aktuellen Werte, teilen das Ergebnis
|
|
|
|
//durch die Anzahl und haben eine Wunschwert fuer den ausgleich.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nWish = 0, nCnt = 0;
|
2000-09-18 23:08:29 +00:00
|
|
|
for ( i = 0; i <= aTabCols.Count(); ++i )
|
|
|
|
{
|
|
|
|
int nDiff = aWish[i];
|
|
|
|
if ( nDiff )
|
|
|
|
{
|
|
|
|
if ( i == 0 )
|
2011-01-17 15:06:54 +01:00
|
|
|
nWish = static_cast<sal_uInt16>( nWish + aTabCols[i] - aTabCols.GetLeft() );
|
2000-09-18 23:08:29 +00:00
|
|
|
else if ( i == aTabCols.Count() )
|
2011-01-17 15:06:54 +01:00
|
|
|
nWish = static_cast<sal_uInt16>(nWish + aTabCols.GetRight() - aTabCols[i-1] );
|
2000-09-18 23:08:29 +00:00
|
|
|
else
|
2011-01-17 15:06:54 +01:00
|
|
|
nWish = static_cast<sal_uInt16>(nWish + aTabCols[i] - aTabCols[i-1] );
|
2000-09-18 23:08:29 +00:00
|
|
|
++nCnt;
|
|
|
|
}
|
|
|
|
}
|
2007-09-27 07:41:55 +00:00
|
|
|
nWish = nWish / nCnt;
|
2011-10-29 13:24:48 +02:00
|
|
|
for ( i = 0; i < aWish.size(); ++i )
|
2000-09-18 23:08:29 +00:00
|
|
|
if ( aWish[i] )
|
|
|
|
aWish[i] = nWish;
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nOldRight = static_cast<sal_uInt16>(aTabCols.GetRight());
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Um die Impl. einfach zu gestalten, aber trotzdem in den meissten Faellen
|
|
|
|
//den Platz richtig auszunutzen laufen wir zweimal.
|
|
|
|
//Problem: Erste Spalte wird breiter, die anderen aber erst danach
|
|
|
|
//schmaler. Die Wunschbreite der ersten Spalte wuerde abgelehnt, weil
|
|
|
|
//mit ihr die max. Breite der Tabelle ueberschritten wuerde.
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 k= 0; k < 2; ++k )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
|
|
|
for ( i = 0; i <= aTabCols.Count(); ++i )
|
|
|
|
{
|
|
|
|
int nDiff = aWish[i];
|
|
|
|
if ( nDiff )
|
|
|
|
{
|
|
|
|
int nMin = aMins[i];
|
|
|
|
if ( nMin > nDiff )
|
|
|
|
nDiff = nMin;
|
|
|
|
|
|
|
|
if ( i == 0 )
|
|
|
|
{
|
|
|
|
if( aTabCols.Count() )
|
|
|
|
nDiff -= aTabCols[0] - aTabCols.GetLeft();
|
|
|
|
else
|
|
|
|
nDiff -= aTabCols.GetRight() - aTabCols.GetLeft();
|
|
|
|
}
|
|
|
|
else if ( i == aTabCols.Count() )
|
|
|
|
nDiff -= aTabCols.GetRight() - aTabCols[i-1];
|
|
|
|
else
|
|
|
|
nDiff -= aTabCols[i] - aTabCols[i-1];
|
|
|
|
|
2003-03-27 14:45:43 +00:00
|
|
|
long nTabRight = aTabCols.GetRight() + nDiff;
|
2000-09-18 23:08:29 +00:00
|
|
|
|
|
|
|
//Wenn die Tabelle zu breit wuerde begrenzen wir die Anpassung
|
|
|
|
//auf das erlaubte Maximum.
|
|
|
|
if ( !bBalance && nTabRight > aTabCols.GetRightMax() )
|
|
|
|
{
|
2007-09-27 07:41:55 +00:00
|
|
|
const long nTmpD = nTabRight - aTabCols.GetRightMax();
|
|
|
|
nDiff -= nTmpD;
|
|
|
|
nTabRight -= nTmpD;
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i2 = i; i2 < aTabCols.Count(); ++i2 )
|
2000-09-18 23:08:29 +00:00
|
|
|
aTabCols[i2] += nDiff;
|
|
|
|
aTabCols.SetRight( nTabRight );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nNewRight = static_cast<sal_uInt16>(aTabCols.GetRight());
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2008-03-18 15:35:01 +00:00
|
|
|
SwFrmFmt *pFmt = pTblNd->GetTable().GetFrmFmt();
|
|
|
|
const sal_Int16 nOriHori = pFmt->GetHoriOrient().GetHoriOrient();
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
//So, die richtige Arbeit koennen wir jetzt der SwTable ueberlassen.
|
2011-01-17 15:06:54 +01:00
|
|
|
SetTabCols( aTabCols, sal_False, 0, (SwCellFrm*)pBoxFrm );
|
2000-09-18 23:08:29 +00:00
|
|
|
|
2008-03-18 15:35:01 +00:00
|
|
|
// i54248: lijian/fme
|
|
|
|
// alignment might have been changed in SetTabCols, restore old value:
|
|
|
|
const SwFmtHoriOrient &rHori = pFmt->GetHoriOrient();
|
|
|
|
SwFmtHoriOrient aHori( rHori );
|
|
|
|
if ( aHori.GetHoriOrient() != nOriHori )
|
|
|
|
{
|
|
|
|
aHori.SetHoriOrient( nOriHori );
|
2008-06-13 08:41:49 +00:00
|
|
|
pFmt->SetFmtAttr( aHori );
|
2008-03-18 15:35:01 +00:00
|
|
|
}
|
|
|
|
|
2000-09-18 23:08:29 +00:00
|
|
|
//Bei Automatischer Breite wird auf Linksbuendig umgeschaltet.
|
|
|
|
//Bei Randattributen wird der Rechte Rand angepasst.
|
|
|
|
if( !bBalance && nNewRight < nOldRight )
|
|
|
|
{
|
2008-03-18 15:35:01 +00:00
|
|
|
if( aHori.GetHoriOrient() == text::HoriOrientation::FULL )
|
2000-09-18 23:08:29 +00:00
|
|
|
{
|
2007-09-27 07:41:55 +00:00
|
|
|
aHori.SetHoriOrient( text::HoriOrientation::LEFT );
|
2008-06-13 08:41:49 +00:00
|
|
|
pFmt->SetFmtAttr( aHori );
|
2000-09-18 23:08:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
SetModified();
|
|
|
|
}
|
|
|
|
|
2010-10-14 08:30:41 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|