summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2022-06-30 15:45:02 -0400
committerJustin Luth <justin_luth@sil.org>2022-07-11 22:10:40 +0200
commitcf02b94bc513ee1b742b4c5d7174632b568e8b72 (patch)
tree584197b17e9353af4d65a62c9e61e60dc34f5b1e /writerfilter
parentdbef922b7ac63c56bd534c1475790198a64131b1 (diff)
tdf#114734 writerfilter: avoid PostIt exception
Comments (aka AnnotationMarks) cannot contain a paragraph style. The exception was causing all properties to be dropped. This fixes the right-to-left text direction issue. Additionally, I need to cancel code when dealing with justify. There is no underlying style to deal with, and also MS Word seems to treat justify literally when dealing with comments. IIRC, LO interally always refers to justify literally, while DOCX normally depends on the RtL context, treating LEFT as START and RIGHT as END. Hmm - I bet that complicates things for export, since exporting comments needs to be handled uniquely. Change-Id: I4f604f90aaad36ea56b8a9157a8a8458f39877c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136690 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 224f8c2aa902..713412ccfa94 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1369,7 +1369,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
{
case NS_ooxml::LN_CT_PPrBase_jc:
{
- bool bExchangeLeftRight = !IsRTFImport() && ExchangeLeftRight(rContext, *m_pImpl);
+ bool bExchangeLeftRight = !IsRTFImport() && !m_pImpl->IsInComments() && ExchangeLeftRight(rContext, *m_pImpl);
handleParaJustification(nIntValue, rContext, bExchangeLeftRight);
break;
}
@@ -1667,7 +1667,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
m_pImpl->GetPropertyFromParaStyleSheet(PROP_WRITING_MODE) >>= nParentBidi;
// Paragraph justification reverses its meaning in an RTL context.
// 1. Only make adjustments if the BiDi changes.
- if ( nParentBidi != nWritingMode && !IsRTFImport() )
+ if (nParentBidi != nWritingMode && !IsRTFImport() && !m_pImpl->IsInComments())
{
style::ParagraphAdjust eAdjust = style::ParagraphAdjust(-1);
// 2. no adjust property exists yet
@@ -3318,7 +3318,7 @@ void DomainMapper::lcl_startParagraphGroup()
if (m_pImpl->GetTopContext())
{
- if (!m_pImpl->IsInShape())
+ if (!m_pImpl->IsInShape() && !m_pImpl->IsInComments())
{
const OUString& sDefaultParaStyle = m_pImpl->GetDefaultParaStyleName();
m_pImpl->GetTopContext()->Insert( PROP_PARA_STYLE_NAME, uno::Any( sDefaultParaStyle ) );