summaryrefslogtreecommitdiffstats
path: root/vcl/source
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:47:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 11:47:06 +0000
commit8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59 (patch)
treeca2b0cc4fba88107f5f6e740285184a061011866 /vcl/source
parentAdding debian version 4:24.2.3-2. (diff)
downloadlibreoffice-8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59.tar.xz
libreoffice-8ceff95c69cf9bd9ff5ab3a4b5689925b8bd6a59.zip
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/salvtables.cxx2
-rw-r--r--vcl/source/app/svapp.cxx1
-rw-r--r--vcl/source/filter/igif/gifread.cxx36
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx14
-rw-r--r--vcl/source/gdi/sallayout.cxx33
-rw-r--r--vcl/source/helper/idletask.cxx4
-rw-r--r--vcl/source/outdev/map.cxx8
-rw-r--r--vcl/source/outdev/text.cxx38
8 files changed, 83 insertions, 53 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index faf645fc79..8dc0edf814 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6927,6 +6927,8 @@ public:
virtual void set_mru_entries(const OUString&) override { assert(false && "not implemented"); }
+ virtual void set_max_drop_down_rows(int) override { assert(false && "not implemented"); }
+
virtual void set_item_menu(const OUString&, weld::Menu*) override
{
assert(false && "not implemented");
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index e1e12dbc3e..71b884423a 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -103,7 +103,6 @@ vcl::KeyCode const ReservedKeys[]
vcl::KeyCode(KEY_F2,KEY_SHIFT) ,
vcl::KeyCode(KEY_F4,KEY_MOD1) ,
vcl::KeyCode(KEY_F4,KEY_MOD2) ,
- vcl::KeyCode(KEY_F4,KEY_MOD1|KEY_MOD2) ,
vcl::KeyCode(KEY_F6,0) ,
vcl::KeyCode(KEY_F6,KEY_MOD1) ,
vcl::KeyCode(KEY_F6,KEY_SHIFT) ,
diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx
index 8f56edaee7..95b70568d9 100644
--- a/vcl/source/filter/igif/gifread.cxx
+++ b/vcl/source/filter/igif/gifread.cxx
@@ -99,7 +99,7 @@ class GIFReader : public GraphicReader
sal_uInt8 nGCDisposalMethod; // 'Disposal Method' (see GIF docs)
sal_uInt8 cTransIndex1;
sal_uInt8 cNonTransIndex1;
- bool bEnhance;
+ sal_uLong nPaletteSize;
void ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount );
void ClearImageExtensions();
@@ -157,7 +157,7 @@ GIFReader::GIFReader( SvStream& rStm )
, nGCTransparentIndex ( 0 )
, cTransIndex1 ( 0 )
, cNonTransIndex1 ( 0 )
- , bEnhance( false )
+ , nPaletteSize( 0 )
{
maUpperName = "SVIGIF";
aSrcBuf.resize(256); // Memory buffer for ReadNextBlock
@@ -328,12 +328,7 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount )
(*pPal)[ 254UL ] = COL_BLACK;
}
- // tdf#157793 limit tdf#157635 fix to only larger palettes
- // I don't know why, but the fix for tdf#157635 causes
- // images with a palette of 16 entries to be inverted.
- // Also, fix tdf#158047 by allowing the tdf#157635 fix for
- // palettes with 64 entries.
- bEnhance = (nCount > 16);
+ nPaletteSize = nCount;
}
bool GIFReader::ReadExtension()
@@ -674,16 +669,25 @@ void GIFReader::CreateNewBitmaps()
aAlphaMask.Invert(); // convert from transparency to alpha
aAnimationFrame.maBitmapEx = BitmapEx( aBmp8, aAlphaMask );
}
- else
+ else if( nPaletteSize > 2 )
{
- // tdf#157576 and tdf#157635 mask out black pixels
+ // tdf#160690 set an opaque alpha mask for non-transparent frames
// Due to the switch from transparency to alpha in commit
- // 81994cb2b8b32453a92bcb011830fcb884f22ff3, mask out black
- // pixels in bitmap.
- if (bEnhance)
- aAnimationFrame.maBitmapEx = BitmapEx( aBmp8, aBmp8 );
- else
- aAnimationFrame.maBitmapEx = BitmapEx( aBmp8 );
+ // 81994cb2b8b32453a92bcb011830fcb884f22ff3, an empty alpha mask
+ // is treated as a completely transparent bitmap. So revert all
+ // of the previous commits for tdf#157576, tdf#157635, and tdf#157793
+ // and create a completely opaque bitmap instead.
+ // Note: this fix also fixes tdf#157576, tdf#157635, and tdf#157793.
+ AlphaMask aAlphaMask(aBmp8.GetSizePixel());
+ aAnimationFrame.maBitmapEx = BitmapEx( aBmp8, aAlphaMask );
+ }
+ else
+ {
+ // Don't apply the fix for tdf#160690 as it will cause 1 bit bitmaps
+ // in Word documents like the following test document to fail to be
+ // parsed correctly:
+ // sw/qa/extras/tiledrendering/data/tdf159626_yellowPatternFill.docx
+ aAnimationFrame.maBitmapEx = BitmapEx( aBmp8 );
}
aAnimationFrame.maPositionPixel = Point( nImagePosX, nImagePosY );
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index ff7383d7be..16b0b5e235 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2746,15 +2746,11 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace,
appendDouble(aRect.GetWidth() * fScale, aContents);
aContents.append(" 0 0 ");
appendDouble(aRect.GetHeight() * fScale, aContents);
- aContents.append(
- + " "
- + OString::number(aRect.getX())
- + " "
- + OString::number(aRect.getY())
- + " cm "
- "/Im"
- + OString::number(nObject)
- + " Do Q\n");
+ aContents.append(" ");
+ appendDouble(aRect.getX() * fScale, aContents);
+ aContents.append(" ");
+ appendDouble(aRect.getY() * fScale, aContents);
+ aContents.append(" cm /Im" + OString::number(nObject) + " Do Q\n");
}
const auto& rOutline = rGlyph.getOutline();
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 28138c3f61..3b1279dd1f 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -220,11 +220,10 @@ static double trimInsignificant(double n)
return std::abs(n) >= 0x1p53 ? n : std::round(n * 1e5) / 1e5;
}
-bool SalLayout::GetBoundRect(tools::Rectangle& rRect) const
+bool SalLayout::GetBoundRect(basegfx::B2DRectangle& rRect) const
{
bool bRet = false;
-
- basegfx::B2DRectangle aUnion;
+ rRect.reset();
basegfx::B2DRectangle aRectangle;
basegfx::B2DPoint aPos;
@@ -240,28 +239,28 @@ bool SalLayout::GetBoundRect(tools::Rectangle& rRect) const
{
aRectangle.transform(basegfx::utils::createTranslateB2DHomMatrix(aPos));
// merge rectangle
- aUnion.expand(aRectangle);
+ rRect.expand(aRectangle);
}
bRet = true;
}
}
- if (aUnion.isEmpty())
- {
- rRect = {};
- }
- else
- {
- double l = rtl::math::approxFloor(trimInsignificant(aUnion.getMinX())),
- t = rtl::math::approxFloor(trimInsignificant(aUnion.getMinY())),
- r = rtl::math::approxCeil(trimInsignificant(aUnion.getMaxX())),
- b = rtl::math::approxCeil(trimInsignificant(aUnion.getMaxY()));
- assert(std::isfinite(l) && std::isfinite(t) && std::isfinite(r) && std::isfinite(b));
- rRect = tools::Rectangle(l, t, r, b);
- }
return bRet;
}
+tools::Rectangle SalLayout::BoundRect2Rectangle(basegfx::B2DRectangle& rRect)
+{
+ if (rRect.isEmpty())
+ return {};
+
+ double l = rtl::math::approxFloor(trimInsignificant(rRect.getMinX())),
+ t = rtl::math::approxFloor(trimInsignificant(rRect.getMinY())),
+ r = rtl::math::approxCeil(trimInsignificant(rRect.getMaxX())),
+ b = rtl::math::approxCeil(trimInsignificant(rRect.getMaxY()));
+ assert(std::isfinite(l) && std::isfinite(t) && std::isfinite(r) && std::isfinite(b));
+ return tools::Rectangle(l, t, r, b);
+}
+
SalLayoutGlyphs SalLayout::GetGlyphs() const
{
return SalLayoutGlyphs(); // invalid
diff --git a/vcl/source/helper/idletask.cxx b/vcl/source/helper/idletask.cxx
index 7df0514912..2865d8d036 100644
--- a/vcl/source/helper/idletask.cxx
+++ b/vcl/source/helper/idletask.cxx
@@ -14,8 +14,8 @@
IdleTask::IdleTask()
: flag(false)
{
- //setting the Priority of Idle task to LOW, LOWEST
- maIdle.SetPriority(TaskPriority::LOWEST);
+ //setting the Priority of Idle task to TOOLKIT_DEBUG
+ maIdle.SetPriority(TaskPriority::TOOLKIT_DEBUG);
//set idle for callback
maIdle.SetInvokeHandler(LINK(this, IdleTask, FlipFlag));
//starting the idle
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 23c68a2385..8707805eb1 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -1217,6 +1217,14 @@ basegfx::B2DPolyPolygon OutputDevice::PixelToLogic( const basegfx::B2DPolyPolygo
return aTransformedPoly;
}
+basegfx::B2DRectangle OutputDevice::PixelToLogic(const basegfx::B2DRectangle& rDeviceRect) const
+{
+ basegfx::B2DRectangle aTransformedRect = rDeviceRect;
+ const basegfx::B2DHomMatrix& rTransformationMatrix = GetInverseViewTransformation();
+ aTransformedRect.transform(rTransformationMatrix);
+ return aTransformedRect;
+}
+
vcl::Region OutputDevice::PixelToLogic( const vcl::Region& rDeviceRegion ) const
{
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 1b40a1b2de..16fdf7b073 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -21,6 +21,7 @@
#include <sal/log.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <tools/lineend.hxx>
#include <tools/debug.hxx>
#include <unotools/configmgr.hxx>
@@ -214,7 +215,11 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
tools::Rectangle aBoundRect;
rSalLayout.DrawBase() = basegfx::B2DPoint( 0, 0 );
rSalLayout.DrawOffset() = Point( 0, 0 );
- if (!rSalLayout.GetBoundRect(aBoundRect))
+ if (basegfx::B2DRectangle r; rSalLayout.GetBoundRect(r))
+ {
+ aBoundRect = SalLayout::BoundRect2Rectangle(r);
+ }
+ else
{
// guess vertical text extents if GetBoundRect failed
double nRight = rSalLayout.GetTextWidth();
@@ -1922,8 +1927,21 @@ bool OutputDevice::GetTextBoundRect( tools::Rectangle& rRect,
std::span<const sal_Bool> pKashidaAry,
const SalLayoutGlyphs* pGlyphs ) const
{
+ basegfx::B2DRectangle aRect;
+ bool bRet = GetTextBoundRect(aRect, rStr, nBase, nIndex, nLen, nLayoutWidth, pDXAry,
+ pKashidaAry, pGlyphs);
+ rRect = SalLayout::BoundRect2Rectangle(aRect);
+ return bRet;
+}
+
+bool OutputDevice::GetTextBoundRect(basegfx::B2DRectangle& rRect, const OUString& rStr,
+ sal_Int32 nBase, sal_Int32 nIndex, sal_Int32 nLen,
+ sal_uLong nLayoutWidth, KernArraySpan pDXAry,
+ std::span<const sal_Bool> pKashidaAry,
+ const SalLayoutGlyphs* pGlyphs) const
+{
bool bRet = false;
- rRect.SetEmpty();
+ rRect.reset();
std::unique_ptr<SalLayout> pSalLayout;
const Point aPoint;
@@ -1947,18 +1965,22 @@ bool OutputDevice::GetTextBoundRect( tools::Rectangle& rRect,
nullptr, pGlyphs);
if( pSalLayout )
{
- tools::Rectangle aPixelRect;
+ basegfx::B2DRectangle aPixelRect;
bRet = pSalLayout->GetBoundRect(aPixelRect);
if( bRet )
{
- Point aRotatedOfs( mnTextOffX, mnTextOffY );
basegfx::B2DPoint aPos = pSalLayout->GetDrawPosition(basegfx::B2DPoint(nXOffset, 0));
- aRotatedOfs -= Point(aPos.getX(), aPos.getY());
- aPixelRect += aRotatedOfs;
+ auto m = basegfx::utils::createTranslateB2DHomMatrix(mnTextOffX - aPos.getX(),
+ mnTextOffY - aPos.getY());
+ aPixelRect.transform(m);
rRect = PixelToLogic( aPixelRect );
- if( mbMap )
- rRect += Point( maMapRes.mnMapOfsX, maMapRes.mnMapOfsY );
+ if (mbMap)
+ {
+ m = basegfx::utils::createTranslateB2DHomMatrix(maMapRes.mnMapOfsX,
+ maMapRes.mnMapOfsY);
+ rRect.transform(m);
+ }
}
}