summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-06-13 08:19:50 +0000
committerRüdiger Timm <rt@openoffice.org>2008-06-13 08:19:50 +0000
commit2bece27fa26b3bd41b21c1c7802c6a526fc4d9e5 (patch)
tree3ebab449c766006ec64fade5c5aee3ce698b2128
parent944c6ef807c328ee6bd3040709af41c0894cf28a (diff)
INTEGRATION: CWS swlists01 (1.9.12); FILE MERGED
2008/05/08 16:13:19 od 1.9.12.2: RESYNC: (1.9-1.10); FILE MERGED 2008/05/08 14:59:50 od 1.9.12.1: #i86732# changes/adjustments for new list handling
-rw-r--r--xmloff/source/text/XMLTextListItemContext.cxx79
1 files changed, 67 insertions, 12 deletions
diff --git a/xmloff/source/text/XMLTextListItemContext.cxx b/xmloff/source/text/XMLTextListItemContext.cxx
index 793fb44e2a29..cffb597301ec 100644
--- a/xmloff/source/text/XMLTextListItemContext.cxx
+++ b/xmloff/source/text/XMLTextListItemContext.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: XMLTextListItemContext.cxx,v $
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
* This file is part of OpenOffice.org.
*
@@ -42,7 +42,11 @@
#ifndef _XMLOFF_TXTIMP_HXX
#include <xmloff/txtimp.hxx>
#endif
-
+// --> OD 2008-05-08 #refactorlists#
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/style/XStyle.hpp>
+#include <xmloff/xmlnumi.hxx>
+// <--
#include "XMLTextListItemContext.hxx"
@@ -56,14 +60,19 @@ using namespace ::xmloff::token;
TYPEINIT1( XMLTextListItemContext, SvXMLImportContext );
XMLTextListItemContext::XMLTextListItemContext(
- SvXMLImport& rImport,
- XMLTextImportHelper& rTxtImp, sal_uInt16 nPrfx,
- const OUString& rLName,
- const Reference< xml::sax::XAttributeList > & xAttrList,
- sal_Bool bIsHeader ) :
- SvXMLImportContext( rImport, nPrfx, rLName ),
- rTxtImport( rTxtImp ),
- nStartValue( -1 )
+ SvXMLImport& rImport,
+ XMLTextImportHelper& rTxtImp,
+ const sal_uInt16 nPrfx,
+ const OUString& rLName,
+ const Reference< xml::sax::XAttributeList > & xAttrList,
+ const sal_Bool bIsHeader )
+ : SvXMLImportContext( rImport, nPrfx, rLName ),
+ rTxtImport( rTxtImp ),
+ nStartValue( -1 ),
+ // --> OD 2008-05-07 #refactorlists#
+ mnSubListCount( 0 ),
+ mxNumRulesOverride()
+ // <--
{
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for( sal_Int16 i=0; i < nAttrCount; i++ )
@@ -82,6 +91,45 @@ XMLTextListItemContext::XMLTextListItemContext(
if( nTmp >= 0 && nTmp <= SHRT_MAX )
nStartValue = (sal_Int16)nTmp;
}
+ // --> OD 2008-05-08 #refactorlists#
+ else if ( nPrefix == XML_NAMESPACE_TEXT &&
+ IsXMLToken( aLocalName, XML_STYLE_OVERRIDE ) )
+ {
+ const ::rtl::OUString sListStyleOverrideName = rValue;
+ if ( sListStyleOverrideName.getLength() > 0 )
+ {
+ OUString sDisplayStyleName(
+ GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_LIST,
+ sListStyleOverrideName ) );
+ const Reference < container::XNameContainer >& rNumStyles =
+ rTxtImp.GetNumberingStyles();
+ if( rNumStyles.is() && rNumStyles->hasByName( sDisplayStyleName ) )
+ {
+ Reference < style::XStyle > xStyle;
+ Any aAny = rNumStyles->getByName( sDisplayStyleName );
+ aAny >>= xStyle;
+
+ uno::Reference< beans::XPropertySet > xPropSet( xStyle, UNO_QUERY );
+ aAny = xPropSet->getPropertyValue( rTxtImp.sNumberingRules );
+ aAny >>= mxNumRulesOverride;
+ }
+ else
+ {
+ const SvxXMLListStyleContext* pListStyle =
+ rTxtImp.FindAutoListStyle( sListStyleOverrideName );
+ if( pListStyle )
+ {
+ mxNumRulesOverride = pListStyle->GetNumRules();
+ if( !mxNumRulesOverride.is() )
+ {
+ pListStyle->CreateAndInsertAuto();
+ mxNumRulesOverride = pListStyle->GetNumRules();
+ }
+ }
+ }
+ }
+ }
+ // <--
}
DBG_ASSERT( !rTxtImport.GetListItem(),
@@ -125,9 +173,16 @@ SvXMLImportContext *XMLTextListItemContext::CreateChildContext(
break;
case XML_TOK_TEXT_LIST:
+ // --> OD 2008-05-07 #refactorlists#
+// pContext = new XMLTextListBlockContext( GetImport(), rTxtImport,
+// nPrefix, rLocalName,
+// xAttrList );
+ ++mnSubListCount;
pContext = new XMLTextListBlockContext( GetImport(), rTxtImport,
- nPrefix, rLocalName,
- xAttrList );
+ nPrefix, rLocalName,
+ xAttrList,
+ (mnSubListCount > 1) );
+ // <--
break;
}