diff options
author | Oliver Specht <oliver.specht@cib.de> | 2015-12-01 10:01:32 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-19 17:59:12 +0200 |
commit | 42ddef789587c5b5bbe7314b53d82642865652ae (patch) | |
tree | cdc8778ca9a786a67d7185e22b90f052701c6cb3 | |
parent | 23acddd6e478eceff770846f0c0aabaa4c265016 (diff) |
tdf#88443: set relative width to objects with captions except formulas
a fix to aoo issue 51453 switched off relative with to all objects
with captions to solve a problem related to formulas
now all objects with captions get relative width except math formulas
Change-Id: I39ccc292ff156c4c94a7a898a6a0602c72bbdd26
Reviewed-on: https://gerrit.libreoffice.org/20320
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Tested-by: Oliver Specht <oliver.specht@cib.de>
(cherry picked from commit 568029bf360e70080d71c5b73fd01464a2d3adc6)
-rw-r--r-- | sw/source/core/doc/doclay.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index e05b5b6339da..9aa4b4a19c0c 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -825,7 +825,19 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable, pNewSet->Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER ) ); aFrameSize = pOldFormat->GetFrameSize(); - aFrameSize.SetWidthPercent(0); + + SwOLENode* pOleNode = rDoc.GetNodes()[nNdIdx + 1]->GetOLENode(); + bool isMath = false; + if(pOleNode) + { + svt::EmbeddedObjectRef& xRef = pOleNode->GetOLEObj().GetObject(); + if(xRef.is()) + { + SvGlobalName aCLSID( xRef->getClassID() ); + isMath = ( SotExchange::IsMath( aCLSID ) != 0 ); + } + } + aFrameSize.SetWidthPercent(isMath ? 0 : 1000); aFrameSize.SetHeightPercent(SwFormatFrameSize::SYNCED); pNewSet->Put( aFrameSize ); |