summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/uiwriter/data2/tdf90069.docxbin0 -> 4737 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx30
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx13
3 files changed, 43 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data2/tdf90069.docx b/sw/qa/extras/uiwriter/data2/tdf90069.docx
new file mode 100644
index 000000000000..719502a67e78
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data2/tdf90069.docx
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index e351da8e14f7..c9548208150b 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -49,6 +49,7 @@
#include <postithelper.hxx>
#include <fmtcntnt.hxx>
#include <shellio.hxx>
+#include <editeng/fontitem.hxx>
namespace
{
@@ -2421,4 +2422,33 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testOfz18563)
TestImportDOCX(aFileStream);
}
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf90069)
+{
+ SwDoc* pDoc = createDoc("tdf90069.docx");
+
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+
+ SwDocShell* pDocShell = pTextDoc->GetDocShell();
+ CPPUNIT_ASSERT(pDocShell);
+
+ SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
+ CPPUNIT_ASSERT(pWrtShell);
+
+ sal_uLong nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+
+ lcl_dispatchCommand(mxComponent, ".uno:InsertRowsAfter", {});
+ pWrtShell->Down(false);
+ pWrtShell->Insert("foo");
+
+ SwTextNode* pTextNodeA1 = static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex]);
+ CPPUNIT_ASSERT(pTextNodeA1->GetText().startsWith("Insert"));
+ nIndex = pWrtShell->GetCursor()->GetNode().GetIndex();
+ SwTextNode* pTextNodeA2 = static_cast<SwTextNode*>(pDoc->GetNodes()[nIndex]);
+ CPPUNIT_ASSERT_EQUAL(OUString("foo"), pTextNodeA2->GetText());
+ CPPUNIT_ASSERT_EQUAL(true, pTextNodeA2->GetSwAttrSet().HasItem(RES_CHRATR_FONT));
+ OUString sFontName = pTextNodeA2->GetSwAttrSet().GetItem(RES_CHRATR_FONT)->GetFamilyName();
+ CPPUNIT_ASSERT_EQUAL(OUString("Lohit Devanagari"), sFontName);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 3837872d5b1d..e53229985fe1 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1771,6 +1771,19 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
}
}
}
+
+ // tdf#90069 in tables, apply paragraph level character style also on
+ // paragraph level to support its copy during insertion of new table rows
+ if ( xParaProps && m_nTableDepth > 0 )
+ {
+ uno::Sequence< beans::PropertyValue > aValues = pParaContext->GetPropertyValues(false);
+
+ for( const auto& rProp : std::as_const(aValues) )
+ {
+ if ( rProp.Name.startsWith("Char") && rProp.Name != "CharStyleName" && rProp.Name != "CharInteropGrabBag" )
+ xParaProps->setPropertyValue( rProp.Name, rProp.Value );
+ }
+ }
}
if( !bKeepLastParagraphProperties )
rAppendContext.pLastParagraphProperties = pToBeSavedProperties;