diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-12-11 09:52:14 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-12-11 09:52:14 +0000 |
commit | 9ae05952b0d5ecbbdcd7159274d90ae81cf51dfc (patch) | |
tree | e05a022c79e4f5c8f175cdbc346ede1501910154 /xmloff | |
parent | CWS-TOOLING: integrate CWS calc47 (diff) | |
download | core-9ae05952b0d5ecbbdcd7159274d90ae81cf51dfc.tar.gz core-9ae05952b0d5ecbbdcd7159274d90ae81cf51dfc.zip |
CWS-TOOLING: integrate CWS sw301bf04_DEV300
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/xmlexp.hxx | 3 | ||||
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 27 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextListBlockContext.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextNumRuleInfo.cxx | 30 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextNumRuleInfo.hxx | 36 | ||||
-rw-r--r-- | xmloff/source/text/txtparae.cxx | 52 |
6 files changed, 140 insertions, 14 deletions
diff --git a/xmloff/inc/xmloff/xmlexp.hxx b/xmloff/inc/xmloff/xmlexp.hxx index fbf80b322771..3a005d1fc25c 100644 --- a/xmloff/inc/xmloff/xmlexp.hxx +++ b/xmloff/inc/xmloff/xmlexp.hxx @@ -574,6 +574,9 @@ public: void AddAttributeXmlId(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> const & i_xIfc); + // --> OD 2008-11-26 #158694# + const sal_Bool exportTextNumberElement() const; + // <-- }; inline UniReference< XMLTextParagraphExport > SvXMLExport::GetTextParagraphExport() diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index f83510d2a901..4aa7ee5d034f 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -221,6 +221,10 @@ public: /// relative path of stream in package, e.g. "someobject/content.xml" ::rtl::OUString mStreamPath; + + // --> OD 2008-11-26 #158694# + sal_Bool mbExportTextNumberElement; + // <-- }; SvXMLExport_Impl::SvXMLExport_Impl() @@ -231,6 +235,9 @@ SvXMLExport_Impl::SvXMLExport_Impl() ,mbSaveBackwardCompatibleODF( sal_True ) // <-- ,mStreamPath() + // --> OD 2008-11-26 #158694# + ,mbExportTextNumberElement( sal_False ) + // <-- { mxUriReferenceFactory = uri::UriReferenceFactory::create( comphelper_getProcessComponentContext()); @@ -746,7 +753,7 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen ::rtl::OUString::createFromAscii("/") + sName : sName; // --> OD 2006-09-26 #i69627# - OUString sOutlineStyleAsNormalListStyle( + const ::rtl::OUString sOutlineStyleAsNormalListStyle( RTL_CONSTASCII_USTRINGPARAM("OutlineStyleAsNormalListStyle") ); if( xPropertySetInfo->hasPropertyByName( sOutlineStyleAsNormalListStyle ) ) { @@ -755,10 +762,19 @@ void SAL_CALL SvXMLExport::initialize( const uno::Sequence< uno::Any >& aArgumen } // <-- - OUString sTargetStorage( RTL_CONSTASCII_USTRINGPARAM("TargetStorage") ); if( xPropertySetInfo->hasPropertyByName( sTargetStorage ) ) mxExportInfo->getPropertyValue( sTargetStorage ) >>= mpImpl->mxTargetStorage; + + // --> OD 2008-11-26 #158694# + const ::rtl::OUString sExportTextNumberElement( + RTL_CONSTASCII_USTRINGPARAM("ExportTextNumberElement") ); + if( xPropertySetInfo->hasPropertyByName( sExportTextNumberElement ) ) + { + uno::Any aAny = mxExportInfo->getPropertyValue( sExportTextNumberElement ); + aAny >>= (mpImpl->mbExportTextNumberElement); + } + // <-- } } @@ -2358,6 +2374,13 @@ SvXMLExport::AddAttributeXmlId(uno::Reference<uno::XInterface> const & i_xIfc) } } +// --> OD 2008-11-26 #158694# +const sal_Bool SvXMLExport::exportTextNumberElement() const +{ + return mpImpl->mbExportTextNumberElement; +} +// <-- + //============================================================================= void SvXMLElementExport::StartElement( SvXMLExport& rExp, diff --git a/xmloff/source/text/XMLTextListBlockContext.cxx b/xmloff/source/text/XMLTextListBlockContext.cxx index 18356d9d8fd0..266a32a702ec 100644 --- a/xmloff/source/text/XMLTextListBlockContext.cxx +++ b/xmloff/source/text/XMLTextListBlockContext.cxx @@ -93,6 +93,9 @@ XMLTextListBlockContext::XMLTextListBlockContext( // Inherit style name from parent list, as well as the flags whether // numbering must be restarted and formats have to be created. OUString sParentListStyleName; + // --> OD 2008-11-27 #158694# + sal_Bool bParentRestartNumbering( sal_False ); + // <-- if( mxParentListBlock.Is() ) { XMLTextListBlockContext *pParent = @@ -106,6 +109,9 @@ XMLTextListBlockContext::XMLTextListBlockContext( mbRestartNumbering = pParent->IsRestartNumbering() || bRestartNumberingAtSubList; // <-- + // --> OD 2008-11-27 #158694# + bParentRestartNumbering = pParent->IsRestartNumbering(); + // <-- mbSetDefaults = pParent->mbSetDefaults; // --> OD 2008-04-22 #refactorlists# msListId = pParent->GetListId(); diff --git a/xmloff/source/text/XMLTextNumRuleInfo.cxx b/xmloff/source/text/XMLTextNumRuleInfo.cxx index 124ba3072f71..802c721bc77c 100644 --- a/xmloff/source/text/XMLTextNumRuleInfo.cxx +++ b/xmloff/source/text/XMLTextNumRuleInfo.cxx @@ -7,11 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: XMLTextNumRuleInfo.cxx,v $ -<<<<<<< XMLTextNumRuleInfo.cxx * $Revision: 1.16 $ -======= - * $Revision: 1.16 $ ->>>>>>> 1.12.12.6 * * This file is part of OpenOffice.org. * @@ -64,6 +60,10 @@ XMLTextNumRuleInfo::XMLTextNumRuleInfo() , msNumberingIsOutline(RTL_CONSTASCII_USTRINGPARAM("NumberingIsOutline")) , msPropNameListId(RTL_CONSTASCII_USTRINGPARAM("ListId")) , msPropNameStartWith(RTL_CONSTASCII_USTRINGPARAM("StartWith")) + // --> OD 2008-11-26 #158694# + , msContinueingPreviousSubTree(RTL_CONSTASCII_USTRINGPARAM("ContinueingPreviousSubTree")) + , msListLabelStringProp(RTL_CONSTASCII_USTRINGPARAM("ListLabelString")) + // <-- , mxNumRules() , msNumRulesName() , msListId() @@ -82,7 +82,10 @@ void XMLTextNumRuleInfo::Set( const ::com::sun::star::uno::Reference < ::com::sun::star::text::XTextContent > & xTextContent, const sal_Bool bOutlineStyleAsNormalListStyle, - const XMLTextListAutoStylePool& rListAutoPool ) + const XMLTextListAutoStylePool& rListAutoPool, + // --> OD 2008-11-26 #158694# + const sal_Bool bExportTextNumberElement ) + // <-- { Reset(); // --> OD 2006-09-27 #i69627# @@ -152,6 +155,14 @@ void XMLTextNumRuleInfo::Set( xPropSet->getPropertyValue( msPropNameListId ) >>= msListId; } + // --> OD 2008-11-26 #158694# + mbContinueingPreviousSubTree = sal_False; + if( xPropSetInfo->hasPropertyByName( msContinueingPreviousSubTree ) ) + { + xPropSet->getPropertyValue( msContinueingPreviousSubTree ) >>= mbContinueingPreviousSubTree; + } + // <-- + mbIsNumbered = sal_True; if( xPropSetInfo->hasPropertyByName( msNumberingIsNumber ) ) { @@ -197,6 +208,15 @@ void XMLTextNumRuleInfo::Set( } } + // --> OD 2008-11-26 #158694# + msListLabelString = ::rtl::OUString(); + if ( bExportTextNumberElement && + xPropSetInfo->hasPropertyByName( msListLabelStringProp ) ) + { + xPropSet->getPropertyValue( msListLabelStringProp ) >>= msListLabelString; + } + // <-- + // paragraph's list level range is [0..9] representing list levels [1..10] ++mnListLevel; } diff --git a/xmloff/source/text/XMLTextNumRuleInfo.hxx b/xmloff/source/text/XMLTextNumRuleInfo.hxx index caf40d608e1f..2f90aad14a07 100644 --- a/xmloff/source/text/XMLTextNumRuleInfo.hxx +++ b/xmloff/source/text/XMLTextNumRuleInfo.hxx @@ -7,11 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: XMLTextNumRuleInfo.hxx,v $ -<<<<<<< XMLTextNumRuleInfo.hxx * $Revision: 1.10.64.1 $ -======= - * $Revision: 1.10.64.1 $ ->>>>>>> 1.6.266.4 * * This file is part of OpenOffice.org. * @@ -61,6 +57,10 @@ class XMLTextNumRuleInfo const ::rtl::OUString msNumberingIsOutline; const ::rtl::OUString msPropNameListId; const ::rtl::OUString msPropNameStartWith; + // --> OD 2008-11-26 #158694# + const ::rtl::OUString msContinueingPreviousSubTree; + const ::rtl::OUString msListLabelStringProp; + // <-- // numbering rules instance and its name ::com::sun::star::uno::Reference < @@ -83,17 +83,22 @@ class XMLTextNumRuleInfo sal_Bool mbOutlineStyleAsNormalListStyle; // <-- + // --> OD 2008-11-26 #158694# + sal_Bool mbContinueingPreviousSubTree; + ::rtl::OUString msListLabelString; + // <-- public: XMLTextNumRuleInfo(); inline XMLTextNumRuleInfo& operator=( const XMLTextNumRuleInfo& rInfo ); - // --> OD 2006-09-27 #i69627# + // --> OD 2008-11-26 #158694# void Set( const ::com::sun::star::uno::Reference < ::com::sun::star::text::XTextContent > & rTextContnt, const sal_Bool bOutlineStyleAsNormalListStyle, - const XMLTextListAutoStylePool& rListAutoPool ); + const XMLTextListAutoStylePool& rListAutoPool, + const sal_Bool bExportTextNumberElement ); // <-- inline void Reset(); @@ -145,6 +150,17 @@ public: { return rCmp.msNumRulesName == msNumRulesName; } + + // --> OD 2008-11-26 #158694# + inline sal_Bool IsContinueingPreviousSubTree() const + { + return mbContinueingPreviousSubTree; + } + inline const ::rtl::OUString& ListLabelString() const + { + return msListLabelString; + } + // <-- }; inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=( @@ -160,6 +176,10 @@ inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=( // --> OD 2006-09-27 #i69627# mbOutlineStyleAsNormalListStyle = rInfo.mbOutlineStyleAsNormalListStyle; // <-- + // --> OD 2008-11-26 #158694# + mbContinueingPreviousSubTree = rInfo.mbContinueingPreviousSubTree; + msListLabelString = rInfo.msListLabelString; + // <-- return *this; } @@ -175,5 +195,9 @@ inline void XMLTextNumRuleInfo::Reset() mbIsNumbered = mbIsRestart = mbOutlineStyleAsNormalListStyle = sal_False; // <-- + // --> OD 2008-11-26 #158694# + mbContinueingPreviousSubTree = sal_False; + msListLabelString = ::rtl::OUString(); + // <-- } #endif // _XMLOFF_XMLTEXTNUMRULEINFO_HXX diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx index 307eafc93bbf..6729ed0ccaac 100644 --- a/xmloff/source/text/txtparae.cxx +++ b/xmloff/source/text/txtparae.cxx @@ -666,6 +666,10 @@ void XMLTextParagraphExport::exportListChange( bool bExportListStyle( true ); bool bRestartNumberingAtContinuedRootList( false ); sal_Int16 nRestartValueForContinuedRootList( -1 ); + // --> OD 2008-11-26 #158694# + bool bContinueingPreviousSubList = !bRootListToBeStarted && + rNextInfo.IsContinueingPreviousSubTree(); + // <-- do { GetExport().CheckAttrList(); @@ -760,6 +764,15 @@ void XMLTextParagraphExport::exportListChange( bExportListStyle = false; } + // --> OD 2008-11-26 #158694# + if ( bContinueingPreviousSubList ) + { + GetExport().AddAttribute( XML_NAMESPACE_TEXT, + XML_CONTINUE_NUMBERING, XML_TRUE ); + bContinueingPreviousSubList = false; + } + // <-- + enum XMLTokenEnum eLName = XML_LIST; OUString *pElem = new OUString( @@ -808,6 +821,23 @@ void XMLTextParagraphExport::exportListChange( pListElements->Insert( pElem, pListElements->Count() ); + // --> OD 2008-11-26 #158694# + // export of <text:number> element for last opened <text:list-item>, if requested + if ( GetExport().exportTextNumberElement() && + eLName == XML_LIST_ITEM && nListLevelsToBeOpened == 1 && // last iteration --> last opened <text:list-item> + rNextInfo.ListLabelString().getLength() > 0 ) + { + const ::rtl::OUString aTextNumberElem = + OUString( GetExport().GetNamespaceMap().GetQNameByKey( + XML_NAMESPACE_TEXT, + GetXMLToken(XML_NUMBER) ) ); + GetExport().IgnorableWhitespace(); + GetExport().StartElement( aTextNumberElem, sal_False ); + GetExport().Characters( rNextInfo.ListLabelString() ); + GetExport().EndElement( aTextNumberElem, sal_True ); + } + // <-- + --nListLevelsToBeOpened; } while ( nListLevelsToBeOpened > 0 ); } @@ -869,6 +899,22 @@ void XMLTextParagraphExport::exportListChange( GetExport().StartElement( *pElem, sal_False ); pListElements->Insert( pElem, pListElements->Count() ); + + // --> OD 2008-11-26 #158694# + // export of <text:number> element for <text:list-item>, if requested + if ( GetExport().exportTextNumberElement() && + rNextInfo.ListLabelString().getLength() > 0 ) + { + const ::rtl::OUString aTextNumberElem = + OUString( GetExport().GetNamespaceMap().GetQNameByKey( + XML_NAMESPACE_TEXT, + GetXMLToken(XML_NUMBER) ) ); + GetExport().IgnorableWhitespace(); + GetExport().StartElement( aTextNumberElem, sal_False ); + GetExport().Characters( rNextInfo.ListLabelString() ); + GetExport().EndElement( aTextNumberElem, sal_True ); + } + // <-- } } // <-- @@ -1800,9 +1846,13 @@ sal_Bool XMLTextParagraphExport::exportTextContentEnumeration( // --> OD 2006-09-27 #i69627# // --> OD 2008-04-24 #refactorlists# // pass list auto style pool to <XMLTextNumRuleInfo> instance + // --> OD 2008-11-26 #158694# + // pass info about request to export <text:number> element + // to <XMLTextNumRuleInfo> instance aNextNumInfo.Set( xTxtCntnt, GetExport().writeOutlineStyleAsNormalListStyle(), - GetListAutoStylePool() ); + GetListAutoStylePool(), + GetExport().exportTextNumberElement() ); // <-- exportListAndSectionChange( xCurrentTextSection, aPropSetHelper, |