Kaydet (Commit) 8d42de21 authored tarafından Justin Luth's avatar Justin Luth

revert tdf#76817 ooxmlimport: connect Heading to existing numbers

tdf#50774 has an example document which was broken by 6.1 commit
8e9e705d.

Reverting does a couple of things:
-go back to previous behaviour (right or wrong) - no regression.
-gives an opportunity to find documents broken by reverting -
i.e. it will give an indication as to which state has more broken
docs. Can be re-visited in 6.2.
-gives me an option to escape from this horrible mess without causing
a regression in a production release of LO.

Change-Id: Ib594b76d5533a0c4807cf70ef706c107e52cddcf
Reviewed-on: https://gerrit.libreoffice.org/54293Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
üst 6fecbff9
......@@ -348,10 +348,13 @@ DECLARE_OOXMLEXPORT_TEST(testNumberingFont, "numbering-font.docx")
DECLARE_OOXMLEXPORT_TEST(testTdf106541_noinheritChapterNumbering, "tdf106541_noinheritChapterNumbering.odt")
{
// in LO, it appears that styles based on the Chapter Numbering style explicitly sets the
// numbering style/outline level to 0 by default, and prevents inheriting directly from "Outline" style.
// in LO, it appears that styles based on the Chapter Numbering style explicitly set the
// numbering style/outline level to 0 by default, and that LO prevents inheriting directly from "Outline" style.
// Adding this preventative unit test to ensure that any fix for tdf106541 doesn't make incorrect assumptions.
CPPUNIT_ASSERT_EQUAL(OUString("Outline"), getProperty<OUString>(getParagraph(1), "NumberingStyleName"));
//reverting tdf#76817 hard-codes the numbering style on the paragraph, preventing RT of "Outline" style
// CPPUNIT_ASSERT_EQUAL(OUString("Outline"), getProperty<OUString>(getParagraph(1), "NumberingStyleName"));
OUString sPara3NumberingStyle = getProperty<OUString>(getParagraph(3), "NumberingStyleName");
CPPUNIT_ASSERT_EQUAL(sPara3NumberingStyle, getProperty<OUString>(getParagraph(4), "NumberingStyleName"));
......@@ -719,7 +722,9 @@ DECLARE_OOXMLEXPORT_TEST(testOOxmlOutlineNumberTypes, "outline-number-types.odt"
DECLARE_OOXMLEXPORT_TEST(testNumParentStyle, "num-parent-style.docx")
{
CPPUNIT_ASSERT_EQUAL(OUString("Outline"), getProperty<OUString>(getParagraph(4), "NumberingStyleName"));
//reverting tdf#76817 hard-codes the numbering style on the paragraph, preventing RT of "Outline" style
//I think this unit test is wrong, but I will revert to its original claim.
CPPUNIT_ASSERT(getProperty<OUString>(getParagraph(4), "NumberingStyleName").startsWith("WWNum"));
}
DECLARE_OOXMLEXPORT_TEST(testNumOverrideLvltext, "num-override-lvltext.docx")
......
......@@ -1132,8 +1132,7 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap )
sal_Int32 nListId = pEntry ? lcl_getListId(pEntry, GetStyleSheetTable()) : -1;
if( pStyleSheetProperties && nListId >= 0 )
{
if ( !pEntry->bIsChapterNumbering )
pParaContext->Insert( PROP_NUMBERING_STYLE_NAME, uno::makeAny( ListDef::GetStyleName( nListId ) ), false);
pParaContext->Insert( PROP_NUMBERING_STYLE_NAME, uno::makeAny( ListDef::GetStyleName( nListId ) ), false);
// Indent properties from the paragraph style have priority
// over the ones from the numbering styles in Word
......
......@@ -625,7 +625,6 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper,
xOutlines->getChapterNumberingRules( );
StyleSheetEntryPtr pParaStyle = pAbsLevel->GetParaStyle( );
pParaStyle->bIsChapterNumbering = true;
aLvlProps.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HEADING_STYLE_NAME), pParaStyle->sConvertedStyleName));
xOutlineRules->replaceByIndex(nLevel, uno::makeAny(comphelper::containerToSequence(aLvlProps)));
......
......@@ -56,7 +56,6 @@ typedef ::std::map< OUString, OUString> StringPairMap_t;
StyleSheetEntry::StyleSheetEntry() :
sStyleIdentifierD()
,bIsDefaultStyle(false)
,bIsChapterNumbering(false)
,bInvalidHeight(false)
,bHasUPE(false)
,nStyleTypeCode(STYLE_TYPE_UNKNOWN)
......@@ -75,7 +74,6 @@ TableStyleSheetEntry::TableStyleSheetEntry( StyleSheetEntry const & rEntry ):
StyleSheetEntry( )
{
bIsDefaultStyle = rEntry.bIsDefaultStyle;
bIsChapterNumbering = rEntry.bIsChapterNumbering;
bInvalidHeight = rEntry.bInvalidHeight;
bHasUPE = rEntry.bHasUPE;
nStyleTypeCode = STYLE_TYPE_TABLE;
......
......@@ -55,7 +55,6 @@ class StyleSheetEntry
public:
OUString sStyleIdentifierD; // WW8 name
bool bIsDefaultStyle;
bool bIsChapterNumbering; //LO built-in Chapter Numbering "Outline" list style
bool bInvalidHeight;
bool bHasUPE; //universal property expansion
StyleType nStyleTypeCode; //sgc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment