summaryrefslogtreecommitdiff
path: root/sw/source/core/edit/edfcol.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2020-08-31 12:49:46 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2020-09-18 13:30:10 +0200
commite046042865cd269b901fdf95c861f66b31fb4b0a (patch)
tree5d8af341247c5415ea13ec5f3cbd765cb68abda0 /sw/source/core/edit/edfcol.cxx
parent42ef0f2cd6f2024b2abab92839a4e14a4246dcfc (diff)
writer: handle styles in multiple languages for online
Use translated name when style is applied and broadcasted. Avoid using style names created by the first view. Change-Id: I18abf3388e69f76ec99eda94e0b67782a52ab23f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101831 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102962 Tested-by: Jenkins Tested-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw/source/core/edit/edfcol.cxx')
-rw-r--r--sw/source/core/edit/edfcol.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx
index d23a345a06ef..23988e1c4e12 100644
--- a/sw/source/core/edit/edfcol.cxx
+++ b/sw/source/core/edit/edfcol.cxx
@@ -91,6 +91,8 @@
#include <tools/diagnose_ex.h>
#include <IDocumentRedlineAccess.hxx>
+#include <SwStyleNameMapper.hxx>
+#include <comphelper/lok.hxx>
#define WATERMARK_NAME "PowerPlusWaterMarkObject"
#define WATERMARK_AUTO_SIZE sal_uInt32(1)
@@ -2186,6 +2188,17 @@ void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat,
RedlineFlags eRedlMode = GetDoc()->getIDocumentRedlineAccess().GetRedlineFlags(), eOldMode = eRedlMode;
SwRewriter aRewriter;
+
+ // in online we can have multiple languages, use universal name then
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ OUString aName;
+ sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(pLocal->GetName(), SwGetPoolIdFromName::TxtColl);
+ SwStyleNameMapper::FillProgName(nId, aName);
+ if (!aName.isEmpty())
+ pLocal->SetName(aName);
+ }
+
aRewriter.AddRule(UndoArg1, pLocal->GetName());
GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::SETFMTCOLL, &aRewriter);