summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-06-29 02:40:48 +0200
committerLuboš Luňák <l.lunak@collabora.com>2021-07-27 09:38:02 +0200
commitb17180a84cb4561b8a7bbf9e2281c91fffd56f87 (patch)
treec3c01cfc5d5619f3e6df767c6be704b94ac018c9
parentefad5d95cd1952d09354650699b5c2daf07aa573 (diff)
write out image size in html export for 'keep ratio' images
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 <l.lunak@collabora.com>
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx8
1 files changed, 4 insertions, 4 deletions
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<sal_Int32>(nPercentWidth)) + "%";
else
sWidth = OString::number(static_cast<sal_Int32>(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<sal_Int32>(nPercentHeight)) + "%";
else
sHeight = OString::number(static_cast<sal_Int32>(aPixelSz.Height()));