From a975573406553f46507dd309f02a5bf5198596fc Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Mon, 20 Jul 2020 02:29:58 +0200 Subject: tdf#134971 Don't overwrite default styles when inserting doc Seems code never really bothered not to touch default style info, when inserting from file. Original commit is: Author: Sascha Ballach Date: Wed Feb 28 08:24:41 2001 +0000 import of default styles added Change-Id: Ibb639a585bedabdcc5987900ecca1e04f4bb593a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99015 Tested-by: Jenkins Reviewed-by: Thorsten Behrens (cherry picked from commit c84764e08da5e1c6202d300684baab0076d6b3ed) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99919 Reviewed-by: Michael Stahl --- xmloff/source/style/xmlstyle.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xmloff') diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index d020280cb173..f6eeb70dea17 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -839,7 +839,9 @@ void SvXMLStylesContext::CopyStylesToDoc( bool bOverwrite, continue; if (pStyle->IsDefaultStyle()) - pStyle->SetDefaults(); + { + if (bOverwrite) pStyle->SetDefaults(); + } else if( InsertStyleFamily( pStyle->GetFamily() ) ) pStyle->CreateAndInsert( bOverwrite ); } -- cgit