sw/inc/SwStyleNameMapper.hxx               |    2 
 sw/qa/extras/odfimport/data/tdf159549.fodt |  121 +++++++++++++++++++++++++++++
 sw/qa/extras/odfimport/odfimport.cxx       |   22 +++++
 sw/source/core/doc/SwStyleNameMapper.cxx   |    3 
 sw/source/core/unocore/unostyle.cxx        |   37 +++-----
 5 files changed, 159 insertions(+), 26 deletions(-)

New commits:
commit 8a8244e019edd5c96311d705a4b4119a41417814
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Mon Dec 9 14:42:44 2024 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Dec 9 20:52:37 2024 +0100

    tdf#159549 sw: add unit test
    
    Change-Id: I8b964d4436835b66f25acece9562516ed70473eb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178148
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    Tested-by: Jenkins
    (cherry picked from commit bfdba3c86301e9680204de0a66bfbfc6383494b9)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178165

diff --git a/sw/qa/extras/odfimport/data/tdf159549.fodt 
b/sw/qa/extras/odfimport/data/tdf159549.fodt
new file mode 100644
index 000000000000..891b4ed9fc8e
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/tdf159549.fodt
@@ -0,0 +1,121 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<office:document xmlns:officeooo="http://openoffice.org/2009/office"; 
xmlns:css3t="http://www.w3.org/TR/css3-text/"; 
xmlns:grddl="http://www.w3.org/2003/g/data-view#"; 
xmlns:xhtml="http://www.w3.org/1999/xhtml"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" 
xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" 
xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" 
xmlns:rpt="http://openoffice.org/2005/report"; 
xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" 
xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" 
xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" 
xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" 
xmlns:xlink="http://www.w3.org/1999/xlink"; 
xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" 
xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" 
xmlns:dc="http://purl.org/dc/eleme
 nts/1.1/" xmlns:ooo="http://openoffice.org/2004/office"; 
xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" 
xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0"
 
xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
 xmlns:drawooo="http://openoffice.org/2010/draw"; 
xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" 
xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" 
xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" 
xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" 
xmlns:ooow="http://openoffice.org/2004/writer"; 
xmlns:oooc="http://openoffice.org/2004/calc"; 
xmlns:tableooo="http://openoffice.org/2009/table"; 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0"
 xmlns:math="http://www.w3.org/1998/Math/MathML"; 
xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" 
xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0
 " xmlns:dom="http://www.w3.org/2001/xml-events"; 
xmlns:xforms="http://www.w3.org/2002/xforms"; office:version="1.2" 
office:mimetype="application/vnd.oasis.opendocument.text">
+ 
<office:meta><meta:creation-date>2024-12-09T13:36:04.154920066</meta:creation-date><dc:date>2024-12-09T14:09:04.311392385</dc:date><meta:editing-duration>PT32M56S</meta:editing-duration><meta:editing-cycles>2</meta:editing-cycles><meta:generator>CIB_OfficeDev/6.4.0.29$Linux_X86_64
 
LibreOffice_project/5374b230ff33d77a7f81d56046759f218a160036</meta:generator><meta:document-statistic
 meta:table-count="0" meta:image-count="0" meta:object-count="0" 
meta:page-count="1" meta:paragraph-count="3" meta:word-count="5" 
meta:character-count="37" 
meta:non-whitespace-character-count="35"/></office:meta>
+ <office:font-face-decls>
+  <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation 
Serif'" style:font-family-generic="roman" style:font-pitch="variable"/>
+  <style:font-face style:name="Lucida Sans" svg:font-family="'Lucida Sans'" 
style:font-family-generic="system" style:font-pitch="variable"/>
+  <style:font-face style:name="Noto Serif CJK SC" svg:font-family="'Noto Serif 
CJK SC'" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+  <style:default-style style:family="graphic">
+   <style:graphic-properties svg:stroke-color="#3465a4" 
draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" 
draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" 
draw:start-line-spacing-vertical="0.283cm" 
draw:end-line-spacing-horizontal="0.283cm" 
draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" 
style:line-break="strict" style:font-independent-line-spacing="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties style:use-window-font-color="true" 
style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" 
fo:country="DE" style:letter-kerning="true" style:font-name-asian="Noto Serif 
CJK SC" style:font-size-asian="10.5pt" style:language-asian="zh" 
style:country-asian="CN" style:font-name-complex="Lucida Sans" 
style:font-size-complex="12pt" style:language-complex="hi" 
style:country-complex="IN"/>
+  </style:default-style>
+  <style:default-style style:family="paragraph">
+   <style:paragraph-properties fo:orphans="2" fo:widows="2" 
fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" 
style:punctuation-wrap="hanging" style:line-break="strict" 
style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+   <style:text-properties style:use-window-font-color="true" 
style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="de" 
fo:country="DE" style:letter-kerning="true" style:font-name-asian="Noto Serif 
CJK SC" style:font-size-asian="10.5pt" style:language-asian="zh" 
style:country-asian="CN" style:font-name-complex="Lucida Sans" 
style:font-size-complex="12pt" style:language-complex="hi" 
style:country-complex="IN" fo:hyphenate="false" 
fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" 
loext:hyphenation-no-caps="false"/>
+  </style:default-style>
+  <style:default-style style:family="table">
+   <style:table-properties table:border-model="collapsing"/>
+  </style:default-style>
+  <style:default-style style:family="table-row">
+   <style:table-row-properties fo:keep-together="auto"/>
+  </style:default-style>
+  <style:style style:name="Standard" style:family="paragraph" 
style:class="text"/>
+  <style:style style:name="Text_20_body" style:display-name="Text body" 
style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+   <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0.247cm" 
loext:contextual-spacing="false" fo:line-height="115%"/>
+   <style:text-properties fo:font-size="32pt"/>
+  </style:style>
+  <style:style style:name="DerivedFromTextBody" style:family="paragraph" 
style:parent-style-name="Text_20_body"/>
+  <style:style style:name="Body_20_Text" style:display-name="Body Text" 
style:family="paragraph" style:parent-style-name="Standard">
+   <style:text-properties fo:font-size="16pt"/>
+  </style:style>
+  <text:outline-style style:name="Outline">
+   <text:outline-level-style text:level="1" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="2" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="3" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="4" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="5" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="6" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="7" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="8" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="9" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="10" style:num-format="">
+    <style:list-level-properties 
text:list-level-position-and-space-mode="label-alignment">
+     <style:list-level-label-alignment text:label-followed-by="listtab"/>
+    </style:list-level-properties>
+   </text:outline-level-style>
+  </text:outline-style>
+  <text:notes-configuration text:note-class="footnote" style:num-format="1" 
text:start-value="0" text:footnotes-position="page" 
text:start-numbering-at="document"/>
+  <text:notes-configuration text:note-class="endnote" style:num-format="i" 
text:start-value="0"/>
+  <text:linenumbering-configuration text:number-lines="false" 
text:offset="0.499cm" style:num-format="1" text:number-position="left" 
text:increment="5"/>
+ </office:styles>
+ <office:automatic-styles>
+  <style:style style:name="T1" style:family="text">
+   <style:text-properties/>
+  </style:style>
+  <style:page-layout style:name="pm1">
+   <style:page-layout-properties fo:page-width="21.001cm" 
fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" 
fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" 
fo:margin-right="2cm" style:writing-mode="lr-tb" 
style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" 
style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" 
style:layout-grid-mode="none" style:layout-grid-ruby-below="false" 
style:layout-grid-print="false" style:layout-grid-display="false" 
style:footnote-max-height="0cm">
+    <style:footnote-sep style:width="0.018cm" 
style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" 
style:line-style="solid" style:adjustment="left" style:rel-width="25%" 
style:color="#000000"/>
+   </style:page-layout-properties>
+   <style:header-style/>
+   <style:footer-style/>
+  </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Standard" style:page-layout-name="pm1"/>
+ </office:master-styles>
+ <office:body>
+  <office:text>
+   <text:sequence-decls>
+    <text:sequence-decl text:display-outline-level="0" 
text:name="Illustration"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+   </text:sequence-decls>
+   <text:p text:style-name="Text_20_body"><text:span text:style-name="T1">Text 
</text:span>Body</text:p>
+   <text:p text:style-name="DerivedFromTextBody">Derived<text:span 
text:style-name="T1">FromTextBody</text:span></text:p>
+   <text:p text:style-name="Body_20_Text">Body Text</text:p>
+  </office:text>
+ </office:body>
+</office:document>
\ No newline at end of file
diff --git a/sw/qa/extras/odfimport/odfimport.cxx 
b/sw/qa/extras/odfimport/odfimport.cxx
index 014c4011cff1..dd22a4937ee2 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -1203,6 +1203,28 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf133459)
     CPPUNIT_ASSERT_EQUAL(u"QQ YYYY"_ustr, getProperty<OUString>(xFormat, 
u"FormatString"_ustr));
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf159549)
+{
+    createSwDoc("tdf159549.fodt");
+
+    uno::Reference<container::XNameAccess> 
xParaStyles(getStyles(u"ParagraphStyles"_ustr));
+
+    uno::Reference<beans::XPropertySet> xStyleBuiltin(xParaStyles->getByName(
+            u"Text body"_ustr), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(float(32), getProperty<float>(xStyleBuiltin, 
"CharHeight"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Standard"), 
xStyleBuiltin.queryThrow<style::XStyle>()->getParentStyle());
+
+    uno::Reference<beans::XPropertySet> xStyleDerived(xParaStyles->getByName(
+            u"DerivedFromTextBody"_ustr), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(float(32), getProperty<float>(xStyleDerived, 
"CharHeight"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Text body"), 
xStyleDerived.queryThrow<style::XStyle>()->getParentStyle());
+
+    uno::Reference<beans::XPropertySet> xStyleCustom(xParaStyles->getByName(
+            u"Body Text"_ustr), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(float(16), getProperty<float>(xStyleCustom, 
"CharHeight"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Standard"), 
xStyleCustom.queryThrow<style::XStyle>()->getParentStyle());
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testTdf134971)
 {
     createSwDoc("tdf134971a.odt");
commit 5917ef4d57ca5869ae3bb419093882e491c06574
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Dec 6 19:25:07 2024 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Dec 9 20:52:28 2024 +0100

    tdf#159549 sw: fix style name in SwXStyle::getParentStyle()
    
    For a style that isn't inserted yet, the m_sParentStyleName is converted
    to UIName by setParentStyle() but isn't converted back to ProgName in
    getParentStyle().
    
    This caused all of the writerfilter test failures in commit
    c166d112381f195a171425d1f9c1d38ce579319a.
    
    Change-Id: Ib5495785996807a8f3d9339ed2740f286b04d716
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177998
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>
    (cherry picked from commit 2b8d794e448a7d3c573ff79cffe9decc8d960262)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178149

diff --git a/sw/inc/SwStyleNameMapper.hxx b/sw/inc/SwStyleNameMapper.hxx
index 4a3b0f1a582b..0fdfb381711a 100644
--- a/sw/inc/SwStyleNameMapper.hxx
+++ b/sw/inc/SwStyleNameMapper.hxx
@@ -89,7 +89,7 @@ public:
     // This gets the UI Name from the programmatic name
     static const OUString& GetUIName(const OUString& rName, 
SwGetPoolIdFromName);
     static         void FillUIName(const OUString& rName, OUString& rFillName,
-                            SwGetPoolIdFromName, bool bBugfix = false);
+                            SwGetPoolIdFromName);
 
     // Get the programmatic Name from the UI name
     static const OUString& GetProgName(const OUString& rName,
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx 
b/sw/source/core/doc/SwStyleNameMapper.cxx
index 554ab750fe49..62d9f440e986 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -295,7 +295,7 @@ void SwStyleNameMapper::FillProgName(
 // Get the UI name from the programmatic name in rName and put it into 
rFillName
 void SwStyleNameMapper::FillUIName(
         const OUString& rName, OUString& rFillName,
-        SwGetPoolIdFromName const eFlags, bool const bBugfix)
+        SwGetPoolIdFromName const eFlags)
 {
     OUString aName = rName;
     if (eFlags == SwGetPoolIdFromName::ChrFmt && rName == "Standard")
@@ -306,7 +306,6 @@ void SwStyleNameMapper::FillUIName(
     {
         rFillName = aName;
         if (eFlags != SwGetPoolIdFromName::TxtColl || // FIXME do it for all 
ids
-            !bBugfix || // TODO why does it change DOCX imports
             GetPoolIdFromUIName(aName, eFlags) == USHRT_MAX)
         {
             // aName isn't in our Prog name table...check if it has a " 
(user)" suffix, if so remove it
diff --git a/sw/source/core/unocore/unostyle.cxx 
b/sw/source/core/unocore/unostyle.cxx
index 098750ab418d..ae1306b66f0a 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -959,8 +959,7 @@ rtl::Reference<SwXBaseStyle> 
SwXStyleFamily::getStyleByName(const OUString& rNam
     if(!m_pBasePool)
         throw uno::RuntimeException();
     OUString sStyleName;
-    SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId(),
-            !m_pDocShell->GetDoc()->IsInWriterfilterImport());
+    SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId());
     SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, 
m_rEntry.family());
     if(!pBase)
         throw container::NoSuchElementException(rName);
@@ -1013,8 +1012,7 @@ sal_Bool SwXStyleFamily::hasByName(const OUString& rName)
     if(!m_pBasePool)
         throw uno::RuntimeException();
     OUString sStyleName;
-    SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId(),
-            m_pDocShell && !m_pDocShell->GetDoc()->IsInWriterfilterImport());
+    SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId());
     SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, 
m_rEntry.family());
     return nullptr != pBase;
 }
@@ -1025,8 +1023,7 @@ void SwXStyleFamily::insertStyleByName(const OUString& 
rName, const rtl::Referen
     if(!m_pBasePool)
         throw uno::RuntimeException();
     OUString sStyleName;
-    SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId(),
-            !m_pDocShell->GetDoc()->IsInWriterfilterImport());
+    SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId());
     SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, 
m_rEntry.family());
     if (pBase)
         throw container::ElementExistException();
@@ -1039,8 +1036,7 @@ void SwXStyleFamily::insertByName(const OUString& rName, 
const uno::Any& rElemen
     if(!m_pBasePool)
         throw uno::RuntimeException();
     OUString sStyleName;
-    SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId(),
-            !m_pDocShell->GetDoc()->IsInWriterfilterImport());
+    SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId());
     SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, 
m_rEntry.family());
     if (pBase)
         throw container::ElementExistException();
@@ -1103,8 +1099,7 @@ void SwXStyleFamily::replaceByName(const OUString& rName, 
const uno::Any& rEleme
     if(!m_pBasePool)
         throw uno::RuntimeException();
     OUString sStyleName;
-    SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId(),
-            !m_pDocShell->GetDoc()->IsInWriterfilterImport());
+    SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId());
     SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, 
m_rEntry.family());
     // replacements only for userdefined styles
     if(!pBase)
@@ -1165,8 +1160,7 @@ void SwXStyleFamily::removeByName(const OUString& rName)
     if(!m_pBasePool)
         throw uno::RuntimeException();
     OUString sName;
-    SwStyleNameMapper::FillUIName(rName, sName, m_rEntry.poolId(),
-            m_pDocShell && !m_pDocShell->GetDoc()->IsInWriterfilterImport());
+    SwStyleNameMapper::FillUIName(rName, sName, m_rEntry.poolId());
     SfxStyleSheetBase* pBase = m_pBasePool->Find(sName, m_rEntry.family());
     if(!pBase)
         throw container::NoSuchElementException();
@@ -1439,7 +1433,9 @@ OUString SwXStyle::getParentStyle()
     {
         if(!m_bIsDescriptor)
             throw uno::RuntimeException();
-        return m_sParentStyleName;
+        OUString ret;
+        SwStyleNameMapper::FillProgName(m_sParentStyleName, ret, 
lcl_GetSwEnumFromSfxEnum(m_rEntry.family()));
+        return ret;
     }
     SfxStyleSheetBase* pBase = m_pBasePool->Find(m_sStyleName, 
m_rEntry.family());
     OUString aString;
@@ -1453,8 +1449,7 @@ void SwXStyle::setParentStyle(const OUString& 
rParentStyle)
 {
     SolarMutexGuard aGuard;
     OUString sParentStyle;
-    SwStyleNameMapper::FillUIName(rParentStyle, sParentStyle, 
lcl_GetSwEnumFromSfxEnum ( m_rEntry.family()),
-            m_pDoc && !m_pDoc->IsInWriterfilterImport());
+    SwStyleNameMapper::FillUIName(rParentStyle, sParentStyle, 
lcl_GetSwEnumFromSfxEnum(m_rEntry.family()));
     if(!m_pBasePool)
     {
         if(!m_bIsDescriptor)
@@ -1760,8 +1755,7 @@ void 
SwXStyle::SetPropertyValue<FN_UNO_FOLLOW_STYLE>(const SfxItemPropertyMapEnt
         return;
     const auto sValue(rValue.get<OUString>());
     OUString aString;
-    SwStyleNameMapper::FillUIName(sValue, aString, m_rEntry.poolId(),
-            m_pDoc && !m_pDoc->IsInWriterfilterImport());
+    SwStyleNameMapper::FillUIName(sValue, aString, m_rEntry.poolId());
     o_rStyleBase.getNewBase()->SetFollow(aString);
 }
 
@@ -1775,8 +1769,7 @@ void SwXStyle::SetPropertyValue<FN_UNO_LINK_STYLE>(const 
SfxItemPropertyMapEntry
         return;
     const auto sValue(rValue.get<OUString>());
     OUString aString;
-    SwStyleNameMapper::FillUIName(sValue, aString, m_rEntry.poolId(),
-            m_pDoc && !m_pDoc->IsInWriterfilterImport());
+    SwStyleNameMapper::FillUIName(sValue, aString, m_rEntry.poolId());
     o_rStyleBase.getNewBase()->SetLink(aString);
 }
 
@@ -1858,8 +1851,7 @@ void 
SwXStyle::SetPropertyValue<FN_UNO_PARA_STYLE_CONDITIONS>(const SfxItemPrope
         const OUString sValue(rNamedValue.Value.get<OUString>());
         // get UI style name from programmatic style name
         OUString aStyleName;
-        SwStyleNameMapper::FillUIName(sValue, aStyleName, 
lcl_GetSwEnumFromSfxEnum(m_rEntry.family()),
-            m_pDoc && !m_pDoc->IsInWriterfilterImport());
+        SwStyleNameMapper::FillUIName(sValue, aStyleName, 
lcl_GetSwEnumFromSfxEnum(m_rEntry.family()));
 
         // check for correct context and style name
         const auto nIdx(GetCommandContextIndex(rNamedValue.Name));
@@ -1903,8 +1895,7 @@ void 
SwXStyle::SetPropertyValue<SID_SWREGISTER_COLLECTION>(const SfxItemProperty
     aReg.SetWhich(SID_SWREGISTER_MODE);
     o_rStyleBase.GetItemSet().Put(aReg);
     OUString aString;
-    SwStyleNameMapper::FillUIName(sName, aString, SwGetPoolIdFromName::TxtColl,
-            m_pDoc && !m_pDoc->IsInWriterfilterImport());
+    SwStyleNameMapper::FillUIName(sName, aString, 
SwGetPoolIdFromName::TxtColl);
     o_rStyleBase.GetItemSet().Put(SfxStringItem(SID_SWREGISTER_COLLECTION, 
aString ) );
 }
 template<>

Reply via email to