Files
libreoffice/sw/source/ui/shells/frmsh.cxx
Release Engineers 65f02b557c 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

1090 lines
43 KiB
C++

/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* Copyright 2008 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: frmsh.cxx,v $
* $Revision: 1.22.190.1 $
*
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#include <hintids.hxx>
#include <svtools/whiter.hxx>
#include <svtools/imapobj.hxx>
#include <svx/srchitem.hxx>
#include <svtools/imap.hxx>
#include <sfx2/viewfrm.hxx>
#include <basic/sbstar.hxx>
#include <svtools/rectitem.hxx>
#include <svtools/ptitem.hxx>
#include <svtools/stritem.hxx>
#include <svx/colritem.hxx>
#include <svx/bolnitem.hxx>
#include <svx/boxitem.hxx>
#include <svx/protitem.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/request.hxx>
#include <sfx2/objface.hxx>
#include <svx/hlnkitem.hxx>
#include <fmturl.hxx>
#include <fmtclds.hxx>
#include <fmtcnct.hxx>
#include <swmodule.hxx>
#include <wrtsh.hxx>
#include <wview.hxx>
#include <frmatr.hxx>
#include <uitool.hxx>
#include <frmfmt.hxx>
#include <frmsh.hxx>
#include <frmmgr.hxx>
#include <frmdlg.hxx>
#include <swevent.hxx>
#include <usrpref.hxx>
#include <edtwin.hxx>
#include <swdtflvr.hxx>
#include <swwait.hxx>
#include <docstat.hxx>
#include <IDocumentStatistics.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <helpid.h>
#include <cmdid.h>
#include <globals.hrc>
#include <popup.hrc>
#include <shells.hrc>
#include "swabstdlg.hxx"
#include "misc.hrc"
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
// Prototypen ------------------------------------------------------------
void lcl_FrmGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine);
const SwFrmFmt* lcl_GetFrmFmtByName(SwWrtShell& rSh, const String& rName)
{
sal_uInt16 nCount = rSh.GetFlyCount(FLYCNTTYPE_FRM);
for( sal_uInt16 i = 0; i < nCount; i++)
{
const SwFrmFmt* pFmt = rSh.GetFlyNum(i, FLYCNTTYPE_FRM);
if(pFmt->GetName() == rName)
return pFmt;
}
return 0;
}
#define SwFrameShell
#include <sfx2/msg.hxx>
#include "swslots.hxx"
SFX_IMPL_INTERFACE(SwFrameShell, SwBaseShell, SW_RES(STR_SHELLNAME_FRAME))
{
SFX_POPUPMENU_REGISTRATION(SW_RES(MN_FRM_POPUPMENU));
SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_FRAME_TOOLBOX));
}
void SwFrameShell::Execute(SfxRequest &rReq)
{
//Erstmal die, die keinen FrmMgr benoetigen.
SwWrtShell &rSh = GetShell();
BOOL bMore = FALSE;
const SfxItemSet* pArgs = rReq.GetArgs();
const SfxPoolItem* pItem;
USHORT nSlot = rReq.GetSlot();
switch ( nSlot )
{
case FN_FRAME_TO_ANCHOR:
if ( rSh.IsFrmSelected() )
{
rSh.GotoFlyAnchor();
rSh.EnterStdMode();
rSh.CallChgLnk();
}
break;
case SID_FRAME_TO_TOP:
rSh.SelectionToTop();
break;
case SID_FRAME_TO_BOTTOM:
rSh.SelectionToBottom();
break;
case FN_FRAME_UP:
rSh.SelectionToTop( FALSE );
break;
case FN_FRAME_DOWN:
rSh.SelectionToBottom( FALSE );
break;
case FN_INSERT_FRAME:
if (!pArgs)
{
// Rahmen existiert bereits, Rahmendialog zur Bearbeitung oeffnen
SfxUInt16Item aDefPage(FN_FORMAT_FRAME_DLG, TP_COLUMN);
rSh.GetView().GetViewFrame()->GetDispatcher()->Execute( FN_FORMAT_FRAME_DLG,
SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD,
&aDefPage, 0L );
}
else
{
// Rahmen existiert bereits, nur Spaltenanzahl wird geaendert
USHORT nCols = 1;
if(pArgs->GetItemState(SID_ATTR_COLUMNS, FALSE, &pItem) == SFX_ITEM_SET)
nCols = ((SfxUInt16Item *)pItem)->GetValue();
SfxItemSet aSet(GetPool(),RES_COL,RES_COL);
rSh.GetFlyFrmAttr( aSet );
SwFmtCol aCol((const SwFmtCol&)aSet.Get(RES_COL));
// GutterWidth wird nicht immer uebergeben, daher erst besorgen (siehe view2: Execute auf diesen Slot)
USHORT nGutterWidth = aCol.GetGutterWidth();
if(!nCols )
nCols++;
aCol.Init(nCols, nGutterWidth, aCol.GetWishWidth());
aSet.Put(aCol);
// Vorlagen-AutoUpdate
SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
if(pFmt && pFmt->IsAutoUpdateFmt())
{
rSh.AutoUpdateFrame(pFmt, aSet);
}
else
{
rSh.StartAllAction();
rSh.SetFlyFrmAttr( aSet );
rSh.SetModified();
rSh.EndAllAction();
}
}
return;
case SID_HYPERLINK_SETLINK:
{
if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(SID_HYPERLINK_SETLINK, FALSE, &pItem))
{
const SvxHyperlinkItem& rHLinkItem = *(const SvxHyperlinkItem *)pItem;
const String& rURL = rHLinkItem.GetURL();
const String& rTarget = rHLinkItem.GetTargetFrame();
SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL );
rSh.GetFlyFrmAttr( aSet );
SwFmtURL aURL( (SwFmtURL&)aSet.Get( RES_URL ) );
String sOldName(rHLinkItem.GetName());
String sFlyName(rSh.GetFlyName());
if (sOldName.ToUpperAscii() != sFlyName.ToUpperAscii())
{
String sName(sOldName);
USHORT i = 1;
while (rSh.FindFlyByName(sName))
{
sName = sOldName;
sName += '_';
sName += String::CreateFromInt32(i++);
}
rSh.SetFlyName(sName);
}
aURL.SetURL( rURL, FALSE );
aURL.SetTargetFrameName(rTarget);
aSet.Put( aURL );
rSh.SetFlyFrmAttr( aSet );
}
}
break;
case FN_FRAME_CHAIN:
rSh.GetView().GetEditWin().SetChainMode( !rSh.GetView().GetEditWin().IsChainMode() );
break;
case FN_FRAME_UNCHAIN:
rSh.Unchain( (SwFrmFmt&)*rSh.GetFlyFrmFmt() );
GetView().GetViewFrame()->GetBindings().Invalidate(FN_FRAME_CHAIN);
break;
case FN_FORMAT_FOOTNOTE_DLG:
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "SwAbstractDialogFactory fail!");
VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( GetView().GetWindow(), GetView().GetWrtShell(), DLG_DOC_FOOTNOTE );
DBG_ASSERT(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
break;
}
case FN_NUMBERING_OUTLINE_DLG:
{
SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
GetView().GetWindow(), &aTmp, GetView().GetWrtShell());
DBG_ASSERT(pDlg, "Dialogdiet fail!");
pDlg->Execute();
delete pDlg;
rReq.Done();
break;
}
case SID_OPEN_XML_FILTERSETTINGS:
{
try
{
uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString::createFromAscii("com.sun.star.comp.ui.XSLTFilterDialog")), uno::UNO_QUERY);
if( xDialog.is() )
{
xDialog->execute();
}
}
catch( uno::Exception& )
{
}
rReq.Ignore ();
}
break;
case FN_WORDCOUNT_DIALOG:
{
SwDocStat aCurr;
SwDocStat aDocStat( rSh.getIDocumentStatistics()->GetDocStat() );
{
SwWait aWait( *GetView().GetDocShell(), TRUE );
rSh.StartAction();
rSh.CountWords( aCurr );
rSh.UpdateDocStat( aDocStat );
rSh.EndAction();
}
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
AbstractSwWordCountDialog* pDialog = pFact->CreateSwWordCountDialog( GetView().GetWindow() );
pDialog->SetValues(aCurr, aDocStat );
pDialog->Execute();
delete pDialog;
}
break;
default: bMore = TRUE;
}
if ( !bMore )
{
return;
}
SwFlyFrmAttrMgr aMgr( FALSE, &rSh, FRMMGR_TYPE_NONE );
BOOL bUpdateMgr = TRUE;
BOOL bCopyToFmt = FALSE;
switch ( nSlot )
{
case SID_OBJECT_ALIGN_MIDDLE:
case FN_FRAME_ALIGN_VERT_CENTER:
aMgr.SetVertOrientation( text::VertOrientation::CENTER );
break;
case SID_OBJECT_ALIGN_DOWN :
case FN_FRAME_ALIGN_VERT_BOTTOM:
aMgr.SetVertOrientation( text::VertOrientation::BOTTOM );
break;
case SID_OBJECT_ALIGN_UP :
case FN_FRAME_ALIGN_VERT_TOP:
aMgr.SetVertOrientation( text::VertOrientation::TOP );
break;
case FN_FRAME_ALIGN_VERT_CHAR_CENTER:
aMgr.SetVertOrientation( text::VertOrientation::CHAR_CENTER );
break;
case FN_FRAME_ALIGN_VERT_CHAR_BOTTOM:
aMgr.SetVertOrientation( text::VertOrientation::CHAR_BOTTOM );
break;
case FN_FRAME_ALIGN_VERT_CHAR_TOP:
aMgr.SetVertOrientation( text::VertOrientation::CHAR_TOP );
break;
case FN_FRAME_ALIGN_VERT_ROW_CENTER:
aMgr.SetVertOrientation( text::VertOrientation::LINE_CENTER );
break;
case FN_FRAME_ALIGN_VERT_ROW_BOTTOM:
aMgr.SetVertOrientation( text::VertOrientation::LINE_BOTTOM );
break;
case FN_FRAME_ALIGN_VERT_ROW_TOP:
aMgr.SetVertOrientation( text::VertOrientation::LINE_TOP );
break;
case SID_OBJECT_ALIGN_CENTER :
case FN_FRAME_ALIGN_HORZ_CENTER:
aMgr.SetHorzOrientation( text::HoriOrientation::CENTER );
break;
case SID_OBJECT_ALIGN_RIGHT:
case FN_FRAME_ALIGN_HORZ_RIGHT:
aMgr.SetHorzOrientation( text::HoriOrientation::RIGHT );
break;
case SID_OBJECT_ALIGN_LEFT:
case FN_FRAME_ALIGN_HORZ_LEFT:
aMgr.SetHorzOrientation( text::HoriOrientation::LEFT );
break;
case FN_SET_FRM_POSITION:
{
aMgr.SetAbsPos(((SfxPointItem &)pArgs->Get
(FN_SET_FRM_POSITION)).GetValue());
}
break;
case SID_ATTR_BRUSH:
{
if(pArgs)
{
aMgr.SetAttrSet( *pArgs );
bCopyToFmt = TRUE;
}
}
break;
case SID_ATTR_ULSPACE:
case SID_ATTR_LRSPACE:
{
if(pArgs && SFX_ITEM_SET == pArgs->GetItemState(GetPool().GetWhich(nSlot), FALSE, &pItem))
{
aMgr.SetAttrSet( *pArgs );
if(SID_ATTR_ULSPACE == nSlot && SID_ATTR_ULSPACE == nSlot)
bCopyToFmt = TRUE;
}
}
break;
case FN_FORMAT_FRAME_DLG:
{
const int nSel = rSh.GetSelectionType();
if (nSel & nsSelectionType::SEL_GRF)
{
rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(FN_FORMAT_GRAFIC_DLG);
bUpdateMgr = FALSE;
}
else
{
SfxItemSet aSet(GetPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1,
SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
FN_GET_PRINT_AREA, FN_GET_PRINT_AREA,
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
SID_ATTR_BRUSH, SID_ATTR_BRUSH,
SID_ATTR_LRSPACE, SID_ATTR_ULSPACE,
FN_SURROUND, FN_HORI_ORIENT,
FN_SET_FRM_NAME, FN_SET_FRM_NAME,
FN_KEEP_ASPECT_RATIO, FN_KEEP_ASPECT_RATIO,
SID_DOCFRAME, SID_DOCFRAME,
SID_HTML_MODE, SID_HTML_MODE,
FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME,
FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT,
0);
const SwViewOption* pVOpt = rSh.GetViewOptions();
if(nSel & nsSelectionType::SEL_OLE)
{
aSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO,
pVOpt->IsKeepRatio()));
}
aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
if(nSel & nsSelectionType::SEL_OLE)
aSet.Put(SfxStringItem(FN_SET_FRM_ALT_NAME, rSh.GetAlternateText()));
const SwRect &rPg = rSh.GetAnyCurRect(RECT_PAGE);
SwFmtFrmSize aFrmSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height());
aFrmSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
aSet.Put(aFrmSize);
const SwRect &rPr = rSh.GetAnyCurRect(RECT_PAGE_PRT);
SwFmtFrmSize aPrtSize(ATT_VAR_SIZE, rPr.Width(), rPr.Height());
aPrtSize.SetWhich(GetPool().GetWhich(FN_GET_PRINT_AREA));
aSet.Put(aPrtSize);
aSet.Put(aMgr.GetAttrSet());
aSet.SetParent( aMgr.GetAttrSet().GetParent() );
// Bei %-Werten Groesse initialisieren
SwFmtFrmSize& rSize = (SwFmtFrmSize&)aSet.Get(RES_FRM_SIZE);
if (rSize.GetWidthPercent() && rSize.GetWidthPercent() != 0xff)
rSize.SetWidth(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Width());
if (rSize.GetHeightPercent() && rSize.GetHeightPercent() != 0xff)
rSize.SetHeight(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Height());
UINT16 nDefPage = 0;
if(pArgs && pArgs->GetItemState(FN_FORMAT_FRAME_DLG, FALSE, &pItem) == SFX_ITEM_SET)
nDefPage = ((SfxUInt16Item *)pItem)->GetValue();
aSet.Put(SfxFrameItem( SID_DOCFRAME, GetView().GetViewFrame()->GetTopFrame()));
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< UINT16 >(eMetric) ));
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
DBG_ASSERT(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateFrmTabDialog( DLG_FRM_STD,
GetView().GetViewFrame(),
GetView().GetWindow(),
aSet, FALSE,
nSel & nsSelectionType::SEL_GRF ? DLG_FRM_GRF :
nSel & nsSelectionType::SEL_OLE ? DLG_FRM_OLE :
DLG_FRM_STD,
FALSE,
nDefPage);
DBG_ASSERT(pDlg, "Dialogdiet fail!");
if ( pDlg->Execute() )
{
const SfxItemSet* pOutSet = pDlg->GetOutputItemSet();
if(pOutSet)
{
rReq.Done(*pOutSet);
if(nSel & nsSelectionType::SEL_OLE &&
SFX_ITEM_SET == pOutSet->GetItemState(FN_KEEP_ASPECT_RATIO, TRUE, &pItem))
{
SwViewOption aUsrPref( *pVOpt );
aUsrPref.SetKeepRatio(((const SfxBoolItem*)pItem)->GetValue());
SW_MOD()->ApplyUsrPref(aUsrPref, &GetView());
}
if (SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_ALT_NAME, TRUE, &pItem))
{
rSh.SetAlternateText(((const SfxStringItem*)pItem)->GetValue());
}
// Vorlagen-AutoUpdate
SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
if(pFmt && pFmt->IsAutoUpdateFmt())
{
rSh.AutoUpdateFrame(pFmt, *pOutSet);
// alles, dass das Format nicht kann, muss hart
// gesetzt werden
if(SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_NAME, FALSE, &pItem))
rSh.SetFlyName(((SfxStringItem*)pItem)->GetValue());
SfxItemSet aShellSet(GetPool(), RES_FRM_SIZE, RES_FRM_SIZE,
RES_SURROUND, RES_SURROUND,
RES_ANCHOR, RES_ANCHOR,
RES_VERT_ORIENT,RES_HORI_ORIENT,
0);
aShellSet.Put(*pOutSet);
aMgr.SetAttrSet(aShellSet);
if(SFX_ITEM_SET == pOutSet->GetItemState(FN_SET_FRM_NAME, FALSE, &pItem))
rSh.SetFlyName(((SfxStringItem*)pItem)->GetValue());
}
else
aMgr.SetAttrSet( *pOutSet );
const SwFrmFmt* pCurrFlyFmt = rSh.GetFlyFrmFmt();
if(SFX_ITEM_SET ==
pOutSet->GetItemState(FN_PARAM_CHAIN_PREVIOUS,
FALSE, &pItem))
{
rSh.HideChainMarker();
String sPrevName =
((const SfxStringItem*)pItem)->GetValue();
const SwFmtChain &rChain = pCurrFlyFmt->GetChain();
//needs cast - no non-const method available
SwFlyFrmFmt* pFlyFmt =
(SwFlyFrmFmt*)rChain.GetPrev();
if(pFlyFmt)
{
if (pFlyFmt->GetName() != sPrevName)
{
rSh.Unchain(*pFlyFmt);
}
else
sPrevName.Erase();
}
if(sPrevName.Len())
{
//needs cast - no non-const method available
SwFrmFmt* pPrevFmt = (SwFrmFmt*)
lcl_GetFrmFmtByName(rSh, sPrevName);
DBG_ASSERT(pPrevFmt, "No frame found!");
if(pPrevFmt)
{
rSh.Chain(*pPrevFmt, *pCurrFlyFmt);
}
}
rSh.SetChainMarker();
}
if(SFX_ITEM_SET ==
pOutSet->GetItemState(FN_PARAM_CHAIN_NEXT, FALSE,
&pItem))
{
rSh.HideChainMarker();
String sNextName =
((const SfxStringItem*)pItem)->GetValue();
const SwFmtChain &rChain = pCurrFlyFmt->GetChain();
//needs cast - no non-const method available
SwFlyFrmFmt* pFlyFmt =
(SwFlyFrmFmt*)rChain.GetNext();
if(pFlyFmt)
{
if (pFlyFmt->GetName() != sNextName)
{
rSh.Unchain(*((SwFlyFrmFmt*) pCurrFlyFmt));
}
else
sNextName.Erase();
}
if(sNextName.Len())
{
//needs cast - no non-const method available
SwFrmFmt* pNextFmt = (SwFrmFmt*)
lcl_GetFrmFmtByName(rSh, sNextName);
DBG_ASSERT(pNextFmt, "No frame found!");
if(pNextFmt)
{
rSh.Chain(*(SwFrmFmt*)
pCurrFlyFmt, *pNextFmt);
}
}
rSh.SetChainMarker();
}
}
}
else
bUpdateMgr = FALSE;
delete pDlg;
}
}
break;
case FN_FRAME_MIRROR_ON_EVEN_PAGES:
{
SwFmtHoriOrient aHori(aMgr.GetHoriOrient());
BOOL bMirror = !aHori.IsPosToggle();
aHori.SetPosToggle(bMirror);
SfxItemSet aSet(GetPool(), RES_HORI_ORIENT, RES_HORI_ORIENT);
aSet.Put(aHori);
aMgr.SetAttrSet(aSet);
bCopyToFmt = TRUE;
rReq.SetReturnValue(SfxBoolItem(nSlot, bMirror));
}
break;
default:
ASSERT( !this, "falscher Dispatcher" );
return;
}
// Vorlagen-AutoUpdate
SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
if ( bUpdateMgr )
{
if(bCopyToFmt && pFmt && pFmt->IsAutoUpdateFmt())
{
rSh.AutoUpdateFrame(pFmt, aMgr.GetAttrSet());
}
else
aMgr.UpdateFlyFrm();
}
}
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
void SwFrameShell::GetState(SfxItemSet& rSet)
{
SwWrtShell &rSh = GetShell();
BOOL bHtmlMode = 0 != ::GetHtmlMode(rSh.GetView().GetDocShell());
if (rSh.IsFrmSelected())
{
SfxItemSet aSet( rSh.GetAttrPool(),
RES_LR_SPACE, RES_UL_SPACE,
RES_PROTECT, RES_HORI_ORIENT,
RES_OPAQUE, RES_OPAQUE,
RES_PRINT, RES_OPAQUE,
0 );
rSh.GetFlyFrmAttr( aSet );
BOOL bProtect = rSh.IsSelObjProtected(FLYPROTECT_POS);
BOOL bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0;
bProtect |= bParentCntProt;
const USHORT eFrmType = rSh.GetFrmType(0,TRUE);
SwFlyFrmAttrMgr aMgr( FALSE, &rSh, FRMMGR_TYPE_NONE );
SfxWhichIter aIter( rSet );
USHORT nWhich = aIter.FirstWhich();
while ( nWhich )
{
switch ( nWhich )
{
case RES_FRM_SIZE:
{
SwFmtFrmSize aSz(aMgr.GetFrmSize());
rSet.Put(aSz);
}
break;
case RES_VERT_ORIENT:
case RES_HORI_ORIENT:
case SID_ATTR_ULSPACE:
case SID_ATTR_LRSPACE:
case RES_LR_SPACE:
case RES_UL_SPACE:
case RES_PROTECT:
case RES_OPAQUE:
case RES_PRINT:
case RES_SURROUND:
{
rSet.Put(aSet.Get(GetPool().GetWhich(nWhich), TRUE ));
}
break;
case SID_OBJECT_ALIGN_LEFT :
case SID_OBJECT_ALIGN_CENTER :
case SID_OBJECT_ALIGN_RIGHT :
case FN_FRAME_ALIGN_HORZ_CENTER:
case FN_FRAME_ALIGN_HORZ_RIGHT:
case FN_FRAME_ALIGN_HORZ_LEFT:
if ( (eFrmType & FRMTYPE_FLY_INCNT) ||
bProtect ||
(nWhich == FN_FRAME_ALIGN_HORZ_CENTER || nWhich == SID_OBJECT_ALIGN_CENTER)&& bHtmlMode )
rSet.DisableItem( nWhich );
break;
case FN_FRAME_ALIGN_VERT_ROW_TOP:
case FN_FRAME_ALIGN_VERT_ROW_CENTER:
case FN_FRAME_ALIGN_VERT_ROW_BOTTOM:
case FN_FRAME_ALIGN_VERT_CHAR_TOP:
case FN_FRAME_ALIGN_VERT_CHAR_CENTER:
case FN_FRAME_ALIGN_VERT_CHAR_BOTTOM:
if ( !(eFrmType & FRMTYPE_FLY_INCNT) || bProtect
|| bHtmlMode && FN_FRAME_ALIGN_VERT_CHAR_BOTTOM == nWhich )
rSet.DisableItem( nWhich );
break;
case SID_OBJECT_ALIGN_UP :
case SID_OBJECT_ALIGN_MIDDLE :
case SID_OBJECT_ALIGN_DOWN :
case FN_FRAME_ALIGN_VERT_TOP:
case FN_FRAME_ALIGN_VERT_CENTER:
case FN_FRAME_ALIGN_VERT_BOTTOM:
if ( bProtect || bHtmlMode && eFrmType & FRMTYPE_FLY_ATCNT)
rSet.DisableItem( nWhich );
else
{
USHORT nId = 0;
if (eFrmType & FRMTYPE_FLY_INCNT)
{
switch (nWhich)
{
case SID_OBJECT_ALIGN_UP :
case FN_FRAME_ALIGN_VERT_TOP:
nId = STR_TOP_BASE; break;
case SID_OBJECT_ALIGN_MIDDLE :
case FN_FRAME_ALIGN_VERT_CENTER:
nId = STR_CENTER_BASE; break;
case SID_OBJECT_ALIGN_DOWN :
case FN_FRAME_ALIGN_VERT_BOTTOM:
if(!bHtmlMode)
nId = STR_BOTTOM_BASE;
else
rSet.DisableItem( nWhich );
break;
}
}
else
{
if (nWhich != FN_FRAME_ALIGN_VERT_TOP &&
nWhich != SID_OBJECT_ALIGN_UP )
{
if (aMgr.GetAnchor() == FLY_AT_FLY)
{
const SwFrmFmt* pFmt = rSh.IsFlyInFly();
if (pFmt)
{
const SwFmtFrmSize& rFrmSz = pFmt->GetFrmSize();
if (rFrmSz.GetHeightSizeType() != ATT_FIX_SIZE)
{
rSet.DisableItem( nWhich );
break;
}
}
}
}
switch (nWhich)
{
case SID_OBJECT_ALIGN_UP :
case FN_FRAME_ALIGN_VERT_TOP:
nId = STR_TOP; break;
case SID_OBJECT_ALIGN_MIDDLE:
case FN_FRAME_ALIGN_VERT_CENTER:
nId = STR_CENTER_VERT; break;
case SID_OBJECT_ALIGN_DOWN:
case FN_FRAME_ALIGN_VERT_BOTTOM:
nId = STR_BOTTOM; break;
}
}
if ( nId )
rSet.Put( SfxStringItem( nWhich, SW_RES(nId) ));
}
break;
case SID_HYPERLINK_GETLINK:
{
String sURL;
SvxHyperlinkItem aHLinkItem;
const SfxPoolItem* pItem;
SfxItemSet aURLSet(GetPool(), RES_URL, RES_URL);
rSh.GetFlyFrmAttr( aURLSet );
if(SFX_ITEM_SET == aURLSet.GetItemState(RES_URL, TRUE, &pItem))
{
const SwFmtURL* pFmtURL = (const SwFmtURL*)pItem;
aHLinkItem.SetURL(pFmtURL->GetURL());
aHLinkItem.SetTargetFrame(pFmtURL->GetTargetFrameName());
aHLinkItem.SetName(rSh.GetFlyName());
}
aHLinkItem.SetInsertMode((SvxLinkInsertMode)(aHLinkItem.GetInsertMode() |
(bHtmlMode ? HLINK_HTMLMODE : 0)));
rSet.Put(aHLinkItem);
}
break;
case FN_FRAME_CHAIN:
{
const int nSel = rSh.GetSelectionType();
if (nSel & nsSelectionType::SEL_GRF || nSel & nsSelectionType::SEL_OLE)
rSet.DisableItem( FN_FRAME_CHAIN );
else
{
const SwFrmFmt *pFmt = rSh.GetFlyFrmFmt();
if ( bParentCntProt || rSh.GetView().GetEditWin().GetApplyTemplate() ||
!pFmt || pFmt->GetChain().GetNext() )
{
rSet.DisableItem( FN_FRAME_CHAIN );
}
else
{
BOOL bChainMode = rSh.GetView().GetEditWin().IsChainMode();
rSet.Put( SfxBoolItem( FN_FRAME_CHAIN, bChainMode ) );
}
}
}
break;
case FN_FRAME_UNCHAIN:
{
const int nSel = rSh.GetSelectionType();
if (nSel & nsSelectionType::SEL_GRF || nSel & nsSelectionType::SEL_OLE)
rSet.DisableItem( FN_FRAME_UNCHAIN );
else
{
const SwFrmFmt *pFmt = rSh.GetFlyFrmFmt();
if ( bParentCntProt || rSh.GetView().GetEditWin().GetApplyTemplate() ||
!pFmt || !pFmt->GetChain().GetNext() )
{
rSet.DisableItem( FN_FRAME_UNCHAIN );
}
}
}
break;
case SID_FRAME_TO_TOP:
case SID_FRAME_TO_BOTTOM:
case FN_FRAME_UP:
case FN_FRAME_DOWN:
if ( bParentCntProt )
rSet.DisableItem( nWhich );
break;
case FN_FORMAT_FRAME_DLG:
{
const int nSel = rSh.GetSelectionType();
if ( bParentCntProt || nSel & nsSelectionType::SEL_GRF)
rSet.DisableItem( nWhich );
}
break;
default:
/* do nothing */;
break;
}
nWhich = aIter.NextWhich();
}
}
}
/*--------------------------------------------------------------------
Beschreibung: Ctor fuer FrameShell
--------------------------------------------------------------------*/
SwFrameShell::SwFrameShell(SwView &_rView) :
SwBaseShell( _rView )
{
SetName(String::CreateFromAscii("Frame"));
SetHelpId(SW_FRAMESHELL);
/* #96392# Use this to announce it is the frame shell who creates the
selection. */
SwTransferable::CreateSelection( _rView.GetWrtShell(), (ViewShell *) this );
}
SwFrameShell::~SwFrameShell()
{
/* #96392# Only clear the selection if it was this frame shell who created
it. */
SwTransferable::ClearSelection( GetShell(), (ViewShell *) this );
}
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
void SwFrameShell::ExecFrameStyle(SfxRequest& rReq)
{
SwWrtShell &rSh = GetShell();
BOOL bDefault = FALSE;
if (!rSh.IsFrmSelected())
return;
// Erst Default-BoxItem aus Pool holen. Wenn ungleich normalem Boxitem,
// dann ist es bereits geaendert worden (neues ist kein Default).
const SvxBoxItem* pPoolBoxItem = (const SvxBoxItem*)::GetDfltAttr(RES_BOX);
const SfxItemSet *pArgs = rReq.GetArgs();
SfxItemSet aFrameSet(rSh.GetAttrPool(), RES_BOX, RES_BOX);
rSh.GetFlyFrmAttr( aFrameSet );
const SvxBoxItem& rBoxItem = (const SvxBoxItem&)aFrameSet.Get(RES_BOX);
if (pPoolBoxItem == &rBoxItem)
bDefault = TRUE;
SvxBoxItem aBoxItem(rBoxItem);
SvxBorderLine aBorderLine;
const SfxPoolItem *pItem = 0;
if(pArgs) //irgendein Controller kann auch mal nichts liefern #48169#
{
switch (rReq.GetSlot())
{
case SID_ATTR_BORDER:
{
if (pArgs->GetItemState(RES_BOX, TRUE, &pItem) == SFX_ITEM_SET)
{
SvxBoxItem aNewBox(*((SvxBoxItem *)pItem));
const SvxBorderLine* pBorderLine;
if ((pBorderLine = aBoxItem.GetTop()) != NULL)
lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine);
if ((pBorderLine = aBoxItem.GetBottom()) != NULL)
lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine);
if ((pBorderLine = aBoxItem.GetLeft()) != NULL)
lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine);
if ((pBorderLine = aBoxItem.GetRight()) != NULL)
lcl_FrmGetMaxLineWidth(pBorderLine, aBorderLine);
if(aBorderLine.GetOutWidth() == 0)
{
aBorderLine.SetInWidth(0);
aBorderLine.SetOutWidth(DEF_LINE_WIDTH_0);
aBorderLine.SetDistance(0);
}
//Distance nur setzen, wenn der Request vom Controller kommt
if(!StarBASIC::IsRunning())
{
aNewBox.SetDistance( rBoxItem.GetDistance() );
}
aBoxItem = aNewBox;
SvxBorderLine aDestBorderLine;
if ((pBorderLine = aBoxItem.GetTop()) != NULL)
aBoxItem.SetLine(&aBorderLine, BOX_LINE_TOP);
if ((pBorderLine = aBoxItem.GetBottom()) != NULL)
aBoxItem.SetLine(&aBorderLine, BOX_LINE_BOTTOM);
if ((pBorderLine = aBoxItem.GetLeft()) != NULL)
aBoxItem.SetLine(&aBorderLine, BOX_LINE_LEFT);
if ((pBorderLine = aBoxItem.GetRight()) != NULL)
aBoxItem.SetLine(&aBorderLine, BOX_LINE_RIGHT);
}
}
break;
case SID_FRAME_LINESTYLE:
{
if (pArgs->GetItemState(SID_FRAME_LINESTYLE, FALSE, &pItem) == SFX_ITEM_SET)
{
const SvxLineItem* pLineItem =
(const SvxLineItem*)pItem;
if ( pLineItem->GetLine() )
{
aBorderLine = *(pLineItem->GetLine());
if (!aBoxItem.GetTop() && !aBoxItem.GetBottom() &&
!aBoxItem.GetLeft() && !aBoxItem.GetRight())
{
aBoxItem.SetLine(&aBorderLine, BOX_LINE_TOP);
aBoxItem.SetLine(&aBorderLine, BOX_LINE_BOTTOM);
aBoxItem.SetLine(&aBorderLine, BOX_LINE_LEFT);
aBoxItem.SetLine(&aBorderLine, BOX_LINE_RIGHT);
}
else
{
if( aBoxItem.GetTop() )
{
aBorderLine.SetColor( aBoxItem.GetTop()->GetColor() );
aBoxItem.SetLine(&aBorderLine, BOX_LINE_TOP);
}
if( aBoxItem.GetBottom() )
{
aBorderLine.SetColor( aBoxItem.GetBottom()->GetColor());
aBoxItem.SetLine(&aBorderLine, BOX_LINE_BOTTOM);
}
if( aBoxItem.GetLeft() )
{
aBorderLine.SetColor( aBoxItem.GetLeft()->GetColor());
aBoxItem.SetLine(&aBorderLine, BOX_LINE_LEFT);
}
if( aBoxItem.GetRight() )
{
aBorderLine.SetColor(aBoxItem.GetRight()->GetColor());
aBoxItem.SetLine(&aBorderLine, BOX_LINE_RIGHT);
}
}
}
else
{
aBoxItem.SetLine(0, BOX_LINE_TOP);
aBoxItem.SetLine(0, BOX_LINE_BOTTOM);
aBoxItem.SetLine(0, BOX_LINE_LEFT);
aBoxItem.SetLine(0, BOX_LINE_RIGHT);
}
}
}
break;
case SID_FRAME_LINECOLOR:
{
if (pArgs->GetItemState(SID_FRAME_LINECOLOR, FALSE, &pItem) == SFX_ITEM_SET)
{
const Color& rNewColor = ((const SvxColorItem*)pItem)->GetValue();
if (!aBoxItem.GetTop() && !aBoxItem.GetBottom() &&
!aBoxItem.GetLeft() && !aBoxItem.GetRight())
{
aBorderLine.SetColor( rNewColor );
aBoxItem.SetLine(&aBorderLine, BOX_LINE_TOP);
aBoxItem.SetLine(&aBorderLine, BOX_LINE_BOTTOM);
aBoxItem.SetLine(&aBorderLine, BOX_LINE_LEFT);
aBoxItem.SetLine(&aBorderLine, BOX_LINE_RIGHT);
}
else
{
if ( aBoxItem.GetTop() )
((SvxBorderLine*)aBoxItem.GetTop())->SetColor( rNewColor );
if ( aBoxItem.GetBottom() )
((SvxBorderLine*)aBoxItem.GetBottom())->SetColor( rNewColor );
if ( aBoxItem.GetLeft() )
((SvxBorderLine*)aBoxItem.GetLeft())->SetColor( rNewColor );
if ( aBoxItem.GetRight() )
((SvxBorderLine*)aBoxItem.GetRight())->SetColor( rNewColor );
}
}
}
break;
}
}
if (bDefault && (aBoxItem.GetTop() || aBoxItem.GetBottom() ||
aBoxItem.GetLeft() || aBoxItem.GetRight()))
{
aBoxItem.SetDistance(MIN_BORDER_DIST);
}
aFrameSet.Put( aBoxItem );
// Vorlagen-AutoUpdate
SwFrmFmt* pFmt = rSh.GetCurFrmFmt();
if(pFmt && pFmt->IsAutoUpdateFmt())
{
rSh.AutoUpdateFrame(pFmt, aFrameSet);
}
else
rSh.SetFlyFrmAttr( aFrameSet );
}
void lcl_FrmGetMaxLineWidth(const SvxBorderLine* pBorderLine, SvxBorderLine& rBorderLine)
{
if(pBorderLine->GetInWidth() > rBorderLine.GetInWidth())
rBorderLine.SetInWidth(pBorderLine->GetInWidth());
if(pBorderLine->GetOutWidth() > rBorderLine.GetOutWidth())
rBorderLine.SetOutWidth(pBorderLine->GetOutWidth());
if(pBorderLine->GetDistance() > rBorderLine.GetDistance())
rBorderLine.SetDistance(pBorderLine->GetDistance());
rBorderLine.SetColor(pBorderLine->GetColor());
}
void SwFrameShell::GetLineStyleState(SfxItemSet &rSet)
{
SwWrtShell &rSh = GetShell();
BOOL bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0;
if (bParentCntProt)
{
if (rSh.IsFrmSelected())
rSet.DisableItem( SID_FRAME_LINECOLOR );
rSet.DisableItem( SID_ATTR_BORDER );
rSet.DisableItem( SID_FRAME_LINESTYLE );
}
else
{
if (rSh.IsFrmSelected())
{
SfxItemSet aFrameSet( rSh.GetAttrPool(), RES_BOX, RES_BOX );
rSh.GetFlyFrmAttr(aFrameSet);
const SvxBorderLine* pLine = ((const SvxBoxItem&)aFrameSet.Get(RES_BOX)).GetTop();
rSet.Put(SvxColorItem(pLine ? pLine->GetColor() : Color(), SID_FRAME_LINECOLOR));
}
}
}
void SwFrameShell::StateInsert(SfxItemSet &rSet)
{
const int nSel = GetShell().GetSelectionType();
if ((nSel & nsSelectionType::SEL_GRF) || (nSel & nsSelectionType::SEL_OLE))
rSet.DisableItem(FN_INSERT_FRAME);
}