summaryrefslogtreecommitdiff
path: root/sw/source/core/doc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-02-04 14:33:37 +0100
committerXisco Faulí <xiscofauli@libreoffice.org>2020-02-07 18:02:50 +0100
commit282cf1507d51573e5e9a4611b1e775b433168ca7 (patch)
treee10bd4a9f3bba31214767b312b2468dddf7e9190 /sw/source/core/doc
parentc1fd8e49f27fba261b5a715426ff5523abf5ac2b (diff)
tdf#130362 sw: fix anchoring of inline math objects
Regression from a7528cd6f17ea5c5b29e7d607e54c62de0d9e7db (sw: insert image: set anchor to at-char by default, 2019-11-18), that defaulted to at-char anchoring for charts and images. What was not considered is that math objects had a previous as-char default (not to-para), and that is supposed to be unchanged. (cherry picked from commit a2f85c062aafb3fd9dfb1c6c6e87e1e73e7545a3) Change-Id: I2a91af6425035b48a0e47ad9b10939945855cd16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87997 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/source/core/doc')
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index c10cd56e93d5..aeafeea3dc2e 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -2855,14 +2855,22 @@ SwFlyFrameFormat* DocumentContentOperationsManager::InsertGraphicObject(
SwFlyFrameFormat* DocumentContentOperationsManager::InsertEmbObject(
const SwPaM &rRg, const svt::EmbeddedObjectRef& xObj,
- const SfxItemSet* pFlyAttrSet)
+ SfxItemSet* pFlyAttrSet)
{
sal_uInt16 nId = RES_POOLFRM_OLE;
if (xObj.is())
{
SvGlobalName aClassName( xObj->getClassID() );
if (SotExchange::IsMath(aClassName))
+ {
nId = RES_POOLFRM_FORMEL;
+ if (pFlyAttrSet && pFlyAttrSet->HasItem(RES_ANCHOR))
+ {
+ // Clear the at-char anchor set in the SwFlyFrameAttrMgr ctor, so the as-char one
+ // set later in pFrameFormat is considered.
+ pFlyAttrSet->ClearItem(RES_ANCHOR);
+ }
+ }
}
SwFrameFormat* pFrameFormat = m_rDoc.getIDocumentStylePoolAccess().GetFrameFormatFromPool( nId );