diff options
author | Michael Brauer <mib@openoffice.org> | 2000-10-23 10:28:11 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2000-10-23 10:28:11 +0000 |
commit | ef1795bbf00670dcd4002b48feb6fa4139c4d7a2 (patch) | |
tree | d774afe55539a217353d94baab259c544eb21a9f /xmloff | |
parent | 7612b295728fbdaeb04f5f0dfe9a300f23984ec9 (diff) |
restart numbering for lists
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/XMLTextNumRuleInfo.cxx | 32 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextNumRuleInfo.hxx | 21 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 12 |
3 files changed, 44 insertions, 21 deletions
diff --git a/xmloff/source/text/XMLTextNumRuleInfo.cxx b/xmloff/source/text/XMLTextNumRuleInfo.cxx index bbc21d898b98..9634eaabb643 100644 --- a/xmloff/source/text/XMLTextNumRuleInfo.cxx +++ b/xmloff/source/text/XMLTextNumRuleInfo.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextNumRuleInfo.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:07:06 $ + * last change: $Author: mib $ $Date: 2000-10-23 11:28:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,6 +75,9 @@ #ifndef _COM_SUN_STAR_STYLE_NUMBERINGTYPE_HPP_ #include <com/sun/star/style/NumberingType.hpp> #endif +#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_ +#include <com/sun/star/container/XNamed.hpp> +#endif #ifndef _XMLOFF_XMLTEXTNUMRULEINFO_HXX #include "XMLTextNumRuleInfo.hxx" @@ -91,6 +94,7 @@ XMLTextNumRuleInfo::XMLTextNumRuleInfo() : sNumberingRules(RTL_CONSTASCII_USTRINGPARAM("NumberingRules")), sNumberingLevel(RTL_CONSTASCII_USTRINGPARAM("NumberingLevel")), sNumberingStartValue(RTL_CONSTASCII_USTRINGPARAM("NumberingStartValue")), + sParaIsNumberingRestart(RTL_CONSTASCII_USTRINGPARAM("ParaIsNumberingRestart")), sNumberingStyleName(RTL_CONSTASCII_USTRINGPARAM("NumberingStyleName")), sNumberingType(RTL_CONSTASCII_USTRINGPARAM("NumberingType")), sIsNumbering(RTL_CONSTASCII_USTRINGPARAM("IsNumbering")), @@ -108,7 +112,6 @@ void XMLTextNumRuleInfo::Set( Reference< XPropertySet > xPropSet( xTextContent, UNO_QUERY ); Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); - Reference < XIndexReplace > xNumRule; Any aAny; // check if numbering is enabled in edit engine @@ -122,17 +125,14 @@ void XMLTextNumRuleInfo::Set( if( xPropSetInfo->hasPropertyByName( sNumberingRules ) ) { aAny = xPropSet->getPropertyValue( sNumberingRules ); - aAny >>= xNumRule; + aAny >>= xNumRules; } - if( xNumRule.is() ) + if( xNumRules.is() ) { - if( xPropSetInfo->hasPropertyByName( sNumberingStyleName ) ) - { - aAny = xPropSet->getPropertyValue( sNumberingStyleName ); - aAny >>= sName; - } - DBG_ASSERT( sName.getLength(), "num rule name is missing!" ); + Reference < XNamed > xNamed( xNumRules, UNO_QUERY ); + if( xNamed.is() ) + sName = xNamed->getName(); aAny = xPropSet->getPropertyValue( sNumberingLevel ); aAny >>= nLevel; @@ -146,7 +146,11 @@ void XMLTextNumRuleInfo::Set( if( bIsNumbered ) { - bIsRestart = sal_False; // TODO: UNO prop missingrNum.IsStart(); + if( xPropSetInfo->hasPropertyByName( sParaIsNumberingRestart ) ) + { + aAny = xPropSet->getPropertyValue( sParaIsNumberingRestart ); + bIsRestart = *(sal_Bool *)aAny.getValue(); + } if( xPropSetInfo->hasPropertyByName( sNumberingStartValue ) ) { aAny = xPropSet->getPropertyValue( sNumberingStartValue ); @@ -154,9 +158,9 @@ void XMLTextNumRuleInfo::Set( } } - DBG_ASSERT( nLevel < xNumRule->getCount(), "wrong num rule level" ); + DBG_ASSERT( nLevel < xNumRules->getCount(), "wrong num rule level" ); - aAny = xNumRule->getByIndex( nLevel ); + aAny = xNumRules->getByIndex( nLevel ); Sequence<PropertyValue> aProps; aAny >>= aProps; const PropertyValue* pPropArray = aProps.getConstArray(); diff --git a/xmloff/source/text/XMLTextNumRuleInfo.hxx b/xmloff/source/text/XMLTextNumRuleInfo.hxx index e7d360123469..fff0ea0cb047 100644 --- a/xmloff/source/text/XMLTextNumRuleInfo.hxx +++ b/xmloff/source/text/XMLTextNumRuleInfo.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextNumRuleInfo.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:07:06 $ + * last change: $Author: mib $ $Date: 2000-10-23 11:28:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,9 +65,13 @@ #ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_ #include <com/sun/star/uno/Reference.hxx> #endif +#ifndef _COM_SUN_STAR_CONTAINER_XINDEXREPLACE_HPP_ +#include <com/sun/star/container/XIndexReplace.hpp> +#endif -namespace com { namespace sun { namespace star { namespace text { - class XTextContent; } } } } +namespace com { namespace sun { namespace star { + namespace text { class XTextContent; } +} } } #ifndef _SAL_TYPES_H_ #include <sal/types.h> @@ -78,11 +82,15 @@ class XMLTextNumRuleInfo const ::rtl::OUString sNumberingRules; const ::rtl::OUString sNumberingLevel; const ::rtl::OUString sNumberingStartValue; + const ::rtl::OUString sParaIsNumberingRestart; const ::rtl::OUString sNumberingStyleName; const ::rtl::OUString sNumberingType; const ::rtl::OUString sIsNumbering; const ::rtl::OUString sNumberingIsNumber; + ::com::sun::star::uno::Reference < + ::com::sun::star::container::XIndexReplace > xNumRules; + ::rtl::OUString sName; sal_Int16 nStartValue; sal_Int16 nLevel; @@ -103,6 +111,9 @@ public: inline void Reset(); const ::rtl::OUString& GetName() const { return sName; } + const ::com::sun::star::uno::Reference < + ::com::sun::star::container::XIndexReplace >& GetNumRules() const + { return xNumRules; } sal_Int16 GetLevel() const { return nLevel; } sal_Bool HasStartValue() const { return nStartValue != -1; } @@ -117,6 +128,7 @@ inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=( const XMLTextNumRuleInfo& rInfo ) { sName = rInfo.sName; + xNumRules = rInfo.xNumRules; nStartValue = rInfo.nStartValue; nLevel = rInfo.nLevel; bIsNumbered = rInfo.bIsNumbered; @@ -129,6 +141,7 @@ inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=( inline void XMLTextNumRuleInfo::Reset() { sName = ::rtl::OUString(); + xNumRules = 0; nStartValue = -1; nLevel = 0; bIsNumbered = bIsOrdered = bIsRestart = sal_False; diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 166aa18fef35..3ac03adc458d 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtimp.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: sab $ $Date: 2000-10-23 10:39:46 $ + * last change: $Author: mib $ $Date: 2000-10-23 11:28:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -426,6 +426,7 @@ XMLTextImportHelper::XMLTextImportHelper( sHeadingStyleName(RTL_CONSTASCII_USTRINGPARAM("HeadingStyleName")), sNumberingLevel(RTL_CONSTASCII_USTRINGPARAM("NumberingLevel")), sNumberingStartValue(RTL_CONSTASCII_USTRINGPARAM("NumberingStartValue")), + sParaIsNumberingRestart(RTL_CONSTASCII_USTRINGPARAM("ParaIsNumberingRestart")), sNumberingStyleName(RTL_CONSTASCII_USTRINGPARAM("NumberingStyleName")), sNumberingRules(RTL_CONSTASCII_USTRINGPARAM("NumberingRules")), sSequenceNumber(RTL_CONSTASCII_USTRINGPARAM("SequenceNumber")), @@ -740,7 +741,12 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( if( pListBlock->IsRestartNumbering() ) { // TODO: property missing - // aNodeNum.SetStart(); + if( xPropSetInfo->hasPropertyByName( sParaIsNumberingRestart ) ) + { + sal_Bool bTmp = sal_True; + aAny.setValue( &bTmp, ::getBooleanCppuType() ); + xPropSet->setPropertyValue( sParaIsNumberingRestart, aAny ); + } pListBlock->ResetRestartNumbering(); } if( pListItem && pListItem->HasStartValue() && |