diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2009-08-27 11:59:20 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2009-08-27 11:59:20 +0000 |
commit | 4c7492c2573bf5845dab9b45bdcae18b10ffb8b9 (patch) | |
tree | 29aea9f8b9e78a19b23afbbe2fedf7cb8ba0b9f5 /xmloff | |
parent | 6b8e9fa1c8e2345fd372d77f5e869e037be1fd18 (diff) |
CWS-TOOLING: integrate CWS sw32a11y01
2009-08-27 10:11:46 +0200 hde r275457 : new testcase i103265
2009-08-27 08:24:31 +0200 hde r275454 : new testcase i103265
2009-08-27 08:23:05 +0200 hde r275453 : new document for testcase i103265
2009-08-26 13:43:33 +0200 hde r275421 : added new autotest
2009-08-26 13:36:28 +0200 hde r275420 : added new autotest
2009-08-18 15:41:18 +0200 od r275113 : #i104300# method <SwEditWin::RequestHelp(..)>
- improve help tip for hyperlinks to cross-reference bookmarks.
2009-08-10 15:18:41 +0200 od r274816 : #i73249# method <SwFrameShell::Execute(..)>
- no update of fly frame manager on dialog "Title and Description"
2009-08-10 14:24:15 +0200 od r274813 : #i92125# correction of end of file - missing newline end
2009-08-10 14:10:14 +0200 od r274811 : #i92125# correction of end of file - newline missing
2009-08-10 14:00:30 +0200 od r274808 : #i92125# - correct end of file - new line missing
2009-08-10 09:12:30 +0200 od r274794 : CWS-TOOLING: rebase CWS sw32a11y01 to trunk@274622 (milestone: DEV300:m54)
2009-08-07 15:52:59 +0200 od r274775 : #i73249# minor adjustment due to compiler warning
2009-08-07 15:40:38 +0200 od r274774 : #i92125# method <MarkManager::deleteMarks(..)>
- do not delete cross-reference bookmark, if deletion occurs inside a certain node
2009-08-06 12:53:05 +0200 od r274717 : #i92125# method <MarkManager::deleteMarks(..)
- no move of position for cross-reference bookmark, if move occurs inside certain node.
2009-08-06 12:50:27 +0200 od r274716 : #i92125# method <SwUndoSaveCntnt::DelCntntIndex(..)>
- keep cross-reference bookmarks, if deletion occurs inside a certain node.
2009-08-06 09:53:29 +0200 od r274705 : #i103265# method <SwTOXPara::GetURL()>
- For outline and template entries create link to bookmark.
The bookmark of type CROSSREF_HEADING_BOOKMARK is created, if needed
2009-07-22 13:57:04 +0200 od r274236 : #i73249# adjustment for export of svg:title and svg:description
2009-07-22 13:51:58 +0200 od r274234 : #i73249# adjust and enhance import/export of svg:title and svg:description
for Writer's text frames, graphics and embedded objects
2009-07-21 10:26:27 +0200 od r274168 : #i73249# implement support for attributes Title and Description for
text frames, graphics and embedded objects in Writer
- core, UNO-API, undo/redo and UI
2009-07-21 10:05:15 +0200 od r274164 : #i73249# new optional properties Title and Description as basis frame properties in text documents
2009-07-13 12:19:54 +0200 od r273928 : #i73249# Implementation of Undo/Redo of drawing object's name, title and description
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/txtparae.hxx | 16 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 132 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.hxx | 5 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 44 |
4 files changed, 152 insertions, 45 deletions
diff --git a/xmloff/inc/xmloff/txtparae.hxx b/xmloff/inc/xmloff/txtparae.hxx index 00a014a9f8..d8ee1a3846 100644 --- a/xmloff/inc/xmloff/txtparae.hxx +++ b/xmloff/inc/xmloff/txtparae.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -123,7 +123,11 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport protected: const ::rtl::OUString sActualSize; - const ::rtl::OUString sAlternativeText; + // --> OD 2009-07-22 #i73249# +// const ::rtl::OUString sAlternativeText; + const ::rtl::OUString sTitle; + const ::rtl::OUString sDescription; + // <-- const ::rtl::OUString sAnchorCharStyleName; const ::rtl::OUString sAnchorPageNo; const ::rtl::OUString sAnchorType; @@ -605,8 +609,12 @@ public: virtual void exportTextAutoStyles(); void exportEvents( const ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > & rPropSet ); - void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet, - const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo ); + // --> OD 2009-07-22 #i73249# +// void exportAlternativeText( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet, +// const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo ); + void exportTitleAndDescription( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet, + const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo ); + // <-- // This method exports the given XText void exportText( diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index c3aaba7e12..2acf8a56cd 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -124,44 +124,45 @@ inline XMLTextFrameContextHyperlink_Impl::XMLTextFrameContextHyperlink_Impl( { } -class XMLTextFrameDescContext_Impl : public SvXMLImportContext +// --> OD 2009-07-22 #i73249# +class XMLTextFrameTitleOrDescContext_Impl : public SvXMLImportContext { - OUString& rDesc; + OUString& mrTitleOrDesc; public: TYPEINFO(); - XMLTextFrameDescContext_Impl( SvXMLImport& rImport, sal_uInt16 nPrfx, - const ::rtl::OUString& rLName, - const ::com::sun::star::uno::Reference< - ::com::sun::star::xml::sax::XAttributeList > & xAttrList, - OUString& rD ); - virtual ~XMLTextFrameDescContext_Impl(); + XMLTextFrameTitleOrDescContext_Impl( SvXMLImport& rImport, + sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + OUString& rTitleOrDesc ); + virtual ~XMLTextFrameTitleOrDescContext_Impl(); virtual void Characters( const OUString& rText ); }; -TYPEINIT1( XMLTextFrameDescContext_Impl, SvXMLImportContext ); +TYPEINIT1( XMLTextFrameTitleOrDescContext_Impl, SvXMLImportContext ); -XMLTextFrameDescContext_Impl::XMLTextFrameDescContext_Impl( +XMLTextFrameTitleOrDescContext_Impl::XMLTextFrameTitleOrDescContext_Impl( SvXMLImport& rImport, - sal_uInt16 nPrfx, const OUString& rLName, - const Reference< XAttributeList > &, - OUString& rD ) : - SvXMLImportContext( rImport, nPrfx, rLName ), - rDesc( rD ) + sal_uInt16 nPrfx, + const OUString& rLName, + OUString& rTitleOrDesc ) + : SvXMLImportContext( rImport, nPrfx, rLName ) + , mrTitleOrDesc( rTitleOrDesc ) { } -XMLTextFrameDescContext_Impl::~XMLTextFrameDescContext_Impl() +XMLTextFrameTitleOrDescContext_Impl::~XMLTextFrameTitleOrDescContext_Impl() { } -void XMLTextFrameDescContext_Impl::Characters( const OUString& rText ) +void XMLTextFrameTitleOrDescContext_Impl::Characters( const OUString& rText ) { - rDesc += rText; + mrTitleOrDesc += rText; } +// <-- // ------------------------------------------------------------------------ @@ -385,7 +386,11 @@ class XMLTextFrameContext_Impl : public SvXMLImportContext const ::rtl::OUString sAnchorPageNo; const ::rtl::OUString sGraphicURL; const ::rtl::OUString sGraphicFilter; - const ::rtl::OUString sAlternativeText; + // --> OD 2009-07-22 #i73249# +// const ::rtl::OUString sAlternativeText; + const ::rtl::OUString sTitle; + const ::rtl::OUString sDescription; + // <-- const ::rtl::OUString sFrameStyleName; const ::rtl::OUString sGraphicRotation; const ::rtl::OUString sTextBoxServiceName; @@ -461,6 +466,9 @@ public: const ::rtl::OUString& rName, const ::rtl::OUString& rTargetFrameName, sal_Bool bMap ); + // --> OD 2009-07-22 #i73249# + void SetTitle( const ::rtl::OUString& rTitle ); + // <-- void SetDesc( const ::rtl::OUString& rDesc ); ::com::sun::star::text::TextContentAnchorType GetAnchorType() const { return eAnchorType; } @@ -829,7 +837,11 @@ XMLTextFrameContext_Impl::XMLTextFrameContext_Impl( , sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo")) , sGraphicURL(RTL_CONSTASCII_USTRINGPARAM("GraphicURL")) , sGraphicFilter(RTL_CONSTASCII_USTRINGPARAM("GraphicFilter")) -, sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")) +// --> OD 2009-07-22 #i73249# +//, sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")) +, sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")) +, sDescription(RTL_CONSTASCII_USTRINGPARAM("Description")) +// <-- , sFrameStyleName(RTL_CONSTASCII_USTRINGPARAM("FrameStyleName")) , sGraphicRotation(RTL_CONSTASCII_USTRINGPARAM("GraphicRotation")) , sTextBoxServiceName(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFrame")) @@ -1262,18 +1274,31 @@ void XMLTextFrameContext_Impl::SetHyperlink( const OUString& rHRef, } } +// --> OD 2009-07-22 #i73249# +void XMLTextFrameContext_Impl::SetTitle( const OUString& rTitle ) +{ + if ( xPropSet.is() ) + { + Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); + if( xPropSetInfo->hasPropertyByName( sTitle ) ) + { + xPropSet->setPropertyValue( sTitle, makeAny( rTitle ) ); + } + } +} + void XMLTextFrameContext_Impl::SetDesc( const OUString& rDesc ) { if ( xPropSet.is() ) { - Reference< XPropertySetInfo > xPropSetInfo = - xPropSet->getPropertySetInfo(); - if( xPropSetInfo->hasPropertyByName( sAlternativeText ) ) + Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); + if( xPropSetInfo->hasPropertyByName( sDescription ) ) { - xPropSet->setPropertyValue( sAlternativeText, makeAny( rDesc ) ); + xPropSet->setPropertyValue( sDescription, makeAny( rDesc ) ); } } } +// <-- //----------------------------------------------------------------------------------------------------- @@ -1312,6 +1337,10 @@ XMLTextFrameContext::XMLTextFrameContext( : SvXMLImportContext( rImport, nPrfx, rLName ) , m_xAttrList( new SvXMLAttributeList( xAttrList ) ) , m_pHyperlink( 0 ) +// --> OD 2009-07-22 #i73249# +, m_sTitle() +, m_sDesc() +// <-- , m_eDefaultAnchorType( eATyp ) // --> OD 2006-03-10 #i51726# , m_HasAutomaticStyleWithoutParentStyle( sal_False ) @@ -1374,9 +1403,20 @@ void XMLTextFrameContext::EndElement() { pImpl->CreateIfNotThere(); - // alternative text + // --> OD 2009-07-22 #i73249# +// // alternative text +// if( m_sDesc.getLength() ) +// pImpl->SetDesc( m_sDesc ); + // svg:title + if( m_sTitle.getLength() ) + { + pImpl->SetTitle( m_sTitle ); + } if( m_sDesc.getLength() ) + { pImpl->SetDesc( m_sDesc ); + } + // <-- if( m_pHyperlink ) { @@ -1484,7 +1524,7 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( Reference < XPropertySet > xPropSet; if( CreateIfNotThere( xPropSet ) ) { - pContext = new XMLReplacementImageContext( GetImport(), + pContext = new XMLReplacementImageContext( GetImport(), p_nPrefix, rLocalName, xAttrList, xPropSet ); m_xReplImplContext = pContext; } @@ -1494,10 +1534,40 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( // the child is a writer frame if( XML_NAMESPACE_SVG == p_nPrefix ) { - bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion(); - if( IsXMLToken( rLocalName, bOld ? XML_DESC : XML_TITLE ) ) - pContext = new XMLTextFrameDescContext_Impl( GetImport(), p_nPrefix, rLocalName, - xAttrList, m_sDesc ); + // --> OD 2009-07-22 #i73249# +// bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion(); +// if( IsXMLToken( rLocalName, bOld ? XML_DESC : XML_TITLE ) ) +// pContext = new XMLTextFrameDescContext_Impl( GetImport(), p_nPrefix, rLocalName, +// xAttrList, m_sDesc ); + const bool bOld = SvXMLImport::OOo_2x >= GetImport().getGeneratorVersion(); + if ( bOld ) + { + if ( IsXMLToken( rLocalName, XML_DESC ) ) + { + pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(), + p_nPrefix, + rLocalName, + m_sTitle ); + } + } + else + { + if( IsXMLToken( rLocalName, XML_TITLE ) ) + { + pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(), + p_nPrefix, + rLocalName, + m_sTitle ); + } + else if ( IsXMLToken( rLocalName, XML_DESC ) ) + { + pContext = new XMLTextFrameTitleOrDescContext_Impl( GetImport(), + p_nPrefix, + rLocalName, + m_sDesc ); + } + } + // <-- } else if( XML_NAMESPACE_DRAW == p_nPrefix ) { diff --git a/xmloff/source/text/XMLTextFrameContext.hxx b/xmloff/source/text/XMLTextFrameContext.hxx index 39d979a69e..4b3eece040 100644 --- a/xmloff/source/text/XMLTextFrameContext.hxx +++ b/xmloff/source/text/XMLTextFrameContext.hxx @@ -1,7 +1,7 @@ /************************************************************************* * * 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 @@ -53,6 +53,9 @@ class XMLTextFrameContext : public SvXMLImportContext SvXMLAttributeList *m_pAttrList; XMLTextFrameContextHyperlink_Impl *m_pHyperlink; + // --> OD 2009-07-22 #i73249# + ::rtl::OUString m_sTitle; + // <-- ::rtl::OUString m_sDesc; ::com::sun::star::text::TextContentAnchorType m_eDefaultAnchorType; diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 85fa30ad33..7f68b3d0b4 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -1128,7 +1128,11 @@ XMLTextParagraphExport::XMLTextParagraphExport( // <-- sActualSize(RTL_CONSTASCII_USTRINGPARAM("ActualSize")), - sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")), + // --> OD 2009-07-22 #i73249# +// sAlternativeText(RTL_CONSTASCII_USTRINGPARAM("AlternativeText")), + sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")), + sDescription(RTL_CONSTASCII_USTRINGPARAM("Description")), + // <-- sAnchorCharStyleName(RTL_CONSTASCII_USTRINGPARAM("AnchorCharStyleName")), sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo")), sAnchorType(RTL_CONSTASCII_USTRINGPARAM("AnchorType")), @@ -2782,6 +2786,10 @@ void XMLTextParagraphExport::_exportTextFrame( // image map GetExport().GetImageMapExport().Export( rPropSet ); + // --> OD 2009-07-22 #i73249# + // svg:title and svg:desc + exportTitleAndDescription( rPropSet, rPropSetInfo ); + // <-- } void XMLTextParagraphExport::exportContour( @@ -2973,8 +2981,10 @@ void XMLTextParagraphExport::_exportTextGraphic( // image map GetExport().GetImageMapExport().Export( rPropSet ); - // svg:desc - exportAlternativeText( rPropSet, rPropSetInfo ); + // --> OD 2009-07-22 #i73249# + // svg:title and svg:desc + exportTitleAndDescription( rPropSet, rPropSetInfo ); + // <-- // draw:contour exportContour( rPropSet, rPropSetInfo ); @@ -3003,23 +3013,39 @@ void XMLTextParagraphExport::exportEvents( const Reference < XPropertySet > & rP if (rPropSet->getPropertySetInfo()->hasPropertyByName(sImageMap)) GetExport().GetImageMapExport().Export( rPropSet ); } -void XMLTextParagraphExport::exportAlternativeText( + +// --> OD 2009-07-22 #i73249# +void XMLTextParagraphExport::exportTitleAndDescription( const Reference < XPropertySet > & rPropSet, const Reference < XPropertySetInfo > & rPropSetInfo ) { // svg:title - if( rPropSetInfo->hasPropertyByName( sAlternativeText ) ) + if( rPropSetInfo->hasPropertyByName( sTitle ) ) { - OUString sAltText; - rPropSet->getPropertyValue( sAlternativeText ) >>= sAltText; - if( sAltText.getLength() ) + OUString sObjTitle; + rPropSet->getPropertyValue( sTitle ) >>= sObjTitle; + if( sObjTitle.getLength() ) { SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG, XML_TITLE, sal_True, sal_False ); - GetExport().Characters( sAltText ); + GetExport().Characters( sObjTitle ); + } + } + + // svg:description + if( rPropSetInfo->hasPropertyByName( sDescription ) ) + { + OUString sObjDesc; + rPropSet->getPropertyValue( sDescription ) >>= sObjDesc; + if( sObjDesc.getLength() ) + { + SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_SVG, + XML_DESC, sal_True, sal_False ); + GetExport().Characters( sObjDesc ); } } } +// <-- void XMLTextParagraphExport::setTextEmbeddedGraphicURL( const Reference < XPropertySet >&, |