diff options
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index f7a11676594e..e61d27c6a961 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1328,9 +1328,18 @@ void SwDoc::CopyFormatArr( const SwFormatsBase& rSourceArr, //FEATURE::CONDCOLL if( RES_CONDTXTFMTCOLL == pSrc->Which() ) + { + if (pDstColl->Which() != RES_CONDTXTFMTCOLL) + { + // Target already had a style with a matching name, but it's not a conditional + // style, then don't copy the conditions. + continue; + } + // Copy the conditions, but delete the old ones first! static_cast<SwConditionTextFormatColl*>(pDstColl)->SetConditions( static_cast<SwConditionTextFormatColl*>(pSrc)->GetCondColls() ); + } //FEATURE::CONDCOLL } } |