[Libreoffice-bugs] [Bug 106132] FILEOPEN, DOCX: Frame (text box) around image cuts into image and caption

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Jul 3 23:54:01 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=106132

--- Comment #12 from Justin L <jluth at mail.com> ---
(In reply to Justin L from comment #11)
> My guess is that some default spacing values for frames/textboxes are not
> being reset to zero during the conversion.
void Shape::setDefaults(bool bHeight)
{
    maDefaultShapeProperties.setProperty(PROP_TextLeftDistance, static_cast<
sal_Int32 >( 250 ));
    maDefaultShapeProperties.setProperty(PROP_TextUpperDistance, static_cast<
sal_Int32 >( 125 ));
    maDefaultShapeProperties.setProperty(PROP_TextRightDistance, static_cast<
sal_Int32 >( 250 ));
    maDefaultShapeProperties.setProperty(PROP_TextLowerDistance, static_cast<
sal_Int32 >( 125 ));
}

Potential fix for the .docx documents (except that it isn't focused on this
particular bug and likely would cause lots of regressions) is:
+++ b/oox/source/drawingml/shape.cxx
@@ -899,6 +899,12 @@ Reference< XShape > const & Shape::createAndInsert(
else if (mbTextBox)
{
  aShapeProps.setProperty(PROP_TextBox, true);
+//clear default border spacing values
+aShapeProps.setProperty(PROP_TextLeftDistance,  static_cast< sal_Int32 >( 0
));
+aShapeProps.setProperty(PROP_TextUpperDistance, static_cast< sal_Int32 >( 0
));
+aShapeProps.setProperty(PROP_TextRightDistance, static_cast< sal_Int32 >( 0
));
+aShapeProps.setProperty(PROP_TextLowerDistance, static_cast< sal_Int32 >( 0
));
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20170703/ba513bb2/attachment-0001.html>


More information about the Libreoffice-bugs mailing list