diff options
author | Oliver Specht <oliver.specht@cib.de> | 2015-12-01 10:01:32 +0100 |
---|---|---|
committer | Oliver Specht <oliver.specht@cib.de> | 2015-12-01 11:56:52 +0000 |
commit | 568029bf360e70080d71c5b73fd01464a2d3adc6 (patch) | |
tree | 6902bc07be4cab0fd06b1672995800fcb1938647 | |
parent | c5c3a1414b52a08ef5701e83e3c1cdcb4c6f7d5a (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>
-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 ); |