diff options
author | Release Engineers <releng@openoffice.org> | 2009-08-27 14:36:29 +0000 |
---|---|---|
committer | Release Engineers <releng@openoffice.org> | 2009-08-27 14:36:29 +0000 |
commit | 2957f2456e5dc6ad075655ad5a25c3aaae858d29 (patch) | |
tree | 572f8caa625dc9fcb48e92d575b5cef98c712863 /xmloff | |
parent | bca12756a58b79d27fd4c607e6d922bd5ba7da50 (diff) |
CWS-TOOLING: integrate CWS sw32bf02
2009-08-25 15:52:04 +0200 hde r275366 : reactived testcases hit by issue 102752
2009-08-21 13:52:17 +0200 od r275245 : #i102921# delete files whose deletion has been forgotten in cws impress172
2009-08-21 11:20:47 +0200 od r275225 : CWS-TOOLING: rebase CWS sw32bf02 to trunk@275001 (milestone: DEV300:m55)
2009-08-20 16:21:30 +0200 od r275191 : #i92511# method <lcl_MoveAllLowerObjs(..)>
- invalidation of cache for object rectangle inclusive spaces is needed.
2009-08-20 15:50:40 +0200 od r275188 : #i96726# method <SwPagePreView::DocSzChgd(..)>
- trigger recalculation of page preview layout even if the count of pages is not changing
2009-08-20 12:37:32 +0200 od r275172 : #i100466# correction for showing and hiding redlines
2009-08-18 13:25:18 +0200 od r275100 : #i103817# method <XMLTextImportHelper::SetStyleAndAttrs(..)
- assure that a heading applies the outline style, if no other list style is applied.
2009-08-18 13:21:38 +0200 od r275098 : #i103817# allow the outline style - list style for outline numbering - to be set directly at the paragraph
2009-08-17 14:13:02 +0200 od r275052 : #i103684# add missing documentation for new optional OutlineLevel attribute introduced in OOo 3.1
2009-08-17 14:00:25 +0200 od r275049 : #i100481# method <XMLTextFrameContext_Impl::CreateChildContext(..)>#
- correct condition for handling embedded documents and embedded math objects
2009-08-12 14:11:34 +0200 od r274891 : #i97379# assure that columns are not applied to fly frames, which represent graphics or embedded objects
2009-08-12 12:51:43 +0200 od r274889 : #i101870# method <SwTxtNode::_MakeNewTxtNode(..)>
- perform action on different paragraph styles before applying new paragraph style
2009-08-12 12:24:44 +0200 od r274888 : #i101092# method <ViewShell::Paint(..)>
- encapsulate paint of document background and document into pre and post drawing layer paint calls
2009-08-12 11:38:48 +0200 od r274886 : #i98766# minor adjustment in order to be warning free under Mac port builds
2009-08-12 11:33:54 +0200 od r274885 : #i99267# method <SwTabFrm::MakeAll()>
- reset <bSplit> after forward move to assure that follows can be joined, if further space is available.
2009-08-12 11:11:49 +0200 od r274882 : #i98766# method <ViewShell::SmoothScroll(..)
- disable smooth scroll for Mac port builds
2009-08-10 12:17:58 +0200 od r274801 : CWS-TOOLING: rebase CWS sw32bf02 to trunk@274622 (milestone: DEV300:m54)
2009-07-21 16:56:45 +0200 od r274206 : #i103685# method <SwTxtFormatter::NewTabPortion(..)>
- adjust condition to apply automatic tab stop at left margin correctly
in case that tab stops are not relative to indent
2009-07-10 11:53:53 +0200 od r273883 : #i102752 method <SwDrawContact::Modify(..)>
- assure that a ShapePropertyChangeNotifier exists
2009-07-07 12:01:58 +0200 mst r273788 : #i103304# apply patch by dtardon to fix bogus conditional
2009-07-07 09:01:13 +0200 od r273767 : CWS-TOOLING: rebase CWS sw32bf02 to trunk@273468 (milestone: DEV300:m51)
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 13 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 290 |
2 files changed, 166 insertions, 137 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index eee8f862f802..c3ff9abebd90 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -1147,12 +1147,15 @@ SvXMLImportContext *XMLTextFrameContext_Impl::CreateChildContext( } } } + // --> OD 2009-08-17 #i100480# + // correction of condition which also avoids warnings. if( !pContext && - ( XML_TEXT_FRAME_OBJECT == nType && - (XML_NAMESPACE_OFFICE == nPrefix && - IsXMLToken( rLocalName, XML_DOCUMENT )) || - (XML_NAMESPACE_MATH == nPrefix && - IsXMLToken(rLocalName, XML_MATH) ) ) ) + ( XML_TEXT_FRAME_OBJECT == nType && + ( ( XML_NAMESPACE_OFFICE == nPrefix && + IsXMLToken( rLocalName, XML_DOCUMENT ) ) || + ( XML_NAMESPACE_MATH == nPrefix && + IsXMLToken( rLocalName, XML_MATH ) ) ) ) ) + // <-- { if( !xPropSet.is() && !bCreateFailed ) { diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index e47c3aae262b..add97d20efda 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -931,6 +931,134 @@ OUString XMLTextImportHelper::ConvertStarFonts( const OUString& rChars, return bConverted ? sChars.makeStringAndClear() : rChars; } +// --> OD 2006-10-12 #i69629# +// helper method to determine, if a paragraph style has a list style (inclusive +// an empty one) inherits a list style (inclusive an empty one) from one of its parents +// --> OD 2007-01-29 #i73973# +// apply special case, that found list style equals the chapter numbering, also +// to the found list styles of the parent styles. +sal_Bool lcl_HasListStyle( OUString sStyleName, + const Reference < XNameContainer >& xParaStyles, + SvXMLImport& rImport, + const OUString& sNumberingStyleName, + const OUString& sOutlineStyleName ) +{ + sal_Bool bRet( sal_False ); + + if ( !xParaStyles->hasByName( sStyleName ) ) + { + // error case + return sal_True; + } + + Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ), + UNO_QUERY ); + if ( !xPropState.is() ) + { + // error case + return sal_False; + } + + if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE ) + { + // list style found + bRet = sal_True; + // special case: the set list style equals the chapter numbering + Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY ); + if ( xPropSet.is() ) + { + OUString sListStyle; + xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle; + if ( sListStyle.getLength() != 0 && + sListStyle == sOutlineStyleName ) + { + bRet = sal_False; + } + } + } + else + { + // --> OD 2007-12-07 #i77708# + sal_Int32 nUPD( 0 ); + sal_Int32 nBuild( 0 ); + // --> OD 2008-03-19 #i86058# +// rImport.getBuildIds( nUPD, nBuild ); + const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild ); + // <-- + // <-- + // search list style at parent + Reference<XStyle> xStyle( xPropState, UNO_QUERY ); + while ( xStyle.is() ) + { + OUString aParentStyle( xStyle->getParentStyle() ); + if ( aParentStyle.getLength() > 0 ) + { + aParentStyle = + rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH, + aParentStyle ); + } + if ( aParentStyle.getLength() == 0 || + !xParaStyles->hasByName( aParentStyle ) ) + { + // no list style found + break; + } + else + { + xPropState = Reference< XPropertyState >( + xParaStyles->getByName( aParentStyle ), + UNO_QUERY ); + if ( !xPropState.is() ) + { + // error case + return sal_True; + } + if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE ) + { + // list style found + bRet = sal_True; + // --> OD 2007-01-29 #i73973# + // special case: the found list style equals the chapter numbering + Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY ); + if ( xPropSet.is() ) + { + OUString sListStyle; + xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle; + if ( sListStyle.getLength() != 0 && + sListStyle == sOutlineStyleName ) + { + bRet = sal_False; + } + // --> OD 2007-12-07 #i77708# + // special handling for text documents from OOo version prior OOo 2.4 + // --> OD 2008-03-19 #i86058# + // check explicitly on certain versions and on import of + // text documents in OpenOffice.org file format + else if ( sListStyle.getLength() == 0 && + ( rImport.IsTextDocInOOoFileFormat() || + ( bBuildIdFound && + ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0 + ( nUPD == 680 && nBuild <= 9238 ) ) ) ) ) // OOo 2.0 - OOo 2.3.1 + { + bRet = sal_False; + } + // <-- + } + // <-- + break; + } + else + { + // search list style at parent + xStyle = Reference<XStyle>( xPropState, UNO_QUERY ); + } + } + } + } + + return bRet; +} +// <-- OUString XMLTextImportHelper::SetStyleAndAttrs( SvXMLImport& rImport, const Reference < XTextCursor >& rCursor, @@ -1241,14 +1369,20 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( // Some minor rework and adjust access to paragraph styles if ( bPara ) { + // --> OD 2009-08-18 #i103817# + sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0; + const bool bHasOutlineLevelProp( xPropSetInfo->hasPropertyByName( sOutlineLevel ) ); + if ( bHasOutlineLevelProp ) + { + xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle; + } + // <-- //if ( bPara && nOutlineLevel != -1 ) //#outline level,removed by zhaojianwei if ( nOutlineLevel > 0 ) //add by zhaojianwei { //#outline level,removed by zhaojianwei - if ( xPropSetInfo->hasPropertyByName( sOutlineLevel ) ) + if ( bHasOutlineLevelProp ) { - sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0; - xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle; // In case that the value equals the value of its paragraph style // attribute outline level, the paragraph attribute value is left unset if ( nCurrentOutlineLevelInheritedFromParagraphStyle != nOutlineLevel ) @@ -1327,15 +1461,33 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( { AddOutlineStyleCandidate( nOutlineLevel, sStyleName ); } + // --> OD 2009-08-18 #i103817# + // Assure that heading applies the outline style + if ( ( !pStyle || !pStyle->IsListStyleSet() ) && + !bOutlineStyleCandidate && + xChapterNumbering.is() ) + { + OUString sEmptyStr; + if ( !lcl_HasListStyle( sStyleName, + xParaStyles, GetXMLImport(), + sNumberingStyleName, + sEmptyStr ) ) + { + // heading not in a list --> apply outline style + xPropSet->setPropertyValue( sNumberingRules, + makeAny(xChapterNumbering) ); + xPropSet->setPropertyValue( sNumberingLevel, + makeAny( static_cast<sal_Int8>(nOutlineLevel - 1) ) ); + } + } + // <-- } // <-- } //-> #outlinelevel added by zhaojianwei //handle for text:p,if the paragraphstyle outlinelevel is set to[1~10] - else if( xPropSetInfo->hasPropertyByName( sOutlineLevel ) ) + else if( bHasOutlineLevelProp ) { - sal_Int16 nCurrentOutlineLevelInheritedFromParagraphStyle = 0; - xPropSet->getPropertyValue( sOutlineLevel ) >>= nCurrentOutlineLevelInheritedFromParagraphStyle; if ( nCurrentOutlineLevelInheritedFromParagraphStyle != 0 ) { sal_Int16 nZero = 0; @@ -1428,132 +1580,6 @@ void XMLTextImportHelper::AddOutlineStyleCandidate( const sal_Int8 nOutlineLevel // <-- // --> OD 2006-10-12 #i69629# -// helper method to determine, if a paragraph style has a list style (inclusive -// an empty one) inherits a list style (inclusive an empty one) from one of its parents -// --> OD 2007-01-29 #i73973# -// apply special case, that found list style equals the chapter numbering, also -// to the found list styles of the parent styles. -sal_Bool lcl_HasListStyle( OUString sStyleName, - const Reference < XNameContainer >& xParaStyles, - SvXMLImport& rImport, - const OUString& sNumberingStyleName, - const OUString& sOutlineStyleName ) -{ - sal_Bool bRet( sal_False ); - - if ( !xParaStyles->hasByName( sStyleName ) ) - { - // error case - return sal_True; - } - - Reference< XPropertyState > xPropState( xParaStyles->getByName( sStyleName ), - UNO_QUERY ); - if ( !xPropState.is() ) - { - // error case - return sal_False; - } - - if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE ) - { - // list style found - bRet = sal_True; - // special case: the set list style equals the chapter numbering - Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY ); - if ( xPropSet.is() ) - { - OUString sListStyle; - xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle; - if ( sListStyle == sOutlineStyleName ) - { - bRet = sal_False; - } - } - } - else - { - // --> OD 2007-12-07 #i77708# - sal_Int32 nUPD( 0 ); - sal_Int32 nBuild( 0 ); - // --> OD 2008-03-19 #i86058# -// rImport.getBuildIds( nUPD, nBuild ); - const bool bBuildIdFound = rImport.getBuildIds( nUPD, nBuild ); - // <-- - // <-- - // search list style at parent - Reference<XStyle> xStyle( xPropState, UNO_QUERY ); - while ( xStyle.is() ) - { - OUString aParentStyle( xStyle->getParentStyle() ); - if ( aParentStyle.getLength() > 0 ) - { - aParentStyle = - rImport.GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH, - aParentStyle ); - } - if ( aParentStyle.getLength() == 0 || - !xParaStyles->hasByName( aParentStyle ) ) - { - // no list style found - break; - } - else - { - xPropState = Reference< XPropertyState >( - xParaStyles->getByName( aParentStyle ), - UNO_QUERY ); - if ( !xPropState.is() ) - { - // error case - return sal_True; - } - if ( xPropState->getPropertyState( sNumberingStyleName ) == PropertyState_DIRECT_VALUE ) - { - // list style found - bRet = sal_True; - // --> OD 2007-01-29 #i73973# - // special case: the found list style equals the chapter numbering - Reference< XPropertySet > xPropSet( xPropState, UNO_QUERY ); - if ( xPropSet.is() ) - { - OUString sListStyle; - xPropSet->getPropertyValue( sNumberingStyleName ) >>= sListStyle; - if ( sListStyle == sOutlineStyleName ) - { - bRet = sal_False; - } - // --> OD 2007-12-07 #i77708# - // special handling for text documents from OOo version prior OOo 2.4 - // --> OD 2008-03-19 #i86058# - // check explicitly on certain versions and on import of - // text documents in OpenOffice.org file format - else if ( sListStyle.getLength() == 0 && - ( rImport.IsTextDocInOOoFileFormat() || - ( bBuildIdFound && - ( ( nUPD == 641 ) || ( nUPD == 645 ) || // prior OOo 2.0 - ( nUPD == 680 && nBuild <= 9238 ) ) ) ) ) // OOo 2.0 - OOo 2.3.1 - { - bRet = sal_False; - } - // <-- - } - // <-- - break; - } - else - { - // search list style at parent - xStyle = Reference<XStyle>( xPropState, UNO_QUERY ); - } - } - } - } - - return bRet; -} -// <-- -// --> OD 2006-10-12 #i69629# void XMLTextImportHelper::SetOutlineStyles( sal_Bool bSetEmptyLevels ) { if ( ( mpOutlineStylesCandidates != NULL || bSetEmptyLevels ) && |