summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo72560b.docxbin0 -> 9969 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx8
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx26
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx10
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.hxx2
5 files changed, 24 insertions, 22 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo72560b.docx b/sw/qa/extras/ooxmlexport/data/fdo72560b.docx
new file mode 100644
index 000000000000..dfe5176f3ae3
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo72560b.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index bc4e289647c4..381262a85d33 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -290,6 +290,14 @@ DECLARE_OOXMLEXPORT_TEST(testFdo72560, "fdo72560.docx")
CPPUNIT_ASSERT_EQUAL( sal_Int32 (style::ParagraphAdjust_RIGHT), getProperty< sal_Int32 >( xParaRightLTR, "ParaAdjust" ));
}
+DECLARE_OOXMLEXPORT_TEST(testFdo72560b, "fdo72560b.docx")
+{
+ // The problem was libreoffice confuse when RTL was specified in non-default style
+ uno::Reference<uno::XInterface> xParaEndRTL(getParagraph( 2, "RTL END"));
+ CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>( xParaEndRTL, "WritingMode" ));
+ CPPUNIT_ASSERT_EQUAL( sal_Int32(style::ParagraphAdjust_LEFT), getProperty< sal_Int32 >( xParaEndRTL, "ParaAdjust" ));
+}
+
DECLARE_OOXMLEXPORT_TEST(testRPrChangeClosed, "rprchange_closed.docx")
{
// Redline defined by rPrChanged wasn't removed.
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 5e6f2b0c0a1a..c1e3141ed9f5 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1183,28 +1183,10 @@ void DomainMapper::lcl_sprm(Sprm & rSprm)
static bool ExchangeLeftRight(const PropertyMapPtr& rContext, DomainMapper_Impl& rImpl)
{
bool bExchangeLeftRight = false;
- boost::optional<PropertyMap::Property> aPropPara = rContext->getProperty(PROP_WRITING_MODE);
- if( aPropPara )
- {
- sal_Int32 aAdjust ;
- if( (aPropPara->second >>= aAdjust) && aAdjust == text::WritingMode2::RL_TB )
- bExchangeLeftRight = true;
- }
- else
- {
- // check if there RTL <bidi> in default style for the paragraph
- StyleSheetEntryPtr pTable = rImpl.GetStyleSheetTable()->FindDefaultParaStyle();
- if ( pTable )
- {
- boost::optional<PropertyMap::Property> aPropStyle = pTable->pProperties->getProperty(PROP_WRITING_MODE);
- if( aPropStyle )
- {
- sal_Int32 aDirect;
- if( (aPropStyle->second >>= aDirect) && aDirect == text::WritingMode2::RL_TB )
- bExchangeLeftRight = true;
- }
- }
- }
+ sal_Int32 aAdjust;
+ uno::Any aPropPara = rImpl.GetAnyProperty(PROP_WRITING_MODE, rContext);
+ if( (aPropPara >>= aAdjust) && aAdjust == text::WritingMode2::RL_TB )
+ bExchangeLeftRight = true;
return bExchangeLeftRight;
}
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 8c3c59243aa0..7f0bbedfe4e0 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -718,6 +718,16 @@ uno::Any DomainMapper_Impl::GetPropertyFromStyleSheet(PropertyIds eId)
return uno::Any();
}
+uno::Any DomainMapper_Impl::GetAnyProperty(PropertyIds eId, const PropertyMapPtr& rContext)
+{
+ if ( rContext )
+ {
+ boost::optional<PropertyMap::Property> aProperty = rContext->getProperty(eId);
+ if ( aProperty )
+ return aProperty->second;
+ }
+ return GetPropertyFromStyleSheet(eId);
+}
ListsManager::Pointer const & DomainMapper_Impl::GetListTable()
{
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 013f8aaa5799..6b6755c6fbfd 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -698,6 +698,8 @@ public:
const OUString GetDefaultParaStyleName();
css::uno::Any GetPropertyFromStyleSheet(PropertyIds eId);
+ // get property first from the given context, or secondly from its stylesheet
+ css::uno::Any GetAnyProperty(PropertyIds eId, const PropertyMapPtr& rContext);
void SetStyleSheetImport( bool bSet ) { m_bInStyleSheetImport = bSet;}
bool IsStyleSheetImport()const { return m_bInStyleSheetImport;}
void SetAnyTableImport( bool bSet ) { m_bInAnyTableImport = bSet;}