[Libreoffice-commits] core.git: sw/source

Oliver Specht oliver.specht at cib.de
Tue Dec 1 03:57:12 PST 2015


 sw/source/core/doc/doclay.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 568029bf360e70080d71c5b73fd01464a2d3adc6
Author: Oliver Specht <oliver.specht at cib.de>
Date:   Tue Dec 1 10:01:32 2015 +0100

    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 at cib.de>
    Tested-by: Oliver Specht <oliver.specht at cib.de>

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index e05b5b6..9aa4b4a 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 );
 


More information about the Libreoffice-commits mailing list