[Libreoffice-commits] core.git: vcl/source
vcl/source/treelist/transfer.cxx | 46 +-- 1 file changed, 16 insertions(+), 30 deletions(-) New commits: commit 2bde39767ff2aead9d4cfddc37f32103bfc52f63 Author: Mike Kaganski AuthorDate: Mon Dec 4 13:40:04 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Dec 5 05:40:32 2023 +0100 Drop own mutex to prevent lock order problem When running UITests on Windows with parallelism, I often see deadlocks in clipboard threads, where one thread holds own mutex and tries to lock solar mutex, and the other holds it and waits for own mutex. The problem is in TransferableDataHelper::GetAny, where solar mutex is released temporarily. Avoid it by dropping own mutex, and only using solar mutex. Change-Id: Idbfa2e1399fe94d092b4090e7aa4956be4103744 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160296 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Mike Kaganski diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index 955b47b7cdf2..7e6009de77dc 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -23,7 +23,6 @@ #include #endif #include -#include #include #include #include @@ -1036,7 +1035,6 @@ namespace { class TransferableClipboardNotifier : public ::cppu::WeakImplHelper< XClipboardListener > { private: -::osl::Mutex& mrMutex; Reference< XClipboardNotifier > mxNotifier; TransferableDataHelper* mpListener; @@ -1048,7 +1046,7 @@ protected: virtual void SAL_CALL disposing( const EventObject& Source ) override; public: -TransferableClipboardNotifier( const Reference< XClipboard >& _rxClipboard, TransferableDataHelper& _rListener, ::osl::Mutex& _rMutex ); +TransferableClipboardNotifier( const Reference< XClipboard >& _rxClipboard, TransferableDataHelper& _rListener ); /// determines whether we're currently listening bool isListening() const { return mpListener != nullptr; } @@ -1059,9 +1057,8 @@ public: } -TransferableClipboardNotifier::TransferableClipboardNotifier( const Reference< XClipboard >& _rxClipboard, TransferableDataHelper& _rListener, ::osl::Mutex& _rMutex ) -:mrMutex( _rMutex ) -,mxNotifier( _rxClipboard, UNO_QUERY ) +TransferableClipboardNotifier::TransferableClipboardNotifier( const Reference< XClipboard >& _rxClipboard, TransferableDataHelper& _rListener ) +:mxNotifier( _rxClipboard, UNO_QUERY ) ,mpListener( &_rListener ) { osl_atomic_increment( &m_refCount ); @@ -1079,11 +1076,6 @@ TransferableClipboardNotifier::TransferableClipboardNotifier( const Reference< X void SAL_CALL TransferableClipboardNotifier::changedContents( const clipboard::ClipboardEvent& event ) { SolarMutexGuard aSolarGuard; -// the SolarMutex here is necessary, since -// - we cannot call mpListener without our own mutex locked -// - Rebind respectively InitFormats (called by Rebind) will -// try to lock the SolarMutex, too -::osl::MutexGuard aGuard( mrMutex ); if( mpListener ) mpListener->Rebind( event.Contents ); } @@ -1098,7 +1090,7 @@ void SAL_CALL TransferableClipboardNotifier::disposing( const EventObject& ) void TransferableClipboardNotifier::dispose() { -::osl::MutexGuard aGuard( mrMutex ); +SolarMutexGuard g; Reference< XClipboardListener > xKeepMeAlive( this ); @@ -,7 +1103,6 @@ void TransferableClipboardNotifier::dispose() struct TransferableDataHelper_Impl { -::osl::MutexmaMutex; rtl::Reference mxClipboardListener; TransferableDataHelper_Impl() @@ -1155,7 +1146,7 @@ TransferableDataHelper& TransferableDataHelper::operator=( const TransferableDat { if ( this != &rDataHelper ) { -::osl::MutexGuard aGuard(mxImpl->maMutex); +SolarMutexGuard g; const bool bWasClipboardListening = mxImpl->mxClipboardListener.is(); @@ -1176,7 +1167,7 @@ TransferableDataHelper& TransferableDataHelper::operator=( const TransferableDat TransferableDataHelper& TransferableDataHelper::operator=(TransferableDataHelper&& rDataHelper) { -::osl::MutexGuard aGuard(mxImpl->maMutex); +SolarMutexGuard g; const bool bWasClipboardListening = mxImpl->mxClipboardListener.is(); @@ -1198,7 +1189,7 @@ TransferableDataHelper::~TransferableDataHelper() { StopClipboardListening( ); { -::osl::MutexGuard aGuard(mxImpl->maMutex); +SolarMutexGuard g; maFormats.clear(); mxObjDesc.reset(); } @@ -1302,7 +1293,6 @@ void TransferableDataHelper::FillDataFlavorExVector( const Sequence< DataFlavor void TransferableDataHelper::InitFormats() { SolarMutexGuard aSolarGuard; -::osl::MutexGuard aGuard(mxImpl->maMutex); maFormats.clear(); mxObjDesc.reset(new TransferableObjectDescriptor); @@ -1328,14 +1318,14 @@ void Transferab
[Libreoffice-commits] core.git: vcl/source vcl/win
vcl/source/app/svmain.cxx | 18 +- vcl/win/dtrans/WinClipboard.cxx | 12 vcl/win/dtrans/WinClipboard.hxx |2 ++ 3 files changed, 23 insertions(+), 9 deletions(-) New commits: commit 8472365774b7471e96a025f424a6c7eb7b02db26 Author: Mike Kaganski AuthorDate: Mon Dec 4 15:08:26 2023 +0300 Commit: Mike Kaganski CommitDate: Mon Dec 4 21:49:03 2023 +0100 Avoid clipboard messages after Scheduler::ImplDeInitScheduler When running UITests on Windows with parallelism, often there are clipboard "content changed" messages that fail the assertion in Scheduler::ImplDeInitScheduler. This is because the clipboard is only uninitialized after the scheduler de-init; and even then, the respective threads are not stopped yet. Make sure that clipboard listeners are stopped before calling the Scheduler::ImplDeInitScheduler in DeInitVCL. Change-Id: I37918cdc565c7f1b3bd4f46e71c55bb5a807db6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160308 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 71dcca106a57..3aa2cecf4ec8 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -507,15 +507,6 @@ void DeInitVCL() // as this processes all pending events in debug builds. ImplGetSystemDependentDataManager().flushAll(); -Scheduler::ImplDeInitScheduler(); - -pSVData->mpWinData->maMsgBoxImgList.clear(); -pSVData->maCtrlData.maCheckImgList.clear(); -pSVData->maCtrlData.maRadioImgList.clear(); -pSVData->maCtrlData.moDisclosurePlus.reset(); -pSVData->maCtrlData.moDisclosureMinus.reset(); -pSVData->mpDefaultWin.disposeAndClear(); - #if defined _WIN32 // See GetSystemClipboard (vcl/source/treelist/transfer2.cxx): if (auto const comp = css::uno::Reference( @@ -527,6 +518,15 @@ void DeInitVCL() pSVData->m_xSystemClipboard.clear(); #endif +Scheduler::ImplDeInitScheduler(); + +pSVData->mpWinData->maMsgBoxImgList.clear(); +pSVData->maCtrlData.maCheckImgList.clear(); +pSVData->maCtrlData.maRadioImgList.clear(); +pSVData->maCtrlData.moDisclosurePlus.reset(); +pSVData->maCtrlData.moDisclosureMinus.reset(); +pSVData->mpDefaultWin.disposeAndClear(); + #ifndef NDEBUG DbgGUIDeInitSolarMutexCheck(); #endif diff --git a/vcl/win/dtrans/WinClipboard.cxx b/vcl/win/dtrans/WinClipboard.cxx index f82c56784523..1a8eaea151b5 100644 --- a/vcl/win/dtrans/WinClipboard.cxx +++ b/vcl/win/dtrans/WinClipboard.cxx @@ -82,6 +82,18 @@ CWinClipboard::~CWinClipboard() unregisterClipboardViewer(); } +void CWinClipboard::disposing(std::unique_lock& mutex) +{ +{ +osl::MutexGuard aGuard(s_aClipboardSingletonMutex); +s_pCWinClipbImpl = nullptr; +} + +unregisterClipboardViewer(); + +WeakComponentImplHelper::disposing(mutex); +} + // XClipboard // to avoid unnecessary traffic we check first if there is a clipboard diff --git a/vcl/win/dtrans/WinClipboard.hxx b/vcl/win/dtrans/WinClipboard.hxx index 779c272c56c9..fbaa1b206288 100644 --- a/vcl/win/dtrans/WinClipboard.hxx +++ b/vcl/win/dtrans/WinClipboard.hxx @@ -105,6 +105,8 @@ public: virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() override; IDataObjectPtr getIDataObject(); + +virtual void disposing(std::unique_lock&) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: vcl/source
vcl/source/app/scheduler.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 274e078a6e94e477b594839355cc709829d921dd Author: Mike Kaganski AuthorDate: Mon Dec 4 14:45:57 2023 +0300 Commit: Mike Kaganski CommitDate: Mon Dec 4 17:26:37 2023 +0100 Relax assertion a bit When running UITests on Windows with parallelism, I often see this assertion failing. I don't know why; but every time I attach the debugger to the failed process, I see mpSchedulerStack's mpTask and mpNext are both nullptr. The only place where this can happen is Task::~Task, which seems to suggest that this situation is basically the same as no mpSchedulerStack. Change-Id: I2485333944b6d56a365820bc4ca781098e508f48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160304 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx index 098242fe6c70..e6893055f633 100644 --- a/vcl/source/app/scheduler.cxx +++ b/vcl/source/app/scheduler.cxx @@ -130,7 +130,7 @@ void Scheduler::ImplDeInitScheduler() #endif rSchedCtx.mbActive = false; -assert( nullptr == rSchedCtx.mpSchedulerStack ); +assert( nullptr == rSchedCtx.mpSchedulerStack || (!rSchedCtx.mpSchedulerStack->mpTask && !rSchedCtx.mpSchedulerStack->mpNext) ); if (rSchedCtx.mpSalTimer) rSchedCtx.mpSalTimer->Stop(); delete rSchedCtx.mpSalTimer;
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/png/PngImageReader.cxx | 21 ++--- 1 file changed, 14 insertions(+), 7 deletions(-) New commits: commit a5b6255ee4c4b4df8141235cd4ee392d86e7fb5c Author: Caolán McNamara AuthorDate: Mon Dec 4 13:03:10 2023 + Commit: Caolán McNamara CommitDate: Mon Dec 4 15:25:43 2023 +0100 ofz#64582 Out-of-memory Change-Id: I862d558ffcf7d0347bf6b9e960b6f00c08c9e8fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160310 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/filter/png/PngImageReader.cxx b/vcl/source/filter/png/PngImageReader.cxx index 860bd807a685..d29c0b90c473 100644 --- a/vcl/source/filter/png/PngImageReader.cxx +++ b/vcl/source/filter/png/PngImageReader.cxx @@ -209,7 +209,6 @@ void getImportantChunks(SvStream& rInStream, SvStream& rOutStream, sal_uInt32 nW sal_uInt32 nHeight) { sal_uInt64 nPos = rInStream.Tell(); -sal_uInt32 nChunkSize, nChunkType; rInStream.SetEndian(SvStreamEndian::BIG); rOutStream.SetEndian(SvStreamEndian::BIG); rOutStream.WriteUInt64(PNG_SIGNATURE); @@ -232,6 +231,7 @@ void getImportantChunks(SvStream& rInStream, SvStream& rOutStream, sal_uInt32 nW + PNG_CRC_SIZE); while (rInStream.good()) { +sal_uInt32 nChunkSize(0), nChunkType(0); rInStream.ReadUInt32(nChunkSize); rInStream.ReadUInt32(nChunkType); bool bBreakOuter = false; @@ -255,13 +255,20 @@ void getImportantChunks(SvStream& rInStream, SvStream& rOutStream, sal_uInt32 nW { // Seek back to start of chunk rInStream.SeekRel(-PNG_TYPE_SIZE - PNG_SIZE_SIZE); +const size_t nDataSize = PNG_SIZE_SIZE + PNG_TYPE_SIZE + + static_cast(nChunkSize) + PNG_CRC_SIZE; +if (nDataSize > rInStream.remainingSize()) +{ +SAL_WARN("vcl.filter", "png claims record of size: " + << nDataSize << ", but only " + << rInStream.remainingSize() << " available."); +bBreakOuter = true; +break; +} // Copy chunk to rOutStream -std::vector aData(nChunkSize + PNG_TYPE_SIZE + PNG_SIZE_SIZE - + PNG_CRC_SIZE); -rInStream.ReadBytes(aData.data(), -PNG_TYPE_SIZE + PNG_SIZE_SIZE + nChunkSize + PNG_CRC_SIZE); -rOutStream.WriteBytes(aData.data(), - PNG_TYPE_SIZE + PNG_SIZE_SIZE + nChunkSize + PNG_CRC_SIZE); +std::vector aData(nDataSize); +rInStream.ReadBytes(aData.data(), nDataSize); +rOutStream.WriteBytes(aData.data(), nDataSize); break; } }
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/metaact.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 8bf16dc47e518e3cd2a6611b1c768ae589ea206e Author: Caolán McNamara AuthorDate: Mon Dec 4 10:58:35 2023 + Commit: Caolán McNamara CommitDate: Mon Dec 4 13:10:23 2023 +0100 ofz#64680 Integer-overflow Change-Id: Ic125ef6faf136a9821efc717214dd49ae24d6059 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160288 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 1d5423cb6fed..2e1f3e4d8459 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -1098,6 +1098,9 @@ MetaBmpExScalePartAction::MetaBmpExScalePartAction( const Point& rDstPt, const S void MetaBmpExScalePartAction::Execute( OutputDevice* pOut ) { +if (!AllowRect(pOut->LogicToPixel(tools::Rectangle(maDstPt, maDstSz +return; + pOut->DrawBitmapEx( maDstPt, maDstSz, maSrcPt, maSrcSz, maBmpEx ); }
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/window.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 1f31cfc305224d3494da1b4eeadbe56b7227bb38 Author: Caolán McNamara AuthorDate: Sun Dec 3 21:01:20 2023 + Commit: Caolán McNamara CommitDate: Mon Dec 4 10:49:22 2023 +0100 cid#1545582 COPY_INSTEAD_OF_MOVE Change-Id: I9d88d11889cef3f761b86c967ba1f3da7a8de891 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160287 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index be029ca9572f..c3fa7fb3d74a 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3112,8 +3112,7 @@ const OUString& Window::GetHelpText() const static const char* pEnv = getenv( "HELP_DEBUG" ); if( pEnv && *pEnv ) { -OUString aTxt = mpWindowImpl->maHelpText + "\n--\n" + aStrHelpId; -mpWindowImpl->maHelpText = aTxt; +mpWindowImpl->maHelpText = mpWindowImpl->maHelpText + "\n--\n" + aStrHelpId; } mpWindowImpl->mbHelpTextDynamic = false; }
[Libreoffice-commits] core.git: vcl/source
vcl/source/bitmap/BitmapEx.cxx | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) New commits: commit 52512614d27d0dfe6ff94a738ed3b0cd477ef251 Author: Noel Grandin AuthorDate: Sat Dec 2 15:38:57 2023 +0200 Commit: Noel Grandin CommitDate: Sat Dec 2 21:27:15 2023 +0100 Simplify some AlphaMask code AlphaMask has an operator=, no need for extra complication Change-Id: Ib0f4aba4e1c9a4a594cc1cbc92f3a335dc9295a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160243 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index 1ef50dc5d6a7..84c14cae4b7c 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -65,7 +65,7 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) maBitmap = Bitmap(aSize, rBitmapEx.maBitmap.getPixelFormat()); SetSizePixel(aSize); if( rBitmapEx.IsAlpha() ) -maAlphaMask = AlphaMask( aSize ).ImplGetBitmap(); +maAlphaMask = AlphaMask( aSize ); tools::Rectangle aDestRect( Point( 0, 0 ), aSize ); tools::Rectangle aSrcRect( aSrc, aSize ); @@ -149,7 +149,7 @@ BitmapEx::BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ) : BitmapEx::BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ) : maBitmap ( rBmp ), -maAlphaMask ( rAlphaMask.ImplGetBitmap() ), +maAlphaMask ( rAlphaMask ), maBitmapSize ( maBitmap.GetSizePixel() ) { if (!maBitmap.IsEmpty() && !maAlphaMask.IsEmpty() && maBitmap.GetSizePixel() != maAlphaMask.GetSizePixel()) @@ -438,10 +438,7 @@ bool BitmapEx::CopyPixel( const tools::Rectangle& rRectDst, const tools::Rectang else { sal_uInt8 nTransparencyOpaque = 0; -std::optional pAlpha(std::in_place, GetSizePixel(), &nTransparencyOpaque); - -maAlphaMask = pAlpha->ImplGetBitmap(); -pAlpha.reset(); +maAlphaMask = AlphaMask(GetSizePixel(), &nTransparencyOpaque); maAlphaMask.CopyPixel( rRectDst, rRectSrc, &pBmpExSrc->maAlphaMask ); } } @@ -450,7 +447,7 @@ bool BitmapEx::CopyPixel( const tools::Rectangle& rRectDst, const tools::Rectang sal_uInt8 nTransparencyOpaque = 0; const AlphaMask aAlphaSrc(pBmpExSrc->GetSizePixel(), &nTransparencyOpaque); -maAlphaMask.CopyPixel( rRectDst, rRectSrc, &aAlphaSrc.ImplGetBitmap() ); +maAlphaMask.CopyPixel( rRectDst, rRectSrc, &aAlphaSrc ); } } }
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/CommonSalLayout.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit fdbf404073bd4a59dc0378418cad297a547d5dd4 Author: Khaled Hosny AuthorDate: Thu Nov 30 12:32:23 2023 +0200 Commit: خالد حسني CommitDate: Thu Nov 30 13:18:02 2023 +0100 vcl: Fix comment The comment is saying the opposite of what the code is doing. Change-Id: I16cc44b56f90f622cedb87b9107d17b940665896 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160144 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index da2c898c8b24..bcf6f54639e8 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -192,8 +192,8 @@ bool GenericSalLayout::HasVerticalAlternate(sal_UCS4 aChar, sal_UCS4 aVariationS hb_ot_layout_collect_lookups(pHbFace, HB_OT_TAG_GSUB, nullptr, nullptr, pFeatures, pLookups); if (!hb_set_is_empty(pLookups)) { -// Find the output glyphs in each lookup (i.e. the glyphs that -// would result from applying this lookup). +// Find the input glyphs in each lookup (i.e. the glyphs that +// this lookup applies to). hb_codepoint_t nIdx = HB_SET_VALUE_INVALID; while (hb_set_next(pLookups, &nIdx)) {
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/layout.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit c9bae2d26ed065bad1e490815a7606435cf63556 Author: Gülşah Köse AuthorDate: Wed Nov 29 16:40:00 2023 +0300 Commit: Szymon Kłos CommitDate: Wed Nov 29 22:28:50 2023 +0100 Online: Put the image width height info into json. When online's image render is delayed we don't have any image size info so getting 0x0. To show better result we need that info into message. Signed-off-by: Gülşah Köse Change-Id: I28f345cdd64de5fa47b3b1054330e606e7b32f03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160106 Tested-by: Jenkins Reviewed-by: Szymon Kłos diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 5095ee62009d..5639d8e62d57 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -3104,6 +3104,8 @@ void VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) BitmapEx aImage = pDevice->GetBitmapEx(Point(0,0), aRenderSize); aImage.Scale(aOutputSize); +rJsonWriter.put("imagewidth", aRenderSize.Width()); +rJsonWriter.put("imageheight", aRenderSize.Height()); SvMemoryStream aOStm(65535, 65535); if(GraphicConverter::Export(aOStm, aImage, ConvertDataFormat::PNG) == ERRCODE_NONE)
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/floatwin.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit b5bc39f84984fd1063865225209d905bea19833d Author: Noel Grandin AuthorDate: Fri Nov 24 10:45:37 2023 +0200 Commit: Noel Grandin CommitDate: Fri Nov 24 18:46:05 2023 +0100 tdf#157551 Calc-Validity-CellRange, dropdown tiny regression from commit b6b26421a1029b18b48b69dbdac4bb70fb622604 Author: Noel Grandin Date: Thu Jul 20 08:19:52 2023 +0200 split Point/Size/Rectangle into AbsoluteScreenPixel* types Change-Id: I92c25041520ec5a8f03b5318c00f49bda398b051 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159915 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 3f9bee4041f2..b2faacadb5fa 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -540,7 +540,8 @@ tools::Rectangle FloatingWindow::ImplConvertToRelPos(vcl::Window* pReference, co pParentWinOutDev->ReMirror(aFloatRect); } else - aFloatRect.SetPos(pReference->OutputToScreenPixel(pReference->AbsoluteScreenToOutputPixel(rRect.TopLeft(; +aFloatRect = tools::Rectangle(pReference->OutputToScreenPixel(pReference->AbsoluteScreenToOutputPixel(rRect.TopLeft())), + rRect.GetSize()); return aFloatRect; }
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/jpeg/jpeg.h |5 + 1 file changed, 1 insertion(+), 4 deletions(-) New commits: commit 9beb65b258f5e3e95ad4b86f2682c15ea1dac1af Author: Taichi Haradaguchi <20001...@ymail.ne.jp> AuthorDate: Sun Nov 19 10:49:53 2023 +0900 Commit: Taichi Haradaguchi <20001...@ymail.ne.jp> CommitDate: Sun Nov 19 06:41:07 2023 +0100 tdf#143148: Use pragma once instead of include guards in vcl/source Change-Id: Ie19a3e16861946434342c7e07482ae649a4afb4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159646 Tested-by: Jenkins Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp> diff --git a/vcl/source/filter/jpeg/jpeg.h b/vcl/source/filter/jpeg/jpeg.h index a7ddcffa6ece..2cf600bb6de4 100644 --- a/vcl/source/filter/jpeg/jpeg.h +++ b/vcl/source/filter/jpeg/jpeg.h @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_H -#define INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_H +#pragma once #include @@ -62,6 +61,4 @@ struct SourceManagerStruct { int no_data_available_failures; }; -#endif - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: vcl/source
vcl/source/text/textlayout.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2195d87e62dae3465554be5a20a45b0a377845d2 Author: Chris Sherlock AuthorDate: Tue Oct 17 18:54:26 2023 +1100 Commit: Tomaž Vajngerl CommitDate: Sun Nov 19 02:23:09 2023 +0100 vcl: simplify warning message Change-Id: Ie8ccf8bc5ba493987bebf38d8b1227c30bcd6e2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158077 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx index a9e219099191..33232b6f0999 100644 --- a/vcl/source/text/textlayout.cxx +++ b/vcl/source/text/textlayout.cxx @@ -254,7 +254,7 @@ namespace vcl css::i18n::Boundary aBoundary = xBI->getWordBoundary( rStr, nBreakPos, rDefLocale, css::i18n::WordType::DICTIONARY_WORD, true ); sal_Int32 nWordStart = nPos; sal_Int32 nWordEnd = aBoundary.endPos; -SAL_WARN_IF( nWordEnd <= nWordStart, "vcl", "ImpBreakLine: Start >= End?" ); +SAL_WARN_IF(nWordEnd <= nWordStart, "vcl", "Start >= End?"); sal_Int32 nWordLen = nWordEnd - nWordStart; if ( ( nWordEnd < nSoftBreak ) || ( nWordLen <= 3 ) )
[Libreoffice-commits] core.git: vcl/source
vcl/source/text/textlayout.cxx | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) New commits: commit 72eaff7b6af01f3b6d9754660ce231e74d501466 Author: Chris Sherlock AuthorDate: Tue Oct 17 18:39:01 2023 +1100 Commit: Tomaž Vajngerl CommitDate: Sun Nov 19 02:21:38 2023 +0100 vcl: ImplIsCharIn() -> lcl_IsCharIn() Change-Id: I61b24783e39e9f904c48c0726024cd5fa122b724 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158076 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx index dd05d57f77c3..a9e219099191 100644 --- a/vcl/source/text/textlayout.cxx +++ b/vcl/source/text/textlayout.cxx @@ -30,7 +30,7 @@ #include #include -static bool ImplIsCharIn(sal_Unicode c, const char* pStr) +static bool lcl_IsCharIn(sal_Unicode c, const char* pStr) { while ( *pStr ) { @@ -124,11 +124,11 @@ namespace vcl { nLastContent--; -if (ImplIsCharIn(aStr[nLastContent], pSepChars)) +if (lcl_IsCharIn(aStr[nLastContent], pSepChars)) break; } -while (nLastContent && ImplIsCharIn(aStr[nLastContent-1], pSepChars)) +while (nLastContent && lcl_IsCharIn(aStr[nLastContent-1], pSepChars)) { nLastContent--; } @@ -143,11 +143,11 @@ namespace vcl while (nFirstContent < nLastContent) { nFirstContent++; -if (ImplIsCharIn(aStr[nFirstContent], pSepChars)) +if (lcl_IsCharIn(aStr[nFirstContent], pSepChars)) break; } -while ((nFirstContent < nLastContent) && ImplIsCharIn(aStr[nFirstContent], pSepChars)) +while ((nFirstContent < nLastContent) && lcl_IsCharIn(aStr[nFirstContent], pSepChars)) { nFirstContent++; } @@ -174,12 +174,12 @@ namespace vcl while (nFirstContent < nLastContent) { nLastContent--; -if (ImplIsCharIn(aStr[nLastContent], pSepChars)) +if (lcl_IsCharIn(aStr[nLastContent], pSepChars)) break; } -while ((nFirstContent < nLastContent) && ImplIsCharIn(aStr[nLastContent-1], pSepChars)) +while ((nFirstContent < nLastContent) && lcl_IsCharIn(aStr[nLastContent-1], pSepChars)) { nLastContent--; }
[Libreoffice-commits] core.git: vcl/source
vcl/source/text/textlayout.cxx |6 -- 1 file changed, 6 deletions(-) New commits: commit 696644462e1f3e43608319068db2bbc167e7b8f8 Author: Chris Sherlock AuthorDate: Tue Oct 17 18:34:46 2023 +1100 Commit: Tomaž Vajngerl CommitDate: Sun Nov 19 02:19:35 2023 +0100 vcl: remove unnecessary includes from textlayout.cxx Change-Id: I4cef4b61c15cde5682b65590bebdc9981d38908c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158074 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx index 3b084a03115f..dd05d57f77c3 100644 --- a/vcl/source/text/textlayout.cxx +++ b/vcl/source/text/textlayout.cxx @@ -20,22 +20,16 @@ #include #include #include -#include #include #include #include -#include -#include #include #include #include #include -#include -#include - static bool ImplIsCharIn(sal_Unicode c, const char* pStr) { while ( *pStr )
[Libreoffice-commits] core.git: vcl/source
vcl/source/app/svmain.cxx | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) New commits: commit d45bd161a4750ca30639ce1c6ca6d6d070e6d2cb Author: Michael Stahl AuthorDate: Thu Nov 9 17:13:30 2023 +0100 Commit: Michael Stahl CommitDate: Fri Nov 10 10:15:51 2023 +0100 vcl: don't override user's SSL_CERT_FILE for bundled OpenSSL Change-Id: I5d61fe62c2e6814ea757a0b543f7dbf45e0db456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159219 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index aa22d61de197..3458e6df2a29 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -197,18 +197,22 @@ int ImplSVMain() #if defined(LINUX) && !defined(SYSTEM_OPENSSL) if (!bWasInitVCL) { -try // to point bundled OpenSSL to some system certificate file -{ // ... this only works if the client actually calls -// SSL_CTX_set_default_verify_paths() or similar; e.g. python ssl. -char const*const path = GetCABundleFile(); -OUString constexpr name(u"SSL_CERT_FILE"_ustr); -OUString const filepath(::rtl::OStringToOUString( -::std::string_view(path), osl_getThreadTextEncoding())); -osl_setEnvironment(name.pData, filepath.pData); -} -catch (uno::RuntimeException const& e) +OUString constexpr name(u"SSL_CERT_FILE"_ustr); +OUString temp; +if (osl_getEnvironment(name.pData, &temp.pData) == osl_Process_E_NotFound) { -SAL_WARN("vcl", e.Message); +try // to point bundled OpenSSL to some system certificate file +{ // ... this only works if the client actually calls +// SSL_CTX_set_default_verify_paths() or similar; e.g. python ssl. +char const*const path = GetCABundleFile(); +OUString const filepath(::rtl::OStringToOUString( +::std::string_view(path), osl_getThreadTextEncoding())); +osl_setEnvironment(name.pData, filepath.pData); +} +catch (uno::RuntimeException const& e) +{ +SAL_WARN("vcl", e.Message); +} } } #endif
[Libreoffice-commits] core.git: vcl/source
vcl/source/text/textlayout.cxx | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) New commits: commit 383f666bcad27b2fbea6ac13a42cafd6f035fc5c Author: Chris Sherlock AuthorDate: Tue Oct 17 18:25:38 2023 +1100 Commit: Tomaž Vajngerl CommitDate: Mon Nov 6 07:22:51 2023 +0100 tdf#43157 vcl: remove DBG_ASSERT() from BreakLinesWithIterator() Change-Id: I2ab54966c8a8b5e5a15f78481330365725b6ef30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158073 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx index 95e5d54a4b3c..3b084a03115f 100644 --- a/vcl/source/text/textlayout.cxx +++ b/vcl/source/text/textlayout.cxx @@ -17,6 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include +#include +#include +#include +#include +#include + #include #include #include @@ -26,14 +33,6 @@ #include #include -#include -#include -#include -#include -#include -#include -#include - #include #include @@ -523,7 +522,7 @@ namespace vcl m_rTargetDevice.Push( PushFlags::MAPMODE | PushFlags::FONT | PushFlags::TEXTLAYOUTMODE ); MapMode aTargetMapMode( m_rTargetDevice.GetMapMode() ); -OSL_ENSURE( aTargetMapMode.GetOrigin() == Point(), "ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: uhm, the code below won't work here ..." ); +SAL_WARN_IF(aTargetMapMode.GetOrigin() != Point(), "vcl", "uhm, the code below won't work here ..."); // normally, controls simulate "zoom" by "zooming" the font. This is responsible for (part of) the discrepancies // between text in Writer and text in controls in Writer, though both have the same font. @@ -534,13 +533,11 @@ namespace vcl // also, use a higher-resolution map unit than "pixels", which should save us some rounding errors when // translating coordinates between the reference device and the target device. -OSL_ENSURE( aTargetMapMode.GetMapUnit() == MapUnit::MapPixel, -"ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: this class is not expected to work with such target devices!" ); +SAL_WARN_IF(aTargetMapMode.GetMapUnit() != MapUnit::MapPixel, "vcl", "this class is not expected to work with such target devices!"); // we *could* adjust all the code in this class to handle this case, but at the moment, it's not necessary const MapUnit eTargetMapUnit = m_rReferenceDevice.GetMapMode().GetMapUnit(); aTargetMapMode.SetMapUnit( eTargetMapUnit ); -OSL_ENSURE( aTargetMapMode.GetMapUnit() != MapUnit::MapPixel, -"ReferenceDeviceTextLayout::ReferenceDeviceTextLayout: a reference device which has map mode PIXEL?!" ); +SAL_WARN_IF(aTargetMapMode.GetMapUnit() == MapUnit::MapPixel, "vcl", "a reference device which has map mode PIXEL?!"); m_rTargetDevice.SetMapMode( aTargetMapMode );
[Libreoffice-commits] core.git: vcl/source
vcl/source/text/textlayout.cxx | 97 + 1 file changed, 42 insertions(+), 55 deletions(-) New commits: commit 183973ece62c0eefbd841dcf99f7fb8716f0fca1 Author: Chris Sherlock AuthorDate: Tue Oct 17 18:06:59 2023 +1100 Commit: Tomaž Vajngerl CommitDate: Mon Nov 6 07:21:23 2023 +0100 vcl: flatten TextLayoutHelper::GetNewsEllipsisString() Change-Id: Ie94ce7c75ab96b8f7186f9f0c455dfa3a9f1683f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158072 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx index db2226842d09..95e5d54a4b3c 100644 --- a/vcl/source/text/textlayout.cxx +++ b/vcl/source/text/textlayout.cxx @@ -144,76 +144,63 @@ namespace vcl OUString aTempLastStr1 = "..." + aLastStr; if (GetTextWidth(aTempLastStr1, 0, aTempLastStr1.getLength()) > nMaxWidth) +return GetEllipsisString(aStr, nMaxWidth, DrawTextFlags::EndEllipsis); + +sal_Int32 nFirstContent = 0; +while (nFirstContent < nLastContent) +{ +nFirstContent++; +if (ImplIsCharIn(aStr[nFirstContent], pSepChars)) +break; +} + +while ((nFirstContent < nLastContent) && ImplIsCharIn(aStr[nFirstContent], pSepChars)) { -aStr = GetEllipsisString(aStr, nMaxWidth, DrawTextFlags::EndEllipsis); +nFirstContent++; } -else + +if (nFirstContent >= nLastContent) +return GetEllipsisString(aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis); + +if (nFirstContent > 4) +nFirstContent = 4; + +OUString aFirstStr = OUString::Concat(aStr.subView(0, nFirstContent)) + "..."; +OUString aTempStr = aFirstStr + aLastStr; + +if (GetTextWidth(aTempStr, 0, aTempStr.getLength() ) > nMaxWidth) +return GetEllipsisString(aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis); + +do { -sal_Int32 nFirstContent = 0; +aStr = aTempStr; + +if (nLastContent > aStr.getLength()) +nLastContent = aStr.getLength(); + while (nFirstContent < nLastContent) { -nFirstContent++; -if (ImplIsCharIn( aStr[nFirstContent], pSepChars)) +nLastContent--; +if (ImplIsCharIn(aStr[nLastContent], pSepChars)) break; -} -while ((nFirstContent < nLastContent) && ImplIsCharIn(aStr[nFirstContent], pSepChars)) -{ -nFirstContent++; } -// MEM continue here -if (nFirstContent >= nLastContent) +while ((nFirstContent < nLastContent) && ImplIsCharIn(aStr[nLastContent-1], pSepChars)) { -aStr = GetEllipsisString(aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis); +nLastContent--; } -else -{ -if (nFirstContent > 4) -nFirstContent = 4; -OUString aFirstStr = OUString::Concat(aStr.subView(0, nFirstContent)) + "..."; -OUString aTempStr = aFirstStr + aLastStr; +if (nFirstContent < nLastContent) +{ +std::u16string_view aTempLastStr = aStr.subView(nLastContent); +aTempStr = aFirstStr + aTempLastStr; -if (GetTextWidth(aTempStr, 0, aTempStr.getLength() ) > nMaxWidth) -{ -aStr = GetEllipsisString(aStr, nMaxWidth, nStyle | DrawTextFlags::EndEllipsis); -} -else -{ -do -{ -aStr = aTempStr; - -if (nLastContent > aStr.getLength()) -nLastContent = aStr.getLength(); - -while (nFirstContent < nLastContent) -{ -nLastContent--; -if (ImplIsCharIn(aStr[nLastContent], pSepChars)) -break; - -} - -while ((nFirstContent < nLastContent) && ImplIsCharIn(aStr[nLastContent-1], pSepChars)) -{ -nLastContent--; -} - -if (nFirstContent < nLastContent) -{ -std::u16string_view aTempLastStr = aStr.subView(nLastContent); -aTempStr = aFirstStr + aTempLastStr; - -if (GetTextWidth(aTempStr, 0, aTempStr.getLength()) > nMaxWidth) -break; -} -} -while (nFirstContent < nLastContent); -
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/igif/gifread.cxx | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) New commits: commit 2a5dac6d75b346a77652dec05cafa6562177d40f Author: Patrick Luby AuthorDate: Fri Nov 3 10:37:00 2023 -0400 Commit: Patrick Luby CommitDate: Fri Nov 3 18:32:26 2023 +0100 tdf#158047 allow the tdf#157635 fix for palettes with 64 entries Change-Id: Ib4e4deb5f7e332a7ef3a9231e993231068c21c4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158885 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Patrick Luby diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 78d3190a0c85..cac966c665f4 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -319,8 +319,6 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ) rColor.SetBlue( *pTmp++ ); } -bEnhance = false; - // if possible accommodate some standard colours if( nCount < 256 ) { @@ -329,15 +327,13 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ) if( nCount < 255 ) (*pPal)[ 254UL ] = COL_BLACK; } -else -{ -// 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. -// Is this the only condition for masking out black -// pixels in non-transparent animation frames? -bEnhance = true; -} + +// 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); } bool GIFReader::ReadExtension()
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/window.cxx |3 --- 1 file changed, 3 deletions(-) New commits: commit 3d83bdb94a43b7d77c5a2362cb8204caf47a6b54 Author: Vasily Melenchuk AuthorDate: Wed Oct 25 13:48:39 2023 +0300 Commit: Vasily Melenchuk CommitDate: Thu Nov 2 09:41:06 2023 +0100 vcl: removed redundant check Change-Id: Iec2c344df9eb1fa61bb04355c3eee38499edcdac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158422 Tested-by: Jenkins Reviewed-by: Vasily Melenchuk diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 35b17761e2c4..437a8b14dcb6 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2398,9 +2398,6 @@ void Window::Show(bool bVisible, ShowFlags nFlags) // now only notify with a NULL data pointer, for all other clients except the access bridge. if ( !bRealVisibilityChanged ) CallEventListeners( mpWindowImpl->mbVisible ? VclEventId::WindowShow : VclEventId::WindowHide ); -if( xWindow->isDisposed() ) -return; - } Size Window::GetSizePixel() const
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/jobset.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0bd5b0f92c10db2da04ad8ee7de8e11534df046e Author: Caolán McNamara AuthorDate: Mon Oct 30 16:49:11 2023 + Commit: Noel Grandin CommitDate: Tue Oct 31 06:16:19 2023 +0100 ofz#63741 Unknown Read this went wrong in commit d97e0458914991214e3d396273862855aff66234 Date: Mon Oct 1 03:09:35 2018 +0200 vcl: no raw pointers where rJobData.SetDriverDataLen() was dropped in favour of using using nDriverDataLen, but missed replacing an interleaved GetDriverDataLen() with nDriverDataLen Change-Id: Iebc9145865fa4ec985bc2feed754c775d77011b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158671 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx index c9ed0d9626ec..19fa712ea658 100644 --- a/vcl/source/gdi/jobset.cxx +++ b/vcl/source/gdi/jobset.cxx @@ -297,7 +297,7 @@ SvStream& ReadJobSetup( SvStream& rIStream, JobSetup& rJobSetup ) if ( nDriverDataLen ) { const char* pDriverData = reinterpret_cast(pOldJobData) + nOldJobDataSize; -const char* pDriverDataEnd = pDriverData + rJobData.GetDriverDataLen(); +const char* pDriverDataEnd = pDriverData + nDriverDataLen; if (pDriverDataEnd > pTempBuf.get() + nRead) { SAL_WARN("vcl", "corrupted job setup");
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/itiff/itiff.cxx | 45 ++ 1 file changed, 22 insertions(+), 23 deletions(-) New commits: commit 63ae3bd49834b9961f43b5a082ec809878acb891 Author: Caolán McNamara AuthorDate: Sat Oct 28 20:10:24 2023 +0100 Commit: Caolán McNamara CommitDate: Sun Oct 29 10:16:00 2023 +0100 ofz#63518 don't allow short read with PHOTOMETRIC_YCBCR format which the old parser didn't support Change-Id: I63e426f57e893b13dd800f4af1ed4b50751dbb2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158600 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/filter/itiff/itiff.cxx b/vcl/source/filter/itiff/itiff.cxx index 39bc51a00860..acd9e6d8e1ae 100644 --- a/vcl/source/filter/itiff/itiff.cxx +++ b/vcl/source/filter/itiff/itiff.cxx @@ -171,6 +171,14 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) } } +uint16_t PhotometricInterpretation(0); +uint16_t Compression(COMPRESSION_NONE); +if (bOk) +{ +TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &PhotometricInterpretation); +TIFFGetField(tif, TIFFTAG_COMPRESSION, &Compression); +} + if (bOk && bFuzzing) { const uint64_t MAX_PIXEL_SIZE = 12000; @@ -194,26 +202,18 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) SAL_WARN_IF(!bOk, "filter.tiff", "skipping slow bizarre ratio tile of " << tw << " x " << th << " for image of " << w << " x " << h); } -uint16_t PhotometricInterpretation; -if (TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &PhotometricInterpretation) == 1) +if (PhotometricInterpretation == PHOTOMETRIC_LOGL) { -if (PhotometricInterpretation == PHOTOMETRIC_LOGL) -{ -uint32_t nLogLBufferRequired; -bOk &= !o3tl::checked_multiply(tw, th, nLogLBufferRequired) && nLogLBufferRequired < MAX_PIXEL_SIZE; -SAL_WARN_IF(!bOk, "filter.tiff", "skipping oversized tiff tile " << tw << " x " << th); -} +uint32_t nLogLBufferRequired; +bOk &= !o3tl::checked_multiply(tw, th, nLogLBufferRequired) && nLogLBufferRequired < MAX_PIXEL_SIZE; +SAL_WARN_IF(!bOk, "filter.tiff", "skipping oversized tiff tile " << tw << " x " << th); } -uint16_t Compression; -if (TIFFGetField(tif, TIFFTAG_COMPRESSION, &Compression) == 1) +if (Compression == COMPRESSION_CCITTFAX4) { -if (Compression == COMPRESSION_CCITTFAX4) -{ -uint32_t DspRuns; -bOk &= !o3tl::checked_multiply(tw, static_cast(4), DspRuns) && DspRuns < MAX_PIXEL_SIZE; -SAL_WARN_IF(!bOk, "filter.tiff", "skipping oversized tiff tile width: " << tw); -} +uint32_t DspRuns; +bOk &= !o3tl::checked_multiply(tw, static_cast(4), DspRuns) && DspRuns < MAX_PIXEL_SIZE; +SAL_WARN_IF(!bOk, "filter.tiff", "skipping oversized tiff tile width: " << tw); } } } @@ -223,14 +223,13 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic) std::vector raster(nPixelsRequired); -uint16_t compression(COMPRESSION_NONE); -const bool bNewCodec = TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression) == 1 && - compression >= COMPRESSION_ZSTD; // >= 5 at time of writing +const bool bNewCodec = Compression >= COMPRESSION_ZSTD; // >= 5 at time of writing // For tdf#149417 we generally allow one short read for fidelity with the old -// parser that this replaced. But don't allow that for new format variations -// that the old parser didn't handle so we don't take libtiff into uncharted -// territory. -aContext.bAllowOneShortRead = !bNewCodec; +// parser that this replaced. But don't allow that for: +// a) new compression variations that the old parser didn't handle +// b) complicated pixel layout variations that the old parser didn't handle +// so we don't take libtiff into uncharted territory. +aContext.bAllowOneShortRead = !bNewCodec && PhotometricInterpretation != PHOTOMETRIC_YCBCR; if (TIFFReadRGBAImageOriented(tif, w, h, raster.data(), ORIENTATION_TOPLEFT, 1)) {
[Libreoffice-commits] core.git: vcl/source
vcl/source/graphic/BinaryDataContainer.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit d63bcfe3dde8cf873c897dbbe73fe8db38aaa70f Author: Noel Grandin AuthorDate: Sat Oct 28 19:59:33 2023 +0200 Commit: Noel Grandin CommitDate: Sat Oct 28 22:56:30 2023 +0200 use more TempFileFast in BinaryDataContainer::Impl Change-Id: Iea16260cd152e1c495e7713ada812265dbb5b702 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158598 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/graphic/BinaryDataContainer.cxx b/vcl/source/graphic/BinaryDataContainer.cxx index c9e75bc4ef77..89ae5eb8da1e 100644 --- a/vcl/source/graphic/BinaryDataContainer.cxx +++ b/vcl/source/graphic/BinaryDataContainer.cxx @@ -18,7 +18,7 @@ struct BinaryDataContainer::Impl { // temp file to store the data out of RAM if necessary -std::unique_ptr mpFile; +std::unique_ptr mpFile; // the binary data std::shared_ptr> mpData; @@ -59,7 +59,7 @@ struct BinaryDataContainer::Impl if (!mpData || mpData->empty()) return; -mpFile.reset(new utl::TempFileNamed()); +mpFile.reset(new utl::TempFileFast()); auto pStream = mpFile->GetStream(StreamMode::READWRITE); pStream->WriteBytes(mpData->data(), mpData->size());
[Libreoffice-commits] core.git: vcl/source
vcl/source/outdev/bitmap.cxx | 64 ++- 1 file changed, 28 insertions(+), 36 deletions(-) New commits: commit 4a6492e155d44ef51fc9a89271f857a6f987182e Author: Chris Sherlock AuthorDate: Sun Sep 24 00:42:07 2023 +1000 Commit: Tomaž Vajngerl CommitDate: Fri Oct 27 05:52:56 2023 +0200 vcl: flatten OutputDevice::BlendBitmap() Change-Id: Idb0c21dd37af81fae0fd4152f0556edb20e63b80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157190 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index d95c97e8633c..1806635593d2 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -909,8 +909,6 @@ Bitmap OutputDevice::BlendBitmap( if( !pP || !pA ) return aBmp; -Bitmap res; - if( GetBitCount() <= 8 ) { Bitmap aDither(aBmp.GetSizePixel(), vcl::PixelFormat::N8_BPP); @@ -949,53 +947,47 @@ Bitmap OutputDevice::BlendBitmap( pB.reset(); pW.reset(); -res = aDither; +return aDither; } -else + +BitmapScopedWriteAccess pB(aBmp); + +bool bFastBlend = false; +if (!bHMirr && !bVMirr) { -BitmapScopedWriteAccess pB(aBmp); +SalTwoRect aTR(aBmpRect.Left(), aBmpRect.Top(), aBmpRect.GetWidth(), aBmpRect.GetHeight(), +nOffX, nOffY, aOutSz.Width(), aOutSz.Height()); -bool bFastBlend = false; -if( !bHMirr && !bVMirr ) +bFastBlend = ImplFastBitmapBlending(*pB, *pP, *pA, aTR); +} + +if (!bFastBlend) +{ +for (int nY = 0; nY < nDstHeight; nY++) { -SalTwoRect aTR(aBmpRect.Left(), aBmpRect.Top(), aBmpRect.GetWidth(), aBmpRect.GetHeight(), -nOffX, nOffY, aOutSz.Width(), aOutSz.Height()); +tools::Long nMapY = pMapY[nY]; -bFastBlend = ImplFastBitmapBlending( *pB,*pP,*pA, aTR ); -} +if (bVMirr) +nMapY = aBmpRect.Bottom() - nMapY; -if( !bFastBlend ) -{ -for( int nY = 0; nY < nDstHeight; nY++ ) +Scanline pAScan = pA->GetScanline(nMapY); +Scanline pBScan = pB->GetScanline(nY); +for(int nX = 0; nX < nDstWidth; nX++) { -tools::Long nMapY = pMapY[ nY ]; +tools::Long nMapX = pMapX[nX]; -if ( bVMirr ) -{ -nMapY = aBmpRect.Bottom() - nMapY; -} -Scanline pAScan = pA->GetScanline( nMapY ); -Scanline pBScan = pB->GetScanline(nY); -for( int nX = 0; nX < nDstWidth; nX++ ) -{ -tools::Long nMapX = pMapX[ nX ]; +if (bHMirr) +nMapX = aBmpRect.Right() - nMapX; -if ( bHMirr ) -{ -nMapX = aBmpRect.Right() - nMapX; -} -BitmapColor aDstCol = pB->GetPixelFromData( pBScan, nX ); -aDstCol.Merge( pP->GetColor( nMapY, nMapX ), pAScan[ nMapX ] ); -pB->SetPixelOnData( pBScan, nX, aDstCol ); -} +BitmapColor aDstCol = pB->GetPixelFromData(pBScan, nX); +aDstCol.Merge(pP->GetColor(nMapY, nMapX), pAScan[nMapX]); +pB->SetPixelOnData(pBScan, nX, aDstCol); } } - -pB.reset(); -res = aBmp; } -return res; +pB.reset(); +return aBmp; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: vcl/source
vcl/source/outdev/bitmapex.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit d35236adb3fc561f49134a88c7468411527ee3d5 Author: Chris Sherlock AuthorDate: Sun Sep 24 00:58:17 2023 +1000 Commit: Tomaž Vajngerl CommitDate: Fri Oct 27 05:50:44 2023 +0200 vcl: flatten OutputDevice::GetBitmapEx() Change-Id: I85e7767cd2665febd289cc1fd023d30ab80cfe5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157191 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/source/outdev/bitmapex.cxx b/vcl/source/outdev/bitmapex.cxx index e849f4b73181..b4fa9641a1e5 100644 --- a/vcl/source/outdev/bitmapex.cxx +++ b/vcl/source/outdev/bitmapex.cxx @@ -160,8 +160,8 @@ BitmapEx OutputDevice::GetBitmapEx( const Point& rSrcPt, const Size& rSize ) con return BitmapEx(GetBitmap( rSrcPt, rSize ), AlphaMask( aAlphaBitmap ) ); } -else -return BitmapEx(GetBitmap( rSrcPt, rSize )); + +return BitmapEx(GetBitmap( rSrcPt, rSize )); } void OutputDevice::DrawDeviceBitmapEx( const Point& rDestPt, const Size& rDestSize,
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/textlayout.cxx | 182 ++ 1 file changed, 96 insertions(+), 86 deletions(-) New commits: commit adba3022f14d28090a668da10fc3311633535ae8 Author: Chris Sherlock AuthorDate: Thu Sep 28 21:14:15 2023 +1000 Commit: Tomaž Vajngerl CommitDate: Fri Oct 27 05:48:33 2023 +0200 vcl: flatten TextLayoutCommon::GetEllipsisString() Change-Id: I04a5eed7a6fbd2d4c7f31006c73729cf79a2ed02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157367 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index 2eaf5746f30b..a1597c69793e 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -75,117 +75,127 @@ namespace vcl OUString aStr = rOrigStr; sal_Int32 nIndex = GetTextBreak( aStr, nMaxWidth, 0, aStr.getLength() ); -if ( nIndex != -1 ) +if (nIndex == -1) +return aStr; + +if( (nStyle & DrawTextFlags::CenterEllipsis) == DrawTextFlags::CenterEllipsis ) { -if( (nStyle & DrawTextFlags::CenterEllipsis) == DrawTextFlags::CenterEllipsis ) +OUStringBuffer aTmpStr( aStr ); +// speed it up by removing all but 1.33x as many as the break pos. +sal_Int32 nEraseChars = std::max(4, aStr.getLength() - (nIndex*4)/3); +while( nEraseChars < aStr.getLength() && GetTextWidth( aTmpStr.toString(), 0, aTmpStr.getLength() ) > nMaxWidth ) { -OUStringBuffer aTmpStr( aStr ); -// speed it up by removing all but 1.33x as many as the break pos. -sal_Int32 nEraseChars = std::max(4, aStr.getLength() - (nIndex*4)/3); -while( nEraseChars < aStr.getLength() && GetTextWidth( aTmpStr.toString(), 0, aTmpStr.getLength() ) > nMaxWidth ) -{ -aTmpStr = aStr; -sal_Int32 i = (aTmpStr.getLength() - nEraseChars)/2; -aTmpStr.remove(i, nEraseChars++); -aTmpStr.insert(i, "..."); -} -aStr = aTmpStr.makeStringAndClear(); +aTmpStr = aStr; +sal_Int32 i = (aTmpStr.getLength() - nEraseChars)/2; +aTmpStr.remove(i, nEraseChars++); +aTmpStr.insert(i, "..."); } -else if ( nStyle & DrawTextFlags::EndEllipsis ) +aStr = aTmpStr.makeStringAndClear(); +} +else if ( nStyle & DrawTextFlags::EndEllipsis ) +{ +aStr = aStr.copy(0, nIndex); +if ( nIndex > 1 ) { -aStr = aStr.copy(0, nIndex); -if ( nIndex > 1 ) +aStr += "..."; +while ( !aStr.isEmpty() && ( GetTextWidth( aStr, 0, aStr.getLength() ) > nMaxWidth) ) { -aStr += "..."; -while ( !aStr.isEmpty() && ( GetTextWidth( aStr, 0, aStr.getLength() ) > nMaxWidth) ) -{ -if ( (nIndex > 1) || (nIndex == aStr.getLength()) ) -nIndex--; -aStr = aStr.replaceAt( nIndex, 1, u""); -} +if ( (nIndex > 1) || (nIndex == aStr.getLength()) ) +nIndex--; +aStr = aStr.replaceAt( nIndex, 1, u""); } +} -if ( aStr.isEmpty() && (nStyle & DrawTextFlags::Clip) ) -aStr += OUStringChar(rOrigStr[ 0 ]); +if ( aStr.isEmpty() && (nStyle & DrawTextFlags::Clip) ) +aStr += OUStringChar(rOrigStr[ 0 ]); +} +else if ( nStyle & DrawTextFlags::PathEllipsis ) +{ +OUString aPath( rOrigStr ); +OUString aAbbreviatedPath; +osl_abbreviateSystemPath( aPath.pData, &aAbbreviatedPath.pData, nIndex, nullptr ); +aStr = aAbbreviatedPath; +} +else if ( nStyle & DrawTextFlags::NewsEllipsis ) +{ +static char const pSepChars[] = "."; +// Determine last section +sal_Int32 nLastContent = aStr.getLength(); +while ( nLastContent ) +{ +nLastContent--; +if ( ImplIsCharIn( aStr[ nLastContent ], pSepChars ) ) +break; } -else if ( nStyle & DrawTextFlags::PathEllipsis ) +while ( nLastContent && +ImplIsCharIn( aStr[ nLastContent-1 ], pSepChars ) ) +nLastContent--; + +OUString aLastStr = aStr.copy(nLastContent); +OUString aTempLastStr1 = "..." + aLastStr; +if ( GetTextWidth( aTempLastStr1, 0, aTempLastStr1.getLength() ) > nMaxWidth ) { -OUString aPath( rOrigStr ); -OUString aAbbreviatedP
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/window2.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 455a1775ccef305cfb96cc5f67c8ee47b7f3a2ae Author: Caolán McNamara AuthorDate: Thu Oct 26 12:18:37 2023 +0100 Commit: Caolán McNamara CommitDate: Thu Oct 26 15:52:33 2023 +0200 crash seen in Window::ImplTrackTimerHdl #0 vcl::Window::ImplTrackTimerHdl (this=0x3403b0a0, pTimer=) at libreoffice/vcl/source/window/window2.cxx:231 #1 0x7f2bdd31f5e7 in Scheduler::CallbackTaskScheduling () at libreoffice/vcl/source/app/scheduler.cxx:485 #2 0x7f2bdd4e5176 in SalTimer::CallCallback (this=) at libreoffice/vcl/inc/saltimer.hxx:54 #3 SvpSalInstance::CheckTimeout (this=this@entry=0x261ef40, bExecuteTimers=bExecuteTimers@entry=true) at libreoffice/vcl/headless/svpinst.cxx:212 #4 0x7f2bdd4e713d in SvpSalInstance::ImplYield (this=this@entry=0x261ef40, bWait=bWait@entry=true, bHandleAllCurrentEvents=bHandleAllCurrentEvents@entry=false) at libreoffice/vcl/headless/svpinst.cxx:453 #5 0x7f2bdd4e74a0 in SvpSalInstance::DoYield (this=0x261ef40, bWait=, bHandleAllCurrentEvents=) at libreoffice/vcl/headless/svpinst.cxx:525 Change-Id: I66ec56603aeb8a7fe855253b961dafb0bc7b875e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158441 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 1551bad52cd1..ceaebf52bea8 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -221,6 +221,12 @@ void Window::InvertTracking( const tools::Rectangle& rRect, ShowTrackFlags nFlag IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer, void ) { +if (!mpWindowImpl) +{ +SAL_WARN("vcl", "ImplTrackTimerHdl has outlived dispose"); +return; +} + ImplSVData* pSVData = ImplGetSVData(); // if Button-Repeat we have to change the timeout
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/window2.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 6f3334a204193f9e47f60f45b17dd102148ed586 Author: Caolán McNamara AuthorDate: Thu Oct 26 12:30:12 2023 +0100 Commit: Caolán McNamara CommitDate: Thu Oct 26 15:51:53 2023 +0200 add warning for suspicious potential double-tracking Change-Id: I0fa7b2a108350a394b5d774aaed899215bdb20de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158501 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index c9720139585d..1551bad52cd1 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -265,6 +265,8 @@ void Window::StartTracking( StartTrackingFlags nFlags ) pTrackWin->EndTracking( TrackingEventFlags::Cancel ); } +SAL_WARN_IF(pSVData->mpWinData->mpTrackTimer, "vcl", "StartTracking called while TrackerTimer still running"); + if ( !mpWindowImpl->mbUseFrameData && (nFlags & (StartTrackingFlags::ScrollRepeat | StartTrackingFlags::ButtonRepeat)) ) {
[Libreoffice-commits] core.git: vcl/source
vcl/source/treelist/svimpbox.cxx | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) New commits: commit 6974c10901cc052bce23295ddff25530137e94c8 Author: Michael Weghorn AuthorDate: Tue Oct 24 09:49:32 2023 +0200 Commit: Michael Weghorn CommitDate: Tue Oct 24 12:57:32 2023 +0200 tdf#135921 a11y: Toggle listbox item checkbox on space Allow toggling the state of the checkbox in a listbox/ treelist entry using the space key if the entry is currently selected. This aligns it with the behavior for "plain" checkboxes. On the a11y layer, these listbox entries are even exposed just as a checkbox when there's only a single checkbox for the entry (s. `AccessibleListBoxEntry::getAccessibleRole`), like in the Spelling options dialog ("Tools" -> "Spelling", then press the "Options..." button). For the case where there are multiple checkboxes (like in the Writer autocorrect options dialog), the first checkbox will be toggled. Making it possible to toggle any of the checkboxes for that case would need further work, s.a. the the related tdf#135585. (For gtk3, it's possible to use the arrow keys to switch the column, then use the space key to toggle the checkbox.) That scenario also uses a different approach for the a11y layer, not a single `AccessibleListBoxEntry` object as is the case for the tdf#135921 scenario. This change makes it possible to toggle the checkbox, but so far, the new state is not yet announced when a screen reader is running, neither when using the keyboard nor when using the mouse (which was possible without this change already). The event handling that's required for this will be added in a separate commit. Change-Id: Ic78f9052d166be0da17a76261a09da02b8a11cd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158374 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index f0fa1938a8a9..559882560a12 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -2326,13 +2326,24 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) // toggle selection m_pView->Select( m_pCursor, !m_pView->IsSelected( m_pCursor ) ); } -else if ( !m_pView->IsSelected( m_pCursor ) ) +else if (m_pView->IsSelected(m_pCursor)) +{ +// trigger button +SvLBoxItem* pButtonItem = m_pCursor->GetFirstItem(SvLBoxItemType::Button); +if (pButtonItem) +{ +SvLBoxButton* pButton = static_cast(pButtonItem); +pButton->ClickHdl(m_pCursor); +InvalidateEntry(m_pCursor); +} +else +bKeyUsed = false; +} +else { SelAllDestrAnch( false ); m_pView->Select( m_pCursor ); } -else -bKeyUsed = false; } else bKeyUsed = false;
[Libreoffice-commits] core.git: vcl/source
vcl/source/bitmap/BitmapEx.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 28d2ac7c10cc6ef7199781a786d8a3514a14b6be Author: Andrea Gelmini AuthorDate: Tue Oct 24 07:50:14 2023 +0200 Commit: Julien Nabet CommitDate: Tue Oct 24 10:09:57 2023 +0200 Fix typo Change-Id: Ib2e612960f27d103bd25d14b86fa9eb0c0422669 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158367 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index 7160a5064453..d29a4aaaff40 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -678,7 +678,7 @@ namespace { const Size aDestinationSizePixel(aDestination.GetSizePixel()); -// tdf#157795 set color to black outside of of bitmap bounds +// tdf#157795 set color to black outside of bitmap bounds // Due to commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, // transparent areas are now black instead of white. const BitmapColor aOutside(0x0, 0x0, 0x0);
[Libreoffice-commits] core.git: vcl/source
vcl/source/bitmap/BitmapEx.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit d8ec731e613d840dc7550a3468110a69fd5280e4 Author: Patrick Luby AuthorDate: Mon Oct 23 09:13:29 2023 -0400 Commit: Patrick Luby CommitDate: Mon Oct 23 18:29:08 2023 +0200 tdf#157795 set color to black outside of of bitmap bounds Due to commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, transparent areas are now black instead of white. Change-Id: I9456bb2603d4968a5d5df0a7bdbff48ce9a8e2f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158355 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index 5608254e68bb..7160a5064453 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -677,7 +677,11 @@ namespace if (xRead) { const Size aDestinationSizePixel(aDestination.GetSizePixel()); -const BitmapColor aOutside(BitmapColor(0xff, 0xff, 0xff)); + +// tdf#157795 set color to black outside of of bitmap bounds +// Due to commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, +// transparent areas are now black instead of white. +const BitmapColor aOutside(0x0, 0x0, 0x0); for(tools::Long y(0); y < aDestinationSizePixel.getHeight(); y++) {
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/impgraph.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 9ef3adb3b83824e5b5a539c5886ba59df744bfaa Author: Stephan Bergmann AuthorDate: Fri Oct 20 13:47:24 2023 +0200 Commit: Stephan Bergmann CommitDate: Fri Oct 20 18:42:06 2023 +0200 loplugin:indentation (macOS) Change-Id: I176ac2153d4f2daa48ed4bf85d123904c234f8f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158251 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 780e2c26fd15..ac36d2c72be4 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -799,7 +799,7 @@ Size ImpGraphic::getPrefSize() const aSize = Size(basegfx::fround(rRange.getWidth() / 20.0f), basegfx::fround(rRange.getHeight() / 20.0f)); else #endif -aSize = Size(basegfx::fround(rRange.getWidth()), basegfx::fround(rRange.getHeight())); +aSize = Size(basegfx::fround(rRange.getWidth()), basegfx::fround(rRange.getHeight())); } else {
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/igif/gifread.cxx | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) New commits: commit a98000c028a3c68329fdb2047f51f8d271b2290c Author: Patrick Luby AuthorDate: Thu Oct 19 20:01:16 2023 -0400 Commit: Patrick Luby CommitDate: Fri Oct 20 14:41:04 2023 +0200 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. Is this the only condition for masking out black pixels in non-transparent animation frames? Change-Id: I9550baab4dc4d9b75a21c8af2f6c0b5eb8e46c12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158214 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Patrick Luby diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index afbf084f4f31..78d3190a0c85 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -99,6 +99,7 @@ class GIFReader : public GraphicReader sal_uInt8 nGCDisposalMethod; // 'Disposal Method' (see GIF docs) sal_uInt8 cTransIndex1; sal_uInt8 cNonTransIndex1; +boolbEnhance; voidReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ); voidClearImageExtensions(); @@ -156,6 +157,7 @@ GIFReader::GIFReader( SvStream& rStm ) , nGCTransparentIndex ( 0 ) , cTransIndex1 ( 0 ) , cNonTransIndex1 ( 0 ) +, bEnhance( false ) { maUpperName = "SVIGIF"; aSrcBuf.resize(256);// Memory buffer for ReadNextBlock @@ -317,6 +319,8 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ) rColor.SetBlue( *pTmp++ ); } +bEnhance = false; + // if possible accommodate some standard colours if( nCount < 256 ) { @@ -325,6 +329,15 @@ void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, sal_uLong nCount ) if( nCount < 255 ) (*pPal)[ 254UL ] = COL_BLACK; } +else +{ +// 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. +// Is this the only condition for masking out black +// pixels in non-transparent animation frames? +bEnhance = true; +} } bool GIFReader::ReadExtension() @@ -671,7 +684,10 @@ void GIFReader::CreateNewBitmaps() // Due to the switch from transparency to alpha in commit // 81994cb2b8b32453a92bcb011830fcb884f22ff3, mask out black // pixels in bitmap. -aAnimationFrame.maBitmapEx = BitmapEx( aBmp8, aBmp8 ); +if (bEnhance) +aAnimationFrame.maBitmapEx = BitmapEx( aBmp8, aBmp8 ); +else +aAnimationFrame.maBitmapEx = BitmapEx( aBmp8 ); } aAnimationFrame.maPositionPixel = Point( nImagePosX, nImagePosY );
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/impgraph.cxx | 11 +++ vcl/source/gdi/pdfwriter_impl.cxx | 18 ++ 2 files changed, 21 insertions(+), 8 deletions(-) New commits: commit 5d347c3d72a1d05f998f93f1e1ffea0b55457217 Author: Patrick Luby AuthorDate: Wed Oct 11 19:53:18 2023 -0400 Commit: Patrick Luby CommitDate: Thu Oct 19 18:25:14 2023 +0200 tdf#157680 scale down size and adjust size and scale factor for /BBox The size of an embedded PDF files is multiplied by PDF_INSERT_MAGIC_SCALE_FACTOR for platforms like macOS so undo that by adjusting the size and scale factor. For some unknown reason, when exporting the following PDF, the estimated size of embedded PDF charts are 20x larger than expected. This only occurs on macOS so possibly there is some special conversion from MapUnit::MapPoint to MapUnit::MapTwip elsewhere in the code: https://bugs.documentfoundation.org/attachment.cgi?id=190109 Change-Id: Id0563466fea3d7a3a0419787ec9da45f0c1d2e0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157852 Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index f3f877d3b939..780e2c26fd15 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -788,6 +788,17 @@ Size ImpGraphic::getPrefSize() const // svg not yet buffered in maBitmapEx, return size derived from range const basegfx::B2DRange& rRange = maVectorGraphicData->getRange(); +#ifdef MACOSX +// tdf#157680 scale down estimated size of embedded PDF +// For some unknown reason, the embedded PDF sizes +// are 20x larger than expected. This only occurs on +// macOS so possibly there is some special conversion +// from MapUnit::MapPoint to MapUnit::MapTwip elsewhere +// in the code. +if (maVectorGraphicData->getType() == VectorGraphicDataType::Pdf) + aSize = Size(basegfx::fround(rRange.getWidth() / 20.0f), basegfx::fround(rRange.getHeight() / 20.0f)); +else +#endif aSize = Size(basegfx::fround(rRange.getWidth()), basegfx::fround(rRange.getHeight())); } else diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 2d5fe724a4ac..506fde66b6c7 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -9111,6 +9112,7 @@ void PDFWriterImpl::writeReferenceXObject(const ReferenceXObjectEmit& rEmit) // vcl::ImportPDF() uses getDefaultPdfResolutionDpi to set the desired // rendering DPI so we have to take into account that here too. static const double fResolutionDPI = vcl::pdf::getDefaultPdfResolutionDpi(); +static const double fMagicScaleFactor = PDF_INSERT_MAGIC_SCALE_FACTOR; sal_Int32 nOldDPIX = GetDPIX(); sal_Int32 nOldDPIY = GetDPIY(); @@ -9125,15 +9127,13 @@ void PDFWriterImpl::writeReferenceXObject(const ReferenceXObjectEmit& rEmit) sal_Int32 nWrappedFormObject = 0; if (!m_aContext.UseReferenceXObject) { -#ifdef MACOSX // tdf#156842 increase scale for external PDF data -// For some unknown reason, the scale is 8 times larger than for -// non-external PDF XObjects. +// Multiply PDF_INSERT_MAGIC_SCALE_FACTOR for platforms like macOS +// that scale all images by this number. // This fix also allows the CppunitTest_vcl_pdfexport to run // successfully on macOS. -fScaleX = 8.0 / aSize.Width(); -fScaleY = 8.0 / aSize.Height(); -#endif +fScaleX = fMagicScaleFactor / aSize.Width(); +fScaleY = fMagicScaleFactor / aSize.Height(); // Parse the PDF data, we need that to write the PDF dictionary of our // object. @@ -9375,9 +9375,11 @@ void PDFWriterImpl::writeReferenceXObject(const ReferenceXObjectEmit& rEmit) appendDouble(fScaleY, aLine); aLine.append(" 0 0 ]"); aLine.append(" /BBox [ 0 0 "); -aLine.append(aSize.Width()); +// tdf#157680 reduce size by magic scale factor in /BBox +aLine.append(aSize.Width() / fMagicScaleFactor); aLine.append(" "); -aLine.append(aSize.Height()); +// tdf#157680 reduce size by magic scale factor in /BBox +aLine.append(aSize.Height() / fMagicScaleFactor); aLine.append(" ]\n"); if (m_aContext.UseReferenceXObject && rEmit.m_nEmbeddedObject > 0)
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/png/PngImageReader.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 3a1cf7a24cfbf65adbbe692ac6f8c1b55c7807fe Author: Noel Grandin AuthorDate: Thu Oct 19 12:07:12 2023 +0200 Commit: Noel Grandin CommitDate: Thu Oct 19 16:19:24 2023 +0200 use png_set_keep_unknown_chunks so we don't see unnecessary warnings about the exIf chunks we use Change-Id: Iac02591be8a239b6077fa05826fdd8e76bcc2236 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158174 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/filter/png/PngImageReader.cxx b/vcl/source/filter/png/PngImageReader.cxx index a949f856646e..860bd807a685 100644 --- a/vcl/source/filter/png/PngImageReader.cxx +++ b/vcl/source/filter/png/PngImageReader.cxx @@ -329,6 +329,8 @@ bool reader(SvStream& rStream, Graphic& rGraphic, APNGInfo aAPNGInfo; png_set_read_user_chunk_fn(pPng, &aAPNGInfo, &handle_unknown_chunk); +// don't complain about vpAg and exIf chunks +png_set_keep_unknown_chunks(pPng, 2, nullptr, 0); png_infop pInfo = png_create_info_struct(pPng); if (!pInfo)
[Libreoffice-commits] core.git: vcl/source
vcl/source/pdf/XmpMetadata.cxx | 83 - 1 file changed, 82 insertions(+), 1 deletion(-) New commits: commit a4971aab4d57bf9177c55c3fb0e163e0db7c48fd Author: Michael Stahl AuthorDate: Wed Oct 18 14:23:48 2023 +0200 Commit: Michael Stahl CommitDate: Wed Oct 18 16:58:07 2023 +0200 tdf#157517 vcl: PDF/UA export: add PDF/A extension schema to XMP ... if PDF/A is also enabled. Thanks to Peter Wyatt for the example document. Change-Id: I2a5951e102ae28a4c998adafe8ab51caa2788e4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158118 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/vcl/source/pdf/XmpMetadata.cxx b/vcl/source/pdf/XmpMetadata.cxx index cb88016365b3..e90befdc05b6 100644 --- a/vcl/source/pdf/XmpMetadata.cxx +++ b/vcl/source/pdf/XmpMetadata.cxx @@ -189,8 +189,89 @@ void XmpMetadata::write() } // PDF/UA -if (mbPDF_UA && mnPDF_A == 0) // veraPDF says this is not allowed in PDF/A-[123][ab] +if (mbPDF_UA) { +if (mnPDF_A != 0) +{ // tdf#157517 PDF/A extension schema is required +aXmlWriter.startElement("rdf:Description"); +aXmlWriter.attribute("rdf:about", OString("")); +aXmlWriter.attribute("xmlns:pdfaExtension", + OString("http://www.aiim.org/pdfa/ns/extension/";)); +aXmlWriter.attribute("xmlns:pdfaSchema", + OString("http://www.aiim.org/pdfa/ns/schema#";)); +aXmlWriter.attribute("xmlns:pdfaProperty", + OString("http://www.aiim.org/pdfa/ns/property#";)); +aXmlWriter.startElement("pdfaExtension:schemas"); +aXmlWriter.startElement("rdf:Bag"); +aXmlWriter.startElement("rdf:li"); +aXmlWriter.attribute("rdf:parseType", OString("Resource")); +aXmlWriter.startElement("pdfaSchema:namespaceURI"); +aXmlWriter.content("http://www.aiim.org/pdfua/ns/id/";); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaSchema:prefix"); +aXmlWriter.content("pdfuaid"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaSchema:schema"); +aXmlWriter.content("PDF/UA identification schema"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaSchema:property"); +aXmlWriter.startElement("rdf:Seq"); + +aXmlWriter.startElement("rdf:li"); +aXmlWriter.attribute("rdf:parseType", OString("Resource")); +aXmlWriter.startElement("pdfaProperty:category"); +aXmlWriter.content("internal"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaProperty:description"); +aXmlWriter.content("PDF/UA version identifier"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaProperty:name"); +aXmlWriter.content("part"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaProperty:valueType"); +aXmlWriter.content("Integer"); +aXmlWriter.endElement(); +aXmlWriter.endElement(); // rdf:li + +aXmlWriter.startElement("rdf:li"); +aXmlWriter.attribute("rdf:parseType", OString("Resource")); +aXmlWriter.startElement("pdfaProperty:category"); +aXmlWriter.content("internal"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaProperty:description"); +aXmlWriter.content("PDF/UA amendment identifier"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaProperty:name"); +aXmlWriter.content("amd"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaProperty:valueType"); +aXmlWriter.content("Text"); +aXmlWriter.endElement(); +aXmlWriter.endElement(); // rdf:li + +aXmlWriter.startElement("rdf:li"); +aXmlWriter.attribute("rdf:parseType", OString("Resource")); +aXmlWriter.startElement("pdfaProperty:category"); +aXmlWriter.content("internal"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaProperty:description"); +aXmlWriter.content("PDF/UA corrigenda identifier"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaProperty:name"); +aXmlWriter.content("corr"); +aXmlWriter.endElement(); +aXmlWriter.startElement("pdfaProperty:valueType"); +aXmlWriter.conte
[Libreoffice-commits] core.git: vcl/source
vcl/source/fontsubset/cff.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 37cc752dda0bfe8656baafe299734e63c431b630 Author: Stephan Bergmann AuthorDate: Fri Oct 13 22:47:40 2023 +0200 Commit: Stephan Bergmann CommitDate: Sun Oct 15 19:49:39 2023 +0200 pStringIds can be constexpr This array lacked being const[expr], presumably accidentally, ever since it got introduced in 2d1f08d63942666c0094904f50ba8c512ab69b9d "CWS-TOOLING: integrate CWS otf01". Change-Id: Ia8f8207ed5b0668356cafd284d4de595b5890cb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157948 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index 76a77ec961cd..7284954397fd 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -433,7 +433,7 @@ constexpr OStringLiteral tok_Regular = "Regular"; constexpr OStringLiteral tok_Roman = "Roman"; constexpr OStringLiteral tok_Semibold = "Semibold"; -static rtl::OStringConstExpr pStringIds[] = { +constexpr rtl::OStringConstExpr pStringIds[] = { /*0*/ tok_notdef, tok_space,tok_exclam, tok_quotedbl, tok_numbersign, tok_dollar, tok_percent, tok_ampersand, tok_quoteright, tok_parenleft,tok_parenright, tok_asterisk,
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfextoutdevdata.cxx | 827 +++- 1 file changed, 358 insertions(+), 469 deletions(-) New commits: commit 871a90df575915ce977d33d60bde23b2257b85d8 Author: Noel Grandin AuthorDate: Thu Oct 12 16:09:22 2023 +0200 Commit: Noel Grandin CommitDate: Sat Oct 14 17:18:45 2023 +0200 use a single queue of data for PDFExtOutDevDataSync instead of spreading the data out across multiple queues, which is just asking for trouble. This is slighly less efficient, but these are pretty small objects, so I think the benefit outweighs the cost. Change-Id: I89f8bdffc548cc287f7298081d80132878faf15e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157890 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/gdi/pdfextoutdevdata.cxx b/vcl/source/gdi/pdfextoutdevdata.cxx index 8bc7e044002e..c2c838d5db55 100644 --- a/vcl/source/gdi/pdfextoutdevdata.cxx +++ b/vcl/source/gdi/pdfextoutdevdata.cxx @@ -33,14 +33,103 @@ #include #include +#include namespace vcl { namespace { -struct PDFExtOutDevDataSync -{ -enum Action{CreateNamedDest, +struct CreateNamedDest { +OUString maDestName; +MapMode maParaMapMode; +PDFWriter::DestAreaType mnParaDestAreaType; +tools::Rectangle maParaRect; +sal_Int32 mnPage; +}; +struct CreateDest { +MapMode maParaMapMode; +PDFWriter::DestAreaType mnParaDestAreaType; +tools::Rectangle maParaRect; +sal_Int32 mnPage; +}; +struct CreateControlLink { sal_Int32 mnControlId; }; +struct CreateLink { +OUString maAltText; +MapMode maParaMapMode; +tools::Rectangle maParaRect; +sal_Int32 mnPage; +}; +struct CreateScreen { +OUString maAltText; +OUString maMimeType; +MapMode maParaMapMode; +tools::Rectangle maParaRect; +sal_Int32 mnPage; +}; +struct SetLinkDest { +sal_Int32 mnLinkId; +sal_Int32 mnDestId; +}; +struct SetLinkURL { +OUString maLinkURL; +sal_Int32 mnLinkId; +}; +struct SetScreenURL { +OUString maScreenURL; +sal_Int32 mnScreenId; +}; +struct SetScreenStream { +OUString maScreenStream; +sal_Int32 mnScreenId; +}; +struct RegisterDest { sal_Int32 mnDestId; }; +struct CreateOutlineItem { +OUString maText; +sal_Int32 mnParent; +sal_Int32 mnDestID; +}; +struct CreateNote { +MapMode maParaMapMode; +PDFNote maParaPDFNote; +tools::Rectangle maParaRect; +sal_Int32 mnPage; +}; +struct SetPageTransition { +PDFWriter::PageTransition maParaPageTransition; +sal_uInt32 mnMilliSec; +sal_Int32 mnPage; +}; +struct EnsureStructureElement { sal_Int32 mnId; }; +struct InitStructureElement { +PDFWriter::StructElement mParaStructElement; +OUString maAlias; +sal_Int32 mnId; +}; +struct BeginStructureElement { sal_Int32 mnId; }; +struct EndStructureElement{}; +struct SetCurrentStructureElement { sal_Int32 mnStructId; }; +struct SetStructureAttribute { +PDFWriter::StructAttribute mParaStructAttribute; +PDFWriter::StructAttributeValue mParaStructAttributeValue; +}; +struct SetStructureAttributeNumerical { PDFWriter::StructAttribute mParaStructAttribute; sal_Int32 mnId; }; +struct SetStructureBoundingBox { tools::Rectangle mRect; }; +struct SetStructureAnnotIds { +::std::vector annotIds; +}; +struct SetActualText { OUString maText; }; +struct SetAlternateText { OUString maText; }; +struct CreateControl { +std::shared_ptr< PDFWriter::AnyWidget > mxControl; +}; +struct BeginGroup {}; +struct EndGroupGfxLink { +Graphic maGraphic; +tools::Rectangle maOutputRect, maVisibleOutputRect; +sal_Int32 mnTransparency; +}; + +typedef std::variant GlobalActionData; -EnsureStructureElement, +typedef std::variant PageActionData; +struct PDFExtOutDevDataSyncPage +{ sal_uInt32 nIdx; -Action eAct; +PageActionData eAct; }; struct PDFLinkDestination @@ -81,24 +171,14 @@ struct PDFLinkDestination sal_Int32 mPageNr; PDFWriter::DestAreaType mAreaType; }; - } struct GlobalSyncData { -std::deque< PDFExtOutDevDataSync::Action > mActions; -std::deque< MapMode > mParaMapModes; -std::deque< tools::Rectangle > mParaRects; -std::deque< sal_Int32 > mParaInts; -std::deque< sal_uInt32 >mParauInts; -std::deque< OUString > mParaOUStrings; -std::deque< PDFWriter::DestAreaType > mParaDestAreaTypes; -std::deque< PDFNote > mParaPDFNotes; -std::deque< PDFWriter::PageTransition > mParaPageTransitions; +std::deque< GlobalActionData > mActions; ::std::map< sal_Int32, PDFLinkDestination > mFutureDestinations; -::std::deque mControlIds; -sal_Int32 GetMappedId(); +sal_Int32 GetMappedId(sal_Int32 nLinkId); /** the way this appears to work: (only) everything that
[Libreoffice-commits] core.git: vcl/source
vcl/source/accessibility/AccessibleTextAttributeHelper.cxx | 53 + 1 file changed, 53 insertions(+) New commits: commit c0a284541fad2c4609d418a5002550f6f9581d51 Author: Michael Weghorn AuthorDate: Fri Oct 13 15:51:56 2023 +0200 Commit: Michael Weghorn CommitDate: Fri Oct 13 21:09:15 2023 +0200 tdf#157696 a11y Translate "CharStrikeout" to IA2 equivalents The IAccessible2 text attributes specification [1] has several different "text-line-through-*" attributes for indicating strikethrough. With this change in place, NVDA on Windows (with the WIP branches to switch both LO's winaccessibility and NVDA to the IAccessible2 text attributes) announces the striked out text in the tdf#157696 sample document as expected. For the qt6 VCL plugin on Linux, this is not the case yet, because Qt's AT-SPI adaptor does not support the attributes yet; s.a. QTBUG-118106 [2]. Pending qtbase change implementing that: [3] While the gtk3 VCL plugin reports 2 attributes, e.g. "strikethrough: single" and "text-decoration: line-through", the ATK text attribute specification [4] only mentions a `ATK_TEXT_ATTR_STRIKETHROUGH` that can be either "true" or "false", and that is also what e.g. the gtk4-demo "Text View" -> "Markup" example does, so the suggested Qt change also does this, which means that just "strikethrough: true" will be reported when any kind of strikethrough is in place with the qt6 VCL plugin and both, this LibreOffice change and the pending Qt Gerrit change applied. [1] https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes [2] https://bugreports.qt.io/browse/QTBUG-118106 [3] https://codereview.qt-project.org/c/qt/qtbase/+/511758 [4] https://gnome.pages.gitlab.gnome.org/atk/AtkText.html#AtkTextAttribute Change-Id: Ib4ebba183be233aacfcf33a4fff29b27711d2e1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157939 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx index d8ffa5161930..ccd900e9edc1 100644 --- a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx +++ b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -37,6 +38,53 @@ OUString lcl_ConvertCharEscapement(sal_Int16 nEscapement) return "baseline"; } +OUString lcl_ConverCharStrikeout(sal_Int16 nStrikeout) +{ +OUString sTextLineThroughStyle; +OUString sTextLineThroughText; +OUString sTextLineThroughType; +OUString sTextLineThroughWidth; + +switch (nStrikeout) +{ +case css::awt::FontStrikeout::BOLD: +sTextLineThroughType = "single"; +sTextLineThroughWidth = "bold"; +break; +case css::awt::FontStrikeout::DONTKNOW: +break; +case css::awt::FontStrikeout::DOUBLE: +sTextLineThroughType = "double"; +break; +case css::awt::FontStrikeout::NONE: +sTextLineThroughStyle = "none"; +break; +case css::awt::FontStrikeout::SINGLE: +sTextLineThroughType = "single"; +break; +case css::awt::FontStrikeout::SLASH: +sTextLineThroughText = u"/"_ustr; +break; +case css::awt::FontStrikeout::X: +sTextLineThroughText = u"X"_ustr; +break; +default: +assert(false && "Unhandled strikeout type"); +} + +OUString sResult; +if (!sTextLineThroughStyle.isEmpty()) +sResult += u"text-line-through-style:"_ustr + sTextLineThroughStyle + ";"; +if (!sTextLineThroughText.isEmpty()) +sResult += u"text-line-through-text:"_ustr + sTextLineThroughText + ";"; +if (!sTextLineThroughType.isEmpty()) +sResult += u"text-line-through-type:"_ustr + sTextLineThroughType + ";"; +if (!sTextLineThroughWidth.isEmpty()) +sResult += u"text-line-through-width:"_ustr + sTextLineThroughWidth + ";"; + +return sResult; +} + OUString lcl_convertFontWeight(double fontWeight) { if (fontWeight == css::awt::FontWeight::THIN || fontWeight == css::awt::FontWeight::ULTRALIGHT) @@ -212,6 +260,11 @@ OUString AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes( const css::awt::FontSlant eFontSlant = *o3tl::doAccess(prop.Value); sValue = lcl_ConvertFontSlant(eFontSlant); } +else if (prop.Name == "CharStrikeout") +{ +const sal_Int16 nStrikeout = *o3tl::doAccess(prop.Value); +aRet += lcl_ConverCharStrikeout(nStrikeout); +} else if (prop.Name == "CharUnderline") { OUString sUnderlineStyle;
[Libreoffice-commits] core.git: vcl/source
vcl/source/accessibility/AccessibleTextAttributeHelper.cxx | 16 + 1 file changed, 16 insertions(+) New commits: commit 807b0507563b1c54822dd302b210931297acde23 Author: Michael Weghorn AuthorDate: Thu Oct 12 14:54:46 2023 +0200 Commit: Michael Weghorn CommitDate: Thu Oct 12 22:14:18 2023 +0200 tdf#157696 a11y: Map "CharEscapement" text attr to IA2 "text-position" While the gtk3 implementation (see `Escapement2VerticalAlign` in `vcl/unx/gtk3/a11y/atktextattributes.cxx`) bridges numeric values to ATK/AT-SPI, the IAccessible2 text attribute specification [1] only allows the 3 values "baseline", "super" and "sub". With this in place, Orca with the qt6 VCL plugin on Linux and NVDA on Windows (with the WIP branches to switch both LO's winaccessibility and NVDA to the IAccessible2 text attributes) announce the subscript and superscript text in the tdf#157696 sample document as expected. (For Orca, announcement of the "vertical-align" text attribute is off by default, so that first needs to be enabled in the "Text Attributes" section of the Orca configuration dialog.) [1] http://www.w3.org/TR/REC-CSS2/visudet.html#propdef-vertical-align Change-Id: I1e4ea014cf818fefd009089be183615abf67aada Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157867 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx index d3c77b9a6233..d8ffa5161930 100644 --- a/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx +++ b/vcl/source/accessibility/AccessibleTextAttributeHelper.cxx @@ -27,6 +27,16 @@ namespace { +OUString lcl_ConvertCharEscapement(sal_Int16 nEscapement) +{ +if (nEscapement > 0) +return "super"; +if (nEscapement < 0) +return "sub"; + +return "baseline"; +} + OUString lcl_convertFontWeight(double fontWeight) { if (fontWeight == css::awt::FontWeight::THIN || fontWeight == css::awt::FontWeight::ULTRALIGHT) @@ -180,6 +190,12 @@ OUString AccessibleTextAttributeHelper::ConvertUnoToIAccessible2TextAttributes( sValue = lcl_ConvertColor( Color(ColorTransparency, *o3tl::doAccess(prop.Value))); } +else if (prop.Name == "CharEscapement") +{ +sAttribute = "text-position"; +const sal_Int16 nEscapement = *o3tl::doAccess(prop.Value); +sValue = lcl_ConvertCharEscapement(nEscapement); +} else if (prop.Name == "CharFontName") { sAttribute = "font-family";
[Libreoffice-commits] core.git: vcl/source
vcl/source/app/svdata.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 0cd703c699334ed96a5743aae977207ba9a2a74b Author: Deepika Goyal AuthorDate: Tue Oct 10 16:37:33 2023 +0400 Commit: Ilmari Lauhakangas CommitDate: Thu Oct 12 19:10:19 2023 +0200 tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro Change-Id: I4c655d7700373636cc00c42d6214976b8aa9aee4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157790 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 75dc09e28e4a..e919bfda7c3d 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -268,7 +268,7 @@ const FieldUnitStringList& ImplGetFieldUnits() ImplSVData* pSVData = ImplGetSVData(); if( pSVData->maCtrlData.maFieldUnitStrings.empty() ) { -sal_uInt32 nUnits = SAL_N_ELEMENTS(SV_FUNIT_STRINGS); +sal_uInt32 nUnits = std::size(SV_FUNIT_STRINGS); pSVData->maCtrlData.maFieldUnitStrings.reserve( nUnits ); for (sal_uInt32 i = 0; i < nUnits; i++) { @@ -283,7 +283,7 @@ namespace vcl { FieldUnit EnglishStringToMetric(std::u16string_view rEnglishMetricString) { -sal_uInt32 nUnits = SAL_N_ELEMENTS(SV_FUNIT_STRINGS); +sal_uInt32 nUnits = std::size(SV_FUNIT_STRINGS); for (sal_uInt32 i = 0; i < nUnits; ++i) { if (o3tl::equalsAscii(rEnglishMetricString, SV_FUNIT_STRINGS[i].first.getId()))
[Libreoffice-commits] core.git: vcl/source
vcl/source/bitmap/BitmapEx.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 3622404f09448b82c095256140afe6240b522ece Author: Noel Grandin AuthorDate: Wed Oct 11 12:54:43 2023 +0200 Commit: Noel Grandin CommitDate: Thu Oct 12 07:57:02 2023 +0200 tdf#157636 FILEOPEN: PPT: Images have no background regression from commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Convert internal vcl bitmap formats transparency->alpha (II) Change-Id: Ia0ed01e7c0d41bd909fe48666bc9aca5ff31d2bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157824 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index c9be55521f16..7333aea90cc3 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -1447,6 +1447,7 @@ void BitmapEx::CombineMaskOr(Color maskColor, sal_uInt8 nTol) Bitmap aNewMask = maBitmap.CreateMask( maskColor, nTol ); if ( IsAlpha() ) aNewMask.CombineOr( maAlphaMask ); +aNewMask.Invert(); maAlphaMask = aNewMask; }
[Libreoffice-commits] core.git: vcl/source
vcl/source/treelist/transfer.cxx | 41 +++ 1 file changed, 41 insertions(+) New commits: commit 3191b322b59cab22ec4c67c0d83520ff577f7ae8 Author: Mike Kaganski AuthorDate: Tue Oct 10 15:59:04 2023 +0300 Commit: Mike Kaganski CommitDate: Wed Oct 11 06:14:17 2023 +0200 tdf#133870: read OBJECTDESCRIPTOR from clipboard This extends commit 8ad0c29f56e5069a3679560d404b603332dcf38a (sw: prefer ODF over RTF when pasting from Writer, 2020-04-22). To see that the clipboard contains a matching EMBED_SOURCE from another instance of the program, the content of OBJECTDESCRIPTOR needs to be read into mxObjDesc of TransferableDataHelper. Change-Id: Ic4bf4ba8b077550336be231451cf2e86c42f112b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157791 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index 812b9609b07f..4ca968e84b8d 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -109,6 +110,43 @@ SvStream& WriteTransferableObjectDescriptor( SvStream& rOStm, const Transferable return rOStm; } +static void TryReadTransferableObjectDescriptor(SvStream& rIStm, +TransferableObjectDescriptor& rObjDesc) +{ +auto nStartPos = rIStm.Tell(); +comphelper::ScopeGuard streamPosRestore([nStartPos, &rIStm] { rIStm.Seek(nStartPos); }); + +sal_uInt32 size; +rIStm.ReadUInt32(size); + +SvGlobalName className; +rIStm >> className; + +sal_uInt32 viewAspect; +rIStm.ReadUInt32(viewAspect); + +sal_Int32 width, height; +rIStm.ReadInt32(width).ReadInt32(height); + +sal_Int32 dragStartPosX, dragStartPosY; +rIStm.ReadInt32(dragStartPosX).ReadInt32(dragStartPosY); + +const OUString typeName = rIStm.ReadUniOrByteString(osl_getThreadTextEncoding()); +const OUString displayName = rIStm.ReadUniOrByteString(osl_getThreadTextEncoding()); + +sal_uInt32 nSig1, nSig2; +rIStm.ReadUInt32(nSig1).ReadUInt32(nSig2); + +if (!rIStm.good() || rIStm.Tell() - nStartPos != size || nSig1 != TOD_SIG1 || nSig2 != TOD_SIG2) +return; + +rObjDesc.maClassName = className; +rObjDesc.mnViewAspect = viewAspect; +rObjDesc.maSize = Size(width, height); +rObjDesc.maDragStartPos = Point(dragStartPosX, dragStartPosY); +rObjDesc.maTypeName = typeName; +rObjDesc.maDisplayName = displayName; +} // the reading of the parameter is done using the special service css::datatransfer::MimeContentType, // a similar approach should be implemented for creation of the mimetype string; @@ -1279,6 +1317,9 @@ void TransferableDataHelper::InitFormats() if( SotClipboardFormatId::OBJECTDESCRIPTOR == format.mnSotId ) { ImplSetParameterString(*mxObjDesc, format); +auto data = GetSequence(format, {}); +SvMemoryStream aSrcStm(data.getArray(), data.getLength(), StreamMode::READ); +TryReadTransferableObjectDescriptor(aSrcStm, *mxObjDesc); break; } }
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/impgraph.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 27b05720c99b933a6cbb7a881433a70766962195 Author: Ashod Nakashian AuthorDate: Tue Jul 18 21:23:13 2023 -0400 Commit: Caolán McNamara CommitDate: Tue Oct 10 20:50:09 2023 +0200 vcl: swap out the BinaryDataContainer too Signed-off-by: Ashod Nakashian Change-Id: I2e6ac88ff95903acf2df2070a7c23f4fc135c253 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154606 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos (cherry picked from commit 896fc921cd72b5f0198772f2d4c569b59f51222c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154615 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx index 35a2145aa8e4..f3f877d3b939 100644 --- a/vcl/source/gdi/impgraph.cxx +++ b/vcl/source/gdi/impgraph.cxx @@ -1308,6 +1308,8 @@ bool ImpGraphic::swapOut() // reset the swap file mpSwapFile.reset(); +mpGfxLink->getDataContainer().swapOut(); + // mark as swapped out mbSwapOut = true;
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/png/PngImageReader.cxx | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) New commits: commit 37b47bca10da480da591c4a5f5369bce59cccab6 Author: Caolán McNamara AuthorDate: Fri Oct 6 16:29:16 2023 +0100 Commit: Caolán McNamara CommitDate: Sat Oct 7 01:16:43 2023 +0200 consistently restore the original endianness here Change-Id: Ia17ef469a3469cca5a2b7eb39b349df78eed6fa9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157657 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/filter/png/PngImageReader.cxx b/vcl/source/filter/png/PngImageReader.cxx index 64ecd2286c14..a949f856646e 100644 --- a/vcl/source/filter/png/PngImageReader.cxx +++ b/vcl/source/filter/png/PngImageReader.cxx @@ -283,7 +283,11 @@ sal_uInt32 NumDenToTime(sal_uInt16 nNumerator, sal_uInt16 nDenominator) bool fcTLbeforeIDAT(SvStream& rStream) { sal_uInt64 nPos = rStream.Tell(); -comphelper::ScopeGuard aGuard([&rStream, nPos]() { rStream.Seek(nPos); }); +SvStreamEndian originalEndian = rStream.GetEndian(); +comphelper::ScopeGuard aGuard([&rStream, nPos, originalEndian] { +rStream.Seek(nPos); +rStream.SetEndian(originalEndian); +}); // Skip PNG header and IHDR rStream.SetEndian(SvStreamEndian::BIG); if (!checkSeek(rStream, PNG_SIGNATURE_SIZE + PNG_TYPE_SIZE + PNG_SIZE_SIZE + PNG_IHDR_SIZE @@ -859,9 +863,10 @@ bool ImportPNG(SvStream& rInputStream, Graphic& rGraphic, GraphicFilterImportFla bool PngImageReader::isAPng(SvStream& rStream) { auto nStmPos = rStream.Tell(); -comphelper::ScopeGuard aGuard([&rStream, &nStmPos] { +SvStreamEndian originalEndian = rStream.GetEndian(); +comphelper::ScopeGuard aGuard([&rStream, nStmPos, originalEndian] { rStream.Seek(nStmPos); -rStream.SetEndian(SvStreamEndian::LITTLE); +rStream.SetEndian(originalEndian); }); if (!isPng(rStream)) return false;
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/builder.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit f8e16f26a037a71349dc1a197b5ace204acb123b Author: Michael Weghorn AuthorDate: Fri Oct 6 17:27:40 2023 +0200 Commit: Michael Weghorn CommitDate: Sat Oct 7 00:05:43 2023 +0200 tdf#157639 a11y: Set proper role for status bar Set `css::accessibility::AccessibleRole::STATUS_BAR` as role for the `VclHBox`/`VclVBox` instances created for `GtkStatusBar` nodes in .ui files, so that they are properly exposed to the accessibility layer. This is e.g. required to make NVDA's feature to announce the status bar content (when pressing NVDA+End) work. An additional change on NVDA side is needed to make the announcement work. Pending PR: https://github.com/nvaccess/nvda/pull/15592 Change-Id: Iac587be96ec941afd7625ee363949f5da0cbc873 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157659 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 6974cdce9ccd..3825c9674fb1 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1679,6 +1679,9 @@ VclPtr VclBuilder::makeObject(vcl::Window *pParent, const OUString xWindow = VclPtr::Create(pParent); else xWindow = VclPtr::Create(pParent); + +if (name == "GtkStatusbar") + xWindow->SetAccessibleRole(css::accessibility::AccessibleRole::STATUS_BAR); } else if (name == "GtkPaned") {
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/igif/gifread.cxx |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) New commits: commit b2ca39bc5e424e67e8fc7e8a044214feb09e39f7 Author: Patrick Luby AuthorDate: Fri Oct 6 15:21:50 2023 -0400 Commit: Patrick Luby CommitDate: Fri Oct 6 22:31:00 2023 +0200 tdf#157576 and tdf#157635 mask out black pixels Due to the switch from transparency to alpha in commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, mask out black pixels in bitmap. Change-Id: I7cc8c39c20d8ec4fed026c3e27fce24396815d68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157665 Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 818317f8baa8..afbf084f4f31 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -666,7 +666,13 @@ void GIFReader::CreateNewBitmaps() aAnimationFrame.maBitmapEx = BitmapEx( aBmp8, aAlphaMask ); } else -aAnimationFrame.maBitmapEx = BitmapEx( aBmp8 ); +{ +// tdf#157576 and tdf#157635 mask out black pixels +// Due to the switch from transparency to alpha in commit +// 81994cb2b8b32453a92bcb011830fcb884f22ff3, mask out black +// pixels in bitmap. +aAnimationFrame.maBitmapEx = BitmapEx( aBmp8, aBmp8 ); +} aAnimationFrame.maPositionPixel = Point( nImagePosX, nImagePosY ); aAnimationFrame.maSizePixel = Size( nImageWidth, nImageHeight );
[Libreoffice-commits] core.git: vcl/source
vcl/source/app/salvtables.cxx | 10 ++ vcl/source/window/mouse.cxx |4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) New commits: commit 6947cbca81b57adf78c0a3cf3108e664220d0cec Author: Caolán McNamara AuthorDate: Thu Oct 5 12:35:05 2023 +0100 Commit: Caolán McNamara CommitDate: Thu Oct 5 15:17:31 2023 +0200 cool#7254 crash on double click of value set item in bullets and numbering #0 0x7f6d6f39e7a8 in vcl::Window::MouseButtonUp (this=this@entry=0x34177ef0, rMEvt=...) at libreoffice/vcl/source/window/mouse.cxx:430 #1 0x7f6d6f6e6a32 in VclDrawingArea::MouseButtonUp (rMEvt=..., this=0x34177ef0) at libreoffice/include/vcl/layout.hxx:707 #2 SalInstanceDrawingArea::dblclick (this=0x31351fd0, rPos=...) at libreoffice/vcl/source/app/salvtables.cxx:6288 #3 0x7f6d6f8c989c in LOKTrigger::trigger_dblclick (rPos=..., rDrawingArea=warning: can't find linker symbol for virtual table for `weld::DrawingArea' value warning: found `construction vtable for SalInstanceDrawingArea-in-JSDrawingArea' instead ...) at libreoffice/include/vcl/jsdialog/executor.hxx:66 #4 jsdialog::ExecuteAction (nWindowId=..., rWidget=..., rData=...) at libreoffice/vcl/jsdialog/executor.cxx:239 #5 0x7f6d6e46cebe in lcl_sendDialogEvent (nWindowId=, pArguments=) at libreoffice/desktop/source/lib/init.cxx:4961 #6 0x0051 in lok::Document::sendDialogEvent (pArguments=, nWindowId=, this=0x30a67ca0) at libreoffice/include/LibreOfficeKit/LibreOfficeKit.hxx:323 #7 ChildSession::dialogEvent (this=this@entry=0x32d5e410, tokens=...) at kit/ChildSession.cpp:1640 #8 0x00540465 in ChildSession::_handleInput (this=, buffer=, length=) at kit/ChildSession.cpp:257 Change-Id: I655beb2a33cdb5d266db3bb50d8dc857192e5a4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157592 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 1ace1412ffdc..ce78cf1e235c 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -6316,15 +6316,17 @@ OutputDevice& SalInstanceDrawingArea::get_ref_device() { return *m_xDrawingArea- void SalInstanceDrawingArea::click(const Point& rPos) { MouseEvent aEvent(rPos, 1, MouseEventModifiers::NONE, MOUSE_LEFT, 0); -m_xDrawingArea->MouseButtonDown(aEvent); -m_xDrawingArea->MouseButtonUp(aEvent); +VclPtr xDrawingArea(m_xDrawingArea); +xDrawingArea->MouseButtonDown(aEvent); +xDrawingArea->MouseButtonUp(aEvent); } void SalInstanceDrawingArea::dblclick(const Point& rPos) { MouseEvent aEvent(rPos, 2, MouseEventModifiers::NONE, MOUSE_LEFT, 0); -m_xDrawingArea->MouseButtonDown(aEvent); -m_xDrawingArea->MouseButtonUp(aEvent); +VclPtr xDrawingArea(m_xDrawingArea); +xDrawingArea->MouseButtonDown(aEvent); +xDrawingArea->MouseButtonUp(aEvent); } void SalInstanceDrawingArea::mouse_up(const Point& rPos) diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index 263c4e56fbc9..e5c8e130f74e 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -420,14 +420,14 @@ void Window::MouseMove( const MouseEvent& rMEvt ) void Window::MouseButtonDown( const MouseEvent& rMEvt ) { NotifyEvent aNEvt( NotifyEventType::MOUSEBUTTONDOWN, this, &rMEvt ); -if (!EventNotify(aNEvt)) +if (!EventNotify(aNEvt) && mpWindowImpl) mpWindowImpl->mbMouseButtonDown = true; } void Window::MouseButtonUp( const MouseEvent& rMEvt ) { NotifyEvent aNEvt( NotifyEventType::MOUSEBUTTONUP, this, &rMEvt ); -if (!EventNotify(aNEvt)) +if (!EventNotify(aNEvt) && mpWindowImpl) mpWindowImpl->mbMouseButtonUp = true; }
[Libreoffice-commits] core.git: vcl/source
vcl/source/outdev/textline.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 58d755bfef8a932577b550751cd5cc4bafb1700c Author: Caolán McNamara AuthorDate: Tue Oct 3 09:24:52 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Oct 3 13:05:33 2023 +0200 ofz: Timeout, reduce limit Change-Id: Id14418dc382c0d11554817fc37990e3f3cba3a05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157514 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index d9c085aa97e3..84965e87b5d6 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -277,7 +277,7 @@ void OutputDevice::ImplDrawWaveTextLine( tools::Long nBaseX, tools::Long nBaseY, bool bIsAbove ) { static bool bFuzzing = utl::ConfigManager::IsFuzzing(); -if (bFuzzing && nWidth > 2) +if (bFuzzing && nWidth > 1) { SAL_WARN("vcl.gdi", "drawLine, skipping suspicious WaveTextLine of length: " << nWidth << " for fuzzing performance");
[Libreoffice-commits] core.git: vcl/source
vcl/source/bitmap/BitmapEmbossGreyFilter.cxx | 62 --- 1 file changed, 28 insertions(+), 34 deletions(-) New commits: commit 6dd514f633211b3cd6a6096b687c4e51a331ee4b Author: Mike Kaganski AuthorDate: Tue Oct 3 10:45:39 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Oct 3 10:59:15 2023 +0200 Try to use doubles in a saner way This avoids convertion to integers too early, so makes the calculations more consistent (no more "use a truncated double later in a calculation involving doubles"). Also it moves variables into proper scopes. Change-Id: Idc11c30c2c6892db092a04a127eb31266b4b70e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157510 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx index c1e96c11709a..06406152d6d6 100644 --- a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx +++ b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx @@ -39,25 +39,21 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const BitmapColor aGrey(sal_uInt8(0)); const sal_Int32 nWidth = pWriteAcc->Width(); const sal_Int32 nHeight = pWriteAcc->Height(); -sal_Int32 nGrey11, nGrey12, nGrey13; -sal_Int32 nGrey21, nGrey22, nGrey23; -sal_Int32 nGrey31, nGrey32, nGrey33; -double fAzim = basegfx::deg2rad<100>(mnAzimuthAngle100); -double fElev = basegfx::deg2rad<100>(mnElevationAngle100); -std::unique_ptr pHMap(new sal_Int32[nWidth + 2]); -std::unique_ptr pVMap(new sal_Int32[nHeight + 2]); -sal_Int32 nX, nY, nNx, nNy, nDotL; -const sal_Int32 nLx = FRound(cos(fAzim) * cos(fElev) * 255.0); -const sal_Int32 nLy = FRound(sin(fAzim) * cos(fElev) * 255.0); -const sal_Int32 nLz = FRound(sin(fElev) * 255.0); -const auto nZ2 = (6 * 255) / 4; -const sal_Int32 nNzLz = ((6 * 255) / 4) * nLz; -const sal_uInt8 cLz = static_cast(std::clamp(nLz, sal_Int32(0), sal_Int32(255))); +const double fAzim = basegfx::deg2rad<100>(mnAzimuthAngle100); +const double fElev = basegfx::deg2rad<100>(mnElevationAngle100); +std::vector pHMap(nWidth + 2); +std::vector pVMap(nHeight + 2); +const double nLx = cos(fAzim) * cos(fElev) * 255.0; +const double nLy = sin(fAzim) * cos(fElev) * 255.0; +const double nLz = sin(fElev) * 255.0; +const double nNz = 6 * 255.0 / 4; +const double nNzLz = nNz * nLz; +const sal_uInt8 cLz = FRound(std::clamp(nLz, 0.0, 255.0)); // fill mapping tables pHMap[0] = 0; -for (nX = 1; nX <= nWidth; nX++) +for (sal_Int32 nX = 1; nX <= nWidth; nX++) { pHMap[nX] = nX - 1; } @@ -66,43 +62,43 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const pVMap[0] = 0; -for (nY = 1; nY <= nHeight; nY++) +for (sal_Int32 nY = 1; nY <= nHeight; nY++) { pVMap[nY] = nY - 1; } pVMap[nHeight + 1] = nHeight - 1; -for (nY = 0; nY < nHeight; nY++) +for (sal_Int32 nY = 0; nY < nHeight; nY++) { -nGrey11 = pReadAcc->GetPixel(pVMap[nY], pHMap[0]).GetIndex(); -nGrey12 = pReadAcc->GetPixel(pVMap[nY], pHMap[1]).GetIndex(); -nGrey13 = pReadAcc->GetPixel(pVMap[nY], pHMap[2]).GetIndex(); -nGrey21 = pReadAcc->GetPixel(pVMap[nY + 1], pHMap[0]).GetIndex(); -nGrey22 = pReadAcc->GetPixel(pVMap[nY + 1], pHMap[1]).GetIndex(); -nGrey23 = pReadAcc->GetPixel(pVMap[nY + 1], pHMap[2]).GetIndex(); -nGrey31 = pReadAcc->GetPixel(pVMap[nY + 2], pHMap[0]).GetIndex(); -nGrey32 = pReadAcc->GetPixel(pVMap[nY + 2], pHMap[1]).GetIndex(); -nGrey33 = pReadAcc->GetPixel(pVMap[nY + 2], pHMap[2]).GetIndex(); +sal_Int32 nGrey11 = pReadAcc->GetPixel(pVMap[nY], pHMap[0]).GetIndex(); +sal_Int32 nGrey12 = pReadAcc->GetPixel(pVMap[nY], pHMap[1]).GetIndex(); +sal_Int32 nGrey13 = pReadAcc->GetPixel(pVMap[nY], pHMap[2]).GetIndex(); +sal_Int32 nGrey21 = pReadAcc->GetPixel(pVMap[nY + 1], pHMap[0]).GetIndex(); +sal_Int32 nGrey22 = pReadAcc->GetPixel(pVMap[nY + 1], pHMap[1]).GetIndex(); +sal_Int32 nGrey23 = pReadAcc->GetPixel(pVMap[nY + 1], pHMap[2]).GetIndex(); +sal_Int32 nGrey31 = pReadAcc->GetPixel(pVMap[nY + 2], pHMap[0]).GetIndex(); +sal_Int32 nGrey32 = pReadAcc->GetPixel(pVMap[nY + 2], pHMap[1]).GetIndex(); +sal_Int32 nGrey33 = pReadAcc->GetPixel(pVMap[nY + 2], pHMap[2]).GetIndex(); Scanline pScanline = pWriteAcc->GetScanline(nY); -for (nX = 0; nX < nWidth; nX++) +for (sal_Int32 nX = 0; nX < nWidth; nX++) { -nNx = nGrey11 + nGrey21 + nGrey31 - nGrey13 - nGrey23 - nGrey33; -nNy = nGrey31 + nGrey32 + nGrey33 - nGrey11 - nGrey12 - nGrey13; +const sal_Int32 nNx = nGrey11 + nGrey21 + nGrey31 - nGrey13 - nGrey23 - nGrey33; +const sal_Int32 nNy = nGrey31 + nGrey32
[Libreoffice-commits] core.git: vcl/source
vcl/source/bitmap/BitmapEmbossGreyFilter.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 89367021a4c960b6873370ea9472b36457c51ef3 Author: Ankit_Jaipuriar AuthorDate: Sat Sep 30 11:09:08 2023 +0530 Commit: Ilmari Lauhakangas CommitDate: Tue Oct 3 08:32:22 2023 +0200 tdf#147906 Use std::hypot for Pythagorean addition Change-Id: I155cf98404dea83121f95ad3e784bc0e862f46d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157416 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas diff --git a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx index f8b974a4367f..c1e96c11709a 100644 --- a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx +++ b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx @@ -50,7 +50,7 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const const sal_Int32 nLx = FRound(cos(fAzim) * cos(fElev) * 255.0); const sal_Int32 nLy = FRound(sin(fAzim) * cos(fElev) * 255.0); const sal_Int32 nLz = FRound(sin(fElev) * 255.0); -const auto nZ2 = ((6 * 255) / 4) * ((6 * 255) / 4); +const auto nZ2 = (6 * 255) / 4; const sal_Int32 nNzLz = ((6 * 255) / 4) * nLz; const sal_uInt8 cLz = static_cast(std::clamp(nLz, sal_Int32(0), sal_Int32(255))); @@ -101,7 +101,7 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const } else { -const double fGrey = nDotL / sqrt(static_cast(nNx * nNx + nNy * nNy + nZ2)); +const double fGrey = nDotL / std::hypot(nNx, nNy, nZ2); aGrey.SetIndex(static_cast(std::clamp(fGrey, 0.0, 255.0))); }
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/menu.cxx | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) New commits: commit a0955317900075371d6adb7f924af24c22f02d09 Author: Jim Raykowski AuthorDate: Fri Sep 15 21:26:32 2023 -0800 Commit: Jim Raykowski CommitDate: Wed Sep 27 07:12:30 2023 +0200 tdf#139935 Part B: Show all menu items possible/potential actions, but grey-out and deactivate, when not applicable This patch makes VCL PopupMenu respect the officecfg::Office::Common::View::Menu::DontHideDisabledEntry setting. Change-Id: I4df0de82585b602e12481ae46bc4f94c2588970d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156979 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 9a90b03ef93b..60673fbe434e 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -57,6 +57,8 @@ #include #include +#include + namespace vcl { @@ -2872,8 +2874,12 @@ bool PopupMenu::PrepareRun(const VclPtr& pParentWin, tools::Rectang nMenuFlags &= ~MenuFlags::HideDisabledEntries; } else -// #102790# context menus shall never show disabled entries -nMenuFlags |= MenuFlags::HideDisabledEntries; +{ + if (officecfg::Office::Common::View::Menu::DontHideDisabledEntry::get()) + nMenuFlags &= ~MenuFlags::HideDisabledEntries; + else + nMenuFlags |= MenuFlags::HideDisabledEntries; +} sal_uInt16 nVisibleEntries = ImplGetVisibleItemCount(); if ( !nVisibleEntries )
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/TypeSerializer.cxx |4 1 file changed, 4 insertions(+) New commits: commit 788ef4f347d8a3c87d45d38ce6bf13cdd3dd76a2 Author: Caolán McNamara AuthorDate: Mon Sep 25 10:40:50 2023 +0100 Commit: Caolán McNamara CommitDate: Mon Sep 25 14:17:17 2023 +0200 ofz#62439 Integer-overflow on scale using SAL_MIN_INT32 Change-Id: Ib26feee174caab9f515cd88cc3cb4a83debb0d99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157242 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/gdi/TypeSerializer.cxx b/vcl/source/gdi/TypeSerializer.cxx index 9144650154af..49890fc38ea0 100644 --- a/vcl/source/gdi/TypeSerializer.cxx +++ b/vcl/source/gdi/TypeSerializer.cxx @@ -435,6 +435,10 @@ static bool UselessScaleForMapMode(const Fraction& rScale) { if (!rScale.IsValid()) return true; +// ofz#62439 negative numbers are multiplied by -1, MIN_INT32 * -1 +// cannot be expressed as an int +if (rScale.GetNumerator() == std::numeric_limits::min()) +return true; if (static_cast(rScale) < 0.0) return true; return false;
[Libreoffice-commits] core.git: vcl/source
vcl/source/outdev/gradient.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 23de37d22c9fecbcffdcf4eb02c926f0f9403d5e Author: Andrea Gelmini AuthorDate: Sun Sep 24 17:12:40 2023 +0200 Commit: Julien Nabet CommitDate: Sun Sep 24 17:24:24 2023 +0200 Fix typo Change-Id: I88c3e9f36c38bd31cd78871d5e86c607ebb39211 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157209 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index ef4f883c20d2..52359a779061 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -162,7 +162,7 @@ void OutputDevice::ClipAndDrawGradientMetafile ( const Gradient &rGradient, cons EnableOutput( false ); #if HAVE_FEATURE_SKIA // tdf#156539 Draw the gradient with polypolygonal clip when using Skia -// For some unkown reason, the previous "draw gradient with XOR, draw +// For some unknown reason, the previous "draw gradient with XOR, draw // polygon with N0, and draw gradient again with XOR" does not work // with Skia/Raster (at least on macOS). Fortunately, Skia supports // polypolygonal clipping so just clip and draw the gradient.
[Libreoffice-commits] core.git: vcl/source
vcl/source/outdev/gradient.cxx | 36 +++- 1 file changed, 27 insertions(+), 9 deletions(-) New commits: commit c43d11cbbabc871a3c71062239b0d9b6db99961e Author: Patrick Luby AuthorDate: Sat Sep 23 19:26:09 2023 -0400 Commit: Patrick Luby CommitDate: Sun Sep 24 02:25:12 2023 +0200 tdf#156539 Draw the gradient with polypolygonal clip when using Skia For some unkown reason, the previous "draw gradient with XOR, draw polygon with N0, and draw gradient again with XOR" does not work with Skia/Raster (at least on macOS). Fortunately, Skia supports polypolygonal clipping so just clip and draw the gradient. Change-Id: Id069160312a270096f5ec9c670615eb95ec6200b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157199 Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index 53dbec354d20..ef4f883c20d2 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include @@ -159,15 +160,32 @@ void OutputDevice::ClipAndDrawGradientMetafile ( const Gradient &rGradient, cons const bool bOldOutput = IsOutputEnabled(); EnableOutput( false ); -Push( vcl::PushFlags::RASTEROP ); -SetRasterOp( RasterOp::Xor ); -DrawGradient( aBoundRect, rGradient ); -SetFillColor( COL_BLACK ); -SetRasterOp( RasterOp::N0 ); -DrawPolyPolygon( rPolyPoly ); -SetRasterOp( RasterOp::Xor ); -DrawGradient( aBoundRect, rGradient ); -Pop(); +#if HAVE_FEATURE_SKIA +// tdf#156539 Draw the gradient with polypolygonal clip when using Skia +// For some unkown reason, the previous "draw gradient with XOR, draw +// polygon with N0, and draw gradient again with XOR" does not work +// with Skia/Raster (at least on macOS). Fortunately, Skia supports +// polypolygonal clipping so just clip and draw the gradient. +if ( SkiaHelper::isVCLSkiaEnabled() ) +{ +Push( vcl::PushFlags::CLIPREGION ); +SetClipRegion( vcl::Region( rPolyPoly ) ); +DrawGradient( aBoundRect, rGradient ); +Pop(); +} +else +#endif +{ +Push( vcl::PushFlags::RASTEROP ); +SetRasterOp( RasterOp::Xor ); +DrawGradient( aBoundRect, rGradient ); +SetFillColor( COL_BLACK ); +SetRasterOp( RasterOp::N0 ); +DrawPolyPolygon( rPolyPoly ); +SetRasterOp( RasterOp::Xor ); +DrawGradient( aBoundRect, rGradient ); +Pop(); +} EnableOutput( bOldOutput ); }
[Libreoffice-commits] core.git: vcl/source
vcl/source/control/edit.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit b2b43e83ccc41c37bad32a4dcf07ca86bf2f8a15 Author: Michael Weghorn AuthorDate: Thu Sep 7 15:42:57 2023 +0200 Commit: Michael Weghorn CommitDate: Mon Sep 18 17:04:17 2023 +0200 a11y: Call base class impl at beginning of Edit::GetFocus Call the base class implementation `Control::GetFocus()` (which currently is just `Window::GetFocus`) before doing anything else, not at the end. This ensures that a focused event is sent to the a11y layer before e.g. adapting text selection. Assistive tooling handles the currently focused object with special interest (and announces events on that object much more likely than for any other objects). This e.g. makes Orca announce the labels for the spinboxes (like "Width", "Height", "Left", "Right") in Writer's "Format" -> "Page Style" dialog -> "Page" page when using the qt6 VCL plugin. Previously, only the current value of the spinboxes was announced without the label when moving focus into one of them using the Tab key. The following 2 Orca commits [1] [2] in the LibreOffice-specific Orca code look related: commit c4c5d11656ec7221e4aa4b980e51c010dcc62674 Author: Joanmarie Diggs Date: Mon Aug 7 13:53:41 2017 -0400 Work around event-ordering issue in LibreOffice commit 38b995d9bacc55bb455c4464b01c82b885ed5549 Author: Joanmarie Diggs Date: Fri Feb 15 09:40:07 2019 -0500 Don't present locusOfFocus changes due to text-selection-changed events (The first one makes the object sending a text-selection-changed event the focus object in Orca, the second one then causes this implicit focus object to no longer be announced. And when LO itself sends the focused event for the object, the object is already considered as the focus object, i.e. not announced either because the assumption is that the focus hasn't changed.) If the new event order causes any issues elsewhere because other places depend on the previous order, that will have to be looked into individually, s.a. the discussion in the Gerrit change for some thoughts on that [3]. [1] https://gitlab.gnome.org/GNOME/orca/-/commit/c4c5d11656ec7221e4aa4b980e51c010dcc62674 [2] https://gitlab.gnome.org/GNOME/orca/-/commit/38b995d9bacc55bb455c4464b01c82b885ed5549 [3] https://gerrit.libreoffice.org/c/core/+/156679 Change-Id: Ib0188fe206a49c9052ec9694bafd451586ff0b9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156679 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 92c03118727c..0e75dc36b91c 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1839,6 +1839,8 @@ void Edit::ImplInvalidateOutermostBorder( vcl::Window* pWin ) void Edit::GetFocus() { +Control::GetFocus(); + if ( mpSubEdit ) mpSubEdit->ImplGrabFocus( GetGetFocusFlags() ); else if ( !mbActivePopup ) @@ -1882,8 +1884,6 @@ void Edit::GetFocus() SetInputContext( InputContext( GetFont(), !IsReadOnly() ? InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE ) ); } - -Control::GetFocus(); } void Edit::LoseFocus()
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/metaact.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 6a77594f380b596371a0a036a1e229e02e8666b9 Author: Caolán McNamara AuthorDate: Tue Sep 12 11:49:23 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Sep 12 14:03:52 2023 +0200 ofz#62155 skip line with negative width Change-Id: I5549ac15a179051f6fb02786c53469479b0a2e67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156839 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index e5e243f55652..70e6f7cf9c82 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -817,6 +817,11 @@ MetaTextLineAction::MetaTextLineAction( const Point& rPos, tools::Long nWidth, void MetaTextLineAction::Execute( OutputDevice* pOut ) { +if (mnWidth < 0) +{ +SAL_WARN("vcl", "skipping line with negative width: " << mnWidth); +return; +} pOut->DrawTextLine( maPos, mnWidth, meStrikeout, meUnderline, meOverline ); }
[Libreoffice-commits] core.git: vcl/source
vcl/source/treelist/treelistbox.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit 4b2543693ed3ffb4d9f0d70f53f32127115c128d Author: Jim Raykowski AuthorDate: Sat Sep 9 21:21:03 2023 -0800 Commit: Jim Raykowski CommitDate: Tue Sep 12 00:45:51 2023 +0200 tdf#156890 SalInstanceTreeView: Indent the entry context bitmap when the bitmap is too large to center without it touching the expand button Change-Id: If4e307ed50eff9bdebe6c377847283ae2eea9543 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156787 Tested-by: Jenkins Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze Reviewed-by: Jim Raykowski diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 94d561ced049..e944214c5b88 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -1452,6 +1452,9 @@ void SvTreeListBox::SetTabs() else nStartPos += nContextWidthDIV2; AddTab( nStartPos, TABFLAGS_CONTEXTBMP ); +// add an indent if the context bitmap can't be centered without touching the expander +if (nContextBmpWidthMax > nIndent + (nNodeWidthPixel / 2)) +nStartPos += nIndent; nStartPos += nContextWidthDIV2; // right edge of context bitmap // only set a distance if there are bitmaps if( nContextBmpWidthMax ) @@ -2584,6 +2587,10 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, tools::Long nLine, vcl: SvViewDataEntry* pViewDataEntry = GetViewDataEntry( &rEntry ); const bool bSeparator(rEntry.GetFlags() & SvTLEntryFlags::IS_SEPARATOR); +const auto nMaxContextBmpWidthBeforeIndentIsNeeded = +nIndent + GetExpandedNodeBmp().GetSizePixel().Width() / 2; +const bool bHasButtonsAtRoot = nWindowStyle & WB_HASBUTTONSATROOT; + const size_t nTabCount = aTabs.size(); const size_t nItemCount = rEntry.ItemCount(); size_t nCurTab = 0; @@ -2618,6 +2625,13 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, tools::Long nLine, vcl: else nX = nTabPos + pTab->CalcOffset(aSize.Width(), nNextTabPos - nTabPos); +// add an indent if the context bitmap can't be centered without touching the expander +if (nCurTab == 0 && !(nTreeFlags & SvTreeFlags::CHKBTN) && bHasButtonsAtRoot && +pTab->nFlags & SvLBoxTabFlags::ADJUST_CENTER && +!(pTab->nFlags & SvLBoxTabFlags::FORCE) && +aSize.Width() > nMaxContextBmpWidthBeforeIndentIsNeeded) +nX += nIndent; + aEntryPos.setX( nX ); aEntryPos.setY( nLine );
[Libreoffice-commits] core.git: vcl/source
vcl/source/app/watchdog.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit cea165a3ebdb5f2a2b172004ff1b3848f303d78a Author: Noel Grandin AuthorDate: Mon Sep 11 14:15:54 2023 +0200 Commit: Noel Grandin CommitDate: Mon Sep 11 16:04:17 2023 +0200 gbWatchdogFiring, replace 'volatile bool' with std::atomic this can be touched from different threads, so atomic is a better tool than volatile. Change-Id: I7304eb50cf565efc4322871e56d21eb4128c4a8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156821 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/app/watchdog.cxx b/vcl/source/app/watchdog.cxx index b14611e227ca..dc2153e63907 100644 --- a/vcl/source/app/watchdog.cxx +++ b/vcl/source/app/watchdog.cxx @@ -25,9 +25,11 @@ #include #endif +#include + namespace { -volatile bool gbWatchdogFiring = false; +std::atomic gbWatchdogFiring = false; osl::Condition* gpWatchdogExit = nullptr; rtl::Reference gxWatchdog;
[Libreoffice-commits] core.git: vcl/source
vcl/source/components/fontident.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 8730202879bbf1423c516ef9a99d34882e44c11c Author: Noel Grandin AuthorDate: Sat Sep 9 13:52:56 2023 +0200 Commit: Noel Grandin CommitDate: Sun Sep 10 17:09:00 2023 +0200 FontIdentificator does not need to implement XAggreggation Checked on jenkins using 'make check' and +void SAL_CALL setDelegator(css::uno::Reference const &) final { assert(false); } Change-Id: I13d3d34e202718894a50deb9dfa40041bdc5d25c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156771 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/components/fontident.cxx b/vcl/source/components/fontident.cxx index 78d5703c5050..104981ad4366 100644 --- a/vcl/source/components/fontident.cxx +++ b/vcl/source/components/fontident.cxx @@ -33,7 +33,7 @@ #include #include -#include +#include #include using namespace ::com::sun::star::uno; @@ -46,7 +46,7 @@ namespace vcl namespace { -class FontIdentificator : public ::cppu::WeakAggImplHelper3< XMaterialHolder, XInitialization, XServiceInfo > +class FontIdentificator : public ::cppu::WeakImplHelper< XMaterialHolder, XInitialization, XServiceInfo > { Fontm_aFont; public:
[Libreoffice-commits] core.git: vcl/source
vcl/source/uitest/uno/uiobject_uno.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 74895033b99ba8b1496dc71699f52402b6d3db11 Author: Noel Grandin AuthorDate: Fri Sep 8 11:14:56 2023 +0200 Commit: Noel Grandin CommitDate: Fri Sep 8 12:28:44 2023 +0200 add SAL_WARN to UIObjectUnoObj::getChild to help track down an intermittent UITest failure on jenkins, which would otherwise assert inside the UIObjectUnoObj constructor Change-Id: I1b06c1eef5fe3402857b7a300decd48488ec621c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156698 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/uitest/uno/uiobject_uno.cxx b/vcl/source/uitest/uno/uiobject_uno.cxx index 0d23fe9272a7..1a59520f1943 100644 --- a/vcl/source/uitest/uno/uiobject_uno.cxx +++ b/vcl/source/uitest/uno/uiobject_uno.cxx @@ -56,6 +56,7 @@ css::uno::Reference SAL_CALL UIObjectUnoObj::getChild( { SolarMutexGuard aGuard; std::unique_ptr pObj = mpObj->get_child(rID); +SAL_WARN_IF(!pObj, "vcl", "child " << rID << " of parent " << mpObj->dumpState() << " does not exist"); return new UIObjectUnoObj(std::move(pObj)); }
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d93f3243d51438e2492ca6f450ae3f1f63b617b1 Author: Khaled Hosny AuthorDate: Thu Sep 7 07:59:49 2023 +0300 Commit: خالد حسني CommitDate: Thu Sep 7 09:01:43 2023 +0200 tdf#157112: fix off-by-one error in /LastChar of PDF Type 3 fonts It should be the index of the last glyph in the subset, so nGlyphs - 1. Change-Id: I62853a27b602d7b3e6b626542dd417438fcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156630 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index ff2de852f4a8..64dfc809fccc 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2627,7 +2627,7 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, "/FirstChar 0\n" "/LastChar " -+ OString::number(nGlyphs) ++ OString::number(nGlyphs - 1) + "\n" "/Widths[");
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/GraphicFormatDetector.cxx | 134 +--- 1 file changed, 64 insertions(+), 70 deletions(-) New commits: commit 9c636d76a9a7e167da39913ab60f5135f8e831a6 Author: Tomaž Vajngerl AuthorDate: Fri Sep 1 21:20:05 2023 +0200 Commit: Tomaž Vajngerl CommitDate: Sat Sep 2 07:32:23 2023 +0200 tdf#147704 fix reading TIFF metadata (width and height) When we prepare (not read and load) the bitmap we need to read only the metadata - most importantly pixel width and height. This didn't work correctly for the TIFF files or more importantly the specific TIFF files in the document, and the result was that the size reported was 0,0 and somehow the crop factor wasn't applied correctly. This change fixes the metadata reading and makes it more robust. Change-Id: I60951e5d01afc311c400589496ae82377ccb4cf5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156457 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/vcl/source/filter/GraphicFormatDetector.cxx b/vcl/source/filter/GraphicFormatDetector.cxx index d4a027d60ed3..2cf9e953003e 100644 --- a/vcl/source/filter/GraphicFormatDetector.cxx +++ b/vcl/source/filter/GraphicFormatDetector.cxx @@ -34,7 +34,6 @@ constexpr sal_uInt32 SVG_CHECK_SIZE = 2048; constexpr sal_uInt32 WMF_EMF_CHECK_SIZE = 44; -constexpr sal_uInt32 DATA_SIZE = 640; namespace { @@ -727,6 +726,7 @@ bool GraphicFormatDetector::checkTIF() if (bDetectOk) { sal_uInt16 nTemp16 = 0; +sal_uInt32 nTemp32 = 0; mrStream.ReadUInt16(nTemp16); if (nTemp16 == 0x2a) @@ -736,90 +736,84 @@ bool GraphicFormatDetector::checkTIF() if (mbExtendedInfo) { -sal_uLong nCount; -sal_uLong nMax = DATA_SIZE - 48; -sal_uInt32 nTemp32 = 0; +sal_uInt32 nIfdOffset = 0; // Offset of the first IFD -mrStream.ReadUInt32(nTemp32); -nCount = nTemp32 + 2; -mrStream.SeekRel(nCount - 0x08); +mrStream.ReadUInt32(nIfdOffset); +mrStream.SeekRel(nIfdOffset - 8); // read 6 bytes until here + +sal_uInt16 nNumberOfTags = 0; +mrStream.ReadUInt16(nNumberOfTags); + +bool bOk = true; +sal_Int32 nCount = 0; -if (nCount < nMax) +// read tags till we find Tag256(Width) +mrStream.ReadUInt16(nTemp16); +while (nTemp16 != 256 && bOk) { -bool bOk = false; +mrStream.SeekRel(10); +mrStream.ReadUInt16(nTemp16); +nCount++; +if (nCount > nNumberOfTags) +bOk = false; +} -// read tags till we find Tag256 ( Width ) -// do not read more bytes than DATA_SIZE +if (bOk) +{ +// width mrStream.ReadUInt16(nTemp16); -while (nTemp16 != 256) +mrStream.SeekRel(4); +if (nTemp16 == 3) { -bOk = nCount < nMax; -if (!bOk) -{ -break; -} -mrStream.SeekRel(10); mrStream.ReadUInt16(nTemp16); -nCount += 12; +maMetadata.maPixSize.setWidth(nTemp16); +mrStream.SeekRel(2); +} +else +{ +mrStream.ReadUInt32(nTemp32); +maMetadata.maPixSize.setWidth(nTemp32); } -if (bOk) +// height +mrStream.SeekRel(2); +mrStream.ReadUInt16(nTemp16); +mrStream.SeekRel(4); +if (nTemp16 == 3) { -// width mrStream.ReadUInt16(nTemp16); -mrStream.SeekRel(4); -if (nTemp16 == 3) -{ -mrStream.ReadUInt16(nTemp16); -maMetadata.maPixSize.setWidth(nTemp16); -mrStream.SeekRel(2); -} -else -{ -
[Libreoffice-commits] core.git: vcl/source
vcl/source/uitest/uno/uiobject_uno.cxx | 19 +-- 1 file changed, 1 insertion(+), 18 deletions(-) New commits: commit 437db5267842d3985e3d4050096275da6dd45c3b Author: Noel Grandin AuthorDate: Thu Aug 31 15:07:42 2023 +0200 Commit: Noel Grandin CommitDate: Thu Aug 31 18:40:33 2023 +0200 remove null checks for mpObj in UIObjectUnoObj Checking for mpObj == nullptr implies that in some sense this object could end up in that state, but the only way that can happen is if we call this object after its destructor has been called. In which case throwing RuntimeException is not appropriate because calling a dead object should not be possible. Rather just let it SIGSEGV instead of hiding it behind an exception that might be ignored. Change-Id: I92911a3108f74ed5dfa4986bec028cbc365ac916 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156345 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/uitest/uno/uiobject_uno.cxx b/vcl/source/uitest/uno/uiobject_uno.cxx index a0a718096391..0d23fe9272a7 100644 --- a/vcl/source/uitest/uno/uiobject_uno.cxx +++ b/vcl/source/uitest/uno/uiobject_uno.cxx @@ -43,6 +43,7 @@ struct Notifier { UIObjectUnoObj::UIObjectUnoObj(std::unique_ptr pObj): mpObj(std::move(pObj)) { +assert(mpObj); } UIObjectUnoObj::~UIObjectUnoObj() @@ -53,9 +54,6 @@ UIObjectUnoObj::~UIObjectUnoObj() css::uno::Reference SAL_CALL UIObjectUnoObj::getChild(const OUString& rID) { -if (!mpObj) -throw css::uno::RuntimeException(); - SolarMutexGuard aGuard; std::unique_ptr pObj = mpObj->get_child(rID); return new UIObjectUnoObj(std::move(pObj)); @@ -116,9 +114,6 @@ IMPL_LINK_NOARG(ExecuteWrapper, ExecuteActionHdl, Timer*, void) void SAL_CALL UIObjectUnoObj::executeAction(const OUString& rAction, const css::uno::Sequence& rPropValues) { -if (!mpObj) -throw css::uno::RuntimeException(); - auto aIdle = std::make_unique("UI Test Idle Handler"); aIdle->SetPriority(TaskPriority::HIGHEST); @@ -158,9 +153,6 @@ void SAL_CALL UIObjectUnoObj::executeAction(const OUString& rAction, const css:: css::uno::Sequence UIObjectUnoObj::getState() { -if (!mpObj) -throw css::uno::RuntimeException(); - SolarMutexGuard aGuard; StringMap aMap = mpObj->get_state(); css::uno::Sequence aProps(aMap.size()); @@ -173,9 +165,6 @@ css::uno::Sequence UIObjectUnoObj::getState() css::uno::Sequence UIObjectUnoObj::getChildren() { -if (!mpObj) -throw css::uno::RuntimeException(); - std::set aChildren; { @@ -191,9 +180,6 @@ css::uno::Sequence UIObjectUnoObj::getChildren() OUString SAL_CALL UIObjectUnoObj::getType() { -if (!mpObj) -throw css::uno::RuntimeException(); - SolarMutexGuard aGuard; return mpObj->get_type(); } @@ -215,9 +201,6 @@ css::uno::Sequence UIObjectUnoObj::getSupportedServiceNames() OUString SAL_CALL UIObjectUnoObj::getHierarchy() { -if (!mpObj) -throw css::uno::RuntimeException(); - SolarMutexGuard aGuard; return mpObj->dumpHierarchy(); }
[Libreoffice-commits] core.git: vcl/source
vcl/source/outdev/font.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fffdfd9e58a6ec31be775123ae6d3f90a6e8e840 Author: Noel Grandin AuthorDate: Thu Aug 31 14:17:17 2023 +0200 Commit: Noel Grandin CommitDate: Thu Aug 31 18:39:50 2023 +0200 SAL_WARN->SAL_INFO in ImplGlyphFallbackLayout reduce log noise Change-Id: I479f936284922ad1062cab0e9ae78795aed84e91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156339 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 4198cf334a15..ea0727b294f9 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -1080,7 +1080,7 @@ std::unique_ptr OutputDevice::ImplGlyphFallbackLayout( std::unique_pt { if(aMissingCodes != oldMissingCodes) { -SAL_WARN("vcl.gdi", "Font fallback to the same font, but has missing codes"); +SAL_INFO("vcl.gdi", "Font fallback to the same font, but has missing codes"); // Restore the missing codes if we're not going to use this font. aMissingCodes = oldMissingCodes; }
[Libreoffice-commits] core.git: vcl/source
vcl/source/treelist/svtabbx.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 978cce0001ef9f37fb5fa5037a876f31ec558166 Author: Michael Weghorn AuthorDate: Tue Aug 29 18:41:32 2023 +0200 Commit: Michael Weghorn CommitDate: Wed Aug 30 11:56:47 2023 +0200 tdf#156683 a11y: Dispose a11y cells with tab list box header When disposing the `SvHeaderTabListBox`, also dispose the a11y objects for its header cells and clear the vector. This fixes a crash on exit that could e.g. be triggered as follows when using the qt6 VCL plugin on Linux: 1) start accerciser 2) start Writer with qt6 VCL plugin 3) press Alt+F12 to open the options dialog 4) enable "LibreOfficeDev" -> "Advanced" (i.e. Java Options dialog) 5) in Accerciser, click through LO a11y hierarchy, in particular on all of the cells of the JRE table 6) close the dialog and LO Backtrace: ~"#0 __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44\n" >~"#1 0x7f0f296a815f in __pthread_kill_internal (signo=6, threadid=) at ./nptl/pthread_kill.c:78\n" >~"#2 0x7f0f2965a472 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26\n" >~"#3 0x7f0f296444b2 in __GI_abort () at ./stdlib/abort.c:79\n" >~"#4 0x7f0f296443d5 in __assert_fail_base (fmt=0x7f0f297b8dc8 \"%s%s%s:%u: %s%sAssertion `%s' failed.\\n%n\", assertion=assertion@entry=0x7f0f28b376a0 \"rClients.end() != rPos && \\\"AccessibleEventNotifier::implLookupClient: invalid client id \\\" \\\"(did you register your client?)!\\\"\", file=file@entry=0x7f0f28b37478 \".../comphelper/source/misc/accessibleeventnotifier.cxx\", line=line@entry=140, function=function@entry=0x7f0f28b375b0 \"bool {anonymous}::implLookupClient(comphelper::AccessibleEventNotifier::TClientId, std::__debug::unordered_map >::iterator&)\") at ./assert/assert.c:92\n" >~"#5 0x7f0f296533a2 in __assert_fail (assertion=0x7f0f28b376a0 \"rClients.end() != rPos && \\\"AccessibleEventNotifier::implLookupClient: invalid client id \\\" \\\"(did you register your client?)!\\\"\", file=0x7f0f28b37478 \".../comphelper/source/misc/accessibleeventnotifier.cxx\", line=140, function=0x7f0f28b375b0 \"bool {anonymous}::implLookupClient(comphelper::AccessibleEventNotifier::TClientId, std::__debug::unordered_map >::iterator&)\") at ./assert/assert.c:101\n" >~"#6 0x7f0f28913886 in (anonymous namespace)::implLookupClient(comphelper::AccessibleEventNotifier::TClientId, std::__debug::unordered_map, std::hash, std::equal_to, std::allocator > > >::iterator&) (nClient=218, rPos=...) at .../comphelper/source/misc/accessibleeventnotifier.cxx:140\n" >~"#7 0x7f0f28913b9a in comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(unsigned int, com::sun::star::uno::Reference const&) (_nClient=218, _rxEventSource=uno::Reference to (accessibility::AccessibleBrowseBoxHeaderCell *) 0x55fb25c8b3d0) at .../comphelper/source/misc/accessibleeventnotifier.cxx:185\n" >~"#8 0x7f0eef073244 in accessibility::AccessibleBrowseBoxBase::disposing() (this=0x55fb25c8b3d0) at .../accessibility/source/extended/AccessibleBrowseBoxBase.cxx:113\n" >~"#9 0x7f0f28474aeb in cppu::WeakComponentImplHelperBase::dispose() (this=0x55fb25c8b3d0) at .../cppuhelper/source/implbase.cxx:104\n" >~"#10 0x7f0eef0712c2 in cppu::PartialWeakComponentImplHelper::dispose() (this=0x55fb25c8b3d0) at .../include/cppuhelper/compbase.hxx:90\n" >~"#11 0x7f0f28474834 in cppu::WeakComponentImplHelperBase::release() (this=0x55fb25c8b3d0) at .../cppuhelper/source/implbase.cxx:79\n" >~"#12 0x7f0eef072124 in cppu::PartialWeakComponentImplHelper::release() (this=0x55fb25c8b3d0) at .../include/cppuhelper/compbase.hxx:86\n" >~"#13 0x7f0eef07544a in accessibility::BrowseBoxAccessibleElement::release() (this=0x55fb25c8b3d0) at .../accessibility/source/extended/AccessibleBrowseBoxBase.cxx:518\n" >~"#14 0x7f0f15842747 in com::sun::star::uno::Reference::~Reference() (this=0x7f0f0c0246e0, __in_chrg=) at .../include/com/sun/star/uno/Reference.hxx:114\n" >~"#15 0x7f0f15862b9f in QtAccessibleWidget::~QtAccessibleWidget() (this=0x7f0f0c0246a0, __in_chrg=) at .../vcl/inc/qt6/../qt5/QtAccessibleWidget.hxx:39\n" >~"#16 0x7f0f15862c76 in QtAccessibleWidget::~QtAccessibleWidget() (this=0x7f0f0c0246a0, __in_chrg=) at .../vcl/inc/qt6/../qt5/QtAccessibleWidget.hxx:39\n" >~"#17 0x7f0f146ca101 in QAccessibleCache::deleteInterface(unsigned int, QObject*) (this=0x55fb1ef073e0, id=2147483876, obj=0x55fb25c8abf0) at /home/michi/development/git/qt5/qtbase/src/gui/accessible/qaccessiblecache.cpp:173\n" >~"#18 0x7f0f146c9712 in QAccessibleCache::~QAccessibleCache() (this=0x55fb1ef073e0, __in_chrg
[Libreoffice-commits] core.git: vcl/source
vcl/source/outdev/bitmap.cxx | 63 +++ 1 file changed, 29 insertions(+), 34 deletions(-) New commits: commit dd1f63a6ed8b6edae098b987861f83c30f484759 Author: Noel Grandin AuthorDate: Tue Aug 29 13:43:33 2023 +0200 Commit: Noel Grandin CommitDate: Tue Aug 29 18:11:52 2023 +0200 simplify error handling path in OutputDevice::BlendBitmap Change-Id: I1c8f8ba7d24e5d85057790249901adc69f295af7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156246 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 3535e6fe5860..fa1b93421b0a 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -906,9 +906,10 @@ Bitmap OutputDevice::BlendBitmap( const sal_Int32*pMapX, const sal_Int32*pMapY ) { -BitmapColor aDstCol; +if( !pP || !pA ) +return aBmp; + Bitmap res; -int nX, nY; if( GetBitCount() <= 8 ) { @@ -917,38 +918,32 @@ Bitmap OutputDevice::BlendBitmap( Bitmap::ScopedReadAccess pB(aBmp); BitmapScopedWriteAccess pW(aDither); -if( pB && pP && pA && pW ) +for( int nY = 0, nOutY = nOffY; nY < nDstHeight; nY++, nOutY++ ) { -int nOutY; - -for( nY = 0, nOutY = nOffY; nY < nDstHeight; nY++, nOutY++ ) +tools::Long nMapY = pMapY[ nY ]; +if (bVMirr) { -tools::Long nMapY = pMapY[ nY ]; -if (bVMirr) -{ -nMapY = aBmpRect.Bottom() - nMapY; -} -const tools::Long nModY = ( nOutY & 0x0FL ) << 4; -int nOutX; +nMapY = aBmpRect.Bottom() - nMapY; +} +const tools::Long nModY = ( nOutY & 0x0FL ) << 4; -Scanline pScanline = pW->GetScanline(nY); -Scanline pScanlineAlpha = pA->GetScanline(nMapY); -for( nX = 0, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ ) +Scanline pScanline = pW->GetScanline(nY); +Scanline pScanlineAlpha = pA->GetScanline(nMapY); +for( int nX = 0, nOutX = nOffX; nX < nDstWidth; nX++, nOutX++ ) +{ +tools::Long nMapX = pMapX[ nX ]; +if (bHMirr) { -tools::Long nMapX = pMapX[ nX ]; -if (bHMirr) -{ -nMapX = aBmpRect.Right() - nMapX; -} -const sal_uLong nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ]; - -aDstCol = pB->GetColor( nY, nX ); -aDstCol.Merge( pP->GetColor( nMapY, nMapX ), 255 - pA->GetIndexFromData( pScanlineAlpha, nMapX ) ); -aIndex.SetIndex( static_cast( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16 ] + - nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16 ] + - nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16 ] ) ); -pW->SetPixelOnData( pScanline, nX, aIndex ); +nMapX = aBmpRect.Right() - nMapX; } +const sal_uLong nD = nVCLDitherLut[ nModY | ( nOutX & 0x0FL ) ]; + +BitmapColor aDstCol = pB->GetColor( nY, nX ); +aDstCol.Merge( pP->GetColor( nMapY, nMapX ), 255 - pA->GetIndexFromData( pScanlineAlpha, nMapX ) ); +aIndex.SetIndex( static_cast( nVCLRLut[ ( nVCLLut[ aDstCol.GetRed() ] + nD ) >> 16 ] + + nVCLGLut[ ( nVCLLut[ aDstCol.GetGreen() ] + nD ) >> 16 ] + + nVCLBLut[ ( nVCLLut[ aDstCol.GetBlue() ] + nD ) >> 16 ] ) ); +pW->SetPixelOnData( pScanline, nX, aIndex ); } } @@ -961,7 +956,7 @@ Bitmap OutputDevice::BlendBitmap( BitmapScopedWriteAccess pB(aBmp); bool bFastBlend = false; -if( pP && pA && pB && !bHMirr && !bVMirr ) +if( !bHMirr && !bVMirr ) { SalTwoRect aTR(aBmpRect.Left(), aBmpRect.Top(), aBmpRect.GetWidth(), aBmpRect.GetHeight(), nOffX, nOffY, aOutSz.Width(), aOutSz.Height()); @@ -969,9 +964,9 @@ Bitmap OutputDevice::BlendBitmap( bFastBlend = ImplFastBitmapBlending( *pB,*pP,*pA, aTR ); } -if( pP && pA && pB && !bFastBlend ) +if( !bFastBlend ) { -for( nY = 0; nY < nDstHeight; nY++ ) +for( int nY = 0; nY < nDstHeight; nY++ ) { tools::Long nMapY = pMapY[ nY ]; @@ -981,7 +976,7 @@ Bitmap OutputDevice::BlendBitmap( } Scanline pAScan = pA->GetScanline( nMapY ); Scanline pBScan = pB->GetSca
[Libreoffice-commits] core.git: vcl/source
vcl/source/outdev/bitmap.cxx | 67 +-- 1 file changed, 15 insertions(+), 52 deletions(-) New commits: commit a2123f9441859b700d17378965870d1baabbac32 Author: Noel Grandin AuthorDate: Tue Aug 29 13:39:33 2023 +0200 Commit: Noel Grandin CommitDate: Tue Aug 29 14:50:54 2023 +0200 remove dead code in OutputDevice::BlendBitmap. This case will always be handled by the block inside if( GetBitCount() <= 8 ) just above. Has been this since initial import in commit 5120979b55c888d5090e91792616c57287929d85 Author: Kurt Zenker Date: Mon Nov 6 13:49:09 2006 + INTEGRATION: CWS vcl67 (1.31.16); FILE MERGED 2006/10/20 14:38:03 thb 1.31.16.3: #i70653# Handling the both-alphas-zero case properly now 2006/09/22 11:51:51 thb 1.31.16.2: #i1# Fixed a warning 2006/09/22 11:42:05 thb 1.31.16.1: #i47518# Properly blending alpha bitmap into alpha vdev now. Change-Id: I1779b17d85685f4b3ecdbda4920b4417ad29452b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156245 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index ef11ad97b79f..3535e6fe5860 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -971,65 +971,28 @@ Bitmap OutputDevice::BlendBitmap( if( pP && pA && pB && !bFastBlend ) { -switch( pP->GetScanlineFormat() ) +for( nY = 0; nY < nDstHeight; nY++ ) { -case ScanlineFormat::N8BitPal: -{ -for( nY = 0; nY < nDstHeight; nY++ ) -{ -tools::Long nMapY = pMapY[ nY ]; -if ( bVMirr ) -{ -nMapY = aBmpRect.Bottom() - nMapY; -} -Scanline pPScan = pP->GetScanline( nMapY ); -Scanline pAScan = pA->GetScanline( nMapY ); -Scanline pBScan = pB->GetScanline( nY ); - -for( nX = 0; nX < nDstWidth; nX++ ) -{ -tools::Long nMapX = pMapX[ nX ]; - -if ( bHMirr ) -{ -nMapX = aBmpRect.Right() - nMapX; -} -aDstCol = pB->GetPixelFromData( pBScan, nX ); -aDstCol.Merge( pP->GetPaletteColor( pPScan[ nMapX ] ), pAScan[ nMapX ] ); -pB->SetPixelOnData( pBScan, nX, aDstCol ); -} -} -} -break; +tools::Long nMapY = pMapY[ nY ]; -default: +if ( bVMirr ) +{ +nMapY = aBmpRect.Bottom() - nMapY; +} +Scanline pAScan = pA->GetScanline( nMapY ); +Scanline pBScan = pB->GetScanline(nY); +for( nX = 0; nX < nDstWidth; nX++ ) { +tools::Long nMapX = pMapX[ nX ]; -for( nY = 0; nY < nDstHeight; nY++ ) +if ( bHMirr ) { -tools::Long nMapY = pMapY[ nY ]; - -if ( bVMirr ) -{ -nMapY = aBmpRect.Bottom() - nMapY; -} -Scanline pAScan = pA->GetScanline( nMapY ); -Scanline pBScan = pB->GetScanline(nY); -for( nX = 0; nX < nDstWidth; nX++ ) -{ -tools::Long nMapX = pMapX[ nX ]; - -if ( bHMirr ) -{ -nMapX = aBmpRect.Right() - nMapX; -} -aDstCol = pB->GetPixelFromData( pBScan, nX ); -aDstCol.Merge( pP->GetColor( nMapY, nMapX ), pAScan[ nMapX ] ); -pB->SetPixelOnData( pBScan, nX, aDstCol ); -} +nMapX = aBmpRect.Right() - nMapX; } +aDstCol = pB->GetPixelFromData( pBScan, nX ); +aDstCol.Merge( pP->GetColor( nMapY, nMapX ), pAScan[ nMapX ] ); +pB->SetPixelOnData( pBScan, nX, aDstCol ); } -break; } }
[Libreoffice-commits] core.git: vcl/source
vcl/source/control/combobox.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 59dd6ae2c887ef89afd89c9c64eb8c208846c3c3 Author: Szymon Kłos AuthorDate: Sat Aug 19 11:33:45 2023 +0200 Commit: Szymon Kłos CommitDate: Tue Aug 29 12:47:06 2023 +0200 jsdialog: inform that combobox has custom entries Change-Id: I6241961db2e0fa676289ce50873a2aae7ec18282 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155937 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-by: Szymon Kłos Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156236 Tested-by: Jenkins diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 05b7a50006b9..2a979b70b0a3 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -1600,6 +1600,9 @@ void ComboBox::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) } rJsonWriter.put("selectedCount", GetSelectedEntryCount()); + +if (IsUserDrawEnabled()) +rJsonWriter.put("customEntryRenderer", true); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: vcl/source vcl/unx
vcl/source/app/salvtables.cxx |2 ++ vcl/unx/gtk3/gtkinst.cxx |3 +++ 2 files changed, 5 insertions(+) New commits: commit df3b95a39472e18ea8acdaae447b7176e37a9256 Author: Caolán McNamara AuthorDate: Mon Aug 28 09:11:15 2023 +0100 Commit: Caolán McNamara CommitDate: Mon Aug 28 12:21:40 2023 +0200 Related: tdf#144906 unset g_DragSource if drag end callback never called a scenario I can reproduce with alt+f4 while dragging from the navigator Change-Id: I7123602e036fbe15e0ae8f9a7e1d5fc7483dc6c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156182 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 91c96ed4986a..780c6baae79e 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5126,6 +5126,8 @@ SalInstanceTreeView::~SalInstanceTreeView() static_cast(*m_xTreeView).SetStartDragHdl(Link()); static_cast(*m_xTreeView).SetModelChangedHdl(Link()); } +if (g_DragSource == this) +g_DragSource = nullptr; m_xTreeView->SetPopupMenuHdl(Link()); m_xTreeView->SetExpandingHdl(Link()); m_xTreeView->SetDoubleClickHdl(Link()); diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 141039dfb79c..087f2ef186ec 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -16768,6 +16768,9 @@ public: g_signal_handler_disconnect(m_pTreeView, m_nRowActivatedSignalId); g_signal_handler_disconnect(gtk_tree_view_get_selection(m_pTreeView), m_nChangedSignalId); +if (g_DragSource == this) +g_DragSource = nullptr; + GValue value = G_VALUE_INIT; g_value_init(&value, G_TYPE_POINTER); g_value_set_pointer(&value, static_cast(nullptr));
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f0a6c9c7da2f0393bdde2729565b2458d1ff6c5a Author: Michael Weghorn AuthorDate: Wed Aug 23 23:08:56 2023 +0200 Commit: Michael Weghorn CommitDate: Thu Aug 24 07:05:50 2023 +0200 vcl: Fix gcc 13.2 build (vcl::PDFWriterImpl::emitType3Font) Fix this build failure seen with a gcc 13.2.0 `--enable-werror` build on Debian testing: .../vcl/source/gdi/pdfwriter_impl.cxx: In member function ‘bool vcl::PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace*, const vcl::pdf::FontSubset&, std::__debug::map&)’: .../vcl/source/gdi/pdfwriter_impl.cxx:2719:47: error: moving a temporary object prevents copy elision [-Werror=pessimizing-move] 2719 | BitmapEx aBitmapEx = std::move(aReader.read()); | ~^~~~ .../vcl/source/gdi/pdfwriter_impl.cxx:2719:47: note: remove ‘std::move’ call cc1plus: all warnings being treated as errors make[1]: *** [.../solenv/gbuild/LinkTarget.mk:337: .../workdir/CxxObject/vcl/source/gdi/pdfwriter_impl.o] Error 1 Change-Id: I9f0ba1afd0dee2a8aaa4708672c755ab3a97e5a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156021 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index bf118a33d22f..55ed6d514b9d 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2716,7 +2716,7 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, // When rendering an image with an alpha mask during PDF // export, the alpha mask needs to be inverted -BitmapEx aBitmapEx = std::move(aReader.read()); +BitmapEx aBitmapEx = aReader.read(); if ( aBitmapEx.IsAlpha()) { AlphaMask aAlpha = aBitmapEx.GetAlphaMask();
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx | 13 - vcl/source/gdi/pdfwriter_impl2.cxx | 36 2 files changed, 40 insertions(+), 9 deletions(-) New commits: commit 7d745697eec8dc5702eb0ebaa8c4b5122c31edab Author: Patrick Luby AuthorDate: Tue Aug 22 18:06:39 2023 -0400 Commit: Patrick Luby CommitDate: Wed Aug 23 13:25:44 2023 +0200 tdf#156853: Fix PDF export of bitmap color fonts Emoji bitmaps need to have their alpha mask inverted like is done with transparent images and shapes. So, invert the alpha mask of Type 3 font bitmaps. Also, add links to test documents for future development and testing. Regression from: commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) Change-Id: I18223a231ab751945883ede029d660949a406f7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155960 Tested-by: Jenkins Reviewed-by: خالد حسني Reviewed-by: Patrick Luby diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 2f74cfa474e2..bf118a33d22f 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2713,7 +2713,18 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, SvMemoryStream aStream(const_cast(rBitmapData.data()), rBitmapData.size(), StreamMode::READ); vcl::PngImageReader aReader(aStream); -auto aBitmapEmit = createBitmapEmit(std::move(aReader.read()), Graphic(), + +// When rendering an image with an alpha mask during PDF +// export, the alpha mask needs to be inverted +BitmapEx aBitmapEx = std::move(aReader.read()); +if ( aBitmapEx.IsAlpha()) +{ +AlphaMask aAlpha = aBitmapEx.GetAlphaMask(); +aAlpha.Invert(); +aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aAlpha); +} + +auto aBitmapEmit = createBitmapEmit(aBitmapEx, Graphic(), aUsedBitmaps, aResourceDict, aOutputStreams); auto nObject = aBitmapEmit.m_aReferenceXObject.getObject(); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 54ff2201ead9..cd46a6a2e9fe 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -499,8 +499,13 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa AlphaMask aAlpha(xVDev->GetBitmap(Point(), xVDev->GetOutputSizePixel())); AlphaMask aPaintAlpha(aPaint.GetAlphaMask()); -// The alpha mask is inverted from what -// is expected so invert it again +// The alpha mask is inverted from what is +// expected so invert it again. To test this +// code, export to PDF the transparent shapes, +// gradients, and images in the documents +// attached to the following bug reports: +// https://bugs.documentfoundation.org/show_bug.cgi?id=155912 +// https://bugs.documentfoundation.org/show_bug.cgi?id=156630 aAlpha.Invert(); // convert to alpha aAlpha.BlendWith(aPaintAlpha); #if HAVE_FEATURE_SKIA @@ -763,8 +768,13 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExAction* pA = static_cast(pAction); -// When rendering an image with an alpha mask during PDF -// export, the alpha mask needs to be inverted +// The alpha mask is inverted from what is +// expected so invert it again. To test this +// code, export to PDF the transparent shapes, +// gradients, and images in the documents +// attached to the following bug reports: +// https://bugs.documentfoundation.org/show_bug.cgi?id=155912 +// https://bugs.documentfoundation.org/show_bug.cgi?id=156630 BitmapEx aBitmapEx( pA->GetBitmapEx() ); if ( aBitmapEx.IsAlpha()) { @@ -784,8 +794,13 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExScaleAction* pA = static_cast(pAction); -// When r
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx | 10 -- vcl/source/gdi/pdfwriter_impl2.cxx | 30 -- 2 files changed, 28 insertions(+), 12 deletions(-) New commits: commit 8dc8413b4f8037b9c89f08a5b0b939bb61052585 Author: Patrick Luby AuthorDate: Tue Aug 22 14:03:54 2023 +0200 Commit: Patrick Luby CommitDate: Tue Aug 22 14:36:44 2023 +0200 Revert "tdf#156853: Fix PDF export of bitmap color fonts" This reverts commit 3e20c3e73cbd10e8323f0997e3a6536abd11e2bd. Reason for revert: This breaks every single fix that I have made for exporting alpha masks to PDF. A different solution is needed as the invert needs to be where it was to snapshot the AlphaMask. Change-Id: I5f743b67067dff43a2324d6ca9bc1f444e245a12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155917 Reviewed-by: Patrick Luby Tested-by: Patrick Luby diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index fe93cabe0897..2f74cfa474e2 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9804,16 +9804,6 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize, const BitmapEmit& PDFWriterImpl::createBitmapEmit(const BitmapEx& i_rBitmap, const Graphic& rGraphic, std::list& rBitmaps, ResourceDict& rResourceDict, std::list& rOutputStreams) { BitmapEx aBitmap( i_rBitmap ); - -// When rendering an image with an alpha mask during PDF export, the alpha -// mask needs to be inverted -if (aBitmap.IsAlpha()) -{ -AlphaMask aAlpha = aBitmap.GetAlphaMask(); -aAlpha.Invert(); -aBitmap = BitmapEx(aBitmap.GetBitmap(), aAlpha); -} - auto ePixelFormat = aBitmap.GetBitmap().getPixelFormat(); if( m_aContext.ColorMode == PDFWriter::DrawGreyscale ) aBitmap.Convert(BmpConversion::N8BitGreys); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index a9b2a1238000..54ff2201ead9 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -763,7 +763,15 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExAction* pA = static_cast(pAction); -const BitmapEx& aBitmapEx( pA->GetBitmapEx() ); +// When rendering an image with an alpha mask during PDF +// export, the alpha mask needs to be inverted +BitmapEx aBitmapEx( pA->GetBitmapEx() ); +if ( aBitmapEx.IsAlpha()) +{ +AlphaMask aAlpha = aBitmapEx.GetAlphaMask(); +aAlpha.Invert(); +aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aAlpha); +} Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(), aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) ); @@ -776,8 +784,18 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExScaleAction* pA = static_cast(pAction); +// When rendering an image with an alpha mask during PDF +// export, the alpha mask needs to be inverted +BitmapEx aBitmapEx( pA->GetBitmapEx() ); +if ( aBitmapEx.IsAlpha()) +{ +AlphaMask aAlpha = aBitmapEx.GetAlphaMask(); +aAlpha.Invert(); +aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aAlpha); +} + Graphic aGraphic = i_pOutDevData ? i_pOutDevData->GetCurrentGraphic() : Graphic(); -implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx(), aGraphic, pDummyVDev, i_rContext ); +implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), aBitmapEx, aGraphic, pDummyVDev, i_rContext ); } break; @@ -785,7 +803,15 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExScalePartAction* pA = static_cast(pAction); +// When rendering an image with an alpha mask during PDF +// export, the alpha mask needs to be inverted BitmapEx aBitmapEx( pA->GetBitmapEx() ); +if ( aBitmapEx.IsAlpha()) +{ +AlphaMask aAlpha = aBitmapEx.GetAlphaMask(); +aAlpha.Invert(); +aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aAlpha); +} aBitmapEx.Crop( tools::Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ); Graphic aGraphic = i_pOutDevData ? i_pOutDev
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx | 39 +- 1 file changed, 22 insertions(+), 17 deletions(-) New commits: commit bc3f6c3a47411a3b5dafadca4e5c55cd24e30662 Author: Khaled Hosny AuthorDate: Tue Aug 22 10:47:33 2023 +0300 Commit: خالد حسني CommitDate: Tue Aug 22 11:45:31 2023 +0200 tdf#155610: Workaround Acrobat bug with Type 3 fonts and unusual UPEM Adobe Acrobat seems to have a bug with Type 3 fonts with unusual UPEM, the common 1000 and 2048 UPEM work fine, but Sitka has 2250 UPEM and Acrobat handles the advance widths in this case incorrectly and everything gets cramped up with gaps when we re-start glyph positioning. Workaround this by always using 0.001 scale in FontMatrix (equivalent to 1000 UPEM) and scale everything if the font’s UPEM is different. Change-Id: I80d25a16456f04bb00304b22b967688fa8260a83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155935 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 4cda5a09b287..fe93cabe0897 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2580,13 +2580,14 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, + OString::number(aSubsetInfo.m_aFontBBox.Bottom() + 1) + "]\n"); -auto nScale = 1. / pFace->UnitsPerEm(); -aLine.append( -"/FontMatrix[" -+ OString::number(nScale) -+ " 0 0 " -+ OString::number(nScale) -+ " 0 0]\n"); +// tdf#155610 +// Adobe Acrobat does not seem to like certain UPEMs, so instead of +// setting the FontMatrix scale relative to the UPEM, we always set to +// 0.001 (1000 UPEM) and scale everything if the font’s UPEM is +// different. +double fScale = 1000. / pFace->UnitsPerEm(); + +aLine.append("/FontMatrix[0.001 0 0 0.001 0 0]\n"); sal_Int32 pGlyphStreams[256] = {}; aLine.append("/CharProcs<<\n"); @@ -2615,7 +2616,8 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, "/Widths["); for (auto i = 0u; i < nGlyphs; i++) { -aLine.append(OString::number(pWidths[i]) + " "); +appendDouble(pWidths[i] * fScale, aLine); +aLine.append(" "); } aLine.append("]\n"); @@ -2645,8 +2647,8 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, std::list aOutputStreams; // Scale for glyph outlines. -double fScaleX = GetDPIX() / 72.; -double fScaleY = GetDPIY() / 72.; +double fScaleX = (GetDPIX() / 72.) * fScale; +double fScaleY = (GetDPIY() / 72.) * fScale; for (auto i = 1u; i < nGlyphs; i++) { @@ -2654,7 +2656,8 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, if (!updateObject(nStream)) return false; OStringBuffer aContents(1024); -aContents.append(OString::number(pWidths[i]) + " 0 d0\n"); +appendDouble(pWidths[i] * fScale, aContents); +aContents.append(" 0 d0\n"); const auto& rGlyph = rSubset.m_aMapping.find(pGlyphIds[i])->second; const auto& rLayers = rGlyph.getColorLayers(); @@ -2691,8 +2694,10 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, } aContents.append( "BT " -"/F" + OString::number(rLayer.m_nFontID) + " " -+ OString::number(pFace->UnitsPerEm()) + " Tf " +"/F" + OString::number(rLayer.m_nFontID) + " "); +appendDouble(pFace->UnitsPerEm() * fScale, aContents); +aContents.append( +" Tf " "<"); appendHex(rLayer.m_nSubsetGlyphID, aContents); aContents.append( @@ -2712,11 +2717,11 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, aUsedBitmaps, aResourceDict, aOutputStreams); auto nObject = aBitmapEmit.m_aReferenceXObject.getObject(); +aContents.append("q "); +appendDouble(aRect.GetWidth() * fScale, aContents); +aContents.append(" 0 0 "); +appendDouble(aRect.GetHeight() * fScale, aContents); aContents.append( -"q " -+ OString::number(aRect.GetWidth()) -+ " 0 0 " -+ OString::number(aRect.GetHeight()) + " " + OString::number(aRect.getX()) + " "
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/svm/SvmConverter.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit 83f2a294fde74e968a564fe69cce0e85c86b3543 Author: Caolán McNamara AuthorDate: Sun Aug 20 21:12:03 2023 +0100 Commit: Caolán McNamara CommitDate: Tue Aug 22 10:06:06 2023 +0200 Related: ofz#57493 Timeout restore this now that ofz has closed ofz#57493 and has reset Change-Id: Ibf5545d1f499e1c986a8242eb501ac870a7a6d72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155879 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/filter/svm/SvmConverter.cxx b/vcl/source/filter/svm/SvmConverter.cxx index 2c2ba2c70977..0e9277dc9240 100644 --- a/vcl/source/filter/svm/SvmConverter.cxx +++ b/vcl/source/filter/svm/SvmConverter.cxx @@ -1274,7 +1274,6 @@ bool TestImportSVM(SvStream& rStream) GDIMetaFile aGDIMetaFile; SvmReader aReader(rStream); aReader.Read(aGDIMetaFile); -#if 0 ScopedVclPtrInstance aVDev; try { @@ -1284,7 +1283,6 @@ bool TestImportSVM(SvStream& rStream) { return false; } -#endif return true; }
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx | 10 ++ vcl/source/gdi/pdfwriter_impl2.cxx | 30 ++ 2 files changed, 12 insertions(+), 28 deletions(-) New commits: commit 3e20c3e73cbd10e8323f0997e3a6536abd11e2bd Author: Khaled Hosny AuthorDate: Tue Aug 22 06:13:10 2023 + Commit: خالد حسني CommitDate: Tue Aug 22 09:55:27 2023 +0200 tdf#156853: Fix PDF export of bitmap color fonts Move the alpha inversion down to createBitmapEmit() so that it gets applied to any bitmap embedded in the PDF, especially since embedded color bitmap glyphs don't go through the higher level code path. Regression from: commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) Change-Id: I68601a7a0d9ac01f5e8054f074f8e18fcbdea1be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155930 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 429efe3aa639..4cda5a09b287 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9799,6 +9799,16 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize, const BitmapEmit& PDFWriterImpl::createBitmapEmit(const BitmapEx& i_rBitmap, const Graphic& rGraphic, std::list& rBitmaps, ResourceDict& rResourceDict, std::list& rOutputStreams) { BitmapEx aBitmap( i_rBitmap ); + +// When rendering an image with an alpha mask during PDF export, the alpha +// mask needs to be inverted +if (aBitmap.IsAlpha()) +{ +AlphaMask aAlpha = aBitmap.GetAlphaMask(); +aAlpha.Invert(); +aBitmap = BitmapEx(aBitmap.GetBitmap(), aAlpha); +} + auto ePixelFormat = aBitmap.GetBitmap().getPixelFormat(); if( m_aContext.ColorMode == PDFWriter::DrawGreyscale ) aBitmap.Convert(BmpConversion::N8BitGreys); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 54ff2201ead9..a9b2a1238000 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -763,15 +763,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExAction* pA = static_cast(pAction); -// When rendering an image with an alpha mask during PDF -// export, the alpha mask needs to be inverted -BitmapEx aBitmapEx( pA->GetBitmapEx() ); -if ( aBitmapEx.IsAlpha()) -{ -AlphaMask aAlpha = aBitmapEx.GetAlphaMask(); -aAlpha.Invert(); -aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aAlpha); -} +const BitmapEx& aBitmapEx( pA->GetBitmapEx() ); Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(), aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) ); @@ -784,18 +776,8 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExScaleAction* pA = static_cast(pAction); -// When rendering an image with an alpha mask during PDF -// export, the alpha mask needs to be inverted -BitmapEx aBitmapEx( pA->GetBitmapEx() ); -if ( aBitmapEx.IsAlpha()) -{ -AlphaMask aAlpha = aBitmapEx.GetAlphaMask(); -aAlpha.Invert(); -aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aAlpha); -} - Graphic aGraphic = i_pOutDevData ? i_pOutDevData->GetCurrentGraphic() : Graphic(); -implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), aBitmapEx, aGraphic, pDummyVDev, i_rContext ); +implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx(), aGraphic, pDummyVDev, i_rContext ); } break; @@ -803,15 +785,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExScalePartAction* pA = static_cast(pAction); -// When rendering an image with an alpha mask during PDF -// export, the alpha mask needs to be inverted BitmapEx aBitmapEx( pA->GetBitmapEx() ); -if ( aBitmapEx.IsAlpha()) -{ -AlphaMask aAlpha = aBitmapEx.GetAlphaMask(); -aAlpha.Invert(); -aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aAlpha); -}
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl2.cxx | 18 +++--- vcl/source/outdev/transparent.cxx | 27 --- 2 files changed, 11 insertions(+), 34 deletions(-) New commits: commit f9d5887697405e600cb85cd49b0ce1d8e63cdc27 Author: Patrick Luby AuthorDate: Sat Aug 19 10:47:25 2023 -0400 Commit: Patrick Luby CommitDate: Sat Aug 19 19:31:46 2023 +0200 Eliminate special alpha mask inversions when Skia is disabled Commit ad1f69d28d31725a22e7e1cbb4d950aa9ad3bea7 fixed an alpha blending bug in AlphaMask::BlendWith(const AlphaMask&) so almost all of the special alpha mask inversions when drawing transparent meta actions are no longer needed and so, when Skia is disabled, the same inversions as Skia are now used. The one special alpha mask inversion that is still needed when Skia is disabled is when exporting to PDF documents like the following with transparent gradients: https://bugs.documentfoundation.org/attachment.cgi?id=188084 Change-Id: I3212a38916be3d238bb9c868b161031616baf0a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155859 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 4e309a2ee8a3..54ff2201ead9 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -499,23 +499,19 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa AlphaMask aAlpha(xVDev->GetBitmap(Point(), xVDev->GetOutputSizePixel())); AlphaMask aPaintAlpha(aPaint.GetAlphaMask()); -#if HAVE_FEATURE_SKIA -// One of the alpha masks is inverted from what +// The alpha mask is inverted from what // is expected so invert it again -if ( SkiaHelper::isVCLSkiaEnabled() ) -{ -aAlpha.Invert(); // convert to alpha -} -else -#endif -{ -aPaintAlpha.Invert(); // convert to alpha -} +aAlpha.Invert(); // convert to alpha aAlpha.BlendWith(aPaintAlpha); #if HAVE_FEATURE_SKIA if ( !SkiaHelper::isVCLSkiaEnabled() ) #endif { +// When Skia is disabled, the alpha mask +// must be inverted a second time. To test +// this code, export the following +// document to PDF: +// https://bugs.documentfoundation.org/attachment.cgi?id=188084 aAlpha.Invert(); // convert to alpha } diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index df64db2c9b85..f26ca5439982 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -648,18 +647,9 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, AlphaMask aAlpha(xVDev->GetBitmap(aPoint, xVDev->GetOutputSizePixel())); AlphaMask aPaintAlpha(aPaint.GetAlphaMask()); -#if HAVE_FEATURE_SKIA -// One of the alpha masks is inverted from what +// The alpha mask is inverted from what // is expected so invert it again -if ( SkiaHelper::isVCLSkiaEnabled() ) -{ -aAlpha.Invert(); // convert to alpha -} -else -#endif -{ -aPaintAlpha.Invert(); // convert to alpha -} +aAlpha.Invert(); // convert to alpha aAlpha.BlendWith(aPaintAlpha); xVDev.disposeAndClear(); @@ -694,18 +684,9 @@ void OutputDevice::DrawTransparent( const GDIMetaFile& rMtf, const Point& rPos, AlphaMask aAlpha(xVDev->GetBitmap(Point(), xVDev->GetOutputSizePixel())); AlphaMask aPaintAlpha(aPaint.GetAlphaMask()); -#if HAVE_FEATURE_SKIA -// One of the alpha masks is inverted from what +// The alpha mask is inverted from what // is expected so invert it again -if ( SkiaHelper::isVCLSkiaEnabled() ) -{ -aAlpha.Inve
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/dockmgr.cxx |8 1 file changed, 8 insertions(+) New commits: commit 0008ff3597e9d89481d5fccb5cefa7f058400a43 Author: Michael Weghorn AuthorDate: Fri Aug 18 15:32:12 2023 +0100 Commit: Michael Weghorn CommitDate: Fri Aug 18 20:13:55 2023 +0200 tdf#141101 a11y: Ensure focused event after showing popup content If the `FloatWinPopupFlags::GrabFocus` flag is set, don't only pass it to `FloatingWindow::StartPopupMode`, but explicitly grab focus again after showing the docking window (client window of the floating window). At least proper handling for accessible focus/focused events depends on the window being visible at the point it receives focus. For winaccessibility, the a11y event listener only gets registered once the window gets shown (`VCLXAccessibleComponent::ProcessWindowChildEvent` forwards a `VclEventId::WindowShow` as `accessibility::AccessibleEventId::CHILD` event, which winaccessibility then processes and registers an event listener for the new child). This makes NVDA on Windows announce focus for the "Automatic" button in the color popup in Writer's character style dialog also when the popup shows for the first time. Change-Id: I2e4028eb4ec68a8b586cbd1a0dc5351d1453937e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155843 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index ba9aa2aa9450..7cde1910fed3 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -823,6 +823,10 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin mpFloatWin->StartPopupMode( pParentToolBox, nFlags ); GetWindow()->Show(); +// grab focus (again) after showing docking window, as e.g. a11y focus +// events require window to be visible first +if (nFlags & FloatWinPopupFlags::GrabFocus) +mpFloatWin->GrabFocus(); if( pParentToolBox->IsKeyEvent() ) { @@ -841,6 +845,10 @@ void ImplDockingWindowWrapper::StartPopupMode( const tools::Rectangle& rRect, Fl ImplPreparePopupMode(); mpFloatWin->StartPopupMode( rRect, nFlags ); GetWindow()->Show(); +// grab focus (again) after showing docking window, as e.g. a11y focus +// events require window to be visible first +if (nFlags & FloatWinPopupFlags::GrabFocus) +mpFloatWin->GrabFocus(); } IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd, FloatingWindow*, void)
[Libreoffice-commits] core.git: vcl/source
vcl/source/app/svapp.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c8bbabd64ca642b8e9dec5cc6479177315be1210 Author: Andrea Gelmini AuthorDate: Fri Aug 18 11:29:43 2023 +0200 Commit: Julien Nabet CommitDate: Fri Aug 18 13:53:57 2023 +0200 Fix typos Change-Id: I29aa97b8072fccee24ed0053c9492d61bef44cb0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155828 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 927cc4a32b60..541256d8c26a 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -189,7 +189,7 @@ Application::~Application() // is no memory loss. These counters are more to be able to have an eye // on amounts of SfxPoolItems used during office usage and to be able to // detect if an error in future changes may lead to memory losses - these -// would show in dramaitically higher numbers then imediately +// would show in dramatically higher numbers then immediately SAL_WARN("vcl", "ITEM: " << getAllocatedSfxPoolItemCount() << " SfxPoolItems still allocated at shutdown"); SAL_WARN("vcl", "ITEM: " << getUsedSfxPoolItemCount() << " SfxPoolItems were incarnated during office usage"); #endif
[Libreoffice-commits] core.git: vcl/source
vcl/source/app/svapp.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit bfa592ab0ce94d1adb905cbd7c1c4a2fd7f16192 Author: Andrea Gelmini AuthorDate: Fri Aug 18 11:30:18 2023 +0200 Commit: Julien Nabet CommitDate: Fri Aug 18 13:52:47 2023 +0200 Fix typo Change-Id: Ia78a6a37b21cd2e286574adcd5fa64818f7d0d75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155829 Tested-by: Julien Nabet Reviewed-by: Julien Nabet diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 4b7fc313bbb1..927cc4a32b60 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -185,7 +185,7 @@ Application::~Application() // const Cell OBJ_CELL_NONE; // being a static held SfxPoolItem which is not yet de-initialized here // number often is (1), even higher with other modules loaded (like 5). -// These get de-allocated reliaby in module-deinitializations, so this +// These get de-allocated reliably in module-deinitializations, so this // is no memory loss. These counters are more to be able to have an eye // on amounts of SfxPoolItems used during office usage and to be able to // detect if an error in future changes may lead to memory losses - these
[Libreoffice-commits] core.git: vcl/source
vcl/source/treelist/svtabbx.cxx | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) New commits: commit e59c026c561da4ae0b9bd1a33fcee3fbc724dece Author: Michael Weghorn AuthorDate: Thu Aug 17 17:25:47 2023 +0200 Commit: Michael Weghorn CommitDate: Fri Aug 18 06:06:07 2023 +0200 vcl a11y: Fix nullptr deref in SvHeaderTabListBox::calcHeaderRect While working on tdf#156561 and tdf#141101, I experienced a crash with the below backtrace on Windows at some point. Potentially a regression from: commit 0e8b7dd7a013dffe080148baac926a698f36ad85 Date: Wed Jul 19 15:19:28 2023 +0200 split GetWindowExtentsRelative asunder Use the `GetWindowExtentsAbsolute` variant when screen coordinates are wanted, as is done elsewhere since the above commit. Backtrace: 1 std::unique_ptr>::operator-> memory 3295 0x7fffa807a02a 2 vcl::Window::GetWindowExtentsRelative window.cxx 2953 0x7fffa82b7132 3 SvHeaderTabListBox::calcHeaderRect svtabbx.cxx 771 0x7fffa850a1a6 4 accessibility::AccessibleBrowseBoxHeaderBar::implGetBoundingBoxOnScreen AccessibleBrowseBoxHeaderBar.cxx 311 0x7fffa41b2728 5 accessibility::AccessibleBrowseBoxBase::getBoundingBoxOnScreen AccessibleBrowseBoxBase.cxx 408 0x7fffa41ada97 6 accessibility::AccessibleBrowseBoxBase::getLocationOnScreen AccessibleBrowseBoxBase.cxx 228 0x7fffa41ae134 7 CMAccessible::accHitTest MAccessible.cxx 988 0x7fffbf8d7fad 8 NdrSendReceive RPCRT40x7ff81155b4b3 9 NdrSendReceive RPCRT40x7ff81155a282 10 NdrStubCall2 RPCRT40x7ff8114fe1ca 11 NdrStubCall3 RPCRT40x7ff8114fd494 12 CStdStubBuffer_Invoke combase 0x7ff812295f1c 13 CStdStubBuffer_Invoke RPCRT40x7ff81153a74b 14 CoWaitForMultipleHandles combase 0x7ff81226bad3 15 CoWaitForMultipleHandles combase 0x7ff81226b85e 16 HSTRING_UserSize combase 0x7ff81229aaa6 17 RoGetActivatableClassRegistration combase 0x7ff812211283 18 CoWaitForMultipleHandles combase 0x7ff812269d7d 19 SetErrorInfo combase 0x7ff812205036 20 CoMarshalInterface combase 0x7ff8122635fa 21 CallWindowProcW USER320x7ff8126be858 22 DispatchMessageW USER320x7ff8126be299 23 ImplSalDispatchMessage salinst.cxx 474 0x7fffa48301d8 24 ImplSalYield salinst.cxx 551 0x7fffa48308fd 25 WinSalInstance::DoYield salinst.cxx 580 0x7fffa482fe01 26 ImplYield svapp.cxx352 0x7fffa891790d 27 Application::Yield svapp.cxx437 0x7fffa891b862 28 Application::Execute svapp.cxx330 0x7fffa8914c4a 29 desktop::Desktop::Main app.cxx 1601 0x7fffc71696b2 30 ImplSVMain svmain.cxx 204 0x7fffa892d08c 31 SVMain
[Libreoffice-commits] core.git: vcl/source
vcl/source/helper/canvasbitmap.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit fa728837ecab38b59c2c562ed48505f204a89bea Author: Noel Grandin AuthorDate: Tue Aug 15 18:59:20 2023 +0200 Commit: Noel Grandin CommitDate: Wed Aug 16 08:27:55 2023 +0200 no need for mutex locking here these values are assigned in the constructor and never updated Change-Id: Ia4e0524c2b5c5465f9659eb88a11b955492e7e63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155723 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx index e64cd07a8940..67e14d4ee9b2 100644 --- a/vcl/source/helper/canvasbitmap.cxx +++ b/vcl/source/helper/canvasbitmap.cxx @@ -932,13 +932,11 @@ uno::Sequence< double > SAL_CALL VclCanvasBitmap::convertFromPARGB( const uno::S sal_Int32 SAL_CALL VclCanvasBitmap::getBitsPerPixel( ) { -SolarMutexGuard aGuard; return m_nBitsPerOutputPixel; } uno::Sequence< ::sal_Int32 > SAL_CALL VclCanvasBitmap::getComponentBitCounts( ) { -SolarMutexGuard aGuard; return m_aComponentBitCounts; }
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/png/PngImageWriter.cxx |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) New commits: commit 5374b7107648757b572249777a5a00d4ad2eaac8 Author: Caolán McNamara AuthorDate: Sun Aug 13 14:23:38 2023 +0100 Commit: Caolán McNamara CommitDate: Sun Aug 13 18:10:39 2023 +0200 cid#1539910 avoid Missing move assignment operator and cid#1539912 Missing move assignment operator cid#1539913 Missing move assignment operator Change-Id: If46cb15c20479a4a88fdfa70fe4bb662004239d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155645 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/filter/png/PngImageWriter.cxx b/vcl/source/filter/png/PngImageWriter.cxx index 09bddf7b2f58..5d8f2c7372a8 100644 --- a/vcl/source/filter/png/PngImageWriter.cxx +++ b/vcl/source/filter/png/PngImageWriter.cxx @@ -126,12 +126,9 @@ static bool pngWrite(SvStream& rStream, const Graphic& rGraphic, int nCompressio if (rGraphic.IsNone()) return false; -Animation aAnimation; sal_uInt32 nSequenceNumber = 0; -bool bIsApng = rGraphic.IsAnimated(); - -if (bIsApng) -aAnimation = rGraphic.GetAnimation(); +const bool bIsApng = rGraphic.IsAnimated(); +Animation aAnimation = bIsApng ? rGraphic.GetAnimation() : Animation(); png_structp pPng = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
[Libreoffice-commits] core.git: vcl/source
vcl/source/app/salvtables.cxx | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) New commits: commit ce2d9f5dd4b6a26847c4779bce4866d969ff4400 Author: Patrick Luby AuthorDate: Thu Aug 10 11:59:48 2023 -0400 Commit: Patrick Luby CommitDate: Thu Aug 10 19:39:56 2023 +0200 Related tdf#156629 force snapshot of alpha mask On macOS, with Skia/Metal with a Retina display (i.e. 2.0 window scale), the alpha mask gets upscaled for the font color and the character background color icons in Writer's properties sidebar with most icon sets. The Breeze and Colibre icon sets running in light mode are the most obvious cases. This bug appears to be caused by asynchronous rendering of the returned image. So, we force a copy of the alpha mask in case it changes before the image is actually drawn. Change-Id: Ie3aa3b26acaee4bd9173e6b356137980c070c7c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155562 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Patrick Luby diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index f5275eb5c68e..80772536adeb 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -861,7 +861,21 @@ Image createImage(const OUString& rImage) Image createImage(const VirtualDevice& rDevice) { -return Image(rDevice.GetBitmapEx(Point(), rDevice.GetOutputSizePixel())); +BitmapEx aBitmapEx(rDevice.GetBitmapEx(Point(), rDevice.GetOutputSizePixel())); + +// Related tdf#156629 force snapshot of alpha mask +// On macOS, with Skia/Metal with a Retina display (i.e. 2.0 window +// scale), the alpha mask gets upscaled for the font color and the +// character background color icons in Writer's properties sidebar +// with most icon sets. The Breeze and Colibre icon sets running in +// light mode are the most obvious cases. +// This bug appears to be caused by asynchronous rendering of the +// returned image. So, we force a copy of the alpha mask in case it +// changes before the image is actually drawn. +AlphaMask aAlphaMask(aBitmapEx.GetAlphaMask()); +AlphaMask::ScopedReadAccess pAccessAlpha(aAlphaMask); + +return Image(BitmapEx(aBitmapEx.GetBitmap(), aAlphaMask)); } sal_uInt16 insert_to_menu(sal_uInt16 nLastId, PopupMenu* pMenu, int pos, const OUString& rId,
[Libreoffice-commits] core.git: vcl/source
vcl/source/bitmap/dibtools.cxx |2 +- vcl/source/filter/etiff/etiff.cxx|8 vcl/source/filter/graphicfilter2.cxx |4 ++-- vcl/source/filter/ieps/ieps.cxx |2 +- vcl/source/filter/ipdf/pdfcompat.cxx |2 +- vcl/source/filter/ipsd/ipsd.cxx |4 ++-- vcl/source/filter/jpeg/Exif.cxx | 10 +- vcl/source/filter/wmf/emfwr.cxx | 10 ++ vcl/source/filter/wmf/emfwr.hxx |4 ++-- vcl/source/filter/wmf/wmf.cxx|6 +++--- vcl/source/gdi/pdfwriter_impl.cxx|8 vcl/source/treelist/transfer.cxx |5 +++-- 12 files changed, 34 insertions(+), 31 deletions(-) New commits: commit c9da81db9684cc3d83bd25fcae5ed2bed5401550 Author: Noel Grandin AuthorDate: Wed Aug 9 14:09:51 2023 +0200 Commit: Noel Grandin CommitDate: Wed Aug 9 16:26:49 2023 +0200 use sal_uInt64 when dealing with stream position Change-Id: Ibb8637e4648f56d7f9895a31df006915df8f8fdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155517 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/bitmap/dibtools.cxx b/vcl/source/bitmap/dibtools.cxx index d6ac43a403da..f5c393848b25 100644 --- a/vcl/source/bitmap/dibtools.cxx +++ b/vcl/source/bitmap/dibtools.cxx @@ -905,7 +905,7 @@ bool ImplReadDIBBody(SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_uI // end of BITMAPINFOHEADER or 12 bytes further in case // of WinBMPv3-NT format. It is possible to seek forward // though because a gap may be there. -sal_Int32 nSeekRel = nOffset - (pIStm->Tell() - nStmPos); +sal_Int64 nSeekRel = nOffset - (pIStm->Tell() - nStmPos); if (nSeekRel > 0) pIStm->SeekRel(nSeekRel); } diff --git a/vcl/source/filter/etiff/etiff.cxx b/vcl/source/filter/etiff/etiff.cxx index f0da56c472af..1f3b2804b497 100644 --- a/vcl/source/filter/etiff/etiff.cxx +++ b/vcl/source/filter/etiff/etiff.cxx @@ -59,7 +59,7 @@ class TIFFWriter private: SvStream& m_rOStm; -sal_uInt32 mnStreamOfs; +sal_uInt64 mnStreamOfs; boolmbStatus; BitmapReadAccess* mpAcc; @@ -72,7 +72,7 @@ private: sal_uInt32 mnLatestIfdPos; sal_uInt16 mnTagCount; // number of tags already written -sal_uInt32 mnCurrentTagCountPos; // offset to the position where the current +sal_uInt64 mnCurrentTagCountPos; // offset to the position where the current // tag count is to insert sal_uInt32 mnXResPos; // if != 0 this DWORDs stores the @@ -204,7 +204,7 @@ bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem const * pF ImplWritePalette(); ImplWriteBody(); } -sal_uInt32 nCurPos = m_rOStm.Tell(); +sal_uInt64 nCurPos = m_rOStm.Tell(); m_rOStm.Seek( mnCurrentTagCountPos ); m_rOStm.WriteUInt16( mnTagCount ); m_rOStm.Seek( nCurPos ); @@ -246,7 +246,7 @@ bool TIFFWriter::ImplWriteHeader( bool bMultiPage ) if ( mnWidth && mnHeight && mnBitsPerPixel && mbStatus ) { -sal_uInt32 nCurrentPos = m_rOStm.Tell(); +sal_uInt64 nCurrentPos = m_rOStm.Tell(); m_rOStm.Seek( mnLatestIfdPos ); m_rOStm.WriteUInt32( nCurrentPos - mnStreamOfs ); // offset to the IFD m_rOStm.Seek( nCurrentPos ); diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index f0f7950271d3..d7161b2808ea 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -151,7 +151,7 @@ bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, bool bExtendedInfo ) sal_uInt32 nTemp32 = 0; boolbRet = false; -sal_Int32 nStmPos = rStm.Tell(); +sal_uInt64 nStmPos = rStm.Tell(); rStm.SetEndian( SvStreamEndian::BIG ); rStm.ReadUInt32( nTemp32 ); @@ -208,7 +208,7 @@ bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, bool bExtendedInfo ) bScanFailure = true; else { -sal_uInt32 nNextMarkerPos = rStm.Tell() + nLength - 2; +sal_uInt64 nNextMarkerPos = rStm.Tell() + nLength - 2; switch( nMarker ) { case 0xe0 : // APP0 Marker diff --git a/vcl/source/filter/ieps/ieps.cxx b/vcl/source/filter/ieps/ieps.cxx index 3dbadda9b9bb..dd2c1597abaf 100644 --- a/vcl/source/filter/ieps/ieps.cxx +++ b/vcl/source/filter/ieps/ieps.cxx @@ -642,7 +642,7 @@ bool ImportEpsGraphic( SvStream & rStream, Graphic & rGraphic) } if (bOk) { -sal_uInt32 nB
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/svm/SvmConverter.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 954b8253b798d0c1fe37806dc773ce0128bde785 Author: Caolán McNamara AuthorDate: Tue Aug 8 20:51:06 2023 +0100 Commit: Caolán McNamara CommitDate: Wed Aug 9 09:47:26 2023 +0200 ofz: Integer-overflow Tell() returns sal_uInt64 not sal_Int32 Change-Id: Ib17cc045316d468be306a678ddb9b2b4b08f6f4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155497 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/vcl/source/filter/svm/SvmConverter.cxx b/vcl/source/filter/svm/SvmConverter.cxx index 48e5a29f5a31..2c2ba2c70977 100644 --- a/vcl/source/filter/svm/SvmConverter.cxx +++ b/vcl/source/filter/svm/SvmConverter.cxx @@ -370,7 +370,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { sal_Int16 nType(0); rIStm.ReadInt16(nType); -sal_Int32 nActBegin = rIStm.Tell(); +sal_uInt64 nActBegin = rIStm.Tell(); sal_Int32 nActionSize(0); rIStm.ReadInt32(nActionSize);
[Libreoffice-commits] core.git: vcl/source
vcl/source/filter/imet/ios2met.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6e12b7f296930c6f37e036407e9fb832d9a9f027 Author: sahil AuthorDate: Mon Jul 31 00:43:00 2023 +0530 Commit: Hossein CommitDate: Mon Aug 7 02:49:30 2023 +0200 tdf#147906 used std::hypot for Pythagorean addition Change-Id: I8a926c621dee746e47ebdaaff4e0c558d7a7e6a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155073 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/vcl/source/filter/imet/ios2met.cxx b/vcl/source/filter/imet/ios2met.cxx index fe856c1d7bb6..e055ea83824a 100644 --- a/vcl/source/filter/imet/ios2met.cxx +++ b/vcl/source/filter/imet/ios2met.cxx @@ -1124,7 +1124,7 @@ void OS2METReader::ReadArc(bool bGivenPos) p*p*((y3*y3-y1*y1)*(x2-x1)+(y2*y2-y1*y1)*(x1-x3)) ) / ncy; cx=( q*q*(x2*x2-x1*x1)+p*p*(y2*y2-y1*y1)+cy*2*p*p*(y1-y2) ) / ncx; // now we still need the radius in x and y direction: -r=sqrt(q*q*(x1-cx)*(x1-cx)+p*p*(y1-cy)*(y1-cy)); +r=hypot(q*(x1-cx), p*(y1-cy)); rx=r/q; ry=r/p; // We now have to find out how the starting and the end point // have to be chosen so that point no. 2 lies inside the drawn arc:
[Libreoffice-commits] core.git: vcl/source
vcl/source/outdev/bitmap.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 37421677cea4969ffecdeb2a58488bae22f81782 Author: Noel Grandin AuthorDate: Wed Aug 2 11:57:20 2023 +0200 Commit: Noel Grandin CommitDate: Wed Aug 2 13:06:20 2023 +0200 tdf#156514 Check spelling red underlines are gone Regression from commit af34f4ea62d8aabbab5d4028034aa2482c16fe8a Author: Noel Grandin Date: Thu Jul 6 10:52:07 2023 +0200 avoid skia assert and slow-path Change-Id: Ib81c7d341a88e72fb0a48a39703485261ac6679c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155217 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index e487ac6802af..ef11ad97b79f 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -314,8 +314,6 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r if (aDstRect.Intersection(tools::Rectangle(aOutPt, aOutSz)).IsEmpty()) return; -if (ImplLogicToDevicePixel(aOutSz).IsEmpty()) // nothing to draw -return; { Point aRelPt = aOutPt + Point(mnOutOffX, mnOutOffY); @@ -341,6 +339,8 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& rBmp, const AlphaMask& r // try to blend the alpha bitmap with the alpha virtual device if (mpAlphaVDev) { +if (ImplLogicToDevicePixel(aOutSz).IsEmpty()) // nothing to draw +return; Bitmap aAlphaBitmap( mpAlphaVDev->GetBitmap( aRelPt, aOutSz ) ); if (SalBitmap* pSalAlphaBmp2 = aAlphaBitmap.ImplGetSalBitmap().get()) {
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/dockmgr.cxx | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) New commits: commit 3bb762c53ea79f8915a1b8fa39f3f5f57aa68c84 Author: Michael Weghorn AuthorDate: Tue Aug 1 09:44:56 2023 +0200 Commit: Michael Weghorn CommitDate: Tue Aug 1 13:11:19 2023 +0200 tdf#156100 tdf#156561 Revert to previous behavior for gtk popups In order to fix announcement of items in the popups with at least NVDA on Windows, commit dc0706cabfe39ddb6ea23d60ccfb756f2b9e6efb Date: Wed Mar 15 17:00:27 2023 +0100 tdf#140762 tdf#152671 Make dock win visible before showing popup made sure that the dock window is made visible before the popup is shown. That's problematic for the gtk implementations, though. On issue was addressed with commit 70642bb7afd2cee6f7ae6eff2936a35978bd0597 Date: Thu Apr 6 15:07:15 2023 +0100 tdf#154470 try moving the Show of the client to after the float positioning , but there's still an issue for the RTL case (tdf#156100). To unbreak that while leaving the announcement with NVDA working properly, effectively revert to the original behavior for the gtk VCL plugins (which have their own implementation for popup handling) for now. Further analysis of the root causes is planned in the context of tdf#156561, so hopefully the code paths can be unified again in the future. (One issue is addressed by Change-Id I62ab32342ef67c770ced9f0d2be867dc9355bd4a, "tdf#156561 wina11y: Handle CHILD event", but that's not enough by itself.) Change-Id: Ie67bded6c380695866d5343dab9d3f563ada057a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155125 Reviewed-by: Caolán McNamara Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 5112c322abda..cc122a71dd0d 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -821,7 +821,21 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin if( pParentToolBox->IsKeyEvent() ) nFlags |= FloatWinPopupFlags::GrabFocus; -mpFloatWin->StartPopupMode( pParentToolBox, nFlags | FloatWinPopupFlags::MakeClientWindowVisibleBeforePopup); +// tdf#140762, tdf#152671, tdf#154470, tdf#156100: Without client window being visible +// before showing popup, at least NVDA on Windows does not announce items in the popup, +// so make the client window visible first. This is problematic for gtk VCL plugins though, +// so don't do it there and use different code paths for now. +// For further analysis of the root causes, there's tdf#156561. +const OUString sToolkit = Application::GetToolkitName(); +if (sToolkit == "gtk3" || sToolkit == "gtk4") +{ +mpFloatWin->StartPopupMode( pParentToolBox, nFlags); +GetWindow()->Show(); +} +else +{ +mpFloatWin->StartPopupMode( pParentToolBox, nFlags | FloatWinPopupFlags::MakeClientWindowVisibleBeforePopup); +} if( pParentToolBox->IsKeyEvent() ) {
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/mapmod.cxx | 39 +-- 1 file changed, 37 insertions(+), 2 deletions(-) New commits: commit be8e52ca8bcc674ff20432766bbe2748cbfc122b Author: Noel Grandin AuthorDate: Wed Jul 26 18:48:20 2023 +0200 Commit: Noel Grandin CommitDate: Thu Jul 27 16:16:04 2023 +0200 avoid some allocation in MapMode the vast majority of the time we call the single-arg constructor for MapMode, and don't modify the resulting object, so declare some singletons for those cases. Change-Id: I5f6e98c638a86acfa5da8bb5944394caa66af9cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154946 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/gdi/mapmod.cxx b/vcl/source/gdi/mapmod.cxx index b74830faa17f..f76d3bb6ec29 100644 --- a/vcl/source/gdi/mapmod.cxx +++ b/vcl/source/gdi/mapmod.cxx @@ -39,6 +39,7 @@ struct MapMode::ImplMapMode boolmbSimple; ImplMapMode(); +ImplMapMode(MapUnit eMapUnit); ImplMapMode(const ImplMapMode& rImpMapMode); bool operator==( const ImplMapMode& rImpMapMode ) const; @@ -53,6 +54,15 @@ MapMode::ImplMapMode::ImplMapMode() : mbSimple = true; } +MapMode::ImplMapMode::ImplMapMode(MapUnit eMapUnit) : +maOrigin( 0, 0 ), +maScaleX( 1, 1 ), +maScaleY( 1, 1 ) +{ +meUnit = eMapUnit; +mbSimple = true; +} + MapMode::ImplMapMode::ImplMapMode( const ImplMapMode& ) = default; bool MapMode::ImplMapMode::operator==( const ImplMapMode& rImpMapMode ) const @@ -65,11 +75,37 @@ bool MapMode::ImplMapMode::operator==( const ImplMapMode& rImpMapMode ) const namespace { + MapMode::ImplType& GetGlobalDefault() { static MapMode::ImplType gDefault; return gDefault; } +MapMode::ImplType GetUnitDefault(MapUnit mapUnit) +{ +static MapMode::ImplType defaults[] +{ +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::Map100thMM) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::Map10thMM) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::MapMM) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::MapCM) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::Map1000thInch) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::Map100thInch) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::Map10thInch) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::MapInch) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::MapPoint) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::MapTwip) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::MapPixel) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::MapSysFont) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::MapAppFont) ), +MapMode::ImplType( MapMode::ImplMapMode(MapUnit::MapRelative) ), +}; +if (mapUnit <= MapUnit::MapRelative) { +return MapMode::ImplType(defaults[static_cast(mapUnit)]); // [-loplugin:redundantfcast] false positive +} +// sometimes the SvmReader stuff will generate a bogus mapunit value +return MapMode::ImplType(MapMode::ImplMapMode(mapUnit)); +} } MapMode::MapMode() : mpImplMapMode(GetGlobalDefault()) @@ -78,9 +114,8 @@ MapMode::MapMode() : mpImplMapMode(GetGlobalDefault()) MapMode::MapMode( const MapMode& ) = default; -MapMode::MapMode( MapUnit eUnit ) +MapMode::MapMode( MapUnit eUnit ) : mpImplMapMode(GetUnitDefault(eUnit)) { -mpImplMapMode->meUnit = eUnit; } MapMode::MapMode( MapUnit eUnit, const Point& rLogicOrg,
[Libreoffice-commits] core.git: vcl/source
vcl/source/outdev/map.cxx | 63 ++ 1 file changed, 25 insertions(+), 38 deletions(-) New commits: commit ece0132a574beb5e56cf7470a10c209c2a3df412 Author: Noel Grandin AuthorDate: Wed Jul 26 18:24:02 2023 +0200 Commit: Noel Grandin CommitDate: Thu Jul 27 10:21:38 2023 +0200 deduplicate some code in ImplCalcMapResolution Change-Id: I792394079c0efbea0ea62f580fbad3bd2a66f93a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154945 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index 7181b52db6b5..23c68a238551 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -124,46 +124,33 @@ static void ImplCalcMapResolution( const MapMode& rMapMode, } else { -auto nXNumerator = aScaleX.GetNumerator(); -auto nYNumerator = aScaleY.GetNumerator(); -assert(nXNumerator != 0 && nYNumerator != 0); - -BigInt aX( rMapRes.mnMapOfsX ); -aX *= BigInt( aScaleX.GetDenominator() ); -if ( rMapRes.mnMapOfsX >= 0 ) -{ -if (nXNumerator >= 0) -aX += BigInt(nXNumerator / 2); -else -aX -= BigInt((nXNumerator + 1) / 2); -} -else +auto funcCalcOffset = [](const Fraction& rScale, tools::Long& rnMapOffset, tools::Long nOrigin) { -if (nXNumerator >= 0 ) -aX -= BigInt((nXNumerator - 1) / 2); -else -aX += BigInt(nXNumerator / 2); -} -aX /= BigInt(nXNumerator); -rMapRes.mnMapOfsX = static_cast(aX) + aOrigin.X(); -BigInt aY( rMapRes.mnMapOfsY ); -aY *= BigInt( aScaleY.GetDenominator() ); -if( rMapRes.mnMapOfsY >= 0 ) -{ -if (nYNumerator >= 0) -aY += BigInt(nYNumerator / 2); -else -aY -= BigInt((nYNumerator + 1) / 2); -} -else -{ -if (nYNumerator >= 0) -aY -= BigInt((nYNumerator - 1) / 2); +auto nNumerator = rScale.GetNumerator(); +assert(nNumerator != 0); + +BigInt aX( rnMapOffset ); +aX *= BigInt( rScale.GetDenominator() ); +if ( rnMapOffset >= 0 ) +{ +if (nNumerator >= 0) +aX += BigInt(nNumerator / 2); +else +aX -= BigInt((nNumerator + 1) / 2); +} else -aY += BigInt(nYNumerator / 2); -} -aY /= BigInt(nYNumerator); -rMapRes.mnMapOfsY = static_cast(aY) + aOrigin.Y(); +{ +if (nNumerator >= 0 ) +aX -= BigInt((nNumerator - 1) / 2); +else +aX += BigInt(nNumerator / 2); +} +aX /= BigInt(nNumerator); +rnMapOffset = static_cast(aX) + nOrigin; +}; + +funcCalcOffset(aScaleX, rMapRes.mnMapOfsX, aOrigin.X()); +funcCalcOffset(aScaleY, rMapRes.mnMapOfsY, aOrigin.Y()); } // calculate scaling factor according to MapMode
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 70f84abd6379c47db96d81d4b028041daa8c5d24 Author: Caolán McNamara AuthorDate: Wed Jul 26 10:17:05 2023 +0100 Commit: Caolán McNamara CommitDate: Wed Jul 26 18:15:21 2023 +0200 cid#153 silence Improper use of negative value and cid#1538887 Improper use of negative value Change-Id: I0d62fb6b3650351dbe6c3cbbc0809b145afc2f4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154934 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 408bc5a5f4d8..e63ae76b8a8d 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -10847,6 +10847,8 @@ void PDFWriterImpl::beginStructureElement(sal_Int32 const id) if( ! m_aContext.Tagged ) return; +assert(id != -1 && "cid#153 doesn't consider above m_aContext.Tagged"); + // close eventual current MC sequence endStructureElementMCSeq(EndMode::OnlyStruct);
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/floatwin.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 2b3dcd24e4da1f83bfaf8e0ffd93839eeae621b0 Author: Noel Grandin AuthorDate: Wed Jul 26 10:35:36 2023 +0200 Commit: Noel Grandin CommitDate: Wed Jul 26 12:13:04 2023 +0200 Revert "simplify logic in FloatingWindow::ImplCalcPos" This reverts commit ea3317188589554ea5773db53aa9e0cc88bee271. Reason for revert: There are 3 different coordinate systems at work here, not 2, my mistake. Change-Id: Iee69b8ba3c2fe60b26b118e79116035be42c6c45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154922 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index aa3abb3ec16b..3aff8ef400c0 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -445,6 +445,8 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, rArrangeIndex = nArrangeIndex; +aPos = pW->AbsoluteScreenToOutputPixel( aPos ); + // store a cliprect that can be used to clip the common edge of the itemrect and the floating window if( pFloatingWindow && pFloatingWindow->mpImplData->mpBox ) { @@ -454,8 +456,6 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, if (bLOKActive && pLOKTwipsPos) { -Point aPosOut = pW->AbsoluteScreenToOutputPixel( aPos ); - if (pW->IsMapModeEnabled() || pW->GetMapMode().GetMapUnit() == MapUnit::MapPixel) { // if we use pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)), @@ -466,16 +466,16 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, // and anyway the following is what we already do in // ScGridWindow::LogicInvalidate when map mode is not enabled. -*pLOKTwipsPos = pW->PixelToLogic(aPosOut, MapMode(MapUnit::MapTwip)); +*pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip)); } else { -*pLOKTwipsPos = OutputDevice::LogicToLogic(aPosOut, pW->GetMapMode(), MapMode(MapUnit::MapTwip)); +*pLOKTwipsPos = OutputDevice::LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)); } } // caller expects coordinates relative to top-level win -return aPos; +return pW->OutputToScreenPixel( aPos ); } Point FloatingWindow::ImplConvertToAbsPos(vcl::Window* pReference, const Point& rPos)
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/floatwin.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit ea3317188589554ea5773db53aa9e0cc88bee271 Author: Noel Grandin AuthorDate: Tue Jul 25 20:59:19 2023 +0200 Commit: Noel Grandin CommitDate: Wed Jul 26 08:07:58 2023 +0200 simplify logic in FloatingWindow::ImplCalcPos no need to convert this position backwards and forwards Change-Id: Iba4ebcba420025865638c99fa143ea0d7d262805 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154901 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 3aff8ef400c0..aa3abb3ec16b 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -445,8 +445,6 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, rArrangeIndex = nArrangeIndex; -aPos = pW->AbsoluteScreenToOutputPixel( aPos ); - // store a cliprect that can be used to clip the common edge of the itemrect and the floating window if( pFloatingWindow && pFloatingWindow->mpImplData->mpBox ) { @@ -456,6 +454,8 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, if (bLOKActive && pLOKTwipsPos) { +Point aPosOut = pW->AbsoluteScreenToOutputPixel( aPos ); + if (pW->IsMapModeEnabled() || pW->GetMapMode().GetMapUnit() == MapUnit::MapPixel) { // if we use pW->LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)), @@ -466,16 +466,16 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow, // and anyway the following is what we already do in // ScGridWindow::LogicInvalidate when map mode is not enabled. -*pLOKTwipsPos = pW->PixelToLogic(aPos, MapMode(MapUnit::MapTwip)); +*pLOKTwipsPos = pW->PixelToLogic(aPosOut, MapMode(MapUnit::MapTwip)); } else { -*pLOKTwipsPos = OutputDevice::LogicToLogic(aPos, pW->GetMapMode(), MapMode(MapUnit::MapTwip)); +*pLOKTwipsPos = OutputDevice::LogicToLogic(aPosOut, pW->GetMapMode(), MapMode(MapUnit::MapTwip)); } } // caller expects coordinates relative to top-level win -return pW->OutputToScreenPixel( aPos ); +return aPos; } Point FloatingWindow::ImplConvertToAbsPos(vcl::Window* pReference, const Point& rPos)
[Libreoffice-commits] core.git: vcl/source
vcl/source/control/ctrl.cxx |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) New commits: commit 29d7b55af594e18065684ef127d781d76324c31b Author: Noel Grandin AuthorDate: Tue Jul 25 16:21:36 2023 +0200 Commit: Noel Grandin CommitDate: Tue Jul 25 19:06:13 2023 +0200 Control::LogicInvalidate takes a pixel rectangle not a logic rectangle Since commit 7adfecb0f5947ae258226c8d1652546f81577026 Author: Marco Cecchetti Date: Sun Feb 5 17:47:34 2023 +0100 lok: form controls: rendering and mouse event forwarding Change-Id: Ibbc0ea03d014ac2141bd59858f0a73e74ffe1144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154895 Tested-by: Jenkins Tested-by: Marco Cecchetti Reviewed-by: Marco Cecchetti diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 01454ef98c00..4f7a42badffc 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -500,14 +500,13 @@ void Control::LogicInvalidate(const tools::Rectangle* pRectangle) if (!pRectangle) { // we have to invalidate the whole control area not the whole document -aResultRectangle = tools::Rectangle(GetPosPixel(), GetSizePixel()); +aResultRectangle = PixelToLogic(tools::Rectangle(GetPosPixel(), GetSizePixel()), MapMode(MapUnit::MapTwip)); } else { -aResultRectangle = *pRectangle; +aResultRectangle = OutputDevice::LogicToLogic(*pRectangle, GetMapMode(), MapMode(MapUnit::MapTwip)); } -aResultRectangle = PixelToLogic(aResultRectangle, MapMode(MapUnit::MapTwip)); pParent->GetLOKNotifier()->notifyInvalidation(&aResultRectangle); }
[Libreoffice-commits] core.git: vcl/source
vcl/source/toolkit/group.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 99e6e4dd273752ee671d1ade00b381786800a508 Author: Balazs Varga AuthorDate: Mon Jul 24 21:39:21 2023 +0200 Commit: Thorsten Behrens CommitDate: Tue Jul 25 13:04:01 2023 +0200 tdf#156354 - Fix UI Basic dialog contents not visible in preview mode with scrollbars enabled. Basic dialog elemets appear under groupbox in case of the dialog have scrollbar. Change-Id: I07b26c4a4f733cb08b3432ee41d829552ec5e08d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154876 Tested-by: Jenkins Tested-by: Gabor Kelemen Reviewed-by: Gabor Kelemen Reviewed-by: Thorsten Behrens diff --git a/vcl/source/toolkit/group.cxx b/vcl/source/toolkit/group.cxx index b33da711fae3..7b23e1006ef5 100644 --- a/vcl/source/toolkit/group.cxx +++ b/vcl/source/toolkit/group.cxx @@ -59,9 +59,9 @@ void GroupBox::ImplInitSettings( bool bBackground ) return; vcl::Window* pParent = GetParent(); -if ( (pParent->IsChildTransparentModeEnabled() || - !(pParent->GetStyle() & WB_CLIPCHILDREN) ) && - !IsControlBackground() ) +if (pParent->IsChildTransparentModeEnabled() || +!(pParent->GetStyle() & WB_CLIPCHILDREN) || +!IsControlBackground()) { EnableChildTransparentMode(); SetParentClipMode( ParentClipMode::NoClip );
[Libreoffice-commits] core.git: vcl/source
vcl/source/fontsubset/fontsubset.cxx |4 1 file changed, 4 insertions(+) New commits: commit 42f0422d19c4d0a2fb09654fb6d1d92e50f6dd5c Author: Khaled Hosny AuthorDate: Tue Jul 25 03:14:37 2023 +0300 Commit: خالد حسني CommitDate: Tue Jul 25 04:16:11 2023 +0200 tdf#156437: Fix missing name inside embedded Type 1 font in PDF Regression from: commit 7415ce2b9795a78f836bc5e5bffb4b56eee26b21 Author: Khaled Hosny Date: Mon Dec 5 20:52:13 2022 +0200 tdf#113048: Fix PDF ascender and descender of some fonts We were setting the font in PDF /Font dictionary, but not inside the font itself. Change-Id: I1936f615f62fd7afa8f31d66d35dbded879328c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154880 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx index 4e6e03c04baf..1ecd358727bf 100644 --- a/vcl/source/fontsubset/fontsubset.cxx +++ b/vcl/source/fontsubset/fontsubset.cxx @@ -79,6 +79,10 @@ bool FontSubsetInfo::CreateFontSubset( mpReqEncodedIds = pReqEncodedIds; mnReqGlyphCount = nReqGlyphCount; +OString aPSName = m_aPSName.toUtf8(); +if (!mpReqFontName) +mpReqFontName = aPSName.getStr(); + // TODO: move the glyphid/encid/notdef reshuffling from the callers to here // dispatch to underlying subsetters
[Libreoffice-commits] core.git: vcl/source
vcl/source/window/layout.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 9429f5aa7912f6d7da67834b0d9e0451f49ecdd6 Author: Szymon Kłos AuthorDate: Mon Jul 24 15:09:23 2023 +0200 Commit: Caolán McNamara CommitDate: Mon Jul 24 17:34:10 2023 +0200 jsdialog: dark mode support in drawing area Change-Id: I235cf327c4c97d2f256c201ea4daf0c99f3d9005 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154855 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 0caa23fb37b2..5095ee62009d 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -3097,6 +3097,9 @@ void VclDrawingArea::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) pDevice->SetOutputSize(aRenderSize); tools::Rectangle aRect(Point(0,0), aRenderSize); +// Dark mode support +pDevice->DrawWallpaper(aRect, pRefDevice->GetBackground()); + Paint(*pDevice, aRect); BitmapEx aImage = pDevice->GetBitmapEx(Point(0,0), aRenderSize);
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 49dca4be647733507b2082a9c74187076a4a8d9b Author: Michael Stahl AuthorDate: Thu Jul 20 11:54:26 2023 +0200 Commit: Michael Stahl CommitDate: Thu Jul 20 13:35:40 2023 +0200 tdf#154990 vcl: PDF export: incorrect checks of annotation struct parents The first form annotation is missing /StructParent. The invalid value is -1, not 0. Typically 0 is the index of the MCIDs entry (m_aMCIDParents) in the ParentTree /Nums, but if there is not a single MCID in the document, this is omitted and 0 may be a valid annotation then. Change-Id: I9885d176eae272d98000f9d9f0ffae82558c0ea0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154668 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 5765426375ba..42f85d42bb76 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -3641,7 +3641,7 @@ bool PDFWriterImpl::emitScreenAnnotations() // End Action dictionary. aLine.append("/OP 0 >>"); -if (0 < rScreen.m_nStructParent) +if (-1 != rScreen.m_nStructParent) { aLine.append("\n/StructParent " + OString::number(rScreen.m_nStructParent) @@ -3879,7 +3879,7 @@ we check in the following sequence: } aLine.append( ">>\n" ); } -if( rLink.m_nStructParent > 0 ) +if (rLink.m_nStructParent != -1) { aLine.append( "/StructParent " ); aLine.append( rLink.m_nStructParent ); @@ -4720,7 +4720,7 @@ bool PDFWriterImpl::emitWidgetAnnotations() iRectMargin = 1; } -if (0 < rWidget.m_nStructParent) +if (-1 != rWidget.m_nStructParent) { aLine.append("/StructParent "); aLine.append(rWidget.m_nStructParent);
[Libreoffice-commits] core.git: vcl/source
vcl/source/control/roadmap.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 445ab2355333ddb46081baffb8b0e3bb14fe00b3 Author: Noel Grandin AuthorDate: Fri Jul 7 09:26:47 2023 +0200 Commit: Noel Grandin CommitDate: Fri Jul 7 13:46:55 2023 +0200 combine PixelToLogic+LogicToPixel into LogicToLogic avoiding some precision loss Change-Id: I946f4f820321f76fb7634c722a28035600bac359 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154157 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/vcl/source/control/roadmap.cxx b/vcl/source/control/roadmap.cxx index 882caa9c451d..a3d3251cea90 100644 --- a/vcl/source/control/roadmap.cxx +++ b/vcl/source/control/roadmap.cxx @@ -571,7 +571,7 @@ void ORoadmap::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& void ORoadmap::DrawHeadline(vcl::RenderContext& rRenderContext) { -Point aTextPos = PixelToLogic(LogicToPixel(Point(ROADMAP_INDENT_X, 8), MapMode(MapUnit::MapAppFont))); +Point aTextPos = OutputDevice::LogicToLogic(Point(ROADMAP_INDENT_X, 8), GetMapMode(), MapMode(MapUnit::MapAppFont)); Size aOutputSize(rRenderContext.GetOutputSize());
[Libreoffice-commits] core.git: vcl/source
vcl/source/app/settings.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 77fca616e0bd79e0b405fd0b3543cf8e94e15df3 Author: Mike Kaganski AuthorDate: Thu Jul 6 17:26:26 2023 +0300 Commit: Mike Kaganski CommitDate: Thu Jul 6 23:29:04 2023 +0200 Don't modify configuration / Windows registry in CppunitTest_sw_a11y After commit 889c12e98e04edb4bc25b86bf16b8cf1d9b68420 (tdf#155794 vcl: handle WM_GETOBJECT without SolarMutex, 2023-06-13), running CppunitTest_sw_a11y resulted in a failed assertion in VCL cleanup on some Windows systems: Assertion failed: !IsModified(), file C:/lo/src/core/vcl/source/gdi/configsettings.cxx, line 56 abort() has been calledwarn:sal.cppunittester:16572:26632:sal/cppunittester/cppunittester.cxx:598: CAUGHT SIGABRT: 25: sal::backtrace_get - 0x7fffcca3162a 24: AbortSignalHandler - 0x7ff7ee9eaf4f 23: raise - 0x7fffc37c90ed 22: abort - 0x7fffc37cae49 21: get_wide_winmain_command_line - 0x7fffc37d0c6f 20: get_wide_winmain_command_line - 0x7fffc37cebc8 19: wassert - 0x7fffc37d18af 18: vcl::SettingsConfigItem::~SettingsConfigItem - 0x7fff2bbfd3cd 17: vcl::SettingsConfigItem::`scalar deleting destructor' - 0x7fff2b861dc0 16: std::default_delete::operator() - 0x7fff2bbfdc38 15: std::unique_ptr >::reset - 0x7fff2bbfeae7 14: DeInitVCL - 0x7fff2bfacd68 13: `anonymous namespace'::Protector::~Protector - 0x7a341357 12: `anonymous namespace'::Protector::`scalar deleting destructor' - 0x7a341520 11: CppUnit::ProtectorChain::pop - 0x7fffcc55dedf 10: CppUnit::TestResult::popProtector - 0x7fffcc52e4e8 9: `anonymous namespace'::ProtectedFixtureFunctor::run - 0x7ff7ee9f0e18 8: main2 - 0x7ff7ee9ef5f9 7: sal_main - 0x7ff7ee9f0e69 6: main - 0x7ff7ee9f1bca 5: invoke_main - 0x7ff7ee9f25e9 4: __scrt_common_main_seh - 0x7ff7ee9f250e 3: __scrt_common_main - 0x7ff7ee9f23ce 2: mainCRTStartup - 0x7ff7ee9f265e 1: BaseThreadInitThunk - 0x7ff8039d7614 0: RtlUserThreadStart - 0x7ff8059826f1 because it called MiscSettings::SetEnableATToolSupport at some point. It seems reasonable to avoid such configuration changes for unit test anyway. Change-Id: I00edc4f6e1183dad66e0504f7d702ad90d7edcd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154134 Reviewed-by: Michael Weghorn Tested-by: Mike Kaganski Reviewed-by: Mike Kaganski diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 9921b0b774bc..6a3b2b34cb51 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2721,6 +2721,11 @@ void MiscSettings::SetEnableATToolSupport( bool bEnable ) if( bEnable && !ImplInitAccessBridge() ) return; +mxData->mnEnableATT = bEnable ? TRISTATE_TRUE : TRISTATE_FALSE; + +if (getenv("LO_TESTNAME") != nullptr) +return; // No registry changing; no SettingsConfigItem modification + HKEY hkey; // If the accessibility key in the Windows registry exists, change it synchronously @@ -2761,7 +2766,6 @@ void MiscSettings::SetEnableATToolSupport( bool bEnable ) setValue( "Accessibility", "EnableATToolSupport", bEnable ? OUString("true") : OUString("false" ) ); -mxData->mnEnableATT = bEnable ? TRISTATE_TRUE : TRISTATE_FALSE; } } #endif