[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/inc vcl/source
vcl/inc/salvtables.hxx|4 ++-- vcl/source/control/button.cxx |2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) New commits: commit f73138a671d098dee96c11167ec390f209352d9e Author: Jan-Marek Glogowski AuthorDate: Wed Apr 7 00:07:53 2021 +0200 Commit: Adolfo Jayme Barrientos CommitDate: Wed Apr 7 16:13:32 2021 +0200 tdf#136918 restrict symbol size to button width ... and scale the button based on the DPI scaling factor. The symbol size is based on pDev->GetTextHeight(), but the button itself is fixed to 20px, which would break at some point. So this at least scales the button witdh based on DPI, just like commit 1eba1c4597f8c2698aa91e2218d8452ad0fbc39c ("tdf#130991 Scale the drop-down arrow size-request") did for the toolbar buttons. OTOH this should probably just use the full button width ignoring the GetTextHeight()... Change-Id: I43010443265c10ad92f46cdecd1d7155a7a07a3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113710 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski (cherry picked from commit ea4fb1559f7b99a0bfaf18f26cb3b6972c9cde1c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113648 Reviewed-by: Adolfo Jayme Barrientos diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 0702cb103a5f..d13a34875a99 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -828,8 +828,8 @@ public: int get_menu_button_width() const override { -const int nButtonWidth = 20; -return nButtonWidth; +OutputDevice* pDefault = Application::GetDefaultDevice(); +return 20 * (pDefault ? pDefault->GetDPIScaleFactor() : 1.0); } void CallHandleEventListener(VclWindowEvent& rEvent) diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 37586dae6bd5..91a4aa4543a3 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -821,6 +821,8 @@ void PushButton::ImplDrawPushButtonContent(OutputDevice *pDev, DrawFlags nDrawFl // calculate symbol size tools::Long nSymbolSize= pDev->GetTextHeight() / 2 + 1; +if (nSymbolSize > aSize.Width() / 2) +nSymbolSize = aSize.Width() / 2; nSeparatorX = aInRect.Right() - 2*nSymbolSize; aSize.AdjustWidth( -(2*nSymbolSize) ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/inc vcl/source
vcl/inc/impfont.hxx |4 - vcl/source/font/font.cxx | 115 --- 2 files changed, 112 insertions(+), 7 deletions(-) New commits: commit a5cecd2ea50dc930cfc0d90be69c08ddd144d3db Author: Armin Le Grand (Allotropia) AuthorDate: Tue Feb 2 17:57:12 2021 +0100 Commit: Armin Le Grand CommitDate: Tue Mar 9 10:20:22 2021 +0100 tdf#127471 improve SVM FontScaling im/export Due to svg::Font Width and it's expression of FontScaling being system-dependent the FontScaling when exchanging beween win-based SVM creators and others was creating errors. Corrected this to work now with newly created SVM files in both directions. For more aspects see discussion in task. Change-Id: I326e4e7e895a9dfc3cdfc5323174ca81e22795e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110330 Tested-by: Jenkins Reviewed-by: Armin Le Grand (cherry picked from commit 40b56cd8da8c38582dc4660b486993d1b4711535) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112088 diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index caa917a751f0..ba1ea3683926 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -84,8 +84,8 @@ public: private: friend class vcl::Font; -friend SvStream&ReadImplFont( SvStream& rIStm, ImplFont& ); -friend SvStream&WriteImplFont( SvStream& rOStm, const ImplFont& ); +friend SvStream&ReadImplFont( SvStream& rIStm, ImplFont&, tools::Long& ); +friend SvStream&WriteImplFont( SvStream& rOStm, const ImplFont&, const tools::Long& ); voidAskConfig(); diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx index 2818e71e00ea..180f5bbf122b 100644 --- a/vcl/source/font/font.cxx +++ b/vcl/source/font/font.cxx @@ -34,6 +34,10 @@ #include #include +#ifdef _WIN32 +#include +#endif + using namespace vcl; namespace @@ -357,7 +361,7 @@ void Font::GetFontAttributes( FontAttributes& rAttrs ) const rAttrs.SetSymbolFlag( mpImplFont->GetCharSet() == RTL_TEXTENCODING_SYMBOL ); } -SvStream& ReadImplFont( SvStream& rIStm, ImplFont& rImplFont ) +SvStream& ReadImplFont( SvStream& rIStm, ImplFont& rImplFont, tools::Long& rnNormedFontScaling ) { VersionCompat aCompat( rIStm, StreamMode::READ ); sal_uInt16 nTmp16(0); @@ -400,15 +404,25 @@ SvStream& ReadImplFont( SvStream& rIStm, ImplFont& rImplFont ) rIStm.ReadUInt16( nTmp16 ); rImplFont.meOverline = static_cast(nTmp16); } +// tdf#127471 read NormedFontScaling +if( aCompat.GetVersion() >= 4 ) +{ +sal_Int32 nNormedFontScaling(0); +rIStm.ReadInt32(nNormedFontScaling); +rnNormedFontScaling = nNormedFontScaling; +} + // Relief // CJKContextLanguage return rIStm; } -SvStream& WriteImplFont( SvStream& rOStm, const ImplFont& rImplFont ) +SvStream& WriteImplFont( SvStream& rOStm, const ImplFont& rImplFont, const tools::Long& rnNormedFontScaling ) { -VersionCompat aCompat( rOStm, StreamMode::WRITE, 3 ); +// tdf#127471 increase to version 4 +VersionCompat aCompat( rOStm, StreamMode::WRITE, 4 ); + TypeSerializer aSerializer(rOStm); rOStm.WriteUniOrByteString( rImplFont.GetFamilyName(), rOStm.GetStreamCharSet() ); rOStm.WriteUniOrByteString( rImplFont.GetStyleName(), rOStm.GetStreamCharSet() ); @@ -440,17 +454,108 @@ SvStream& WriteImplFont( SvStream& rOStm, const ImplFont& rImplFont ) // new in version 3 rOStm.WriteUInt16( rImplFont.meOverline ); +// new in version 4, NormedFontScaling +rOStm.WriteInt32(rnNormedFontScaling); + return rOStm; } SvStream& ReadFont( SvStream& rIStm, vcl::Font& rFont ) { -return ReadImplFont( rIStm, *rFont.mpImplFont ); +// tdf#127471 try to read NormedFontScaling +tools::Long nNormedFontScaling(0); +SvStream& rRetval(ReadImplFont( rIStm, *rFont.mpImplFont, nNormedFontScaling )); + +if (nNormedFontScaling > 0) +{ +#ifdef _WIN32 +// we run on windows and a NormedFontScaling was written +if(rFont.GetFontSize().getWidth() == nNormedFontScaling) +{ +// the writing producer was running on a non-windows system, adapt to needed windows +// system-specific pre-multiply +const tools::Long nHeight(std::max(rFont.GetFontSize().getHeight(), 0)); +sal_uInt32 nScaledWidth(0); + +if(nHeight > 0) +{ +vcl::Font aUnscaledFont(rFont); +aUnscaledFont.SetAverageFontWidth(0); +const FontMetric aUnscaledFontMetric(Application::GetDefaultDevice()->GetFontMetric(aUnscaledFont)); + +if (aUnscaledFontMetric.GetAverageFontWidth() > 0) +{ +const double fScaleFactor(static_cast(nNormedFontScaling) / static_cast(nHeight)); +nScaledWidth =
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/inc vcl/source
vcl/inc/pdf/ExternalPDFStreams.hxx | 12 vcl/source/filter/ipdf/pdfdocument.cxx | 12 +--- vcl/source/gdi/pdfwriter_impl.cxx | 12 +--- 3 files changed, 26 insertions(+), 10 deletions(-) New commits: commit ed7a3dabc8c35b8b33bad33fc26ebd8fb80b0cbd Author: Tomaž Vajngerl AuthorDate: Tue Mar 2 18:57:46 2021 +0900 Commit: Adolfo Jayme Barrientos CommitDate: Wed Mar 3 09:14:22 2021 +0100 tdf#140606 make PDF parsing more lenient and prevent a crash If the external document can't be opened, it tried to continue with the export anyway, which eventually lead to a crash. This is fixed by handling this situation and prevent a crash, however the part of the document in this case isn't exported. The document couldn't be opened because of a parsing error - there was a unexpected null character instead of a whitespace, which made the parser panic. Fix this by making the parser more lenient in such a situation when there is an unexpected null and try to continue parsing. Bug document seems to be created with a buggy PDF writer, but other PDF readers don't complain when parsing the document so it looks to be a valid. qpdf --check doesn't complain either. Change-Id: I61eb281e821ccd195ef006d778556e25d1c7f5e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111820 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 2c1ed5a5dad827cde032f27a4348e81be15889bc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111857 Reviewed-by: Adolfo Jayme Barrientos diff --git a/vcl/inc/pdf/ExternalPDFStreams.hxx b/vcl/inc/pdf/ExternalPDFStreams.hxx index ab3d057bd83c..0a1997fe7dc7 100644 --- a/vcl/inc/pdf/ExternalPDFStreams.hxx +++ b/vcl/inc/pdf/ExternalPDFStreams.hxx @@ -33,21 +33,25 @@ struct VCL_DLLPUBLIC ExternalPDFStream std::map& getCopiedResources() { return maCopiedResources; } -filter::PDFDocument& getPDFDocument() +std::shared_ptr& getPDFDocument() { if (!mpPDFDocument) { SvMemoryStream aPDFStream; aPDFStream.WriteBytes(maData.data(), maData.size()); aPDFStream.Seek(0); -mpPDFDocument = std::make_shared(); -if (!mpPDFDocument->Read(aPDFStream)) +auto pPDFDocument = std::make_shared(); +if (!pPDFDocument->Read(aPDFStream)) { SAL_WARN("vcl.pdfwriter", "PDFWriterImpl::writeReferenceXObject: reading the PDF document failed"); } +else +{ +mpPDFDocument = pPDFDocument; +} } -return *mpPDFDocument; +return mpPDFDocument; } }; diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx index 41c44bd01b57..804713abaf10 100644 --- a/vcl/source/filter/ipdf/pdfdocument.cxx +++ b/vcl/source/filter/ipdf/pdfdocument.cxx @@ -1441,12 +1441,18 @@ bool PDFDocument::Tokenize(SvStream& rStream, TokenizeMode eMode, } else { -if (!rtl::isAsciiWhiteSpace(static_cast(ch))) +auto uChar = static_cast(ch); +// Be more lenient and allow unexpected null char +if (!rtl::isAsciiWhiteSpace(uChar) && uChar != 0) { -SAL_WARN("vcl.filter", "PDFDocument::Tokenize: unexpected character: " - << ch << " at byte position " << rStream.Tell()); +SAL_WARN("vcl.filter", + "PDFDocument::Tokenize: unexpected character with code " + << sal_Int32(ch) << " at byte position " << rStream.Tell()); return false; } +SAL_WARN_IF(uChar == 0, "vcl.filter", +"PDFDocument::Tokenize: unexpected null character at " +<< rStream.Tell() << " - ignoring"); } break; } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 951cda0f29da..eeeb4305a181 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8459,10 +8459,16 @@ void PDFWriterImpl::writeReferenceXObject(ReferenceXObjectEmit& rEmit) // object. if (rEmit.m_nExternalPDFDataIndex < 0) return; -auto & rExternalPDFStream = m_aExternalPDFStreams.get(rEmit.m_nExternalPDFDataIndex); -auto & rPDFDocument = rExternalPDFStream.getPDFDocument(); +auto& rExternalPDFStream = m_aExternalPDFStreams.get(rEmit.m_nExternalPDFDataIndex); +auto& pPDFDocument = rExternalPDFStream.getPDFDocument(); +if (!pPDFDocument) +
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/inc vcl/source
vcl/inc/salgdi.hxx |3 ++- vcl/source/gdi/salgdilayout.cxx |8 +++- vcl/source/outdev/gradient.cxx |2 +- 3 files changed, 10 insertions(+), 3 deletions(-) New commits: commit 0932a7a2c3b64a30f6928007a7d60a2073660f40 Author: Caolán McNamara AuthorDate: Tue Dec 15 11:55:29 2020 + Commit: Caolán McNamara CommitDate: Tue Dec 15 21:01:22 2020 +0100 tdf#138936 gradient missing under RTL from writer comment margins Change-Id: I57533f033f9528b7c89162967b392eb5abb4d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107702 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 6ed360105d24..4ebdcb283697 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -275,7 +275,8 @@ public: boolDrawGradient( const tools::PolyPolygon& rPolyPoly, -const Gradient& rGradient ); +const Gradient& rGradient, +const OutputDevice* pOutDev); bool DrawGradient(basegfx::B2DPolyPolygon const & rPolyPolygon, SalGradient const & rGradient); diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 5638cb9bb856..452b5b61dd8e 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -600,8 +600,14 @@ bool SalGraphics::DrawPolyLine( bPixelSnapHairline); } -bool SalGraphics::DrawGradient( const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient ) +bool SalGraphics::DrawGradient(const tools::PolyPolygon& rPolyPoly, const Gradient& rGradient, const OutputDevice* pOutDev) { +if( (m_nLayout & SalLayoutFlags::BiDiRtl) || (pOutDev && pOutDev->IsRTLEnabled()) ) +{ +tools::PolyPolygon aFinal(mirror(rPolyPoly.getB2DPolyPolygon(), pOutDev)); +return drawGradient(aFinal, rGradient); +} + return drawGradient( rPolyPoly, rGradient ); } diff --git a/vcl/source/outdev/gradient.cxx b/vcl/source/outdev/gradient.cxx index f37bad807845..0312369c959a 100644 --- a/vcl/source/outdev/gradient.cxx +++ b/vcl/source/outdev/gradient.cxx @@ -107,7 +107,7 @@ void OutputDevice::DrawGradient( const tools::PolyPolygon& rPolyPoly, // try to draw gradient natively if (!mbOutputClipped) -bDrawn = mpGraphics->DrawGradient( aClixPolyPoly, aGradient ); +bDrawn = mpGraphics->DrawGradient( aClixPolyPoly, aGradient, this ); if (!bDrawn && !mbOutputClipped) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/inc vcl/source
vcl/inc/sallayout.hxx|2 ++ vcl/source/gdi/sallayout.cxx |5 + vcl/source/outdev/font.cxx | 19 +-- 3 files changed, 20 insertions(+), 6 deletions(-) New commits: commit 049b4ad189d78af54dcc93295473a58671f27c5a Author: Caolán McNamara AuthorDate: Thu Dec 3 15:38:21 2020 + Commit: Caolán McNamara CommitDate: Thu Dec 3 21:23:06 2020 +0100 cid#1468270 Wrapper object use after free I think this is a better reflection of the original intent here before commit 1441ab9c75a2f0ac664983db22b681a1b602f8a9 fix possible SIGSEGV and commit 8f54136caa786523fd224f6c98fc8e7c45cd805d use std::unique_ptr for SalLayout Change-Id: Ib4ab63334e644a8136b9f7da20916715850563ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107112 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index bf93c0f64028..30fd5580b4c5 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -138,6 +138,8 @@ public: // used only by OutputDevice::ImplLayout, TODO: make friend explicitMultiSalLayout( std::unique_ptr pBaseLayout ); voidAddFallback(std::unique_ptr pFallbackLayout, ImplLayoutRuns const &); +// give up ownership of the initial pBaseLayout taken by the ctor +std::unique_ptr ReleaseBaseLayout(); boolLayoutText(ImplLayoutArgs&, const SalLayoutGlyphs*) override; voidAdjustLayout(ImplLayoutArgs&) override; voidInitFont() const override; diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 7beea9a01091..eaa03d22e5f0 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -996,6 +996,11 @@ MultiSalLayout::MultiSalLayout( std::unique_ptr pBaseLayout ) mnUnitsPerPixel = mpLayouts[ 0 ]->GetUnitsPerPixel(); } +std::unique_ptr MultiSalLayout::ReleaseBaseLayout() +{ +return std::move(mpLayouts[0]); +} + void MultiSalLayout::SetIncomplete(bool bIncomplete) { mbIncomplete = bIncomplete; diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 71dc5e861fcf..d20bbe8ccd44 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -1246,9 +1246,6 @@ std::unique_ptr OutputDevice::ImplGlyphFallbackLayout( std::unique_pt return nullptr; } -// keep a pointer to the layout because we might move ownership of the unique_ptr -const SalLayout* pSalLayoutTmp = pSalLayout.get(); - // prepare multi level glyph fallback std::unique_ptr pMultiSalLayout; ImplLayoutRuns aLayoutRuns = rLayoutArgs.maRuns; @@ -1306,11 +1303,21 @@ std::unique_ptr OutputDevice::ImplGlyphFallbackLayout( std::unique_pt break; } -if( pMultiSalLayout && pMultiSalLayout->LayoutText( rLayoutArgs, nullptr ) ) -pSalLayout = std::move(pMultiSalLayout); +if (pMultiSalLayout) // due to missing glyphs, multilevel layout fallback attempted +{ +// if it works, use that Layout +if (pMultiSalLayout->LayoutText(rLayoutArgs, nullptr)) +pSalLayout = std::move(pMultiSalLayout); +else +{ +// if it doesn't, give up and restore ownership of the pSalLayout +// back to its original state +pSalLayout = pMultiSalLayout->ReleaseBaseLayout(); +} +} // restore orig font settings -pSalLayoutTmp->InitFont(); +pSalLayout->InitFont(); rLayoutArgs.maRuns = aLayoutRuns; return pSalLayout; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/inc vcl/source
vcl/inc/salgdi.hxx |4 +++- vcl/source/gdi/salgdilayout.cxx | 28 2 files changed, 27 insertions(+), 5 deletions(-) New commits: commit 7f876fd0d49527fef03d0248f776143e150feb33 Author: Caolán McNamara AuthorDate: Fri Nov 27 11:47:35 2020 + Commit: Caolán McNamara CommitDate: Fri Nov 27 15:32:56 2020 +0100 with RTL UI the LRT scrollbar in 'gen' calc is rendered incorrectly this is noticable since... commit 4deadc3c78949c18bb886eb1f66caa8f3cd7a2df Date: Fri Sep 25 13:30:11 2020 +0200 disentangle AA and B2D use in VCL drawing but is probably a problem since around... commit b5f081e1ac14f60497f62a27be86b07b0baa42f7 Date: Thu Aug 30 23:41:36 2018 +0200 Support RTL layout in VCL using Matrices Change-Id: I6bcad30982ee1eaee96bc6721d73e1e545f0d86a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106737 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 9fa687123bfa..6ed360105d24 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -596,7 +596,9 @@ private: // for buffering the Mirror-Matrix, see ::getMirror basegfx::B2DHomMatrix m_aLastMirror; -tools::Longm_aLastMirrorW; +tools::Long m_aLastMirrorW; +tools::Long m_nLastMirrorDeviceLTRButBiDiRtlTranslate; +boolm_bLastMirrorDeviceLTRButBiDiRtlSet; protected: /// flags which hold the SetAntialiasing() value from OutputDevice diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 89089d9755a2..5638cb9bb856 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -58,6 +58,8 @@ SalGraphics::SalGraphics() : m_nLayout( SalLayoutFlags::NONE ), m_aLastMirror(), m_aLastMirrorW(0), +m_nLastMirrorDeviceLTRButBiDiRtlTranslate(0), +m_bLastMirrorDeviceLTRButBiDiRtlSet(false), m_bAntiAlias(false) { // read global RTL settings @@ -316,14 +318,33 @@ const basegfx::B2DHomMatrix& SalGraphics::getMirror( const OutputDevice* i_pOutD const tools::Long w = GetDeviceWidth(i_pOutDev); SAL_WARN_IF( !w, "vcl", "missing graphics width" ); -if(w != m_aLastMirrorW) +const bool bMirrorDeviceLTRButBiDiRtlSet = i_pOutDev && !i_pOutDev->IsRTLEnabled(); +tools::Long nMirrorDeviceLTRButBiDiRtlTranslate(0); +if (bMirrorDeviceLTRButBiDiRtlSet) +nMirrorDeviceLTRButBiDiRtlTranslate = w - i_pOutDev->GetOutputWidthPixel() - (2 * i_pOutDev->GetOutOffXPixel()); + +// if the device width, or mirror state of the device changed, then m_aLastMirror is invalid +bool bLastMirrorValid = w == m_aLastMirrorW && bMirrorDeviceLTRButBiDiRtlSet == m_bLastMirrorDeviceLTRButBiDiRtlSet; +if (bLastMirrorValid && bMirrorDeviceLTRButBiDiRtlSet) +{ +// if the device is in in the unusual mode of a LTR device, but layout flags of SalLayoutFlags::BiDiRtl are +// in use, then the m_aLastMirror is invalid if the distance it should translate has changed +bLastMirrorValid = nMirrorDeviceLTRButBiDiRtlTranslate == m_nLastMirrorDeviceLTRButBiDiRtlTranslate; +} + +if (!bLastMirrorValid) { const_cast(this)->m_aLastMirrorW = w; +const_cast(this)->m_bLastMirrorDeviceLTRButBiDiRtlSet = bMirrorDeviceLTRButBiDiRtlSet; + const_cast(this)->m_nLastMirrorDeviceLTRButBiDiRtlTranslate = nMirrorDeviceLTRButBiDiRtlTranslate; if(w) { -if(nullptr != i_pOutDev && !i_pOutDev->IsRTLEnabled()) +if (bMirrorDeviceLTRButBiDiRtlSet) { +/* This path gets exercised in calc's RTL UI (e.g. SAL_RTL_ENABLED=1) + with its LTR horizontal scrollbar */ + // Original code was (removed here already pOutDevRef->i_pOutDev): // // mirror this window back // double devX = w-i_pOutDev->GetOutputWidthPixel()-i_pOutDev->GetOutOffXPixel(); // re-mirrored mnOutOffX @@ -332,8 +353,7 @@ const basegfx::B2DHomMatrix& SalGraphics::getMirror( const OutputDevice* i_pOutD // that this works as before, but I have reduced this (by re-placing and re-formatting) to // a simple translation: const_cast(this)->m_aLastMirror = basegfx::utils::createTranslateB2DHomMatrix( -w - i_pOutDev->GetOutputWidthPixel() - (2 * i_pOutDev->GetOutOffXPixel()), -0.0); +nMirrorDeviceLTRButBiDiRtlTranslate, 0.0); } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - vcl/inc vcl/source
vcl/inc/printdlg.hxx |3 +-- vcl/source/window/printdlg.cxx | 24 2 files changed, 17 insertions(+), 10 deletions(-) New commits: commit bb9fdc02569a0016ba5dd623479b8e8b0d1aa84e Author: Samuel Mehrbrodt AuthorDate: Thu Nov 26 10:52:04 2020 +0100 Commit: Samuel Mehrbrodt CommitDate: Thu Nov 26 14:36:30 2020 +0100 Fix "single print jobs" function in print dlg Did not work at all Change-Id: I388ce579691a1e7ad2eff8420c2f8b6b3e939ef0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106679 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx index 1832e6da35b5..60839b07382f 100644 --- a/vcl/inc/printdlg.hxx +++ b/vcl/inc/printdlg.hxx @@ -99,7 +99,7 @@ namespace vcl bool isPrintToFile() const; bool isCollate() const; -bool isSingleJobs() const { return mbSingleJobs; }; +bool isSingleJobs() const; bool hasPreview() const; void setPaperSizes(); @@ -204,7 +204,6 @@ namespace vcl SizemaFirstPageSize; boolmbShowLayoutFrame; -boolmbSingleJobs; Paper mePaper; diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index d9a7504bae76..6ea1182f2b7e 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -549,7 +549,6 @@ PrintDialog::PrintDialog(weld::Window* i_pWindow, const std::shared_ptrconnect_toggled( LINK( this, PrintDialog, ToggleHdl ) ); mxCollateBox->connect_toggled( LINK( this, PrintDialog, ToggleHdl ) ); +mxSingleJobsBox->connect_toggled( LINK( this, PrintDialog, ToggleHdl ) ); mxPagesBtn->connect_toggled( LINK( this, PrintDialog, ToggleHdl ) ); // setup select hdl @@ -739,8 +739,8 @@ void PrintDialog::storeToSettings() pItem->setValue( "PrintDialog", "CollateSingleJobs", - mbSingleJobs ? OUString("true") : -OUString("false") ); + mxSingleJobsBox->get_active() ? OUString("true") : + OUString("false") ); pItem->setValue( "PrintDialog", "HasPreview", @@ -794,10 +794,7 @@ void PrintDialog::readFromSettings() // collate single jobs aValue = pItem->getValue( "PrintDialog", "CollateSingleJobs" ); -if ( aValue.equalsIgnoreAsciiCase("true") ) -mbSingleJobs = true; -else -mbSingleJobs = false; +mxSingleJobsBox->set_active(aValue.equalsIgnoreAsciiCase("true")); // preview box aValue = pItem->getValue( "PrintDialog", @@ -1009,9 +1006,15 @@ void PrintDialog::setPaperOrientation( Orientation eOrientation ) void PrintDialog::checkControlDependencies() { if (mxCopyCountField->get_value() > 1) +{ mxCollateBox->set_sensitive( !mbCollateAlwaysOff ); +mxSingleJobsBox->set_sensitive( mxCollateBox->get_active() ); +} else +{ mxCollateBox->set_sensitive( false ); +mxSingleJobsBox->set_sensitive( false ); +} OUString aImg(mxCollateBox->get_active() ? OUString(SV_PRINT_COLLATE_BMP) : OUString(SV_PRINT_NOCOLLATE_BMP)); @@ -1746,6 +1749,11 @@ bool PrintDialog::isCollate() const return mxCopyCountField->get_value() > 1 && mxCollateBox->get_active(); } +bool PrintDialog::isSingleJobs() const +{ +return mxSingleJobsBox->get_active(); +} + bool PrintDialog::hasPreview() const { return mxPreviewBox->get_active(); @@ -1846,7 +1854,7 @@ IMPL_LINK(PrintDialog, ClickHdl, weld::Button&, rButton, void) } else if( == mxSingleJobsBox.get() ) { -maPController->setValue( "SingleJob", +maPController->setValue( "SinglePrintJobs", makeAny( isSingleJobs() ) ); checkControlDependencies(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits