summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtfimport/data/tdf105729.rtf9
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx6
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx6
3 files changed, 19 insertions, 2 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf105729.rtf b/sw/qa/extras/rtfimport/data/tdf105729.rtf
new file mode 100644
index 000000000000..996dd37b0057
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf105729.rtf
@@ -0,0 +1,9 @@
+{\rtf1
+{\stylesheet
+{\s16\qc
+Titel 1;}
+}
+\pard\plain \ltrpar\s16\qc
+Centered Title
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 1b9a2cc368a1..79f82d72dedb 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2746,6 +2746,12 @@ DECLARE_RTFIMPORT_TEST(testTdf104287, "tdf104287.rtf")
CPPUNIT_ASSERT(xShape->getAnchor().is());
}
+DECLARE_RTFIMPORT_TEST(testTdf105729, "tdf105729.rtf")
+{
+ // This was style::ParagraphAdjust_LEFT, \ltrpar undone the effect of \qc from style.
+ CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust")));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index fe7b9a97b0b4..79a12523f999 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1445,12 +1445,14 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
if (nIntValue != 0)
{
rContext->Insert(PROP_WRITING_MODE, uno::makeAny( text::WritingMode2::RL_TB ));
- rContext->Insert(PROP_PARA_ADJUST, uno::makeAny( style::ParagraphAdjust_RIGHT ), /*bOverwrite=*/false);
+ if (!IsRTFImport())
+ rContext->Insert(PROP_PARA_ADJUST, uno::makeAny( style::ParagraphAdjust_RIGHT ), /*bOverwrite=*/false);
}
else
{
rContext->Insert(PROP_WRITING_MODE, uno::makeAny( text::WritingMode2::LR_TB ));
- rContext->Insert(PROP_PARA_ADJUST, uno::makeAny( style::ParagraphAdjust_LEFT ), /*bOverwrite=*/false);
+ if (!IsRTFImport())
+ rContext->Insert(PROP_PARA_ADJUST, uno::makeAny( style::ParagraphAdjust_LEFT ), /*bOverwrite=*/false);
}
}