summaryrefslogtreecommitdiff
path: root/xmloff/source/style/styleexp.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-01-07 11:57:24 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-01-07 11:57:24 +0000
commit4e93b7d7f542049f9ae8fdebd03f00e82fa51439 (patch)
tree841a6ff2596ab3cdf34f09dd3beab7439dc65f13 /xmloff/source/style/styleexp.cxx
parent91c99daaaec9354222e6f1ae2b7d71130a3eb8f1 (diff)
CWS-TOOLING: integrate CWS outlinelevel
2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
Diffstat (limited to 'xmloff/source/style/styleexp.cxx')
-rw-r--r--xmloff/source/style/styleexp.cxx73
1 files changed, 70 insertions, 3 deletions
diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx
index 6f5d0bc82468..f822239d3106 100644
--- a/xmloff/source/style/styleexp.cxx
+++ b/xmloff/source/style/styleexp.cxx
@@ -86,6 +86,7 @@ XMLStyleExport::XMLStyleExport(
sIsAutoUpdate( RTL_CONSTASCII_USTRINGPARAM( "IsAutoUpdate" ) ),
sFollowStyle( RTL_CONSTASCII_USTRINGPARAM( "FollowStyle" ) ),
sNumberingStyleName( RTL_CONSTASCII_USTRINGPARAM( "NumberingStyleName" ) ),
+ sOutlineLevel( RTL_CONSTASCII_USTRINGPARAM( "OutlineLevel" ) ),//#outline level,add by zhaojianwei
sPoolStyleName( rPoolStyleName ),
pAutoStylePool( pAutoStyleP )
{
@@ -107,12 +108,12 @@ sal_Bool XMLStyleExport::exportStyle(
const Reference< XStyle >& rStyle,
const OUString& rXMLFamily,
const UniReference < SvXMLExportPropertyMapper >& rPropMapper,
+ const Reference< XNameAccess >& xStyles, //#outline level,add by zhaojianwei
const OUString* pPrefix )
{
Reference< XPropertySet > xPropSet( rStyle, UNO_QUERY );
Reference< XPropertySetInfo > xPropSetInfo =
xPropSet->getPropertySetInfo();
-
Any aAny;
// Don't export styles that aren't existing really. This may be the
@@ -185,6 +186,31 @@ sal_Bool XMLStyleExport::exportStyle(
XML_TRUE );
}
+ // style:default-outline-level"..." //#outline level, add by zhaojianwei.0802
+ sal_Int32 nOutlineLevel = 0;
+ if( xPropSetInfo->hasPropertyByName( sOutlineLevel ) )
+ {
+ Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY );
+ if( PropertyState_DIRECT_VALUE == xPropState->getPropertyState( sOutlineLevel ) )
+ {
+ aAny = xPropSet->getPropertyValue( sOutlineLevel );
+ aAny >>= nOutlineLevel;
+ if( nOutlineLevel > 0 )
+ {
+ OUStringBuffer sTmp;
+ sTmp.append( static_cast<sal_Int32>(nOutlineLevel));
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE,
+ XML_DEFAULT_OUTLINE_LEVEL,
+ sTmp.makeStringAndClear() );
+ }
+ else
+ {
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_DEFAULT_OUTLINE_LEVEL,
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "" )));
+ }
+ }
+ }//<-end,zhaojianwei
+
// style:list-style-name="..." (SW paragarph styles only)
if( xPropSetInfo->hasPropertyByName( sNumberingStyleName ) )
{
@@ -249,8 +275,49 @@ sal_Bool XMLStyleExport::exportStyle(
// <--
}
}
+ //#outline level, add by zhaojianwei.0802
+ else if( nOutlineLevel > 0 )
+ {
+
+ bool bNoInheritedListStyle( true );
+
+ /////////////////////////////////////////////////
+ Reference<XStyle> xStyle( xPropState, UNO_QUERY );
+ while ( xStyle.is() )
+ {
+ OUString aParentStyle( xStyle->getParentStyle() );
+ if ( aParentStyle.getLength() == 0 ||
+ !xStyles->hasByName( aParentStyle ) )
+ {
+ break;
+ }
+ else
+ {
+ xPropState = Reference< XPropertyState >( xStyles->getByName( aParentStyle ), UNO_QUERY );
+ if ( !xPropState.is() )
+ {
+ break;
+ }
+ if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE )
+ {
+ bNoInheritedListStyle = false;
+ break;
+ }
+ else
+ {
+ xStyle = Reference<XStyle>( xPropState, UNO_QUERY );
+ }
+ }
+ }
+ /////////////////////////////////////////////////
+ if ( bNoInheritedListStyle )
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME,
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "" )));
+ }
+ //<-end,zhaojianwei
}
+
// style:pool-id="..." is not required any longer since we use
// english style names only
exportStyleAttributes( rStyle );
@@ -405,7 +472,7 @@ void XMLStyleExport::exportStyleFamily(
if( !bUsed || xStyle->isInUse() )
{
BOOL bExported = exportStyle( xStyle, rXMLFamily, rPropMapper,
- pPrefix );
+ xStyles,pPrefix );
if( bUsed && bFirstStyle && bExported )
{
// If this is the first style, find out wether next styles
@@ -480,7 +547,7 @@ void XMLStyleExport::exportStyleFamily(
xStyleCont->getByName( sNextName ) >>= xStyle;
DBG_ASSERT( xStyle.is(), "Style not found for export!" );
- if( xStyle.is() && exportStyle( xStyle, rXMLFamily, rPropMapper, pPrefix ) )
+ if( xStyle.is() && exportStyle( xStyle, rXMLFamily, rPropMapper, xStyles,pPrefix ) )
pExportedStyles->Insert( new String( sTmp ) );
}
}