summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorVasily Melenchuk <vasily.melenchuk@cib.de>2023-04-26 18:03:18 +0300
committerAndras Timar <andras.timar@collabora.com>2023-05-13 20:05:31 +0200
commitaad3eff8d925a1873fda631eb4b5b060d17bce38 (patch)
treebb2536a3570def519218755315e48b07bb54d4b1 /writerfilter
parent4de6c0a08924cb6574024e4529ac5c2e66f633ee (diff)
tdf#151974: writerfilter: apply props only to new document
Properties applied to document shoudl be a case only for new doc, but DomainMapper can be called during pasing of RTF and cause modifications to props in already open document. Tested only for "NoNumberingShowFollowBy" but I assume this is a case for all compatibility props. Change-Id: I4558d809ca477918373b15fa05500ed985e170a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151069 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de> (cherry picked from commit 2d0a87f97e2c9ac50cd6ce329ca8256daf94ead4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151288 Reviewed-by: Stéphane Guillou <stephane.guillou@libreoffice.org> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx45
1 files changed, 25 insertions, 20 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 827c1d4612d8..28e3df63ca3c 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -116,26 +116,31 @@ DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xCon
mbHasControls(false),
mbWasShapeInPara(false)
{
- // #i24363# tab stops relative to indent
- m_pImpl->SetDocumentSettingsProperty(
- getPropertyName( PROP_TABS_RELATIVE_TO_INDENT ),
- uno::Any( false ) );
- m_pImpl->SetDocumentSettingsProperty(
- getPropertyName( PROP_SURROUND_TEXT_WRAP_SMALL ),
- uno::Any( true ) );
- m_pImpl->SetDocumentSettingsProperty(
- getPropertyName( PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING ),
- uno::Any( true ) );
-
- // Don't load the default style definitions to avoid weird mix
- m_pImpl->SetDocumentSettingsProperty("StylesNoDefault", uno::Any(true));
- m_pImpl->SetDocumentSettingsProperty("MsWordCompTrailingBlanks", uno::Any(true));
- m_pImpl->SetDocumentSettingsProperty("HeaderSpacingBelowLastPara",
- uno::Any(true));
- m_pImpl->SetDocumentSettingsProperty("FrameAutowidthWithMorePara", uno::Any(true));
- m_pImpl->SetDocumentSettingsProperty("FootnoteInColumnToPageEnd", uno::Any(true));
- m_pImpl->SetDocumentSettingsProperty("TabAtLeftIndentForParagraphsInList", uno::Any(true));
- m_pImpl->SetDocumentSettingsProperty("NoNumberingShowFollowBy", uno::Any(true));
+ if (m_pImpl->IsNewDoc())
+ {
+ // #i24363# tab stops relative to indent
+ m_pImpl->SetDocumentSettingsProperty(
+ getPropertyName(PROP_TABS_RELATIVE_TO_INDENT),
+ uno::Any(false));
+ m_pImpl->SetDocumentSettingsProperty(
+ getPropertyName(PROP_SURROUND_TEXT_WRAP_SMALL),
+ uno::Any(true));
+ m_pImpl->SetDocumentSettingsProperty(
+ getPropertyName(PROP_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING),
+ uno::Any(true));
+
+ // Don't load the default style definitions to avoid weird mix
+ m_pImpl->SetDocumentSettingsProperty("StylesNoDefault", uno::Any(true));
+ m_pImpl->SetDocumentSettingsProperty("MsWordCompTrailingBlanks", uno::Any(true));
+ m_pImpl->SetDocumentSettingsProperty("HeaderSpacingBelowLastPara",
+ uno::Any(true));
+ m_pImpl->SetDocumentSettingsProperty("FrameAutowidthWithMorePara", uno::Any(true));
+ m_pImpl->SetDocumentSettingsProperty("FootnoteInColumnToPageEnd", uno::Any(true));
+ m_pImpl->SetDocumentSettingsProperty("TabAtLeftIndentForParagraphsInList", uno::Any(true));
+
+ // Enable only for new documents, since pasting from clipboard can influence existing doc
+ m_pImpl->SetDocumentSettingsProperty("NoNumberingShowFollowBy", uno::Any(true));
+ }
// Initialize RDF metadata, to be able to add statements during the import.
try