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

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 27 07:38:40 UTC 2021


 sw/source/filter/html/htmlflywriter.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b17180a84cb4561b8a7bbf9e2281c91fffd56f87
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Jun 29 02:40:48 2021 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Jul 27 09:38:02 2021 +0200

    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 at collabora.com>

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()));


More information about the Libreoffice-commits mailing list