Related: tdf#152250 Copy also style hierarchy

Change-Id: I134857c9a7749b0dd4a6fe6842dcc8c72d373f4d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149928
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 4eb5671..caa43bc 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -695,13 +695,8 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO
                    aStyleName = static_cast<const ScCondDateFormatEntry*>(pEntry)->GetStyleName();

                if(!aStyleName.isEmpty())
                {
                    if(rDocument.GetStyleSheetPool()->Find(aStyleName, SfxStyleFamily::Para))
                        continue;

                    rDocument.GetStyleSheetPool()->CopyStyleFrom(
                            pTable->rDocument.GetStyleSheetPool(), aStyleName, SfxStyleFamily::Para );
                }
                            pTable->rDocument.GetStyleSheetPool(), aStyleName, SfxStyleFamily::Para, true );
            }
        }