2010-10-14 08:30:41 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2011-03-31 10:05:04 +02:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#include <hintids.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/zforlist.hxx>
|
|
|
|
#include <svl/stritem.hxx>
|
|
|
|
#include <svl/whiter.hxx>
|
2009-10-06 07:38:24 +02:00
|
|
|
#include <unotools/moduleoptions.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <svx/rulritem.hxx>
|
2009-12-10 23:06:35 +01:00
|
|
|
#include <svl/srchitem.hxx>
|
2010-01-08 18:32:51 +01:00
|
|
|
#include <editeng/lrspitem.hxx>
|
|
|
|
#include <editeng/ulspitem.hxx>
|
|
|
|
#include <editeng/brshitem.hxx>
|
|
|
|
#include <editeng/boxitem.hxx>
|
|
|
|
#include <editeng/shaditem.hxx>
|
|
|
|
#include <editeng/spltitem.hxx>
|
|
|
|
#include <editeng/langitem.hxx>
|
|
|
|
#include <editeng/keepitem.hxx>
|
|
|
|
#include <editeng/bolnitem.hxx>
|
|
|
|
#include <editeng/colritem.hxx>
|
|
|
|
#include <editeng/frmdiritem.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <svx/numinf.hxx>
|
2008-11-19 16:29:07 +00:00
|
|
|
#include <svx/svddef.hxx>
|
2008-03-12 11:54:31 +00:00
|
|
|
#include <svx/svxdlg.hxx>
|
2009-10-16 00:05:16 +02:00
|
|
|
#include <svl/zformat.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
#include <sfx2/objface.hxx>
|
|
|
|
|
|
|
|
|
|
|
|
#include <fmtornt.hxx>
|
|
|
|
#include <fmtclds.hxx>
|
|
|
|
#include <fmtlsplt.hxx>
|
2004-01-13 10:27:07 +00:00
|
|
|
#include <fmtrowsplt.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <fmtfsize.hxx>
|
|
|
|
#include <swmodule.hxx>
|
|
|
|
#include <wrtsh.hxx>
|
|
|
|
#include <wview.hxx>
|
|
|
|
#include <frmatr.hxx>
|
|
|
|
#include <uitool.hxx>
|
|
|
|
#include <inputwin.hxx>
|
|
|
|
#include <uiitems.hxx>
|
|
|
|
#include <usrpref.hxx>
|
|
|
|
#include <tabsh.hxx>
|
2007-09-27 11:29:35 +00:00
|
|
|
#include "swtablerep.hxx"
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <tablemgr.hxx>
|
|
|
|
#include <cellatr.hxx>
|
|
|
|
#include <frmfmt.hxx>
|
|
|
|
#include <swundo.hxx>
|
|
|
|
#include <swtable.hxx>
|
|
|
|
#include <docsh.hxx>
|
|
|
|
#include <tblsel.hxx>
|
|
|
|
|
2007-09-27 11:29:35 +00:00
|
|
|
#include <dialog.hrc>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <popup.hrc>
|
|
|
|
#include <shells.hrc>
|
|
|
|
#include <cmdid.h>
|
|
|
|
#include <globals.hrc>
|
|
|
|
#include <helpid.h>
|
2010-01-05 16:37:49 +01:00
|
|
|
#include <unobaseclass.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
#define SwTableShell
|
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
|
|
|
#include <sfx2/msg.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
#include <swslots.hxx>
|
2004-08-23 08:08:29 +00:00
|
|
|
|
2007-09-27 11:29:35 +00:00
|
|
|
#include "swabstdlg.hxx"
|
|
|
|
#include <table.hrc>
|
|
|
|
|
2011-03-25 15:51:54 +01:00
|
|
|
using ::editeng::SvxBorderLine;
|
2007-09-27 11:29:35 +00:00
|
|
|
using namespace ::com::sun::star;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
SFX_IMPL_INTERFACE(SwTableShell, SwBaseShell, SW_RES(STR_SHELLNAME_TABLE))
|
|
|
|
{
|
|
|
|
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_TAB_POPUPMENU));
|
|
|
|
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_TABLE_TOOLBOX));
|
|
|
|
}
|
|
|
|
|
|
|
|
TYPEINIT1(SwTableShell,SwBaseShell)
|
|
|
|
|
2011-03-14 16:51:14 +00:00
|
|
|
const sal_uInt16 aUITableAttrRange[] =
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
FN_PARAM_TABLE_NAME, FN_PARAM_TABLE_NAME,
|
|
|
|
FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE,
|
|
|
|
FN_PARAM_TABLE_SPACE, FN_PARAM_TABLE_SPACE,
|
|
|
|
FN_TABLE_REP, FN_TABLE_REP,
|
|
|
|
SID_RULER_BORDERS, SID_RULER_BORDERS,
|
|
|
|
RES_LR_SPACE, RES_UL_SPACE,
|
|
|
|
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW,
|
|
|
|
RES_BOX, RES_SHADOW,
|
|
|
|
RES_BACKGROUND, RES_BACKGROUND,
|
|
|
|
SID_BACKGRND_DESTINATION, SID_BACKGRND_DESTINATION,
|
|
|
|
SID_HTML_MODE, SID_HTML_MODE,
|
|
|
|
SID_ATTR_BRUSH_ROW, SID_ATTR_BRUSH_TABLE,
|
|
|
|
RES_PAGEDESC, RES_BREAK,
|
|
|
|
RES_KEEP, RES_KEEP,
|
|
|
|
RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT,
|
|
|
|
FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN,
|
2002-06-17 10:11:16 +00:00
|
|
|
RES_FRAMEDIR, RES_FRAMEDIR,
|
2004-01-13 10:27:07 +00:00
|
|
|
RES_ROW_SPLIT, RES_ROW_SPLIT,
|
2011-11-02 10:36:12 +00:00
|
|
|
FN_TABLE_BOX_TEXTORIENTATION, FN_TABLE_BOX_TEXTORIENTATION,
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i29550#
|
2004-07-12 12:37:44 +00:00
|
|
|
RES_COLLAPSING_BORDERS, RES_COLLAPSING_BORDERS,
|
|
|
|
// <-- collapsing borders
|
2000-09-18 16:15:01 +00:00
|
|
|
0
|
|
|
|
};
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16* SwuiGetUITableAttrRange()
|
2004-08-23 08:08:29 +00:00
|
|
|
{
|
|
|
|
return aUITableAttrRange;
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2004-08-23 08:08:29 +00:00
|
|
|
static void lcl_SetAttr( SwWrtShell &rSh, const SfxPoolItem &rItem )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
SfxItemSet aSet( rSh.GetView().GetPool(), rItem.Which(), rItem.Which(), 0);
|
|
|
|
aSet.Put( rItem );
|
|
|
|
rSh.SetTblAttr( aSet );
|
|
|
|
}
|
|
|
|
|
2004-08-23 08:08:29 +00:00
|
|
|
static SwTableRep* lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
SwFrmFmt *pFmt = rSh.GetTableFmt();
|
|
|
|
SwTabCols aCols;
|
|
|
|
rSh.GetTabCols( aCols );
|
|
|
|
|
|
|
|
//Ersteinmal die einfachen Attribute besorgen.
|
|
|
|
rSet.Put( SfxStringItem( FN_PARAM_TABLE_NAME, pFmt->GetName()));
|
2004-05-03 12:54:38 +00:00
|
|
|
rSet.Put( SfxUInt16Item( FN_PARAM_TABLE_HEADLINE, rSh.GetRowsToRepeat() ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.Put( pFmt->GetShadow() );
|
|
|
|
rSet.Put(SfxUInt16Item(FN_TABLE_SET_VERT_ALIGN, rSh.GetBoxAlign()));
|
2002-06-17 10:11:16 +00:00
|
|
|
rSet.Put( pFmt->GetFrmDir() );
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
SvxULSpaceItem aULSpace( pFmt->GetULSpace() );
|
|
|
|
rSet.Put( aULSpace );
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nBackgroundDestination = rSh.GetViewOptions()->GetTblDest();
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.Put(SwBackgroundDestinationItem(SID_BACKGRND_DESTINATION, nBackgroundDestination ));
|
|
|
|
SvxBrushItem aBrush( RES_BACKGROUND );
|
2001-10-31 07:42:52 +00:00
|
|
|
if(rSh.GetRowBackground(aBrush))
|
|
|
|
rSet.Put( aBrush, SID_ATTR_BRUSH_ROW );
|
|
|
|
else
|
|
|
|
rSet.InvalidateItem(SID_ATTR_BRUSH_ROW);
|
|
|
|
rSh.GetTabBackground(aBrush);
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.Put( aBrush, SID_ATTR_BRUSH_TABLE );
|
2004-04-21 09:00:22 +00:00
|
|
|
|
|
|
|
// text direction in boxes
|
2007-05-10 15:23:49 +00:00
|
|
|
SvxFrameDirectionItem aBoxDirection( FRMDIR_ENVIRONMENT, RES_FRAMEDIR );
|
2004-04-21 09:00:22 +00:00
|
|
|
if(rSh.GetBoxDirection( aBoxDirection ))
|
2011-11-02 10:36:12 +00:00
|
|
|
rSet.Put(aBoxDirection, FN_TABLE_BOX_TEXTORIENTATION);
|
2004-04-21 09:00:22 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bTableSel = rSh.IsTableMode();
|
2000-09-18 16:15:01 +00:00
|
|
|
if(!bTableSel)
|
|
|
|
{
|
|
|
|
rSh.StartAllAction();
|
|
|
|
rSh.Push();
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.GetView().GetViewFrame()->GetDispatcher()->Execute( FN_TABLE_SELECT_ALL, sal_False );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2007-05-10 15:23:49 +00:00
|
|
|
SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
// Tabellenvariante, wenn mehrere Tabellenzellen selektiert
|
|
|
|
rSh.GetCrsr(); //Damit GetCrsrCnt() auch das Richtige liefert
|
2010-09-30 18:34:49 +02:00
|
|
|
aBoxInfo.SetTable ((rSh.IsTableMode() && rSh.GetCrsrCnt() > 1) ||
|
2000-09-18 16:15:01 +00:00
|
|
|
!bTableSel);
|
|
|
|
// Abstandsfeld immer anzeigen
|
2011-01-17 15:06:54 +01:00
|
|
|
aBoxInfo.SetDist ((sal_Bool) sal_True);
|
2000-09-18 16:15:01 +00:00
|
|
|
// Minimalgroesse in Tabellen und Absaetzen setzen
|
|
|
|
aBoxInfo.SetMinDist( !bTableSel || rSh.IsTableMode() ||
|
|
|
|
rSh.GetSelectionType() &
|
2007-09-27 11:29:35 +00:00
|
|
|
(nsSelectionType::SEL_TXT | nsSelectionType::SEL_TBL));
|
2000-09-18 16:15:01 +00:00
|
|
|
// Default-Abstand immer setzen
|
|
|
|
aBoxInfo.SetDefDist (MIN_BORDER_DIST);
|
|
|
|
// Einzelne Linien koennen nur in Tabellen DontCare-Status haben
|
|
|
|
aBoxInfo.SetValid( VALID_DISABLE, !bTableSel || !rSh.IsTableMode() );
|
|
|
|
|
|
|
|
rSet.Put(aBoxInfo);
|
|
|
|
rSh.GetTabBorders( rSet );
|
|
|
|
|
2004-01-13 10:27:07 +00:00
|
|
|
//row split
|
|
|
|
SwFmtRowSplit* pSplit = 0;
|
|
|
|
rSh.GetRowSplit(pSplit);
|
|
|
|
if(pSplit)
|
|
|
|
{
|
|
|
|
rSet.Put(*pSplit);
|
|
|
|
delete pSplit;
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
if(!bTableSel)
|
|
|
|
{
|
|
|
|
rSh.ClearMark();
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.Pop(sal_False);
|
2000-09-18 16:15:01 +00:00
|
|
|
rSh.EndAllAction();
|
|
|
|
}
|
|
|
|
|
|
|
|
SwTabCols aTabCols;
|
|
|
|
rSh.GetTabCols( aTabCols );
|
|
|
|
SvxColumnItem aColItem;
|
|
|
|
|
|
|
|
|
|
|
|
// Pointer wird nach der Dialogausfuehrung geloescht
|
2012-12-07 09:59:24 +01:00
|
|
|
SwTableRep* pRep = new SwTableRep( aTabCols );
|
2000-09-18 16:15:01 +00:00
|
|
|
pRep->SetSpace(aCols.GetRightMax());
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nPercent = 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
long nWidth = ::GetTableWidth(pFmt, aCols, &nPercent, &rSh );
|
|
|
|
// Die Tabellenbreite ist fuer relative Angaben nicht korrekt
|
|
|
|
if(nPercent)
|
|
|
|
nWidth = pRep->GetSpace() * nPercent / 100;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nAlign = pFmt->GetHoriOrient().GetHoriOrient();
|
2000-09-18 16:15:01 +00:00
|
|
|
pRep->SetAlign(nAlign);
|
|
|
|
SvxLRSpaceItem aLRSpace( pFmt->GetLRSpace() );
|
|
|
|
SwTwips nLeft = aLRSpace.GetLeft();
|
|
|
|
SwTwips nRight = aLRSpace.GetRight();
|
|
|
|
SwTwips nDiff = pRep->GetSpace() - nRight - nLeft - nWidth;
|
2007-09-27 11:29:35 +00:00
|
|
|
if(nAlign != text::HoriOrientation::FULL && Abs(nDiff) > 2)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
SwTwips nLR = pRep->GetSpace() - nWidth;
|
|
|
|
switch ( nAlign )
|
|
|
|
{
|
2007-09-27 11:29:35 +00:00
|
|
|
case text::HoriOrientation::CENTER: nLeft = nRight = nLR / 2;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
2007-09-27 11:29:35 +00:00
|
|
|
case text::HoriOrientation::LEFT: nRight = nLR; nLeft = 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
2007-09-27 11:29:35 +00:00
|
|
|
case text::HoriOrientation::RIGHT: nLeft = nLR, nRight = 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
2007-09-27 11:29:35 +00:00
|
|
|
case text::HoriOrientation::LEFT_AND_WIDTH:
|
2000-09-18 16:15:01 +00:00
|
|
|
nRight = nLR - nLeft;
|
|
|
|
break;
|
2007-09-27 11:29:35 +00:00
|
|
|
case text::HoriOrientation::NONE:
|
2000-09-18 16:15:01 +00:00
|
|
|
if(!nPercent)
|
|
|
|
nWidth = pRep->GetSpace() - nLeft - nRight;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pRep->SetLeftSpace(nLeft);
|
|
|
|
pRep->SetRightSpace(nRight);
|
|
|
|
|
|
|
|
pRep->SetWidth(nWidth);
|
|
|
|
pRep->SetWidthPercent(nPercent);
|
|
|
|
// sind einzelne Zeilen/Zellen selektiert, wird die Spaltenbearbeitung veraendert
|
|
|
|
pRep->SetLineSelected(bTableSel && ! rSh.HasWholeTabSelection());
|
|
|
|
rSet.Put(SwPtrItem(FN_TABLE_REP, pRep));
|
|
|
|
return pRep;
|
|
|
|
}
|
|
|
|
|
2004-08-23 08:08:29 +00:00
|
|
|
void ItemSetToTableParam( const SfxItemSet& rSet,
|
2000-09-18 16:15:01 +00:00
|
|
|
SwWrtShell &rSh )
|
|
|
|
{
|
|
|
|
rSh.StartAllAction();
|
|
|
|
rSh.StartUndo( UNDO_TABLE_ATTR );
|
|
|
|
const SfxPoolItem* pItem = 0;
|
|
|
|
|
|
|
|
SwViewOption aUsrPref( *rSh.GetViewOptions() );
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nBackgroundDestination = aUsrPref.GetTblDest();
|
|
|
|
if(SFX_ITEM_SET == rSet.GetItemState(SID_BACKGRND_DESTINATION, sal_False, &pItem))
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
nBackgroundDestination = ((SfxUInt16Item*)pItem)->GetValue();
|
2011-01-17 15:06:54 +01:00
|
|
|
aUsrPref.SetTblDest((sal_uInt8)nBackgroundDestination);
|
2000-09-18 16:15:01 +00:00
|
|
|
SW_MOD()->ApplyUsrPref(aUsrPref, &rSh.GetView());
|
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bBorder = ( SFX_ITEM_SET == rSet.GetItemState( RES_BOX ) ||
|
2000-09-18 16:15:01 +00:00
|
|
|
SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_BORDER_INNER ) );
|
|
|
|
pItem = 0;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bBackground = SFX_ITEM_SET == rSet.GetItemState( RES_BACKGROUND, sal_False, &pItem );
|
2000-09-18 16:15:01 +00:00
|
|
|
const SfxPoolItem* pRowItem = 0, *pTableItem = 0;
|
2011-01-17 15:06:54 +01:00
|
|
|
bBackground |= SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_BRUSH_ROW, sal_False, &pRowItem );
|
|
|
|
bBackground |= SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_BRUSH_TABLE, sal_False, &pTableItem );
|
2004-01-13 10:27:07 +00:00
|
|
|
const SfxPoolItem* pSplit = 0;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bRowSplit = SFX_ITEM_SET == rSet.GetItemState( RES_ROW_SPLIT, sal_False, &pSplit );
|
2004-04-21 09:00:22 +00:00
|
|
|
const SfxPoolItem* pBoxDirection = 0;
|
2011-11-02 10:36:12 +00:00
|
|
|
sal_Bool bBoxDirection = SFX_ITEM_SET == rSet.GetItemState( FN_TABLE_BOX_TEXTORIENTATION, sal_False, &pBoxDirection );
|
2004-04-21 09:00:22 +00:00
|
|
|
if( bBackground || bBorder || bRowSplit || bBoxDirection)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
Die Umrandung wird auf die vorliegende Selektion angewendet
|
|
|
|
Liegt keine Selektion vor, wird die Tabelle vollstaendig selektiert.
|
|
|
|
Der Hintergrund wird immer auf den aktuellen Zustand angewendet.
|
|
|
|
*/
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bTableSel = rSh.IsTableMode();
|
2000-09-18 16:15:01 +00:00
|
|
|
rSh.StartAllAction();
|
|
|
|
|
|
|
|
if(bBackground)
|
|
|
|
{
|
|
|
|
if(pItem)
|
|
|
|
rSh.SetBoxBackground( *(const SvxBrushItem*)pItem );
|
|
|
|
if(pRowItem)
|
|
|
|
{
|
|
|
|
SvxBrushItem aBrush(*(const SvxBrushItem*)pRowItem);
|
|
|
|
aBrush.SetWhich(RES_BACKGROUND);
|
|
|
|
rSh.SetRowBackground(aBrush);
|
|
|
|
}
|
|
|
|
if(pTableItem)
|
|
|
|
{
|
|
|
|
SvxBrushItem aBrush(*(const SvxBrushItem*)pTableItem);
|
|
|
|
aBrush.SetWhich(RES_BACKGROUND);
|
|
|
|
rSh.SetTabBackground( aBrush );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-04-21 09:00:22 +00:00
|
|
|
if(bBoxDirection)
|
|
|
|
{
|
2007-05-10 15:23:49 +00:00
|
|
|
SvxFrameDirectionItem aDirection( FRMDIR_ENVIRONMENT, RES_FRAMEDIR );
|
2004-04-21 09:00:22 +00:00
|
|
|
aDirection.SetValue(static_cast< const SvxFrameDirectionItem* >(pBoxDirection)->GetValue());
|
|
|
|
rSh.SetBoxDirection(aDirection);
|
|
|
|
}
|
|
|
|
|
2004-01-13 10:27:07 +00:00
|
|
|
if(bBorder || bRowSplit)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
rSh.Push();
|
|
|
|
if(!bTableSel)
|
|
|
|
{
|
|
|
|
rSh.GetView().GetViewFrame()->GetDispatcher()->Execute( FN_TABLE_SELECT_ALL );
|
|
|
|
}
|
2004-01-13 10:27:07 +00:00
|
|
|
if(bBorder)
|
|
|
|
rSh.SetTabBorders( rSet );
|
|
|
|
|
|
|
|
if(bRowSplit)
|
|
|
|
{
|
|
|
|
rSh.SetRowSplit(*static_cast<const SwFmtRowSplit*>(pSplit));
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
if(!bTableSel)
|
|
|
|
{
|
|
|
|
rSh.ClearMark();
|
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.Pop(sal_False);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2004-01-13 10:27:07 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
rSh.EndAllAction();
|
|
|
|
}
|
|
|
|
|
|
|
|
SwTabCols aTabCols;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bTabCols = sal_False;
|
|
|
|
sal_Bool bSingleLine = sal_False;
|
2000-09-18 16:15:01 +00:00
|
|
|
SwTableRep* pRep = 0;
|
|
|
|
SwFrmFmt *pFmt = rSh.GetTableFmt();
|
|
|
|
SfxItemSet aSet( rSh.GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 );
|
2011-01-17 15:06:54 +01:00
|
|
|
if(SFX_ITEM_SET == rSet.GetItemState( FN_TABLE_REP, sal_False, &pItem ))
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
pRep = (SwTableRep*)((const SwPtrItem*)pItem)->GetValue();
|
|
|
|
|
|
|
|
const SwTwips nWidth = pRep->GetWidth();
|
2007-09-27 11:29:35 +00:00
|
|
|
if ( text::HoriOrientation::FULL == pRep->GetAlign() )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
|
|
|
SwFmtHoriOrient aAttr( pFmt->GetHoriOrient() );
|
2007-09-27 11:29:35 +00:00
|
|
|
aAttr.SetHoriOrient( text::HoriOrientation::FULL );
|
2000-09-18 16:15:01 +00:00
|
|
|
aSet.Put( aAttr );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwFmtFrmSize aSz( ATT_VAR_SIZE, nWidth );
|
|
|
|
if(pRep->GetWidthPercent())
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
aSz.SetWidthPercent( (sal_uInt8)pRep->GetWidthPercent() );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
aSet.Put(aSz);
|
|
|
|
}
|
|
|
|
|
|
|
|
SvxLRSpaceItem aLRSpace( RES_LR_SPACE );
|
|
|
|
aLRSpace.SetLeft(pRep->GetLeftSpace());
|
|
|
|
aLRSpace.SetRight(pRep->GetRightSpace());
|
|
|
|
aSet.Put( aLRSpace );
|
|
|
|
|
2007-09-27 11:29:35 +00:00
|
|
|
sal_Int16 eOrient = pRep->GetAlign();
|
2000-09-18 16:15:01 +00:00
|
|
|
SwFmtHoriOrient aAttr( 0, eOrient );
|
|
|
|
aSet.Put( aAttr );
|
|
|
|
// Damit beim recording die Ausrichtung nicht durch die Abstaende ueberschrieben
|
|
|
|
// wird, darf das Item nur bei manueller Ausrichtung aufgez. werden
|
2007-09-27 11:29:35 +00:00
|
|
|
if(eOrient != text::HoriOrientation::NONE)
|
2000-09-18 16:15:01 +00:00
|
|
|
((SfxItemSet&)rSet).ClearItem( SID_ATTR_LRSPACE );
|
|
|
|
|
|
|
|
|
|
|
|
if(pRep->HasColsChanged())
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
bTabCols = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_TABLE_HEADLINE, sal_False, &pItem))
|
2004-05-03 12:54:38 +00:00
|
|
|
rSh.SetRowsToRepeat( ((SfxUInt16Item*)pItem)->GetValue() );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( FN_TABLE_SET_VERT_ALIGN, sal_False, &pItem))
|
2000-09-18 16:15:01 +00:00
|
|
|
rSh.SetBoxAlign(((SfxUInt16Item*)(pItem))->GetValue());
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_TABLE_NAME, sal_False, &pItem ))
|
2000-09-18 16:15:01 +00:00
|
|
|
rSh.SetTableName( *pFmt, ((const SfxStringItem*)pItem)->GetValue() );
|
|
|
|
|
|
|
|
// kopiere die ausgesuchten Attribute in den ItemSet
|
2011-03-14 16:51:14 +00:00
|
|
|
static sal_uInt16 aIds[] =
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2002-06-17 10:11:16 +00:00
|
|
|
RES_PAGEDESC,
|
|
|
|
RES_BREAK,
|
|
|
|
RES_KEEP,
|
|
|
|
RES_LAYOUT_SPLIT,
|
|
|
|
RES_UL_SPACE,
|
|
|
|
RES_SHADOW,
|
|
|
|
RES_FRAMEDIR,
|
2011-04-16 22:42:13 -03:00
|
|
|
// #i29550#
|
2004-07-12 12:37:44 +00:00
|
|
|
RES_COLLAPSING_BORDERS,
|
|
|
|
// <-- collapsing borders
|
2000-09-18 16:15:01 +00:00
|
|
|
0
|
|
|
|
};
|
2011-01-17 15:06:54 +01:00
|
|
|
for( const sal_uInt16* pIds = aIds; *pIds; ++pIds )
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( *pIds, sal_False, &pItem))
|
2000-09-18 16:15:01 +00:00
|
|
|
aSet.Put( *pItem );
|
|
|
|
|
|
|
|
if( aSet.Count() )
|
|
|
|
rSh.SetTblAttr( aSet );
|
|
|
|
|
|
|
|
if(bTabCols)
|
|
|
|
{
|
|
|
|
rSh.GetTabCols( aTabCols );
|
|
|
|
bSingleLine = pRep->FillTabCols( aTabCols );
|
|
|
|
rSh.SetTabCols( aTabCols, bSingleLine );
|
|
|
|
}
|
|
|
|
|
|
|
|
rSh.EndUndo( UNDO_TABLE_ATTR );
|
|
|
|
rSh.EndAllAction();
|
|
|
|
}
|
|
|
|
|
2004-08-23 08:08:29 +00:00
|
|
|
static void lcl_TabGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2010-12-24 16:24:20 +01:00
|
|
|
if(pBorderLine->GetWidth() > rBorderLine.GetWidth())
|
|
|
|
rBorderLine.SetWidth(pBorderLine->GetWidth());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2012-07-03 21:26:13 +02:00
|
|
|
rBorderLine.SetBorderLineStyle(pBorderLine->GetBorderLineStyle());
|
2000-09-18 16:15:01 +00:00
|
|
|
rBorderLine.SetColor(pBorderLine->GetColor());
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwTableShell::Execute(SfxRequest &rReq)
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bUseDialog = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
const SfxItemSet* pArgs = rReq.GetArgs();
|
|
|
|
SwWrtShell &rSh = GetShell();
|
|
|
|
|
|
|
|
//Erstmal die Slots, die keinen FrmMgr benoetigen.
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bMore = sal_False;
|
2000-09-18 16:15:01 +00:00
|
|
|
const SfxPoolItem* pItem = 0;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nSlot = rReq.GetSlot();
|
2000-09-18 16:15:01 +00:00
|
|
|
if(pArgs)
|
2011-01-17 15:06:54 +01:00
|
|
|
pArgs->GetItemState(GetPool().GetWhich(nSlot), sal_False, &pItem);
|
|
|
|
sal_Bool bCallDone = sal_False;
|
2000-09-18 16:15:01 +00:00
|
|
|
switch ( nSlot )
|
|
|
|
{
|
|
|
|
case SID_ATTR_BORDER:
|
|
|
|
{
|
|
|
|
if(!pArgs)
|
|
|
|
break;
|
|
|
|
//Items erzeugen, weil wir sowieso nacharbeiten muessen
|
2007-05-10 15:23:49 +00:00
|
|
|
SvxBoxItem aBox( RES_BOX );
|
2000-09-18 16:15:01 +00:00
|
|
|
SfxItemSet aCoreSet( GetPool(),
|
|
|
|
RES_BOX, RES_BOX,
|
2004-04-21 09:00:22 +00:00
|
|
|
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
|
|
|
|
0);
|
2007-05-10 15:23:49 +00:00
|
|
|
SvxBoxInfoItem aCoreInfo( SID_ATTR_BORDER_INNER );
|
2000-09-18 16:15:01 +00:00
|
|
|
aCoreSet.Put(aCoreInfo);
|
|
|
|
rSh.GetTabBorders( aCoreSet );
|
|
|
|
const SvxBoxItem& rCoreBox = (const SvxBoxItem&)
|
|
|
|
aCoreSet.Get(RES_BOX);
|
2007-09-27 11:29:35 +00:00
|
|
|
const SfxPoolItem *pBoxItem = 0;
|
2011-01-17 15:06:54 +01:00
|
|
|
if ( pArgs->GetItemState(RES_BOX, sal_True, &pBoxItem) == SFX_ITEM_SET )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2007-09-27 11:29:35 +00:00
|
|
|
aBox = *(SvxBoxItem*)pBoxItem;
|
2000-09-18 16:15:01 +00:00
|
|
|
if ( !rReq.IsAPI() )
|
2011-01-17 15:06:54 +01:00
|
|
|
aBox.SetDistance( Max(rCoreBox.GetDistance(),sal_uInt16(55)) );
|
2000-09-18 16:15:01 +00:00
|
|
|
else if ( aBox.GetDistance() < MIN_BORDER_DIST )
|
2011-01-17 15:06:54 +01:00
|
|
|
aBox.SetDistance( Max(rCoreBox.GetDistance(),(sal_uInt16)MIN_BORDER_DIST) );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
else
|
2010-10-25 00:06:12 +02:00
|
|
|
OSL_ENSURE( !this, "where is BoxItem?" );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2008-11-19 16:29:07 +00:00
|
|
|
//since the drawing layer also supports borders the which id might be a different one
|
2007-05-10 15:23:49 +00:00
|
|
|
SvxBoxInfoItem aInfo( SID_ATTR_BORDER_INNER );
|
2011-01-17 15:06:54 +01:00
|
|
|
if (pArgs->GetItemState(SID_ATTR_BORDER_INNER, sal_True, &pBoxItem) == SFX_ITEM_SET)
|
2007-09-27 11:29:35 +00:00
|
|
|
aInfo = *(SvxBoxInfoItem*)pBoxItem;
|
2011-01-17 15:06:54 +01:00
|
|
|
else if( pArgs->GetItemState(SDRATTR_TABLE_BORDER_INNER, sal_True, &pBoxItem) == SFX_ITEM_SET )
|
2008-11-19 16:29:07 +00:00
|
|
|
{
|
|
|
|
aInfo = *(SvxBoxInfoItem*)pBoxItem;
|
|
|
|
aInfo.SetWhich(SID_ATTR_BORDER_INNER);
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
aInfo.SetTable( sal_True );
|
|
|
|
aInfo.SetValid( VALID_DISABLE, sal_False );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Die Attribute aller Linien werden gelesen und das staerkste gewinnt
|
|
|
|
const SvxBorderLine* pBorderLine;
|
|
|
|
SvxBorderLine aBorderLine;
|
|
|
|
if ((pBorderLine = rCoreBox.GetTop()) != NULL)
|
|
|
|
lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine);
|
|
|
|
if ((pBorderLine = rCoreBox.GetBottom()) != NULL)
|
|
|
|
lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine);
|
|
|
|
if ((pBorderLine = rCoreBox.GetLeft()) != NULL)
|
|
|
|
lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine);
|
|
|
|
if ((pBorderLine = rCoreBox.GetRight()) != NULL)
|
|
|
|
lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine);
|
|
|
|
if ((pBorderLine = aCoreInfo.GetHori()) != NULL)
|
|
|
|
lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine);
|
|
|
|
if ((pBorderLine = aCoreInfo.GetVert()) != NULL)
|
|
|
|
lcl_TabGetMaxLineWidth(pBorderLine, aBorderLine);
|
|
|
|
|
|
|
|
if(aBorderLine.GetOutWidth() == 0)
|
|
|
|
{
|
2012-07-03 21:26:13 +02:00
|
|
|
aBorderLine.SetBorderLineStyle(table::BorderLineStyle::SOLID);
|
2010-12-24 16:24:20 +01:00
|
|
|
aBorderLine.SetWidth( DEF_LINE_WIDTH_0 );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bLine = sal_False;
|
2000-09-18 16:15:01 +00:00
|
|
|
if ( (pBorderLine = aBox.GetTop()) != NULL)
|
2011-01-17 15:06:54 +01:00
|
|
|
aBox.SetLine(&aBorderLine, BOX_LINE_TOP), bLine |= sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
if ((pBorderLine = aBox.GetBottom()) != NULL)
|
2011-01-17 15:06:54 +01:00
|
|
|
aBox.SetLine(&aBorderLine, BOX_LINE_BOTTOM), bLine |= sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
if ((pBorderLine = aBox.GetLeft()) != NULL)
|
2011-01-17 15:06:54 +01:00
|
|
|
aBox.SetLine(&aBorderLine, BOX_LINE_LEFT), bLine |= sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
if ((pBorderLine = aBox.GetRight()) != NULL)
|
2011-01-17 15:06:54 +01:00
|
|
|
aBox.SetLine(&aBorderLine, BOX_LINE_RIGHT), bLine |= sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
if ((pBorderLine = aInfo.GetHori()) != NULL)
|
2011-01-17 15:06:54 +01:00
|
|
|
aInfo.SetLine(&aBorderLine, BOXINFO_LINE_HORI), bLine |= sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
if ((pBorderLine = aInfo.GetVert()) != NULL)
|
2011-01-17 15:06:54 +01:00
|
|
|
aInfo.SetLine(&aBorderLine, BOXINFO_LINE_VERT), bLine |= sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
aCoreSet.Put( aBox );
|
|
|
|
aCoreSet.Put( aInfo );
|
|
|
|
rSh.SetTabBorders( aCoreSet );
|
|
|
|
|
2002-07-19 10:16:36 +00:00
|
|
|
// we must record the "real" values because otherwise the lines can't be reconstructed on playtime
|
|
|
|
// the coding style of the controller (setting lines with width 0) is not transportable via Query/PutValue in
|
|
|
|
// the SvxBoxItem
|
|
|
|
rReq.AppendItem( aBox );
|
|
|
|
rReq.AppendItem( aInfo );
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2002-07-19 10:16:36 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_INSERT_TABLE:
|
2004-06-01 06:46:15 +00:00
|
|
|
InsertTable( rReq );
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case FN_FORMAT_TABLE_DLG:
|
|
|
|
{
|
2006-01-05 13:51:17 +00:00
|
|
|
//#127012# get the bindings before the dialog is called
|
|
|
|
// it might happen that this shell is removed after closing the dialog
|
|
|
|
SfxBindings& rBindings = GetView().GetViewFrame()->GetBindings();
|
2000-09-18 16:15:01 +00:00
|
|
|
SfxItemSet aCoreSet( GetPool(), aUITableAttrRange);
|
|
|
|
|
2001-06-19 09:53:51 +00:00
|
|
|
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &rSh.GetView()));
|
2011-01-17 15:06:54 +01:00
|
|
|
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
|
2000-09-18 16:15:01 +00:00
|
|
|
SwTableRep* pTblRep = ::lcl_TableParamToItemSet( aCoreSet, rSh );
|
2004-05-10 15:35:51 +00:00
|
|
|
SfxAbstractTabDialog * pDlg = NULL;
|
2002-07-19 10:16:36 +00:00
|
|
|
if ( bUseDialog )
|
2004-05-10 15:35:51 +00:00
|
|
|
{
|
2007-09-27 11:29:35 +00:00
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
|
2007-09-27 11:29:35 +00:00
|
|
|
|
2007-04-26 08:17:01 +00:00
|
|
|
pDlg = pFact->CreateSwTableTabDlg( GetView().GetWindow(), GetPool(), &aCoreSet, &rSh, DLG_FORMAT_TABLE );
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pDlg, "Dialogdiet fail!");
|
2011-10-05 17:33:05 +02:00
|
|
|
|
|
|
|
if( pItem )
|
|
|
|
pDlg->SetCurPageId( ((SfxUInt16Item *)pItem)->GetValue() );
|
2004-05-10 15:35:51 +00:00
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
|
|
|
|
rSh.GetTblAttr(aCoreSet);
|
|
|
|
// GetTblAttr buegelt den Background ueber!
|
|
|
|
SvxBrushItem aBrush( RES_BACKGROUND );
|
2001-10-26 13:17:20 +00:00
|
|
|
if(rSh.GetBoxBackground(aBrush))
|
|
|
|
aCoreSet.Put( aBrush );
|
|
|
|
else
|
|
|
|
aCoreSet.InvalidateItem( RES_BACKGROUND );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2010-09-30 18:34:49 +02:00
|
|
|
if ( (!pDlg && rReq.GetArgs()) || pDlg->Execute() == RET_OK )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2002-07-19 10:16:36 +00:00
|
|
|
const SfxItemSet* pOutSet = pDlg ? pDlg->GetOutputItemSet() : rReq.GetArgs();
|
|
|
|
if ( pDlg )
|
2003-08-19 11:38:23 +00:00
|
|
|
{
|
|
|
|
//to record FN_INSERT_TABLE correctly
|
|
|
|
rReq.SetSlot(FN_FORMAT_TABLE_DLG);
|
2002-07-19 10:16:36 +00:00
|
|
|
rReq.Done( *pOutSet );
|
2003-08-19 11:38:23 +00:00
|
|
|
}
|
2004-08-23 08:08:29 +00:00
|
|
|
ItemSetToTableParam( *pOutSet, rSh );
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
2002-07-19 10:16:36 +00:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
delete pDlg;
|
|
|
|
delete pTblRep;
|
|
|
|
rBindings.Update(SID_RULER_BORDERS);
|
|
|
|
rBindings.Update(SID_ATTR_TABSTOP);
|
2002-03-07 09:23:27 +00:00
|
|
|
rBindings.Update(SID_RULER_BORDERS_VERTICAL);
|
|
|
|
rBindings.Update(SID_ATTR_TABSTOP_VERTICAL);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
2003-08-19 11:38:23 +00:00
|
|
|
case SID_ATTR_BRUSH:
|
|
|
|
case SID_ATTR_BRUSH_ROW :
|
|
|
|
case SID_ATTR_BRUSH_TABLE :
|
|
|
|
if(rReq.GetArgs())
|
2004-08-23 08:08:29 +00:00
|
|
|
ItemSetToTableParam(*rReq.GetArgs(), rSh);
|
2003-08-19 11:38:23 +00:00
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case FN_NUM_FORMAT_TABLE_DLG:
|
|
|
|
{
|
|
|
|
SwView* pView = GetActiveView();
|
|
|
|
if(pView)
|
|
|
|
{
|
|
|
|
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
|
2011-01-17 15:06:54 +01:00
|
|
|
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
|
2000-09-18 16:15:01 +00:00
|
|
|
SvNumberFormatter* pFormatter = rSh.GetNumberFormatter();
|
|
|
|
SfxItemSet aCoreSet( GetPool(),
|
|
|
|
SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE,
|
|
|
|
SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO,
|
|
|
|
0 );
|
|
|
|
|
|
|
|
SfxItemSet aBoxSet( *aCoreSet.GetPool(),
|
|
|
|
RES_BOXATR_FORMAT, RES_BOXATR_FORMAT,
|
|
|
|
RES_BOXATR_VALUE, RES_BOXATR_VALUE,
|
|
|
|
0 );
|
|
|
|
rSh.GetTblBoxFormulaAttrs( aBoxSet );
|
|
|
|
|
|
|
|
SfxItemState eState = aBoxSet.GetItemState(RES_BOXATR_FORMAT);
|
|
|
|
if(eState == SFX_ITEM_DEFAULT)
|
|
|
|
{
|
|
|
|
aCoreSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE,
|
|
|
|
pFormatter->GetFormatIndex(NF_TEXT, LANGUAGE_SYSTEM)));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
aCoreSet.Put( SfxUInt32Item( SID_ATTR_NUMBERFORMAT_VALUE,
|
|
|
|
((SwTblBoxNumFormat&)aBoxSet.Get(
|
|
|
|
RES_BOXATR_FORMAT )).GetValue() ));
|
|
|
|
|
2001-03-12 17:47:57 +00:00
|
|
|
String sCurText( rSh.GetTableBoxText() );
|
2000-09-18 16:15:01 +00:00
|
|
|
aCoreSet.Put( SvxNumberInfoItem( pFormatter,
|
|
|
|
((SwTblBoxValue&)aBoxSet.Get(
|
|
|
|
RES_BOXATR_VALUE)).GetValue(),
|
2001-03-12 17:47:57 +00:00
|
|
|
sCurText, SID_ATTR_NUMBERFORMAT_INFO ));
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2007-09-27 11:29:35 +00:00
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
|
2007-09-27 11:29:35 +00:00
|
|
|
|
2009-05-06 10:59:57 +00:00
|
|
|
SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( GetView().GetWindow(),aCoreSet,
|
2009-12-15 23:07:57 +01:00
|
|
|
pView->GetViewFrame()->GetFrame().GetFrameInterface(),
|
2009-05-06 10:59:57 +00:00
|
|
|
RC_DLG_SWNUMFMTDLG );
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pDlg, "Dialogdiet fail!");
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
if (RET_OK == pDlg->Execute())
|
|
|
|
{
|
2007-09-27 11:29:35 +00:00
|
|
|
const SfxPoolItem* pNumberFormatItem = GetView().GetDocShell()->
|
2000-09-18 16:15:01 +00:00
|
|
|
GetItem( SID_ATTR_NUMBERFORMAT_INFO );
|
|
|
|
|
2007-09-27 11:29:35 +00:00
|
|
|
if( pNumberFormatItem && 0 != ((SvxNumberInfoItem*)pNumberFormatItem)->GetDelCount() )
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2006-03-16 11:47:24 +00:00
|
|
|
const sal_uInt32* pDelArr = ((SvxNumberInfoItem*)
|
2007-09-27 11:29:35 +00:00
|
|
|
pNumberFormatItem)->GetDelArray();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
for ( sal_uInt16 i = 0; i < ((SvxNumberInfoItem*)pNumberFormatItem)->GetDelCount(); i++ )
|
2007-09-27 11:29:35 +00:00
|
|
|
((SvxNumberInfoItem*)pNumberFormatItem)->
|
2000-09-18 16:15:01 +00:00
|
|
|
GetNumberFormatter()->DeleteEntry( pDelArr[i] );
|
|
|
|
}
|
|
|
|
|
|
|
|
if( SFX_ITEM_SET == pDlg->GetOutputItemSet()->GetItemState(
|
2011-01-17 15:06:54 +01:00
|
|
|
SID_ATTR_NUMBERFORMAT_VALUE, sal_False, &pNumberFormatItem ))
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2007-09-27 11:29:35 +00:00
|
|
|
SfxItemSet aBoxFormatSet( *aCoreSet.GetPool(),
|
2000-09-18 16:15:01 +00:00
|
|
|
RES_BOXATR_FORMAT, RES_BOXATR_FORMAT );
|
2007-09-27 11:29:35 +00:00
|
|
|
aBoxFormatSet.Put( SwTblBoxNumFormat(
|
|
|
|
((SfxUInt32Item*)pNumberFormatItem)->GetValue() ));
|
|
|
|
rSh.SetTblBoxFormulaAttrs( aBoxFormatSet );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
delete pDlg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_CALC_TABLE:
|
|
|
|
rSh.UpdateTable();
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_TABLE_OPTIMAL_HEIGHT:
|
|
|
|
{
|
|
|
|
const SwFmtFrmSize aSz;
|
|
|
|
rSh.SetRowHeight( aSz );
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_TABLE_DELETE_COL:
|
|
|
|
if ( rSh.DeleteCol() && rSh.HasSelection() )
|
|
|
|
rSh.EnterStdMode();
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_END_TABLE:
|
|
|
|
rSh.MoveTable( fnTableCurr, fnTableEnd );
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_START_TABLE:
|
|
|
|
rSh.MoveTable( fnTableCurr, fnTableStart );
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
2002-10-18 08:30:14 +00:00
|
|
|
case FN_GOTO_NEXT_CELL:
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bAppendLine = sal_True;
|
2002-10-18 08:30:14 +00:00
|
|
|
if( pItem )
|
|
|
|
bAppendLine = ((SfxBoolItem*)pItem)->GetValue();
|
|
|
|
rReq.SetReturnValue( SfxBoolItem( nSlot,
|
|
|
|
rSh.GoNextCell( bAppendLine ) ) );
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2002-10-18 08:30:14 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_GOTO_PREV_CELL:
|
|
|
|
rReq.SetReturnValue( SfxBoolItem( nSlot, rSh.GoPrevCell() ) );
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2002-10-18 08:30:14 +00:00
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case FN_TABLE_DELETE_ROW:
|
|
|
|
if ( rSh.DeleteRow() && rSh.HasSelection() )
|
|
|
|
rSh.EnterStdMode();
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_TABLE_MERGE_CELLS:
|
|
|
|
if ( rSh.IsTableMode() )
|
|
|
|
switch ( rSh.MergeTab() )
|
|
|
|
{
|
|
|
|
case TBLMERGE_OK:
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2003-08-19 11:00:16 +00:00
|
|
|
//no break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case TBLMERGE_NOSELECTION: break;
|
|
|
|
case TBLMERGE_TOOCOMPLEX:
|
|
|
|
{
|
|
|
|
InfoBox aInfoBox( GetView().GetWindow(),
|
|
|
|
SW_RES( MSG_ERR_TABLE_MERGE ) );
|
|
|
|
aInfoBox.Execute();
|
|
|
|
break;
|
|
|
|
}
|
2010-10-24 23:48:32 +02:00
|
|
|
default: OSL_ENSURE( !this, "unknown return value MergeTab.");
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_TABLE_ADJUST_CELLS:
|
|
|
|
case FN_TABLE_BALANCE_CELLS:
|
2003-04-17 09:16:29 +00:00
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bBalance = (FN_TABLE_BALANCE_CELLS == nSlot);
|
2003-04-17 09:16:29 +00:00
|
|
|
if ( rSh.IsAdjustCellWidthAllowed(bBalance) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// remove actions to make a valid table selection
|
|
|
|
UnoActionRemoveContext aRemoveContext(rSh.GetDoc());
|
|
|
|
}
|
|
|
|
rSh.AdjustCellWidth(bBalance);
|
|
|
|
}
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2003-04-17 09:16:29 +00:00
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_TABLE_BALANCE_ROWS:
|
2011-01-17 15:06:54 +01:00
|
|
|
if ( rSh.BalanceRowHeight(sal_True) )
|
|
|
|
rSh.BalanceRowHeight(sal_False);
|
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_TABLE_SELECT_ALL:
|
|
|
|
rSh.EnterStdMode();
|
|
|
|
rSh.MoveTable( fnTableCurr, fnTableStart );
|
|
|
|
rSh.SttSelect();
|
|
|
|
rSh.MoveTable( fnTableCurr, fnTableEnd );
|
|
|
|
rSh.EndSelect();
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_TABLE_SELECT_COL:
|
|
|
|
rSh.EnterStdMode();
|
|
|
|
rSh.SelectTableCol();
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_TABLE_SELECT_ROW:
|
|
|
|
rSh.EnterStdMode();
|
|
|
|
rSh.SelectTableRow();
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_TABLE_SET_READ_ONLY_CELLS:
|
|
|
|
rSh.ProtectCells();
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.ResetSelect( 0, sal_False );
|
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case FN_TABLE_UNSET_READ_ONLY_CELLS:
|
|
|
|
rSh.UnProtectCells();
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
case SID_AUTOFORMAT:
|
|
|
|
{
|
2007-09-27 11:29:35 +00:00
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
|
2007-09-27 11:29:35 +00:00
|
|
|
|
2012-09-25 11:35:47 +01:00
|
|
|
AbstractSwAutoFormatDlg* pDlg = pFact->CreateSwAutoFormatDlg(&GetView().GetViewFrame()->GetWindow(), &rSh);
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pDlg, "Dialogdiet fail!");
|
2000-09-18 16:15:01 +00:00
|
|
|
pDlg->Execute();
|
|
|
|
delete pDlg;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_TABLE_SET_ROW_HEIGHT:
|
|
|
|
{
|
2007-09-27 11:29:35 +00:00
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
|
2007-09-27 11:29:35 +00:00
|
|
|
|
2007-04-26 08:17:01 +00:00
|
|
|
VclAbstractDialog* pDlg = pFact->CreateVclAbstractDialog( GetView().GetWindow(), rSh, DLG_ROW_HEIGHT );
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pDlg, "Dialogdiet fail!");
|
2000-09-18 16:15:01 +00:00
|
|
|
pDlg->Execute();
|
|
|
|
delete pDlg;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_NUMBER_BULLETS:
|
|
|
|
case FN_NUM_BULLET_ON:
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE( !this, "function may not be called now." );
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_TABLE_INSERT_COL:
|
|
|
|
case FN_TABLE_INSERT_ROW:
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bColumn = rReq.GetSlot() == FN_TABLE_INSERT_COL;
|
|
|
|
sal_uInt16 nCount = 0;
|
|
|
|
sal_Bool bAfter = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
if (pItem)
|
|
|
|
{
|
|
|
|
nCount = ((const SfxInt16Item* )pItem)->GetValue();
|
2011-01-17 15:06:54 +01:00
|
|
|
if(SFX_ITEM_SET == pArgs->GetItemState(FN_PARAM_INSERT_AFTER, sal_True, &pItem))
|
2000-09-18 16:15:01 +00:00
|
|
|
bAfter = ((const SfxBoolItem* )pItem)->GetValue();
|
|
|
|
}
|
|
|
|
else if( !rReq.IsAPI() )
|
|
|
|
++nCount;
|
|
|
|
|
|
|
|
if( nCount )
|
|
|
|
{
|
2007-03-14 07:05:35 +00:00
|
|
|
// i74180: Table border patch submitted by chensuchun:
|
|
|
|
// -->get the SvxBoxInfoItem of the table before insert
|
|
|
|
SfxItemSet aCoreSet( GetPool(), aUITableAttrRange);
|
|
|
|
::lcl_TableParamToItemSet( aCoreSet, rSh );
|
|
|
|
bool bSetInnerBorders = false;
|
2007-09-27 11:29:35 +00:00
|
|
|
SwUndoId nUndoId = UNDO_EMPTY;
|
2007-03-14 07:05:35 +00:00
|
|
|
// <--End
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
if( bColumn )
|
2007-03-14 07:05:35 +00:00
|
|
|
{
|
|
|
|
rSh.StartUndo( UNDO_TABLE_INSCOL );
|
2000-09-18 16:15:01 +00:00
|
|
|
rSh.InsertCol( nCount, bAfter );
|
2007-03-14 07:05:35 +00:00
|
|
|
bSetInnerBorders = true;
|
|
|
|
nUndoId = UNDO_TABLE_INSCOL;
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
else if ( !rSh.IsInRepeatedHeadline() )
|
2007-03-14 07:05:35 +00:00
|
|
|
{
|
|
|
|
rSh.StartUndo( UNDO_TABLE_INSROW );
|
2000-09-18 16:15:01 +00:00
|
|
|
rSh.InsertRow( nCount, bAfter );
|
2007-03-14 07:05:35 +00:00
|
|
|
bSetInnerBorders = true;
|
|
|
|
nUndoId = UNDO_TABLE_INSROW;
|
|
|
|
}
|
|
|
|
|
|
|
|
// -->after inserting,reset the inner table borders
|
|
|
|
if ( bSetInnerBorders )
|
|
|
|
{
|
|
|
|
const SvxBoxInfoItem aBoxInfo((const SvxBoxInfoItem&)
|
|
|
|
aCoreSet.Get(SID_ATTR_BORDER_INNER));
|
|
|
|
SfxItemSet aSet( GetPool(), SID_ATTR_BORDER_INNER,
|
|
|
|
SID_ATTR_BORDER_INNER, 0);
|
|
|
|
aSet.Put( aBoxInfo );
|
|
|
|
ItemSetToTableParam( aSet, rSh );
|
|
|
|
rSh.EndUndo( nUndoId );
|
|
|
|
}
|
|
|
|
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
nSlot = bColumn ? FN_TABLE_INSERT_COL_DLG : FN_TABLE_INSERT_ROW_DLG;
|
|
|
|
}
|
|
|
|
// kein break; bei Count = 0 kommt der Dialog
|
|
|
|
case FN_TABLE_INSERT_COL_DLG:
|
|
|
|
case FN_TABLE_INSERT_ROW_DLG:
|
|
|
|
{
|
2010-07-10 18:21:24 +02:00
|
|
|
const SfxSlot* pSlot = GetStaticInterface()->GetSlot(nSlot);
|
2000-09-18 16:15:01 +00:00
|
|
|
if ( FN_TABLE_INSERT_ROW_DLG != nSlot || !rSh.IsInRepeatedHeadline())
|
|
|
|
{
|
CWS-TOOLING: integrate CWS impress172
2009-07-30 15:29:39 +0200 cl r274492 : #i102921# remove reference to inssrc.obj which was moved to svx
2009-07-29 11:40:35 +0200 wg r274445 : i103869
2009-07-22 14:39:13 +0200 sj r274241 : #i102713# fixed cloud shape
2009-07-07 15:28:04 +0200 sj r273800 : fixed build problem
2009-07-07 13:27:13 +0200 cl r273792 : #i102921# moved insert col/rows dialog to svx
2009-07-07 10:36:05 +0200 cl r273782 : fixed compiler warnings
2009-07-02 10:40:21 +0200 sj r273626 : fixed build problem
2009-07-02 10:27:56 +0200 cl r273624 : fixed merge problem
2009-07-02 10:27:19 +0200 cl r273623 : fixed compiler warning
2009-07-01 10:04:58 +0200 cl r273550 : CWS-TOOLING: rebase CWS impress172 to trunk@273468 (milestone: DEV300:m51)
2009-06-30 16:22:02 +0200 cl r273518 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:46 +0200 cl r273517 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:28 +0200 cl r273516 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:49 +0200 cl r273515 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:28 +0200 cl r273514 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:17:38 +0200 cl r273513 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:45:44 +0200 cl r273511 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:37:16 +0200 cl r273510 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:33:47 +0200 cl r273509 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:32:10 +0200 cl r273508 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:30:05 +0200 cl r273507 : #i102921# added insert table row/col dialog for impress tables
2009-06-29 12:32:42 +0200 sj r273465 : #158632# fixed textrange hyperlinks to specific pages, added slide names
2009-06-24 15:17:59 +0200 sj r273349 : #158636# fixed text range hyperlink to first/last slide
2009-06-22 13:18:30 +0200 sj r273224 : #158651# fixed header footer import
2009-06-19 15:18:24 +0200 sj r273160 : #158614# default text of presentation objects now cleared
2009-06-16 15:54:19 +0200 sj r273023 : #i101545# fixed crash - bracketing of graphic links has been done twice leading to a broken graphic state stack
2009-06-15 16:26:26 +0200 sj r272998 : #158635# importing bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-15 16:25:26 +0200 sj r272997 : #158635# added bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-12 13:17:32 +0200 sj r272915 : #i102713# fixed cloud shape
2009-06-10 18:36:58 +0200 sj r272833 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-08 19:52:28 +0200 sj r272746 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-04 15:28:32 +0200 cl r272640 : #i102358# applied patch to remove warnings
2009-06-04 14:39:45 +0200 cl r272630 : #i99423# applied path to change impress wizard create button to open when opening exisitng documents
2009-06-03 18:21:26 +0200 sj r272601 : #158635# now using the correct paragraph bottom spacing. using font independent linespacing for impress text objects
2009-06-03 15:47:27 +0200 cl r272583 : #i101817# added color collection based on scribus
2009-06-03 14:43:59 +0200 cl r272580 : #i102163# use weak ref to SdrObject instead of listening to the model
2009-06-03 12:39:29 +0200 cl r272556 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 12:27:00 +0200 cl r272555 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 11:33:44 +0200 cl r272553 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:59 +0200 cl r272552 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:22 +0200 cl r272551 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-02 18:41:07 +0200 sj r272527 : #i28358# applied patch (better conversion of dotted lines)
2009-06-02 11:52:13 +0200 cl r272491 : #i98668# applied patch to fix possible endless loop if exception occours
2009-05-28 17:02:55 +0200 sj r272416 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:25 +0200 sj r272415 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:10 +0200 sj r272414 : #i102336# retaining graphic file names unchanged
2009-05-25 12:43:58 +0200 sj r272232 : #i102069# added patch from thb (fixed rotated group objects)
2009-08-05 17:01:07 +00:00
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
2010-07-10 18:21:24 +02:00
|
|
|
::std::auto_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( GetView().GetWindow(), nSlot == FN_TABLE_INSERT_COL_DLG, pSlot->GetCommand() ) : 0);
|
CWS-TOOLING: integrate CWS impress172
2009-07-30 15:29:39 +0200 cl r274492 : #i102921# remove reference to inssrc.obj which was moved to svx
2009-07-29 11:40:35 +0200 wg r274445 : i103869
2009-07-22 14:39:13 +0200 sj r274241 : #i102713# fixed cloud shape
2009-07-07 15:28:04 +0200 sj r273800 : fixed build problem
2009-07-07 13:27:13 +0200 cl r273792 : #i102921# moved insert col/rows dialog to svx
2009-07-07 10:36:05 +0200 cl r273782 : fixed compiler warnings
2009-07-02 10:40:21 +0200 sj r273626 : fixed build problem
2009-07-02 10:27:56 +0200 cl r273624 : fixed merge problem
2009-07-02 10:27:19 +0200 cl r273623 : fixed compiler warning
2009-07-01 10:04:58 +0200 cl r273550 : CWS-TOOLING: rebase CWS impress172 to trunk@273468 (milestone: DEV300:m51)
2009-06-30 16:22:02 +0200 cl r273518 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:46 +0200 cl r273517 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:28 +0200 cl r273516 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:49 +0200 cl r273515 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:28 +0200 cl r273514 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:17:38 +0200 cl r273513 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:45:44 +0200 cl r273511 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:37:16 +0200 cl r273510 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:33:47 +0200 cl r273509 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:32:10 +0200 cl r273508 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:30:05 +0200 cl r273507 : #i102921# added insert table row/col dialog for impress tables
2009-06-29 12:32:42 +0200 sj r273465 : #158632# fixed textrange hyperlinks to specific pages, added slide names
2009-06-24 15:17:59 +0200 sj r273349 : #158636# fixed text range hyperlink to first/last slide
2009-06-22 13:18:30 +0200 sj r273224 : #158651# fixed header footer import
2009-06-19 15:18:24 +0200 sj r273160 : #158614# default text of presentation objects now cleared
2009-06-16 15:54:19 +0200 sj r273023 : #i101545# fixed crash - bracketing of graphic links has been done twice leading to a broken graphic state stack
2009-06-15 16:26:26 +0200 sj r272998 : #158635# importing bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-15 16:25:26 +0200 sj r272997 : #158635# added bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-12 13:17:32 +0200 sj r272915 : #i102713# fixed cloud shape
2009-06-10 18:36:58 +0200 sj r272833 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-08 19:52:28 +0200 sj r272746 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-04 15:28:32 +0200 cl r272640 : #i102358# applied patch to remove warnings
2009-06-04 14:39:45 +0200 cl r272630 : #i99423# applied path to change impress wizard create button to open when opening exisitng documents
2009-06-03 18:21:26 +0200 sj r272601 : #158635# now using the correct paragraph bottom spacing. using font independent linespacing for impress text objects
2009-06-03 15:47:27 +0200 cl r272583 : #i101817# added color collection based on scribus
2009-06-03 14:43:59 +0200 cl r272580 : #i102163# use weak ref to SdrObject instead of listening to the model
2009-06-03 12:39:29 +0200 cl r272556 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 12:27:00 +0200 cl r272555 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 11:33:44 +0200 cl r272553 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:59 +0200 cl r272552 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:22 +0200 cl r272551 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-02 18:41:07 +0200 sj r272527 : #i28358# applied patch (better conversion of dotted lines)
2009-06-02 11:52:13 +0200 cl r272491 : #i98668# applied patch to fix possible endless loop if exception occours
2009-05-28 17:02:55 +0200 sj r272416 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:25 +0200 sj r272415 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:10 +0200 sj r272414 : #i102336# retaining graphic file names unchanged
2009-05-25 12:43:58 +0200 sj r272232 : #i102069# added patch from thb (fixed rotated group objects)
2009-08-05 17:01:07 +00:00
|
|
|
|
|
|
|
if( pDlg.get() && (pDlg->Execute() == 1) )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nDispatchSlot = (nSlot == FN_TABLE_INSERT_COL_DLG) ? FN_TABLE_INSERT_COL : FN_TABLE_INSERT_ROW;
|
|
|
|
SfxUInt16Item aCountItem( nDispatchSlot, static_cast< sal_uInt16 >(pDlg->getInsertCount()) );
|
CWS-TOOLING: integrate CWS impress172
2009-07-30 15:29:39 +0200 cl r274492 : #i102921# remove reference to inssrc.obj which was moved to svx
2009-07-29 11:40:35 +0200 wg r274445 : i103869
2009-07-22 14:39:13 +0200 sj r274241 : #i102713# fixed cloud shape
2009-07-07 15:28:04 +0200 sj r273800 : fixed build problem
2009-07-07 13:27:13 +0200 cl r273792 : #i102921# moved insert col/rows dialog to svx
2009-07-07 10:36:05 +0200 cl r273782 : fixed compiler warnings
2009-07-02 10:40:21 +0200 sj r273626 : fixed build problem
2009-07-02 10:27:56 +0200 cl r273624 : fixed merge problem
2009-07-02 10:27:19 +0200 cl r273623 : fixed compiler warning
2009-07-01 10:04:58 +0200 cl r273550 : CWS-TOOLING: rebase CWS impress172 to trunk@273468 (milestone: DEV300:m51)
2009-06-30 16:22:02 +0200 cl r273518 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:46 +0200 cl r273517 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:20:28 +0200 cl r273516 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:49 +0200 cl r273515 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:19:28 +0200 cl r273514 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 16:17:38 +0200 cl r273513 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:45:44 +0200 cl r273511 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:37:16 +0200 cl r273510 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:33:47 +0200 cl r273509 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:32:10 +0200 cl r273508 : #i102921# added insert table row/col dialog for impress tables
2009-06-30 15:30:05 +0200 cl r273507 : #i102921# added insert table row/col dialog for impress tables
2009-06-29 12:32:42 +0200 sj r273465 : #158632# fixed textrange hyperlinks to specific pages, added slide names
2009-06-24 15:17:59 +0200 sj r273349 : #158636# fixed text range hyperlink to first/last slide
2009-06-22 13:18:30 +0200 sj r273224 : #158651# fixed header footer import
2009-06-19 15:18:24 +0200 sj r273160 : #158614# default text of presentation objects now cleared
2009-06-16 15:54:19 +0200 sj r273023 : #i101545# fixed crash - bracketing of graphic links has been done twice leading to a broken graphic state stack
2009-06-15 16:26:26 +0200 sj r272998 : #158635# importing bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-15 16:25:26 +0200 sj r272997 : #158635# added bookmark interactions: firstslide, lastslide, nextslide, previousslide
2009-06-12 13:17:32 +0200 sj r272915 : #i102713# fixed cloud shape
2009-06-10 18:36:58 +0200 sj r272833 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-08 19:52:28 +0200 sj r272746 : #158674# fixed curvedleftarrow, curvedrightarrow, curveddownarrow, curveduparrow
2009-06-04 15:28:32 +0200 cl r272640 : #i102358# applied patch to remove warnings
2009-06-04 14:39:45 +0200 cl r272630 : #i99423# applied path to change impress wizard create button to open when opening exisitng documents
2009-06-03 18:21:26 +0200 sj r272601 : #158635# now using the correct paragraph bottom spacing. using font independent linespacing for impress text objects
2009-06-03 15:47:27 +0200 cl r272583 : #i101817# added color collection based on scribus
2009-06-03 14:43:59 +0200 cl r272580 : #i102163# use weak ref to SdrObject instead of listening to the model
2009-06-03 12:39:29 +0200 cl r272556 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 12:27:00 +0200 cl r272555 : #i93308# correct namespace for com.sun.star.text.textfields
2009-06-03 11:33:44 +0200 cl r272553 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:59 +0200 cl r272552 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-03 11:30:22 +0200 cl r272551 : #i23221# allow all settings (that make sense) for presentation styles
2009-06-02 18:41:07 +0200 sj r272527 : #i28358# applied patch (better conversion of dotted lines)
2009-06-02 11:52:13 +0200 cl r272491 : #i98668# applied patch to fix possible endless loop if exception occours
2009-05-28 17:02:55 +0200 sj r272416 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:25 +0200 sj r272415 : #i102336# retaining graphic file names unchanged
2009-05-28 17:00:10 +0200 sj r272414 : #i102336# retaining graphic file names unchanged
2009-05-25 12:43:58 +0200 sj r272232 : #i102069# added patch from thb (fixed rotated group objects)
2009-08-05 17:01:07 +00:00
|
|
|
SfxBoolItem aAfter( FN_PARAM_INSERT_AFTER, !pDlg->isInsertBefore() );
|
|
|
|
SfxViewFrame* pVFrame = GetView().GetViewFrame();
|
|
|
|
if( pVFrame )
|
|
|
|
pVFrame->GetDispatcher()->Execute( nDispatchSlot, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aCountItem, &aAfter, 0L);
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_TABLE_SPLIT_CELLS:
|
|
|
|
{
|
2002-07-19 10:16:36 +00:00
|
|
|
long nCount=0;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bHorizontal=sal_True;
|
|
|
|
sal_Bool bProportional = sal_False;
|
2002-07-19 10:16:36 +00:00
|
|
|
SFX_REQUEST_ARG( rReq, pSplit, SfxInt32Item, FN_TABLE_SPLIT_CELLS, sal_False );
|
|
|
|
SFX_REQUEST_ARG( rReq, pHor, SfxBoolItem, FN_PARAM_1, sal_False );
|
2002-11-22 06:32:08 +00:00
|
|
|
SFX_REQUEST_ARG( rReq, pProp, SfxBoolItem, FN_PARAM_2, sal_False );
|
2002-07-19 10:16:36 +00:00
|
|
|
if ( pSplit )
|
|
|
|
{
|
|
|
|
nCount = pSplit->GetValue();
|
|
|
|
if ( pHor )
|
|
|
|
bHorizontal = pHor->GetValue();
|
2002-11-22 06:32:08 +00:00
|
|
|
if ( pProp )
|
|
|
|
bProportional = pProp->GetValue();
|
2002-07-19 10:16:36 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-03-12 11:54:31 +00:00
|
|
|
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
|
|
|
|
if( pFact )
|
2002-07-19 10:16:36 +00:00
|
|
|
{
|
2008-03-12 11:54:31 +00:00
|
|
|
const long nMaxVert = rSh.GetAnyCurRect( RECT_FRM ).Width() / MINLAY;
|
|
|
|
SvxAbstractSplittTableDialog* pDlg = pFact->CreateSvxSplittTableDialog( GetView().GetWindow(), rSh.IsTableVertical(), nMaxVert, 99 );
|
|
|
|
if( pDlg && (pDlg->Execute() == RET_OK) )
|
|
|
|
{
|
|
|
|
nCount = pDlg->GetCount();
|
|
|
|
bHorizontal = pDlg->IsHorizontal();
|
|
|
|
bProportional = pDlg->IsProportional();
|
|
|
|
rReq.AppendItem( SfxInt32Item( FN_TABLE_SPLIT_CELLS, nCount ) );
|
|
|
|
rReq.AppendItem( SfxBoolItem( FN_PARAM_1, bHorizontal ) );
|
|
|
|
rReq.AppendItem( SfxBoolItem( FN_PARAM_2, bProportional ) );
|
|
|
|
}
|
|
|
|
delete pDlg;
|
2002-07-19 10:16:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( nCount>1 )
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.SplitTab(!bHorizontal, static_cast< sal_uInt16 >( nCount-1 ), bProportional );
|
|
|
|
bCallDone = sal_True;
|
2002-07-19 10:16:36 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
rReq.Ignore();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_TABLE_SPLIT_TABLE:
|
|
|
|
{
|
2009-01-06 16:42:28 +00:00
|
|
|
SFX_REQUEST_ARG( rReq, pType, SfxUInt16Item, FN_PARAM_1, sal_False );
|
|
|
|
if( pType )
|
|
|
|
{
|
|
|
|
switch( pType->GetValue() )
|
|
|
|
{
|
|
|
|
case HEADLINE_NONE :
|
|
|
|
case HEADLINE_BORDERCOPY:
|
|
|
|
case HEADLINE_CNTNTCOPY:
|
|
|
|
case HEADLINE_BOXATTRCOPY:
|
|
|
|
case HEADLINE_BOXATRCOLLCOPY:
|
|
|
|
rSh.SplitTable(pType->GetValue()) ;
|
|
|
|
default: ;//wrong parameter, do nothing
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
|
2007-09-27 11:29:35 +00:00
|
|
|
|
2009-01-06 16:42:28 +00:00
|
|
|
AbstractSplitTableDialog* pDlg = pFact->CreateSplitTblDialog( GetView().GetWindow(), rSh );
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pDlg, "Dialogdiet fail!");
|
2009-01-06 16:42:28 +00:00
|
|
|
pDlg->Execute();
|
|
|
|
rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, pDlg->GetSplitMode() ) );
|
|
|
|
delete pDlg;
|
|
|
|
bCallDone = sal_True;
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_TABLE_MERGE_TABLE:
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bPrev = rSh.CanMergeTable( sal_True );
|
|
|
|
sal_Bool bNext = rSh.CanMergeTable( sal_False );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
if( bPrev && bNext )
|
|
|
|
{
|
2007-09-27 11:29:35 +00:00
|
|
|
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
|
2007-04-26 08:17:01 +00:00
|
|
|
VclAbstractDialog* pDlg = pFact->CreateSwVclDialog( DLG_MERGE_TABLE, GetView().GetWindow(), bPrev );
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE(pDlg, "dialogdiet pDlg fail!");
|
2004-05-10 15:35:51 +00:00
|
|
|
if( RET_OK != pDlg->Execute())
|
2011-01-17 15:06:54 +01:00
|
|
|
bPrev = bNext = sal_False;
|
2000-09-18 16:15:01 +00:00
|
|
|
delete pDlg;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bPrev || bNext )
|
|
|
|
rSh.MergeTable( bPrev );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_TABLE_MODE_FIX :
|
|
|
|
case FN_TABLE_MODE_FIX_PROP :
|
|
|
|
case FN_TABLE_MODE_VARIABLE :
|
|
|
|
{
|
|
|
|
rSh.SetTblChgMode( ( FN_TABLE_MODE_FIX == nSlot ? TBLFIX_CHGABS
|
|
|
|
: FN_TABLE_MODE_FIX_PROP == nSlot
|
|
|
|
? TBLFIX_CHGPROP
|
|
|
|
: TBLVAR_CHGABS ) );
|
|
|
|
|
|
|
|
SfxBindings& rBind = GetView().GetViewFrame()->GetBindings();
|
2011-03-14 16:51:14 +00:00
|
|
|
static sal_uInt16 aInva[] =
|
2000-09-18 16:15:01 +00:00
|
|
|
{ FN_TABLE_MODE_FIX,
|
|
|
|
FN_TABLE_MODE_FIX_PROP,
|
|
|
|
FN_TABLE_MODE_VARIABLE,
|
|
|
|
0
|
|
|
|
};
|
|
|
|
rBind.Invalidate( aInva );
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_TABLE_AUTOSUM:
|
|
|
|
{
|
|
|
|
SfxViewFrame* pVFrame = GetView().GetViewFrame();
|
|
|
|
pVFrame->GetDispatcher()->Execute(FN_EDIT_FORMULA, SFX_CALLMODE_SYNCHRON);
|
2011-01-17 15:06:54 +01:00
|
|
|
const sal_uInt16 nId = SwInputChild::GetChildWindowId();
|
2000-09-18 16:15:01 +00:00
|
|
|
SwInputChild* pChildWin = (SwInputChild*)pVFrame->
|
|
|
|
GetChildWindow( nId );
|
|
|
|
String sSum;
|
|
|
|
GetShell().GetAutoSum(sSum);
|
|
|
|
if( pChildWin )
|
|
|
|
pChildWin->SetFormula( sSum );
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
2004-08-02 12:09:46 +00:00
|
|
|
case FN_TABLE_HEADLINE_REPEAT:
|
|
|
|
if(0 != rSh.GetRowsToRepeat())
|
|
|
|
rSh.SetRowsToRepeat( 0 );
|
|
|
|
else
|
|
|
|
rSh.SetRowsToRepeat(rSh.GetRowSelectionFromTop());
|
|
|
|
break;
|
|
|
|
case FN_TABLE_SELECT_CELL :
|
|
|
|
rSh.SelectTableCell();
|
|
|
|
break;
|
|
|
|
case FN_TABLE_DELETE_TABLE :
|
|
|
|
{
|
|
|
|
rSh.StartAction();
|
|
|
|
rSh.StartUndo();
|
|
|
|
rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_TABLE_SELECT_ALL);
|
|
|
|
rSh.DeleteRow();
|
|
|
|
rSh.EndUndo();
|
|
|
|
rSh.EndAction();
|
|
|
|
}
|
|
|
|
//'this' is already destroyed
|
|
|
|
return;
|
|
|
|
//break;
|
2000-09-18 16:15:01 +00:00
|
|
|
default:
|
2011-01-17 15:06:54 +01:00
|
|
|
bMore = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ( !bMore )
|
|
|
|
{
|
2003-08-19 11:00:16 +00:00
|
|
|
if(bCallDone)
|
|
|
|
rReq.Done();
|
2000-09-18 16:15:01 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
else
|
2011-01-17 15:06:54 +01:00
|
|
|
bMore = sal_False;
|
2000-09-18 16:15:01 +00:00
|
|
|
//Jetzt die Slots, die direkt auf dem TableFmt arbeiten.
|
|
|
|
SwFrmFmt *pFmt = rSh.GetTableFmt();
|
|
|
|
switch ( nSlot )
|
|
|
|
{
|
|
|
|
case SID_ATTR_ULSPACE:
|
|
|
|
{
|
|
|
|
if(pItem)
|
|
|
|
{
|
|
|
|
SvxULSpaceItem aULSpace( *(const SvxULSpaceItem*)pItem );
|
|
|
|
aULSpace.SetWhich( RES_UL_SPACE );
|
|
|
|
::lcl_SetAttr( rSh, aULSpace );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ATTR_LRSPACE:
|
|
|
|
{
|
|
|
|
if(pItem)
|
|
|
|
{
|
|
|
|
SfxItemSet aSet( GetPool(), RES_LR_SPACE, RES_LR_SPACE,
|
|
|
|
RES_HORI_ORIENT, RES_HORI_ORIENT, 0 );
|
|
|
|
SvxLRSpaceItem aLRSpace( *(const SvxLRSpaceItem*)pItem );
|
|
|
|
aLRSpace.SetWhich( RES_LR_SPACE );
|
|
|
|
aSet.Put( aLRSpace );
|
|
|
|
SwFmtHoriOrient aHori( pFmt->GetHoriOrient() );
|
2007-09-27 11:29:35 +00:00
|
|
|
aHori.SetHoriOrient( text::HoriOrientation::NONE );
|
2000-09-18 16:15:01 +00:00
|
|
|
aSet.Put( aLRSpace );
|
|
|
|
rSh.SetTblAttr( aSet );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
// der letzte case-Zweig der noch einen TabellenManager braucht!!
|
|
|
|
case FN_TABLE_SET_COL_WIDTH:
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
SwTableFUNC aMgr( &rSh, sal_False);
|
2000-09-18 16:15:01 +00:00
|
|
|
aMgr.ColWidthDlg(GetView().GetWindow());
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_TABLE_VERT_NONE:
|
|
|
|
case FN_TABLE_VERT_CENTER:
|
|
|
|
case FN_TABLE_VERT_BOTTOM:
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nAlign = nSlot == FN_TABLE_VERT_NONE ?
|
2007-09-27 11:29:35 +00:00
|
|
|
text::VertOrientation::NONE :
|
2000-09-18 16:15:01 +00:00
|
|
|
nSlot == FN_TABLE_VERT_CENTER ?
|
2007-09-27 11:29:35 +00:00
|
|
|
text::VertOrientation::CENTER : text::VertOrientation::BOTTOM;
|
2000-09-18 16:15:01 +00:00
|
|
|
rSh.SetBoxAlign(nAlign);
|
2011-01-17 15:06:54 +01:00
|
|
|
bCallDone = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ATTR_PARA_SPLIT:
|
|
|
|
if ( pItem )
|
|
|
|
{
|
|
|
|
SwFmtLayoutSplit aSplit( ((const SvxFmtSplitItem*)pItem)->GetValue());
|
|
|
|
SfxItemSet aSet(GetPool(), RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT, 0 );
|
|
|
|
aSet.Put(aSplit);
|
|
|
|
rSh.SetTblAttr(aSet);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ATTR_PARA_KEEP:
|
|
|
|
if ( pItem )
|
|
|
|
{
|
|
|
|
SvxFmtKeepItem aKeep( *(const SvxFmtKeepItem*)pItem );
|
|
|
|
aKeep.SetWhich( RES_KEEP );
|
|
|
|
SfxItemSet aSet(GetPool(), RES_KEEP, RES_KEEP, 0 );
|
|
|
|
aSet.Put(aKeep);
|
|
|
|
rSh.SetTblAttr(aSet);
|
|
|
|
}
|
|
|
|
break;
|
2004-01-13 10:27:07 +00:00
|
|
|
case FN_TABLE_ROW_SPLIT :
|
|
|
|
{
|
|
|
|
const SfxBoolItem* pBool = static_cast<const SfxBoolItem*>(pItem);
|
|
|
|
SwFmtRowSplit* pSplit = 0;
|
|
|
|
if(!pBool)
|
|
|
|
{
|
|
|
|
rSh.GetRowSplit(pSplit);
|
|
|
|
if(pSplit)
|
|
|
|
pSplit->SetValue(!pSplit->GetValue());
|
|
|
|
else
|
2011-01-17 15:06:54 +01:00
|
|
|
pSplit = new SwFmtRowSplit(sal_True);
|
2004-01-13 10:27:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pSplit = new SwFmtRowSplit(pBool->GetValue());
|
|
|
|
}
|
|
|
|
rSh.SetRowSplit( *pSplit );
|
|
|
|
delete pSplit;
|
|
|
|
}
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
default:
|
2010-10-24 23:48:32 +02:00
|
|
|
OSL_ENSURE( !this, "wrong Dispatcher" );
|
2000-09-18 16:15:01 +00:00
|
|
|
return;
|
|
|
|
}
|
2003-08-19 11:00:16 +00:00
|
|
|
if(bCallDone)
|
|
|
|
rReq.Done();
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void SwTableShell::GetState(SfxItemSet &rSet)
|
|
|
|
{
|
|
|
|
SfxWhichIter aIter( rSet );
|
|
|
|
SwWrtShell &rSh = GetShell();
|
|
|
|
SwFrmFmt *pFmt = rSh.GetTableFmt();
|
2005-11-04 15:02:31 +00:00
|
|
|
// os #124829# crash report: in case of an invalid shell selection return immediately
|
|
|
|
if(!pFmt)
|
|
|
|
return;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nSlot = aIter.FirstWhich();
|
2000-09-18 16:15:01 +00:00
|
|
|
while ( nSlot )
|
|
|
|
{
|
|
|
|
switch ( nSlot )
|
|
|
|
{
|
|
|
|
case FN_TABLE_MERGE_CELLS:
|
|
|
|
if ( !rSh.IsTableMode() )
|
|
|
|
rSet.DisableItem(FN_TABLE_MERGE_CELLS);
|
|
|
|
break;
|
|
|
|
case FN_TABLE_ADJUST_CELLS:
|
|
|
|
if ( !rSh.IsAdjustCellWidthAllowed() )
|
|
|
|
rSet.DisableItem(FN_TABLE_ADJUST_CELLS);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_TABLE_BALANCE_CELLS:
|
2011-01-17 15:06:54 +01:00
|
|
|
if ( !rSh.IsAdjustCellWidthAllowed(sal_True) )
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem(FN_TABLE_BALANCE_CELLS);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_TABLE_BALANCE_ROWS:
|
2011-01-17 15:06:54 +01:00
|
|
|
if ( !rSh.BalanceRowHeight(sal_True) )
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem(FN_TABLE_BALANCE_ROWS);
|
|
|
|
break;
|
2001-06-05 06:47:18 +00:00
|
|
|
case FN_OPTIMIZE_TABLE:
|
|
|
|
if ( !rSh.IsTableMode() &&
|
|
|
|
!rSh.IsAdjustCellWidthAllowed() &&
|
2011-01-17 15:06:54 +01:00
|
|
|
!rSh.IsAdjustCellWidthAllowed(sal_True) &&
|
|
|
|
!rSh.BalanceRowHeight(sal_True) )
|
2001-06-05 06:47:18 +00:00
|
|
|
rSet.DisableItem(FN_OPTIMIZE_TABLE);
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
case SID_INSERT_DIAGRAM:
|
2000-11-14 17:32:27 +00:00
|
|
|
{
|
|
|
|
SvtModuleOptions aMOpt;
|
|
|
|
if ( !aMOpt.IsMath() || rSh.IsTblComplexForChart() )
|
|
|
|
rSet.DisableItem(nSlot);
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_INSERT_TABLE:
|
|
|
|
// Irgendeinen Wert "putten", damit Controller enabled bleibt.
|
|
|
|
// Statt "Insert:Table" erscheint dann "Format:Table".
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_TABLE_OPTIMAL_HEIGHT:
|
|
|
|
{
|
|
|
|
//Disablen wenn bereits auto-Hoehe eingestellt ist.
|
|
|
|
SwFmtFrmSize *pSz;
|
|
|
|
rSh.GetRowHeight( pSz );
|
|
|
|
if ( pSz )
|
|
|
|
{
|
2004-05-18 14:01:26 +00:00
|
|
|
if ( ATT_VAR_SIZE == pSz->GetHeightSizeType() )
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem( nSlot );
|
|
|
|
delete pSz;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_TABLE_INSERT_ROW:
|
|
|
|
case FN_TABLE_INSERT_ROW_DLG:
|
|
|
|
{
|
|
|
|
if ( rSh.IsInRepeatedHeadline() )
|
|
|
|
rSet.DisableItem( nSlot );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RES_LR_SPACE:
|
|
|
|
rSet.Put(pFmt->GetLRSpace());
|
|
|
|
break;
|
|
|
|
case RES_UL_SPACE:
|
|
|
|
rSet.Put(pFmt->GetULSpace());
|
|
|
|
break;
|
|
|
|
case FN_TABLE_VERT_NONE:
|
|
|
|
case FN_TABLE_VERT_CENTER:
|
|
|
|
case FN_TABLE_VERT_BOTTOM:
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nAlign = rSh.GetBoxAlign();
|
|
|
|
sal_Bool bSet = (nSlot == FN_TABLE_VERT_NONE && nAlign == text::VertOrientation::NONE) ||
|
2010-09-30 18:34:49 +02:00
|
|
|
(nSlot == FN_TABLE_VERT_CENTER && nAlign == text::VertOrientation::CENTER) ||
|
|
|
|
(nSlot == FN_TABLE_VERT_BOTTOM && nAlign == text::VertOrientation::BOTTOM);
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.Put(SfxBoolItem(nSlot, bSet));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_TABLE_MODE_FIX :
|
|
|
|
case FN_TABLE_MODE_FIX_PROP :
|
|
|
|
case FN_TABLE_MODE_VARIABLE :
|
|
|
|
{
|
2007-09-27 11:29:35 +00:00
|
|
|
TblChgMode nMode = rSh.GetTblChgMode();
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bSet = (nSlot == FN_TABLE_MODE_FIX && nMode == TBLFIX_CHGABS) ||
|
2010-11-04 13:05:15 +01:00
|
|
|
(nSlot == FN_TABLE_MODE_FIX_PROP && nMode == TBLFIX_CHGPROP) ||
|
|
|
|
(nSlot == FN_TABLE_MODE_VARIABLE && nMode == TBLVAR_CHGABS);
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.Put(SfxBoolItem(nSlot, bSet));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ATTR_PARA_SPLIT:
|
|
|
|
rSet.Put( pFmt->GetKeep() );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SID_ATTR_PARA_KEEP:
|
|
|
|
rSet.Put( pFmt->GetLayoutSplit() );
|
|
|
|
break;
|
|
|
|
case FN_TABLE_SPLIT_TABLE:
|
|
|
|
{
|
|
|
|
if ( rSh.IsInHeadline() )
|
|
|
|
rSet.DisableItem( nSlot );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_TABLE_MERGE_TABLE:
|
|
|
|
{
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_Bool bAsk;
|
|
|
|
if( !rSh.CanMergeTable( sal_True, &bAsk ))
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem( nSlot );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2004-01-13 10:27:07 +00:00
|
|
|
case FN_TABLE_DELETE_ROW:
|
|
|
|
{
|
|
|
|
SwSelBoxes aBoxes;
|
2007-09-27 11:29:35 +00:00
|
|
|
::GetTblSel( rSh, aBoxes, nsSwTblSearchType::TBLSEARCH_ROW );
|
2004-01-13 10:27:07 +00:00
|
|
|
if( ::HasProtectedCells( aBoxes ))
|
|
|
|
rSet.DisableItem( nSlot );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_TABLE_DELETE_COL:
|
|
|
|
{
|
|
|
|
SwSelBoxes aBoxes;
|
2007-09-27 11:29:35 +00:00
|
|
|
::GetTblSel( rSh, aBoxes, nsSwTblSearchType::TBLSEARCH_COL );
|
2004-01-13 10:27:07 +00:00
|
|
|
if( ::HasProtectedCells( aBoxes ))
|
|
|
|
rSet.DisableItem( nSlot );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FN_TABLE_UNSET_READ_ONLY_CELLS:
|
|
|
|
// disable in readonly sections, but enable in protected cells
|
|
|
|
if( !rSh.CanUnProtectCells() )
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem( nSlot );
|
2004-01-13 10:27:07 +00:00
|
|
|
break;
|
|
|
|
case RES_ROW_SPLIT:
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2004-01-13 10:27:07 +00:00
|
|
|
const SwFmtLayoutSplit& rTabSplit = pFmt->GetLayoutSplit();
|
|
|
|
if ( 0 == rTabSplit.GetValue() )
|
|
|
|
{
|
2000-09-18 16:15:01 +00:00
|
|
|
rSet.DisableItem( nSlot );
|
2004-01-13 10:27:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SwFmtRowSplit* pSplit = 0;
|
|
|
|
rSh.GetRowSplit(pSplit);
|
|
|
|
if(pSplit)
|
|
|
|
rSet.Put(*pSplit);
|
|
|
|
else
|
|
|
|
rSet.InvalidateItem( nSlot );
|
|
|
|
delete pSplit;
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
break;
|
2004-08-02 12:09:46 +00:00
|
|
|
case FN_TABLE_HEADLINE_REPEAT:
|
|
|
|
if(0 != rSh.GetRowsToRepeat())
|
|
|
|
rSet.Put(SfxBoolItem(nSlot, sal_True));
|
|
|
|
else if(!rSh.GetRowSelectionFromTop())
|
|
|
|
rSet.DisableItem( nSlot );
|
|
|
|
else
|
|
|
|
rSet.Put(SfxBoolItem(nSlot, sal_False));
|
|
|
|
break;
|
|
|
|
case FN_TABLE_SELECT_CELL :
|
|
|
|
if(rSh.HasBoxSelection())
|
|
|
|
rSet.DisableItem( nSlot );
|
|
|
|
break;
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
nSlot = aIter.NextWhich();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-09-27 11:29:35 +00:00
|
|
|
SwTableShell::SwTableShell(SwView &_rView) :
|
|
|
|
SwBaseShell(_rView)
|
2000-09-18 16:15:01 +00:00
|
|
|
{
|
2012-07-02 16:02:38 +01:00
|
|
|
SetName(rtl::OUString("Table"));
|
2000-09-18 16:15:01 +00:00
|
|
|
SetHelpId(SW_TABSHELL);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwTableShell::GetFrmBorderState(SfxItemSet &rSet)
|
|
|
|
{
|
|
|
|
SfxItemSet aCoreSet( GetPool(),
|
|
|
|
RES_BOX, RES_BOX,
|
|
|
|
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0 );
|
2007-05-10 15:23:49 +00:00
|
|
|
SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
|
2000-09-18 16:15:01 +00:00
|
|
|
aCoreSet.Put( aBoxInfo );
|
|
|
|
GetShell().GetTabBorders( aCoreSet );
|
|
|
|
rSet.Put( aCoreSet );
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwTableShell::ExecTableStyle(SfxRequest& rReq)
|
|
|
|
{
|
|
|
|
SwWrtShell &rSh = GetShell();
|
|
|
|
const SfxItemSet *pArgs = rReq.GetArgs();
|
|
|
|
if(pArgs)
|
|
|
|
switch ( rReq.GetSlot() )
|
|
|
|
{
|
|
|
|
case SID_FRAME_LINESTYLE:
|
|
|
|
case SID_FRAME_LINECOLOR:
|
|
|
|
{
|
|
|
|
if ( rReq.GetSlot() == SID_FRAME_LINESTYLE )
|
|
|
|
{
|
|
|
|
const SvxLineItem &rLineItem = (const SvxLineItem&)pArgs->
|
|
|
|
Get( SID_FRAME_LINESTYLE );
|
|
|
|
const SvxBorderLine* pBorderLine = rLineItem.GetLine();
|
2011-01-17 15:06:54 +01:00
|
|
|
rSh.SetTabLineStyle( 0, sal_True, pBorderLine);
|
2000-09-18 16:15:01 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const SvxColorItem &rNewColorItem = (const SvxColorItem&)pArgs->
|
|
|
|
Get( SID_FRAME_LINECOLOR );
|
|
|
|
rSh.SetTabLineStyle( &rNewColorItem.GetValue() );
|
|
|
|
}
|
2002-07-19 10:16:36 +00:00
|
|
|
|
|
|
|
rReq.Done();
|
2010-11-30 16:44:46 +01:00
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwTableShell::GetLineStyleState(SfxItemSet &rSet)
|
|
|
|
{
|
|
|
|
SfxItemSet aCoreSet( GetPool(),
|
|
|
|
RES_BOX, RES_BOX,
|
|
|
|
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0);
|
2007-05-10 15:23:49 +00:00
|
|
|
SvxBoxInfoItem aCoreInfo( SID_ATTR_BORDER_INNER );
|
2000-09-18 16:15:01 +00:00
|
|
|
aCoreSet.Put(aCoreInfo);
|
|
|
|
GetShell().GetTabBorders( aCoreSet );
|
|
|
|
|
|
|
|
const SvxBoxItem& rBoxItem = (const SvxBoxItem&)aCoreSet.Get( RES_BOX );
|
|
|
|
const SvxBorderLine* pLine = rBoxItem.GetTop();
|
|
|
|
|
|
|
|
rSet.Put( SvxColorItem( pLine ? pLine->GetColor() : Color(), SID_FRAME_LINECOLOR ) );
|
|
|
|
SvxLineItem aLine( SID_FRAME_LINESTYLE );
|
|
|
|
aLine.SetLine(pLine);
|
|
|
|
rSet.Put( aLine );
|
|
|
|
}
|
|
|
|
|
|
|
|
void SwTableShell::ExecNumberFormat(SfxRequest& rReq)
|
|
|
|
{
|
|
|
|
const SfxItemSet* pArgs = rReq.GetArgs();
|
|
|
|
SwWrtShell &rSh = GetShell();
|
|
|
|
|
|
|
|
//Erstmal die Slots, die keinen FrmMgr benoetigen.
|
|
|
|
const SfxPoolItem* pItem = 0;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nSlot = rReq.GetSlot();
|
2000-09-18 16:15:01 +00:00
|
|
|
if(pArgs)
|
2011-01-17 15:06:54 +01:00
|
|
|
pArgs->GetItemState(GetPool().GetWhich(nSlot), sal_False, &pItem);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
// Sprache immer von Cursorposition besorgen
|
2001-02-21 16:38:36 +00:00
|
|
|
LanguageType eLang = rSh.GetCurLang();
|
2000-09-18 16:15:01 +00:00
|
|
|
SvNumberFormatter* pFormatter = rSh.GetNumberFormatter();
|
2005-12-14 13:51:56 +00:00
|
|
|
sal_uInt32 nNumberFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
|
2011-01-17 15:06:54 +01:00
|
|
|
sal_uInt16 nFmtType = 0, nOffset = 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
switch ( nSlot )
|
|
|
|
{
|
|
|
|
case FN_NUMBER_FORMAT:
|
|
|
|
if( pItem )
|
|
|
|
{
|
|
|
|
// Index fuer String bestimmen
|
2012-11-27 22:58:50 -06:00
|
|
|
OUString aCode( ((const SfxStringItem*)pItem)->GetValue() );
|
2000-09-18 16:15:01 +00:00
|
|
|
nNumberFormat = pFormatter->GetEntryKey( aCode, eLang );
|
|
|
|
if( NUMBERFORMAT_ENTRY_NOT_FOUND == nNumberFormat )
|
|
|
|
{
|
|
|
|
// neu eintragen
|
2012-11-27 22:58:50 -06:00
|
|
|
sal_Int32 nErrPos;
|
2000-09-18 16:15:01 +00:00
|
|
|
short nType;
|
|
|
|
if( !pFormatter->PutEntry( aCode, nErrPos, nType,
|
|
|
|
nNumberFormat, eLang ))
|
|
|
|
nNumberFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FN_NUMBER_STANDARD: nFmtType = NUMBERFORMAT_NUMBER; break;
|
|
|
|
case FN_NUMBER_SCIENTIFIC: nFmtType = NUMBERFORMAT_SCIENTIFIC; break;
|
|
|
|
case FN_NUMBER_DATE: nFmtType = NUMBERFORMAT_DATE; break;
|
|
|
|
case FN_NUMBER_TIME: nFmtType = NUMBERFORMAT_TIME; break;
|
|
|
|
case FN_NUMBER_CURRENCY: nFmtType = NUMBERFORMAT_CURRENCY; break;
|
|
|
|
case FN_NUMBER_PERCENT: nFmtType = NUMBERFORMAT_PERCENT; break;
|
|
|
|
|
|
|
|
case FN_NUMBER_TWODEC: // #.##0,00
|
|
|
|
nFmtType = NUMBERFORMAT_NUMBER;
|
|
|
|
nOffset = NF_NUMBER_1000DEC2;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2011-03-12 11:51:35 +01:00
|
|
|
OSL_FAIL("wrong dispatcher");
|
2000-09-18 16:15:01 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( nFmtType )
|
|
|
|
nNumberFormat = pFormatter->GetStandardFormat( nFmtType, eLang ) + nOffset;
|
|
|
|
|
|
|
|
if( NUMBERFORMAT_ENTRY_NOT_FOUND != nNumberFormat )
|
|
|
|
{
|
2001-02-21 16:38:36 +00:00
|
|
|
SfxItemSet aBoxSet( GetPool(), RES_BOXATR_FORMAT, RES_BOXATR_FORMAT );
|
2000-09-18 16:15:01 +00:00
|
|
|
aBoxSet.Put( SwTblBoxNumFormat( nNumberFormat ));
|
|
|
|
rSh.SetTblBoxFormulaAttrs( aBoxSet );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2010-10-14 08:30:41 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|