From b17180a84cb4561b8a7bbf9e2281c91fffd56f87 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Tue, 29 Jun 2021 02:40:48 +0200 Subject: write out image size in html export for 'keep ratio' images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this the code was leaving out writing any size to the html output. Which means the size was the original image size, which may not be the size used by Writer. Change-Id: Ia249035a604f0f51f59b3190ebb8975a686533c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119498 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- sw/source/filter/html/htmlflywriter.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sw/source/filter/html/htmlflywriter.cxx') diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index f528c061c9a6..f89b6a39b1e7 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -959,9 +959,9 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma sal_uInt8 nPercentHeight = pFSItem->GetHeightPercent(); // Size of the object in Twips without margins - Size aTwipSz( (nPercentWidth ? 0 + Size aTwipSz( (nPercentWidth && nPercentWidth != 255 ? 0 : pFSItem->GetWidth()-aTwipSpc.Width()), - (nPercentHeight ? 0 + (nPercentHeight && nPercentHeight != 255 ? 0 : pFSItem->GetHeight()-aTwipSpc.Height()) ); OSL_ENSURE( aTwipSz.Width() >= 0 && aTwipSz.Height() >= 0, "Frame size minus spacing < 0!!!???" ); @@ -987,7 +987,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma ((nPercentWidth && nPercentWidth!=255) || aPixelSz.Width()) ) { OString sWidth; - if (nPercentWidth) + if (nPercentWidth && nPercentWidth != 255) sWidth = OString::number(static_cast(nPercentWidth)) + "%"; else sWidth = OString::number(static_cast(aPixelSz.Width())); @@ -998,7 +998,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma ((nPercentHeight && nPercentHeight!=255) || aPixelSz.Height()) ) { OString sHeight; - if (nPercentHeight) + if (nPercentHeight && nPercentHeight != 255) sHeight = OString::number(static_cast(nPercentHeight)) + "%"; else sHeight = OString::number(static_cast(aPixelSz.Height())); -- cgit v1.2.3