[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/toolkit/treelistbox.hxx |2 ++ svx/source/tbxctrls/fontworkgallery.cxx |2 +- vcl/source/treelist/treelistbox.cxx |7 +++ vcl/source/treelist/uiobject.cxx|4 +++- 4 files changed, 13 insertions(+), 2 deletions(-) New commits: commit 54725f6e5f06b074d1c08d8efbd16518b96882d5 Author: Mike Kaganski AuthorDate: Tue May 3 09:49:07 2022 +0100 Commit: Mike Kaganski CommitDate: Tue May 3 19:54:12 2022 +0200 Don't add empty labels to fontwork's icon view This allows to center the icon in the respective entry, not having whitespace in the bottom Change-Id: Ib148df6911f020f8d4efca4f6a80a65b7f95945f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133720 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/vcl/toolkit/treelistbox.hxx b/include/vcl/toolkit/treelistbox.hxx index 491adbdbea30..0a9ea9da5a22 100644 --- a/include/vcl/toolkit/treelistbox.hxx +++ b/include/vcl/toolkit/treelistbox.hxx @@ -565,6 +565,8 @@ public: voidSetCheckButtonState( SvTreeListEntry*, SvButtonState ); SvButtonState GetCheckButtonState( SvTreeListEntry* ) const; +static bool HasEntryText(const SvTreeListEntry* pEntry); + voidSetEntryText(SvTreeListEntry*, const OUString& ); voidSetExpandedEntryBmp( SvTreeListEntry* _pEntry, const Image& _rImage ); voidSetCollapsedEntryBmp( SvTreeListEntry* _pEntry, const Image& _rImage ); diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 34436c5a77b2..cc9c4631361d 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -130,7 +130,7 @@ void FontWorkGalleryDialog::fillFavorites(sal_uInt16 nThemeId) for( size_t nFavorite = 1; nFavorite <= nFavCount; nFavorite++ ) { OUString sId = OUString::number(static_cast(nFavorite)); -maCtlFavorites->append(sId, "", maFavoritesHorizontal[nFavorite-1]); +maCtlFavorites->insert(-1, nullptr, , maFavoritesHorizontal[nFavorite - 1], nullptr); } if (maCtlFavorites->n_children()) diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx index 9f2ebab1009b..896e1c78dbe7 100644 --- a/vcl/source/treelist/treelistbox.cxx +++ b/vcl/source/treelist/treelistbox.cxx @@ -1568,6 +1568,13 @@ SvTreeListEntry* SvTreeListBox::InsertEntry( return pEntry; } +// static +bool SvTreeListBox::HasEntryText(const SvTreeListEntry* pEntry) +{ +assert(pEntry); +return pEntry->GetFirstItem(SvLBoxItemType::String) != nullptr; +} + void SvTreeListBox::SetEntryText(SvTreeListEntry* pEntry, const OUString& rStr) { SvLBoxString* pItem = static_cast(pEntry->GetFirstItem(SvLBoxItemType::String)); diff --git a/vcl/source/treelist/uiobject.cxx b/vcl/source/treelist/uiobject.cxx index ccc066804139..bcb161e03ecb 100644 --- a/vcl/source/treelist/uiobject.cxx +++ b/vcl/source/treelist/uiobject.cxx @@ -38,7 +38,9 @@ StringMap TreeListUIObject::get_state() aMap["LevelChildren"] = OUString::number(mxTreeList->GetLevelChildCount(nullptr)); aMap["CheckBoxList"] = OUString::boolean(isCheckBoxList(mxTreeList)); SvTreeListEntry* pEntry = mxTreeList->FirstSelected(); -aMap["SelectEntryText"] = pEntry ? mxTreeList->GetEntryText(pEntry) : OUString(); +aMap["SelectEntryText"] = (pEntry && SvTreeListBox::HasEntryText(pEntry)) + ? mxTreeList->GetEntryText(pEntry) + : OUString(); return aMap; }
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/fieldvalues.hxx|6 +- svx/source/dialog/svxruler.cxx |4 ++-- vcl/source/app/svdata.cxx |4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) New commits: commit 5337675a31a4aad5151691b9c7587bd4b3140715 Author: Stephan Bergmann AuthorDate: Mon Mar 14 08:05:40 2022 +0100 Commit: Stephan Bergmann CommitDate: Mon Mar 14 10:39:48 2022 +0100 Simplify vcl::EnglishStringToMetric Change-Id: I10b93a073a58c175d487b7aac3a65d461974eb6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131514 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/include/vcl/fieldvalues.hxx b/include/vcl/fieldvalues.hxx index b00fc5a47128..999f3e5fa355 100644 --- a/include/vcl/fieldvalues.hxx +++ b/include/vcl/fieldvalues.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_VCL_FIELDVALUES_HXX #define INCLUDED_VCL_FIELDVALUES_HXX +#include + +#include + #include #include #include @@ -29,7 +33,7 @@ class LocaleDataWrapper; namespace vcl { -VCL_DLLPUBLIC FieldUnit EnglishStringToMetric(const OUString& rEnglishMetricString); +VCL_DLLPUBLIC FieldUnit EnglishStringToMetric(std::string_view rEnglishMetricString); VCL_DLLPUBLIC bool TextToValue(const OUString& rStr, double& rValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index ddbf54445a76..ca680dd09bb9 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -3267,7 +3267,7 @@ void SvxRuler::MenuSelect(std::string_view ident) if (ident.empty()) return; /* Handler of the context menus for switching the unit of measurement */ -SetUnit(vcl::EnglishStringToMetric(OUString::fromUtf8(ident))); +SetUnit(vcl::EnglishStringToMetric(ident)); } void SvxRuler::TabMenuSelect(const OString& rIdent) @@ -3348,7 +3348,7 @@ void SvxRuler::Command( const CommandEvent& rCommandEvent ) for ( sal_uInt16 i = nCount; i; --i ) { OString sIdent = xMenu->get_id(i - 1); -FieldUnit eMenuUnit = vcl::EnglishStringToMetric(OUString::fromUtf8(sIdent)); +FieldUnit eMenuUnit = vcl::EnglishStringToMetric(sIdent); xMenu->set_active(sIdent, eMenuUnit == eUnit); if( bReduceMetric ) { diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index cb553176cc36..68884767406b 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -279,12 +279,12 @@ const FieldUnitStringList& ImplGetFieldUnits() namespace vcl { -FieldUnit EnglishStringToMetric(const OUString& rEnglishMetricString) +FieldUnit EnglishStringToMetric(std::string_view rEnglishMetricString) { sal_uInt32 nUnits = SAL_N_ELEMENTS(SV_FUNIT_STRINGS); for (sal_uInt32 i = 0; i < nUnits; ++i) { -if (rEnglishMetricString.toUtf8() == SV_FUNIT_STRINGS[i].first.mpId) +if (rEnglishMetricString == SV_FUNIT_STRINGS[i].first.mpId) return SV_FUNIT_STRINGS[i].second; } return FieldUnit::NONE;
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/fieldvalues.hxx|3 ++- svx/source/dialog/svxruler.cxx |4 ++-- vcl/source/app/svdata.cxx | 15 +++ vcl/source/control/field.cxx |4 ++-- 4 files changed, 21 insertions(+), 5 deletions(-) New commits: commit 2b95b55983689d5476e89c27177351e2d6785047 Author: Caolán McNamara AuthorDate: Wed Feb 2 12:59:49 2022 + Commit: Caolán McNamara CommitDate: Thu Feb 3 10:10:09 2022 +0100 tdf#125849 cannot modify the ruler unit of measure in translated UI Change-Id: Ica74dd5e55d30605ee03affa4b724ffa4ec65b5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129357 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/fieldvalues.hxx b/include/vcl/fieldvalues.hxx index e8f78bd5e119..b00fc5a47128 100644 --- a/include/vcl/fieldvalues.hxx +++ b/include/vcl/fieldvalues.hxx @@ -29,7 +29,8 @@ class LocaleDataWrapper; namespace vcl { -VCL_DLLPUBLIC FieldUnit StringToMetric(const OUString& rMetricString); +VCL_DLLPUBLIC FieldUnit EnglishStringToMetric(const OUString& rEnglishMetricString); + VCL_DLLPUBLIC bool TextToValue(const OUString& rStr, double& rValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits, const LocaleDataWrapper& rLocaleDataWrapper, FieldUnit eUnit); diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index 43000ea7279c..6e960a18433d 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -3257,7 +3257,7 @@ void SvxRuler::MenuSelect(std::string_view ident) if (ident.empty()) return; /* Handler of the context menus for switching the unit of measurement */ -SetUnit(vcl::StringToMetric(OUString::fromUtf8(ident))); +SetUnit(vcl::EnglishStringToMetric(OUString::fromUtf8(ident))); } void SvxRuler::TabMenuSelect(const OString& rIdent) @@ -3338,7 +3338,7 @@ void SvxRuler::Command( const CommandEvent& rCommandEvent ) for ( sal_uInt16 i = nCount; i; --i ) { OString sIdent = xMenu->get_id(i - 1); -FieldUnit eMenuUnit = vcl::StringToMetric(OUString::fromUtf8(sIdent)); +FieldUnit eMenuUnit = vcl::EnglishStringToMetric(OUString::fromUtf8(sIdent)); xMenu->set_active(sIdent, eMenuUnit == eUnit); if( bReduceMetric ) { diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 7ba785277c3e..1493729c9b1d 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -276,6 +277,20 @@ const FieldUnitStringList& ImplGetFieldUnits() return pSVData->maCtrlData.maFieldUnitStrings; } +namespace vcl +{ +FieldUnit EnglishStringToMetric(const OUString& rEnglishMetricString) +{ +sal_uInt32 nUnits = SAL_N_ELEMENTS(SV_FUNIT_STRINGS); +for (sal_uInt32 i = 0; i < nUnits; ++i) +{ +if (rEnglishMetricString.equalsAscii(SV_FUNIT_STRINGS[i].first.mpId)) +return SV_FUNIT_STRINGS[i].second; +} +return FieldUnit::NONE; +} +} + const FieldUnitStringList& ImplGetCleanedFieldUnits() { ImplSVData* pSVData = ImplGetSVData(); diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 7fabe96d400a..0e0093714f5a 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -960,7 +960,7 @@ static OUString ImplMetricToString( FieldUnit rUnit ) return OUString(); } -namespace vcl +namespace { FieldUnit StringToMetric(const OUString ) { @@ -979,7 +979,7 @@ namespace vcl static FieldUnit ImplMetricGetUnit(const OUString& rStr) { OUString aStr = ImplMetricGetUnitText(rStr); -return vcl::StringToMetric(aStr); +return StringToMetric(aStr); } static FieldUnit ImplMap2FieldUnit( MapUnit meUnit, tools::Long& nDecDigits )
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/gdimtf.hxx|2 svx/source/unodraw/UnoGraphicExporter.cxx | 96 ++-- vcl/source/gdi/gdimtf.cxx | 100 ++ vcl/source/gdi/impgraph.cxx | 27 +++- 4 files changed, 80 insertions(+), 145 deletions(-) New commits: commit 4d535c4f867d86d40786788e5e5c9fd061a65673 Author: Armin Le Grand (Allotropia) AuthorDate: Mon Jan 31 19:44:19 2022 +0100 Commit: Armin Le Grand CommitDate: Wed Feb 2 09:43:10 2022 +0100 tdf#126319 Corrected bitmap creation from metafile The conversion from Metafile to Bitmap in GraphicExporter is based on metafiles which does just not deliver enough precision when getting the bounds to do the correct size calculation for the target Bitmap. So I changed that to use Primitive functionality what produces better data. That old fix/correction itself was based on hairlines only which is anyways no longer sufficient since LO uses less hairlines nowadays, what is good in general (They are a relic of non-AA times when it was not possible to paint/work with lines taller than one pixel). Thus, cases need to be solved more generic based on better data. It would also be good to change this to primitives completely, but that is too much for now. Change-Id: I71bd136b106ef8ff3ba51458c46df08269773c01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129235 Tested-by: Jenkins Reviewed-by: Armin Le Grand diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx index 614d77369d1f..f8637675482d 100644 --- a/include/vcl/gdimtf.hxx +++ b/include/vcl/gdimtf.hxx @@ -125,7 +125,7 @@ public: * - coordinates of actions will be transformed to preferred mapmode * - the returned rectangle is relative to the preferred mapmode of the metafile */ -tools::Rectangle GetBoundRect( OutputDevice& i_rReference, tools::Rectangle* pHairline = nullptr ) const; +tools::Rectangle GetBoundRect( OutputDevice& i_rReference ) const; voidAdjust( short nLuminancePercent, short nContrastPercent, short nChannelRPercent = 0, short nChannelGPercent = 0, diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 6c158e936684..a91f16ab64f7 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -178,7 +178,7 @@ namespace { /** creates a bitmap that is optionally transparent from a metafile */ -BitmapEx GetBitmapFromMetaFile( const GDIMetaFile& rMtf,bool bIsSelection, const Size* pSize ) +BitmapEx GetBitmapFromMetaFile( const GDIMetaFile& rMtf, const Size* pSize ) { // use new primitive conversion tooling basegfx::B2DRange aRange(basegfx::B2DPoint(0.0, 0.0)); @@ -204,55 +204,7 @@ namespace { aRange.expand(basegfx::B2DPoint(aSize100th.Width(), aSize100th.Height())); } -// get hairline and full bound rect to evtl. correct logic size by the -// equivalent of one pixel to make those visible at right and bottom -tools::Rectangle aHairlineRect; -const tools::Rectangle aRect(rMtf.GetBoundRect(*Application::GetDefaultDevice(), )); - -if(!aRect.IsEmpty()) -{ -GDIMetaFile aMtf(rMtf); - -if (bIsSelection) -{ -// tdf#105998 Correct the Metafile using information from it's real sizes measured -// using rMtf.GetBoundRect above and a copy -const Size aOnePixelInMtf( -Application::GetDefaultDevice()->PixelToLogic( -Size(1, 1), -rMtf.GetPrefMapMode())); -const Size aHalfPixelInMtf( -(aOnePixelInMtf.getWidth() + 1) / 2, -(aOnePixelInMtf.getHeight() + 1) / 2); - -// tdf#126319 take bounds into account individually -const bool bHairlineRight(!aHairlineRect.IsEmpty() && aRect.Right() == aHairlineRect.Right()); -const bool bHairlineBottom(!aHairlineRect.IsEmpty() && aRect.Bottom() == aHairlineRect.Bottom()); -const bool bHairlineLeft(!aHairlineRect.IsEmpty() && aRect.Left() == aHairlineRect.Left()); -const bool bHairlineTop(!aHairlineRect.IsEmpty() && aRect.Top() == aHairlineRect.Top()); - -// tdf#126319 Move the content dependent on Top/Left hairline -aMtf.Move( -(bHairlineLeft ? -aHalfPixelInMtf.getWidth() : aHalfPixelInMtf.getWidth()), -(bHairlineTop ? -aHalfPixelInMtf.getHeight() : aHalfPixelInMtf.getHeight())); - -// Do not Scale, but set the PrefSize. Some levels deeper the -// MetafilePrimitive will add a mapping to the decomposition -
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/bitmap.hxx| 14 +- svx/source/dialog/_bmpmask.cxx|2 - svx/source/dialog/_contdlg.cxx|2 - vcl/source/bitmap/BitmapEx.cxx|2 - vcl/source/bitmap/bitmappaint.cxx | 49 +++--- 5 files changed, 15 insertions(+), 54 deletions(-) New commits: commit 5c23560ba39fe17c75cafe3d495af743238e4d67 Author: Noel Grandin AuthorDate: Thu Jul 1 12:59:47 2021 +0200 Commit: Noel Grandin CommitDate: Thu Jul 1 14:33:11 2021 +0200 BmpCombine::And is dead ever since commit ddd2639a482befb4a3bf1f75a88e66c21a691b67 Date: Sat Feb 27 15:50:37 2021 +0200 drop mask from BitmapEx Change-Id: I45fae0140067e2bfe5ce1ae2f5014ce733835ef1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118220 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 2a6872c179f0..d27ffdaa8559 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -78,11 +78,6 @@ enum class BmpConversion N8BitNoConversion // make 8bit without color conversion (e.g. take the red channel) }; -enum class BmpCombine -{ -Or, And -}; - class BitmapInfoAccess; class BitmapReadAccess; class BitmapWriteAccess; @@ -238,19 +233,14 @@ public: const tools::Rectangle& rRectSrc, const Bitmap* pBmpSrc ); -/** Perform boolean operations with another bitmap +/** Perform boolean OR operation with another bitmap @param rMask The mask bitmap in the selected combine operation -@param eCombine -The combine operation to perform on the bitmap - @return true, if the operation was completed successfully. */ -boolCombineSimple( -const Bitmap& rMask, -BmpCombine eCombine ); +boolCombineOr( const Bitmap& rMask ); /** Alpha-blend the given bitmap against a specified uniform background color. diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 7f65bb697517..420321d2a9be 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -615,7 +615,7 @@ BitmapEx SvxBmpMask::ImpMaskTransparent( const BitmapEx& rBitmapEx, const Color& Bitmap aMask( rBitmapEx.GetBitmap().CreateMask( rColor, nTol ) ); if( rBitmapEx.IsAlpha() ) -aMask.CombineSimple( rBitmapEx.GetAlpha(), BmpCombine::Or ); +aMask.CombineOr( rBitmapEx.GetAlpha() ); aBmpEx = BitmapEx( rBitmapEx.GetBitmap(), aMask ); LeaveWait(); diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx index c6fcde5d1dfc..712544ff0c01 100644 --- a/svx/source/dialog/_contdlg.cxx +++ b/svx/source/dialog/_contdlg.cxx @@ -634,7 +634,7 @@ IMPL_LINK( SvxSuperContourDlg, PipetteClickHdl, ContourWindow&, rWnd, void ) Bitmap aMask = aGraphic.GetBitmapEx().GetBitmap().CreateMask( rColor, nTol ); if( aGraphic.IsTransparent() ) -aMask.CombineSimple( aGraphic.GetBitmapEx().GetAlpha(), BmpCombine::Or ); +aMask.CombineOr( aGraphic.GetBitmapEx().GetAlpha() ); if( !aMask.IsEmpty() ) { diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index 2c56ab44b6a0..91ee55c58ed3 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -1443,7 +1443,7 @@ void BitmapEx::CombineMaskOr(Color maskColor, sal_uInt8 nTol) { Bitmap aNewMask = maBitmap.CreateMask( maskColor, nTol ); if ( IsAlpha() ) - aNewMask.CombineSimple( maAlphaMask, BmpCombine::Or ); + aNewMask.CombineOr( maAlphaMask ); maAlphaMask = aNewMask; } diff --git a/vcl/source/bitmap/bitmappaint.cxx b/vcl/source/bitmap/bitmappaint.cxx index 847dd4171b18..e06f96e8abd7 100644 --- a/vcl/source/bitmap/bitmappaint.cxx +++ b/vcl/source/bitmap/bitmappaint.cxx @@ -1047,7 +1047,7 @@ bool Bitmap::Replace(const Color* pSearchColors, const Color* pReplaceColors, si return bRet; } -bool Bitmap::CombineSimple(const Bitmap& rMask, BmpCombine eCombine) +bool Bitmap::CombineOr(const Bitmap& rMask) { ScopedReadAccess pMaskAcc(const_cast(rMask)); BitmapScopedWriteAccess pAcc(*this); @@ -1062,51 +1062,22 @@ bool Bitmap::CombineSimple(const Bitmap& rMask, BmpCombine eCombine) const BitmapColor aBlack(pAcc->GetBestMatchingColor(aColBlack)); const BitmapColor aMaskBlack(pMaskAcc->GetBestMatchingColor(aColBlack)); -switch (eCombine) +for (tools::Long nY = 0; nY < nHeight; nY++) { -case BmpCombine::And: +Scanline pScanline = pAcc->GetScanline(nY); +Scanline pScanlineMask = pMaskAcc->GetScanline(nY); +for (tools::Long nX = 0; nX < nWidth; nX++)
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/filter/PDFiumLibrary.hxx |2 ++ include/vcl/pdf/PDFFillMode.hxx | 24 svx/source/svdraw/svdpdf.cxx | 10 +- vcl/source/pdf/PDFiumLibrary.cxx | 17 + 4 files changed, 48 insertions(+), 5 deletions(-) New commits: commit 97601533cbef67bfdb5f25dc00d0dda743e8349e Author: Miklos Vajna AuthorDate: Thu Jan 14 21:20:31 2021 +0100 Commit: Miklos Vajna CommitDate: Fri Jan 15 08:35:11 2021 +0100 pdfium: add wrapper for FPDF_FILLMODE_* defines Which is, I think, the last direct pdfium usage outside vcl. Change-Id: I2e435e5a3669c6163bf2c20bc6d1d8bd4c88cecd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109314 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index eee97e39bf9a..79f91c6f5264 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -154,6 +155,7 @@ public: std::unique_ptr getPathSegment(int index); Size getImageSize(PDFiumPage& rPage); std::unique_ptr getImageBitmap(); +bool getDrawMode(PDFFillMode& eFillMode, bool& bStroke); }; class VCL_DLLPUBLIC PDFiumTextPage final diff --git a/include/vcl/pdf/PDFFillMode.hxx b/include/vcl/pdf/PDFFillMode.hxx new file mode 100644 index ..e5bc71f0d16a --- /dev/null +++ b/include/vcl/pdf/PDFFillMode.hxx @@ -0,0 +1,24 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +namespace vcl::pdf +{ +enum class PDFFillMode +{ +None = 0, +Alternate = 1, +Winding = 2, +}; + +} // namespace vcl::pdf + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index e266609bd295..75f079540935 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -1011,13 +1011,13 @@ void ImpSdrPdfImport::ImportPath(std::unique_ptr con const double dWidth = 0.5 * fabs(sqrt2(aPathMatrix.a(), aPathMatrix.c()) * fWidth); mnLineWidth = convertPointToMm100(dWidth); -int nFillMode = FPDF_FILLMODE_ALTERNATE; -FPDF_BOOL bStroke = 1; // Assume we have to draw, unless told otherwise. -if (FPDFPath_GetDrawMode(pPageObject->getPointer(), , )) +vcl::pdf::PDFFillMode nFillMode = vcl::pdf::PDFFillMode::Alternate; +bool bStroke = true; // Assume we have to draw, unless told otherwise. +if (pPageObject->getDrawMode(nFillMode, bStroke)) { -if (nFillMode == FPDF_FILLMODE_ALTERNATE) +if (nFillMode == vcl::pdf::PDFFillMode::Alternate) mpVD->SetDrawMode(DrawModeFlags::Default); -else if (nFillMode == FPDF_FILLMODE_WINDING) +else if (nFillMode == vcl::pdf::PDFFillMode::Winding) mpVD->SetDrawMode(DrawModeFlags::Default); else mpVD->SetDrawMode(DrawModeFlags::NoFill); diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index 755c19684183..bdd3fed7b4d4 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -107,6 +107,13 @@ static_assert(static_cast(vcl::pdf::PDFTextRenderMode::FillStrokeClip) static_assert(static_cast(vcl::pdf::PDFTextRenderMode::Clip) == FPDF_TEXTRENDERMODE_CLIP, "PDFTextRenderMode::Clip value mismatch"); +static_assert(static_cast(vcl::pdf::PDFFillMode::None) == FPDF_FILLMODE_NONE, + "PDFFillMode::None value mismatch"); +static_assert(static_cast(vcl::pdf::PDFFillMode::Alternate) == FPDF_FILLMODE_ALTERNATE, + "PDFFillMode::Alternate value mismatch"); +static_assert(static_cast(vcl::pdf::PDFFillMode::Winding) == FPDF_FILLMODE_WINDING, + "PDFFillMode::Winding value mismatch"); + namespace { /// Callback class to be used with FPDF_SaveWithVersion(). @@ -704,6 +711,16 @@ std::unique_ptr PDFiumPageObject::getImageBitmap() return pPDFiumBitmap; } +bool PDFiumPageObject::getDrawMode(PDFFillMode& rFillMode, bool& rStroke) +{ +auto nFillMode = static_cast(rFillMode); +auto bStroke = static_cast(rStroke); +bool bRet = FPDFPath_GetDrawMode(mpPageObject, , ); +rFillMode = static_cast(nFillMode); +rStroke = static_cast(bStroke); +return bRet; +} + BitmapChecksum PDFiumPage::getChecksum(int nMDPPerm) { size_t nPageWidth = getWidth(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/filter/PDFiumLibrary.hxx |1 + svx/source/svdraw/svdpdf.cxx | 13 +++-- vcl/source/pdf/PDFiumLibrary.cxx |7 +++ 3 files changed, 11 insertions(+), 10 deletions(-) New commits: commit 06322b0922972fec4b9e5f57e8dbab18ca9bd676 Author: Miklos Vajna AuthorDate: Wed Jan 13 21:30:24 2021 +0100 Commit: Miklos Vajna CommitDate: Thu Jan 14 09:10:34 2021 +0100 pdfium: add an FPDFPageObj_GetStrokeWidth() wrapper Change-Id: If411b788b3ea07c29377e01052ee6a48893ca482 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109250 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index aff5ad6ad8af..eee97e39bf9a 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -148,6 +148,7 @@ public: PDFTextRenderMode getTextRenderMode(); Color getFillColor(); Color getStrokeColor(); +double getStrokeWidth(); // Path int getPathSegmentCount(); std::unique_ptr getPathSegment(int index); diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 00969a90904c..e266609bd295 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -1007,8 +1007,7 @@ void ImpSdrPdfImport::ImportPath(std::unique_ptr con basegfx::utils::createScaleTranslateB2DHomMatrix(mfScaleX, mfScaleY, maOfs.X(), maOfs.Y())); aPolyPoly.transform(aTransform); -float fWidth = 1; -FPDFPageObj_GetStrokeWidth(pPageObject->getPointer(), ); +float fWidth = pPageObject->getStrokeWidth(); const double dWidth = 0.5 * fabs(sqrt2(aPathMatrix.a(), aPathMatrix.c()) * fWidth); mnLineWidth = convertPointToMm100(dWidth); @@ -1024,17 +1023,11 @@ void ImpSdrPdfImport::ImportPath(std::unique_ptr con mpVD->SetDrawMode(DrawModeFlags::NoFill); } -unsigned int nR; -unsigned int nG; -unsigned int nB; -unsigned int nA; -FPDFPageObj_GetFillColor(pPageObject->getPointer(), , , , ); -mpVD->SetFillColor(Color(nR, nG, nB)); +mpVD->SetFillColor(pPageObject->getFillColor()); if (bStroke) { -FPDFPageObj_GetStrokeColor(pPageObject->getPointer(), , , , ); -mpVD->SetLineColor(Color(nR, nG, nB)); +mpVD->SetLineColor(pPageObject->getStrokeColor()); } else mpVD->SetLineColor(COL_TRANSPARENT); diff --git a/vcl/source/pdf/PDFiumLibrary.cxx b/vcl/source/pdf/PDFiumLibrary.cxx index 3165f669f41d..755c19684183 100644 --- a/vcl/source/pdf/PDFiumLibrary.cxx +++ b/vcl/source/pdf/PDFiumLibrary.cxx @@ -666,6 +666,13 @@ Color PDFiumPageObject::getStrokeColor() return aColor; } +double PDFiumPageObject::getStrokeWidth() +{ +float fWidth = 1; +FPDFPageObj_GetStrokeWidth(mpPageObject, ); +return fWidth; +} + int PDFiumPageObject::getPathSegmentCount() { return FPDFPath_CountSegments(mpPageObject); } std::unique_ptr PDFiumPageObject::getPathSegment(int index) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/keycod.hxx|2 +- svx/source/svdraw/svdview.cxx |1 - vcl/source/window/keycod.cxx |7 +++ 3 files changed, 4 insertions(+), 6 deletions(-) New commits: commit 44fd4f1aacdd9a77fd4f5d2d1d300d3c73c35861 Author: Caolán McNamara AuthorDate: Tue Sep 1 15:03:04 2020 +0100 Commit: Caolán McNamara CommitDate: Wed Sep 2 12:38:48 2020 +0200 KeyFuncType::REPEAT is just a bare KEY_REPEAT case the one use of it in SdrView::KeyInput already has a handler for KEY_REPEAT in its default branch, so we can drop KeyFuncType::REPEAT Change-Id: I6dd7612ab551baf3dfdccf0179b3efadfb7659ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101876 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/vcl/keycod.hxx b/include/vcl/keycod.hxx index 6219897b55cb..8da99ba7ccb9 100644 --- a/include/vcl/keycod.hxx +++ b/include/vcl/keycod.hxx @@ -28,7 +28,7 @@ namespace vcl { class Window; } enum class KeyFuncType : sal_Int32 { DONTKNOW, CUT, COPY, PASTE, UNDO, - REDO, DELETE, REPEAT }; + REDO, DELETE }; namespace vcl { diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 95869b217b07..d74e5e8bf800 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -168,7 +168,6 @@ bool SdrView::KeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) case KeyFuncType::DELETE: DeleteMarked(); break; case KeyFuncType::UNDO: mpModel->Undo(); break; case KeyFuncType::REDO: mpModel->Redo(); break; -case KeyFuncType::REPEAT: mpModel->Repeat(*this); break; default: { switch (rKEvt.GetKeyCode().GetFullCode()) { case KEY_ESCAPE: { diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx index 193115f5a6a1..349e87ecbf43 100644 --- a/vcl/source/window/keycod.cxx +++ b/vcl/source/window/keycod.cxx @@ -26,7 +26,7 @@ #include #include -const sal_uInt16 aImplKeyFuncTab[(static_cast(KeyFuncType::REPEAT)+1)*4] = +const sal_uInt16 aImplKeyFuncTab[(static_cast(KeyFuncType::DELETE)+1)*4] = { 0, 0, 0, 0,// KeyFuncType::DONTKNOW KEY_X | KEY_MOD1, KEY_DELETE | KEY_SHIFT, KEY_CUT, 0, // KeyFuncType::CUT @@ -34,8 +34,7 @@ const sal_uInt16 aImplKeyFuncTab[(static_cast(KeyFuncType::REPEAT)+1)*4] = KEY_V | KEY_MOD1, KEY_INSERT | KEY_SHIFT, KEY_PASTE, 0,// KeyFuncType::PASTE KEY_Z | KEY_MOD1, KEY_BACKSPACE | KEY_MOD2, KEY_UNDO, 0, // KeyFuncType::UNDO KEY_Y | KEY_MOD1, KEY_UNDO | KEY_SHIFT, 0, 0, // KeyFuncType::REDO -KEY_DELETE, 0, 0, 0, // KeyFuncType::DELETE -KEY_REPEAT, 0, 0, 0// KeyFuncType::REPEAT +KEY_DELETE, 0, 0, 0// KeyFuncType::DELETE }; bool ImplGetKeyCode( KeyFuncType eFunc, sal_uInt16& rCode1, sal_uInt16& rCode2, sal_uInt16& rCode3, sal_uInt16& rCode4 ) @@ -79,7 +78,7 @@ KeyFuncType vcl::KeyCode::GetFunction() const sal_uInt16 nCompCode = GetModifier() | GetCode(); if ( nCompCode ) { -for ( sal_uInt16 i = sal_uInt16(KeyFuncType::CUT); i <= sal_uInt16(KeyFuncType::REPEAT); i++ ) +for ( sal_uInt16 i = sal_uInt16(KeyFuncType::CUT); i <= sal_uInt16(KeyFuncType::DELETE); i++ ) { sal_uInt16 nKeyCode1; sal_uInt16 nKeyCode2; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/toolbox.hxx|4 + include/vcl/uitest/uiobject.hxx| 23 +++ svx/source/tbxctrls/tbunosearchcontrollers.cxx |1 vcl/source/uitest/uiobject.cxx | 52 + vcl/source/window/toolbox2.cxx |7 +++ 5 files changed, 87 insertions(+) New commits: commit d17227830438f7a7e0d5de82b5a447771dfe8f25 Author: Ahmed ElShreif AuthorDate: Fri Jul 10 23:45:51 2020 +0200 Commit: Ahmed ElShreif CommitDate: Tue Jul 14 15:28:47 2020 +0200 uitest : Add support for "ToolBox" Objects for example" "bottom find bar" This patch will help us in testing any ToolBox Objects by this lines : >> variable_name = MainWindow.getChild(Bar_name) >> variable_name.executeAction("CLICK", mkPropertyValues({"POS": poition_x })) for position_x you just put the id of which entry in the ToolBox do you want to press on it . Also This patch set the ID of the bottom find bar to be "FindBar" to be able to select it in UITests . Change-Id: I360cdbde47be188c49c6d61bf5df4df5caa6a23e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98549 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index 6987f777b00a..8383662129f8 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -78,6 +78,10 @@ class VCL_DLLPUBLIC ToolBox : public DockingWindow public: using ImplToolItems = std::vector; +virtual FactoryFunction GetUITestFactory() const override; + +void SetCurItemId( sal_uInt16 CurID ) { mnCurItemId=CurID; } + static constexpr auto APPEND = std::numeric_limits::max(); diff --git a/include/vcl/uitest/uiobject.hxx b/include/vcl/uitest/uiobject.hxx index 15686e406904..36dd5488ce7a 100644 --- a/include/vcl/uitest/uiobject.hxx +++ b/include/vcl/uitest/uiobject.hxx @@ -34,6 +34,7 @@ class SpinButton; class SpinField; class VerticalTabControl; class VclMultiLineEdit; +class ToolBox; typedef std::map StringMap; @@ -480,6 +481,28 @@ private: SvTreeListEntry* const mpEntry; }; +class ToolBoxUIObject final : public WindowUIObject +{ +private: +VclPtr mxToolBox; + +public: + +ToolBoxUIObject(const VclPtr& mxToolBox); +virtual ~ToolBoxUIObject() override; + +virtual void execute(const OUString& rAction, +const StringMap& rParameters) override; + +virtual StringMap get_state() override; + +static std::unique_ptr create(vcl::Window* pWindow); + +private: + +virtual OUString get_name() const override; +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx index 4305e95d1c9f..730acf5dece1 100644 --- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx +++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx @@ -1544,6 +1544,7 @@ void SAL_CALL FindbarDispatcher::dispatch( const css::util::URL& aURL, const css css::uno::Reference< css::awt::XWindow > xWindow(xUIElement->getRealInterface(), css::uno::UNO_QUERY); VclPtr pWindow = VCLUnoHelper::GetWindow( xWindow ); ToolBox* pToolBox = static_cast(pWindow.get()); +pToolBox->set_id("FindBar"); if ( pToolBox ) { ToolBox::ImplToolItems::size_type nItemCount = pToolBox->GetItemCount(); diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx index 477f1ff06af9..9e58f594b158 100644 --- a/vcl/source/uitest/uiobject.cxx +++ b/vcl/source/uitest/uiobject.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -1561,4 +1562,55 @@ std::unique_ptr VerticalTabControlUIObject::create(vcl::Window* pWindo return std::unique_ptr(new VerticalTabControlUIObject(pTabControl)); } + +ToolBoxUIObject::ToolBoxUIObject(const VclPtr& xToolBox): +WindowUIObject(xToolBox), +mxToolBox(xToolBox) +{ +} + +ToolBoxUIObject::~ToolBoxUIObject() +{ +} + +void ToolBoxUIObject::execute(const OUString& rAction, +const StringMap& rParameters) +{ +if (rAction == "CLICK") +{ +if (rParameters.find("POS") != rParameters.end()) +{ +auto itr = rParameters.find("POS"); +sal_uInt16 nPos = itr->second.toUInt32(); +mxToolBox->SetCurItemId(nPos); +mxToolBox->Click(); +mxToolBox->Select(); +} +} +else +WindowUIObject::execute(rAction, rParameters); +} + +StringMap ToolBoxUIObject::get_state() +{ +StringMap aMap = WindowUIObject::get_state(); +aMap["CurrSelectedItemID"] = OUString::number(mxToolBox->GetCurItemId()); +aMap["CurrSelectedItemText"] = mxToolBox->GetItemText(mxToolBox->GetCurItemId()); +aMap["CurrSelectedItemCommand"] = mxToolBox->GetItemCommand(mxToolBox->GetCurItemId()); +aMap["ItemCount"] =
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/filter/PDFiumLibrary.hxx | 21 svx/source/inc/svdpdf.hxx|6 +++- svx/source/svdraw/svdpdf.cxx | 44 ++- vcl/source/pdf/PDFiumLibrary.cxx | 33 ++ 4 files changed, 76 insertions(+), 28 deletions(-) New commits: commit bc8016b81c2c609711c26af1f85da327cf30a4ff Author: Tomaž Vajngerl AuthorDate: Mon Jul 6 14:08:23 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Wed Jul 8 20:55:01 2020 +0200 pdf: add PDFiumPathSegment to the wrapper & use in ImpSdrPdfImport A PageObject of type FPDF_PAGEOBJ_PATH can have a path segment, that is common in vector graphic objects. The path segment is wrapped into PDFiumPathSegment which can be used to handle the path and path properties. Change-Id: I990d51ba90fa356a6eca137eb4b71947858289aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98210 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index f7dcc4b2c99e..43176f584420 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -73,6 +73,24 @@ public: class PDFiumTextPage; +class VCL_DLLPUBLIC PDFiumPathSegment final +{ +private: +FPDF_PATHSEGMENT mpPathSegment; + +PDFiumPathSegment(const PDFiumPathSegment&) = delete; +PDFiumPathSegment& operator=(const PDFiumPathSegment&) = delete; + +public: +PDFiumPathSegment(FPDF_PATHSEGMENT pPathSegment); +~PDFiumPathSegment(); + +FPDF_PATHSEGMENT getPointer() { return mpPathSegment; } +basegfx::B2DPoint getPoint(); +bool isClosed(); +int getType(); +}; + class VCL_DLLPUBLIC PDFiumPageObject final { private: @@ -100,6 +118,9 @@ public: int getTextRenderMode(); Color getFillColor(); Color getStrokeColor(); +// Path +int getPathSegmentCount(); +std::unique_ptr getPathSegment(int index); }; class VCL_DLLPUBLIC PDFiumTextPage final diff --git a/svx/source/inc/svdpdf.hxx b/svx/source/inc/svdpdf.hxx index 60a90619e6a8..08a05a50f156 100644 --- a/svx/source/inc/svdpdf.hxx +++ b/svx/source/inc/svdpdf.hxx @@ -113,8 +113,10 @@ class ImpSdrPdfImport final void ImportForm(std::unique_ptr const& pPageObject, std::unique_ptr const& pTextPage, int nPageObjectIndex); -void ImportImage(FPDF_PAGEOBJECT pPageObject, int nPageObjectIndex); -void ImportPath(FPDF_PAGEOBJECT pPageObject, int nPageObjectIndex); +void ImportImage(std::unique_ptr const& pPageObject, + int nPageObjectIndex); +void ImportPath(std::unique_ptr const& pPageObject, +int nPageObjectIndex); void ImportText(std::unique_ptr const& pPageObject, std::unique_ptr const& pTextPage, int nPageObjectIndex); diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 30413fa1a30f..85911156159b 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -680,10 +680,10 @@ void ImpSdrPdfImport::ImportPdfObject( ImportText(pPageObject, pTextPage, nPageObjectIndex); break; case FPDF_PAGEOBJ_PATH: -ImportPath(pPageObject->getPointer(), nPageObjectIndex); +ImportPath(pPageObject, nPageObjectIndex); break; case FPDF_PAGEOBJ_IMAGE: -ImportImage(pPageObject->getPointer(), nPageObjectIndex); +ImportImage(pPageObject, nPageObjectIndex); break; case FPDF_PAGEOBJ_SHADING: SAL_WARN("sd.filter", "Got page object SHADING: " << nPageObjectIndex); @@ -878,10 +878,11 @@ void ImpSdrPdfImport::MapScaling() mnMapScalingOfs = nCount; } -void ImpSdrPdfImport::ImportImage(FPDF_PAGEOBJECT pPageObject, int /*nPageObjectIndex*/) +void ImpSdrPdfImport::ImportImage(std::unique_ptr const& pPageObject, + int /*nPageObjectIndex*/) { std::unique_ptr::type, FPDFBitmapDeleter> bitmap( -FPDFImageObj_GetBitmap(pPageObject)); +FPDFImageObj_GetBitmap(pPageObject->getPointer())); if (!bitmap) { SAL_WARN("sd.filter", "Failed to get IMAGE"); @@ -924,7 +925,7 @@ void ImpSdrPdfImport::ImportImage(FPDF_PAGEOBJECT pPageObject, int /*nPageObject float bottom; float right; float top; -if (!FPDFPageObj_GetBounds(pPageObject, , , , )) +if (!FPDFPageObj_GetBounds(pPageObject->getPointer(), , , , )) { SAL_WARN("sd.filter", "FAILED to get image bounds"); } @@ -941,36 +942,27 @@ void ImpSdrPdfImport::ImportImage(FPDF_PAGEOBJECT pPageObject, int /*nPageObject InsertObj(pGraf); } -void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int /*nPageObjectIndex*/) +void ImpSdrPdfImport::ImportPath(std::unique_ptr const& pPageObject, +
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/filter/PDFiumLibrary.hxx |6 ++ svx/source/inc/svdpdf.hxx|7 +-- svx/source/svdraw/svdpdf.cxx | 30 +++--- vcl/source/pdf/PDFiumLibrary.cxx | 25 + 4 files changed, 51 insertions(+), 17 deletions(-) New commits: commit b5b8da80439419a2daa6a80c9d3979173fe2887a Author: Tomaž Vajngerl AuthorDate: Sun Jun 28 12:34:19 2020 +0200 Commit: Tomaž Vajngerl CommitDate: Mon Jun 29 14:35:56 2020 +0200 pdf: support PDF Form object and getMatrix Change-Id: I61f2004df7f9c9ac37959e0b50ea1ff83387c77a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97365 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index 501f964f395d..9f34bdb92ad6 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -87,6 +88,11 @@ public: int getType(); OUString getText(std::unique_ptr const& pTextPage); + +int getFormObjectCount(); +std::unique_ptr getFormObject(int nIndex); + +basegfx::B2DHomMatrix getMatrix(); }; class VCL_DLLPUBLIC PDFiumTextPage final diff --git a/svx/source/inc/svdpdf.hxx b/svx/source/inc/svdpdf.hxx index 71e66ff3deac..0bfdb2b3e6ef 100644 --- a/svx/source/inc/svdpdf.hxx +++ b/svx/source/inc/svdpdf.hxx @@ -107,9 +107,12 @@ class SVXCORE_DLLPUBLIC ImpSdrPdfImport final void checkClip(); bool isClip() const; -void ImportPdfObject(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTextPage, +void ImportPdfObject(std::unique_ptr const& pPageObject, + std::unique_ptr const& pTextPage, int nPageObjectIndex); -void ImportForm(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTextPage, int nPageObjectIndex); +void ImportForm(std::unique_ptr const& pPageObject, +std::unique_ptr const& pTextPage, +int nPageObjectIndex); void ImportImage(FPDF_PAGEOBJECT pPageObject, int nPageObjectIndex); void ImportPath(FPDF_PAGEOBJECT pPageObject, int nPageObjectIndex); void ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTextPage, int nPageObjectIndex); diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 9fa8c82f722b..79693be693e1 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -169,7 +169,7 @@ void ImpSdrPdfImport::DoObjects(SvdProgressInfo* pProgrInfo, sal_uInt32* pAction for (int nPageObjectIndex = 0; nPageObjectIndex < nPageObjectCount; ++nPageObjectIndex) { auto pPageObject = pPdfPage->getObject(nPageObjectIndex); -ImportPdfObject(pPageObject->getPointer(), pTextPage->getPointer(), nPageObjectIndex); +ImportPdfObject(pPageObject, pTextPage, nPageObjectIndex); if (pProgrInfo && pActionsToReport) { (*pActionsToReport)++; @@ -666,23 +666,24 @@ void ImpSdrPdfImport::checkClip() } bool ImpSdrPdfImport::isClip() const { return !maClip.getB2DRange().isEmpty(); } -void ImpSdrPdfImport::ImportPdfObject(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTextPage, - int nPageObjectIndex) +void ImpSdrPdfImport::ImportPdfObject( +std::unique_ptr const& pPageObject, +std::unique_ptr const& pTextPage, int nPageObjectIndex) { -if (pPageObject == nullptr) +if (!pPageObject) return; -const int nPageObjectType = FPDFPageObj_GetType(pPageObject); +const int nPageObjectType = pPageObject->getType(); switch (nPageObjectType) { case FPDF_PAGEOBJ_TEXT: -ImportText(pPageObject, pTextPage, nPageObjectIndex); +ImportText(pPageObject->getPointer(), pTextPage->getPointer(), nPageObjectIndex); break; case FPDF_PAGEOBJ_PATH: -ImportPath(pPageObject, nPageObjectIndex); +ImportPath(pPageObject->getPointer(), nPageObjectIndex); break; case FPDF_PAGEOBJ_IMAGE: -ImportImage(pPageObject, nPageObjectIndex); +ImportImage(pPageObject->getPointer(), nPageObjectIndex); break; case FPDF_PAGEOBJ_SHADING: SAL_WARN("sd.filter", "Got page object SHADING: " << nPageObjectIndex); @@ -697,21 +698,20 @@ void ImpSdrPdfImport::ImportPdfObject(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE } } -void ImpSdrPdfImport::ImportForm(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTextPage, +void ImpSdrPdfImport::ImportForm(std::unique_ptr const& pPageObject, + std::unique_ptr const& pTextPage, int /*nPageObjectIndex*/) { // Get the form matrix to perform correct translation/scaling of the form sub-objects. const
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/settings.hxx|2 +- svx/source/sidebar/possize/PosSizePropertyPanel.cxx |2 +- vcl/source/app/settings.cxx | 12 ++-- vcl/source/control/field.cxx|4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) New commits: commit 0784df709d5d8d39e2ba3778702466e57e1270d4 Author: Henry Castro AuthorDate: Thu May 7 17:53:40 2020 -0400 Commit: Henry Castro CommitDate: Sun May 10 18:33:59 2020 +0200 lok: replace name Neutro to Neutral This commit was split because it has to be in sync with cp-6.2 branch Change-Id: I849b63f34297a6876d5a3ab83bb6ce551bb156d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93687 Tested-by: Jenkins Reviewed-by: Henry Castro diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index fedb39ccaa09..c3567e4120d9 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -707,7 +707,7 @@ public: static bool GetMathLayoutRTL(); // returns true if UI language requires right-to-left Math Layout const LocaleDataWrapper&GetLocaleDataWrapper() const; const LocaleDataWrapper&GetUILocaleDataWrapper() const; -const LocaleDataWrapper&GetNeutroLocaleDataWrapper() const; +const LocaleDataWrapper&GetNeutralLocaleDataWrapper() const; const vcl::I18nHelper& GetLocaleI18nHelper() const; const vcl::I18nHelper& GetUILocaleI18nHelper() const; diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 38d49e88ec67..248675f7ee1f 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -801,7 +801,7 @@ void PosSizePropertyPanel::GetControlState(const sal_uInt16 nSID, boost::propert if (pControl && !pControl->get_text().isEmpty()) { -OUString sValue = Application::GetSettings().GetNeutroLocaleDataWrapper(). +OUString sValue = Application::GetSettings().GetNeutralLocaleDataWrapper(). getNum(pControl->get_value(pControl->get_unit()), pControl->get_digits(), false, false); rState.put(pControl->get_buildable_name().getStr(), sValue.toUtf8().getStr()); } diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 00889abe3dfb..8e18213f412a 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -238,7 +238,7 @@ struct ImplAllSettingsData LanguageTag maUILocale; std::unique_ptr mpLocaleDataWrapper; std::unique_ptr mpUILocaleDataWrapper; -std::unique_ptr mpNeutroLocaleDataWrapper; +std::unique_ptr mpNeutralLocaleDataWrapper; std::unique_ptrmpI18nHelper; std::unique_ptrmpUII18nHelper; SvtSysLocalemaSysLocale; @@ -2756,7 +2756,7 @@ ImplAllSettingsData::~ImplAllSettingsData() { mpLocaleDataWrapper.reset(); mpUILocaleDataWrapper.reset(); -mpNeutroLocaleDataWrapper.reset(); +mpNeutralLocaleDataWrapper.reset(); mpI18nHelper.reset(); mpUII18nHelper.reset(); } @@ -2993,12 +2993,12 @@ const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const return *mxData->mpUILocaleDataWrapper; } -const LocaleDataWrapper& AllSettings::GetNeutroLocaleDataWrapper() const +const LocaleDataWrapper& AllSettings::GetNeutralLocaleDataWrapper() const { -if ( !mxData->mpNeutroLocaleDataWrapper ) - const_cast(this)->mxData->mpNeutroLocaleDataWrapper.reset( new LocaleDataWrapper( +if ( !mxData->mpNeutralLocaleDataWrapper ) + const_cast(this)->mxData->mpNeutralLocaleDataWrapper.reset( new LocaleDataWrapper( comphelper::getProcessComponentContext(), LanguageTag("en-US") ) ); -return *mxData->mpNeutroLocaleDataWrapper; +return *mxData->mpNeutralLocaleDataWrapper; } const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index c10e6a409855..f443abdd2ad7 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -631,7 +631,7 @@ void NumericFormatter::SetValueFromString(const OUString& rStr) sal_Int64 nValue; if (ImplNumericGetValue(rStr, nValue, GetDecimalDigits(), -Application::GetSettings().GetNeutroLocaleDataWrapper())) +Application::GetSettings().GetNeutralLocaleDataWrapper())) { SetValue(nValue); } @@ -1712,7 +1712,7 @@ boost::property_tree::ptree MetricField::DumpAsPropertyTree() aTree.put("min", GetMin()); aTree.put("max", GetMax()); aTree.put("unit", FieldUnitToString(GetUnit())); -OUString sValue = Application::GetSettings().GetNeutroLocaleDataWrapper(). +OUString sValue
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/settings.hxx|1 + svx/source/sidebar/possize/PosSizePropertyPanel.cxx |5 - vcl/source/app/settings.cxx | 10 ++ vcl/source/control/field.cxx|4 4 files changed, 19 insertions(+), 1 deletion(-) New commits: commit 863de3f7c4031f3d583debeebe0fdd8ef1ac3911 Author: Henry Castro AuthorDate: Thu Apr 16 22:24:23 2020 -0400 Commit: Henry Castro CommitDate: Sat May 9 14:24:24 2020 +0200 lok: fix wrong metric conversion of the metric input control The client side does not work well if the browser has different locale, and the input element conversion fails or change to a different value, so the value is converted to a neutral locale. Change-Id: I89f96844603a8552609d486590c7de752cb5a95c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92395 Reviewed-by: Henry Castro Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93069 Tested-by: Jenkins diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 6adda0d66fa2..fedb39ccaa09 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -707,6 +707,7 @@ public: static bool GetMathLayoutRTL(); // returns true if UI language requires right-to-left Math Layout const LocaleDataWrapper&GetLocaleDataWrapper() const; const LocaleDataWrapper&GetUILocaleDataWrapper() const; +const LocaleDataWrapper&GetNeutroLocaleDataWrapper() const; const vcl::I18nHelper& GetLocaleI18nHelper() const; const vcl::I18nHelper& GetUILocaleI18nHelper() const; diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 24737369d2db..38d49e88ec67 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -800,7 +801,9 @@ void PosSizePropertyPanel::GetControlState(const sal_uInt16 nSID, boost::propert if (pControl && !pControl->get_text().isEmpty()) { -rState.put(pControl->get_buildable_name().getStr(), pControl->get_text().toUtf8().getStr()); +OUString sValue = Application::GetSettings().GetNeutroLocaleDataWrapper(). +getNum(pControl->get_value(pControl->get_unit()), pControl->get_digits(), false, false); +rState.put(pControl->get_buildable_name().getStr(), sValue.toUtf8().getStr()); } } diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 8db54992b80f..9044867bae3d 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -238,6 +238,7 @@ struct ImplAllSettingsData LanguageTag maUILocale; std::unique_ptr mpLocaleDataWrapper; std::unique_ptr mpUILocaleDataWrapper; +std::unique_ptr mpNeutroLocaleDataWrapper; std::unique_ptrmpI18nHelper; std::unique_ptrmpUII18nHelper; SvtSysLocalemaSysLocale; @@ -2755,6 +2756,7 @@ ImplAllSettingsData::~ImplAllSettingsData() { mpLocaleDataWrapper.reset(); mpUILocaleDataWrapper.reset(); +mpNeutroLocaleDataWrapper.reset(); mpI18nHelper.reset(); mpUII18nHelper.reset(); } @@ -2991,6 +2993,14 @@ const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const return *mxData->mpUILocaleDataWrapper; } +const LocaleDataWrapper& AllSettings::GetNeutroLocaleDataWrapper() const +{ +if ( !mxData->mpNeutroLocaleDataWrapper ) + const_cast(this)->mxData->mpNeutroLocaleDataWrapper.reset( new LocaleDataWrapper( +comphelper::getProcessComponentContext(), LanguageTag("en_US") ) ); +return *mxData->mpNeutroLocaleDataWrapper; +} + const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const { if ( !mxData->mpI18nHelper ) { diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index dc4e98c440f0..e6a4e96598ed 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -1694,6 +1694,10 @@ boost::property_tree::ptree MetricField::DumpAsPropertyTree() aTree.put("min", GetMin()); aTree.put("max", GetMax()); aTree.put("unit", FieldUnitToString(GetUnit())); +OUString sValue = Application::GetSettings().GetNeutroLocaleDataWrapper(). +getNum(GetValue(), GetDecimalDigits(), false, false); +aTree.put("value", sValue.toUtf8().getStr()); + return aTree; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source vcl/unx
include/vcl/weld.hxx |2 + svx/source/tbxctrls/tbcontrl.cxx |4 +- vcl/source/app/salvtables.cxx| 66 ++- vcl/unx/gtk3/gtk3gtkinst.cxx | 32 +- 4 files changed, 71 insertions(+), 33 deletions(-) New commits: commit 4636a07f283753a4ddac279d4ef38385219ec423 Author: Caolán McNamara AuthorDate: Mon Dec 30 19:33:39 2019 + Commit: Caolán McNamara CommitDate: Tue Dec 31 12:06:42 2019 +0100 separate setting toggle and showing menu for ToolbarToggleMenu buttons Change-Id: I7989c5b85cbf4e7698c76e35a516bcc39da41897 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86038 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index e298a85f90c6..8c20ef58cda4 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1964,6 +1964,8 @@ public: virtual bool get_item_sensitive(const OString& rIdent) const = 0; virtual void set_item_active(const OString& rIdent, bool bActive) = 0; virtual bool get_item_active(const OString& rIdent) const = 0; +virtual void set_menu_item_active(const OString& rIdent, bool bActive) = 0; +virtual bool get_menu_item_active(const OString& rIdent) const = 0; virtual void set_item_menu(const OString& rIdent, weld::Menu* pMenu) = 0; virtual void set_item_popover(const OString& rIdent, weld::Widget* pPopover) = 0; virtual void set_item_visible(const OString& rIdent, bool bVisible) = 0; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 3ab6b7cc12e3..50eaa75212d1 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -4271,7 +4271,7 @@ bool MenuOrToolMenuButton::get_active() const { if (m_pMenuButton) return m_pMenuButton->get_active(); -return m_pToolbar->get_item_active(m_aIdent); +return m_pToolbar->get_menu_item_active(m_aIdent); } void MenuOrToolMenuButton::set_active(bool bActive) const @@ -4281,7 +4281,7 @@ void MenuOrToolMenuButton::set_active(bool bActive) const m_pMenuButton->set_active(bActive); return; } -m_pToolbar->set_item_active(m_aIdent, bActive); +m_pToolbar->set_menu_item_active(m_aIdent, bActive); } weld::Widget* MenuOrToolMenuButton::get_widget() const diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 33870d28111d..15630fe70503 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -952,6 +952,7 @@ private: DECL_LINK(ClickHdl, ToolBox*, void); DECL_LINK(DropdownClick, ToolBox*, void); + public: SalInstanceToolbar(ToolBox* pToolBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership) : SalInstanceWidget(pToolBox, pBuilder, bTakeOwnership) @@ -985,34 +986,57 @@ public: { sal_uInt16 nItemId = m_xToolBox->GetItemId(OUString::fromUtf8(rIdent)); m_xToolBox->CheckItem(nItemId, bActive); +} + +virtual bool get_item_active(const OString& rIdent) const override +{ +return m_xToolBox->IsItemChecked(m_xToolBox->GetItemId(OUString::fromUtf8(rIdent))); +} + +void set_menu_item_active(const OString& rIdent, bool bActive) override +{ +sal_uInt16 nItemId = m_xToolBox->GetItemId(OUString::fromUtf8(rIdent)); +assert (m_xToolBox->GetItemBits(nItemId) & ToolBoxItemBits::DROPDOWN); -if (m_xToolBox->GetItemBits(nItemId) & ToolBoxItemBits::DROPDOWN) +auto pFloat = m_aFloats[nItemId]; +if (pFloat) { -auto pFloat = m_aFloats[nItemId]; -if (pFloat) -{ -if (bActive) - vcl::Window::GetDockingManager()->StartPopupMode(m_xToolBox, pFloat, FloatWinPopupFlags::GrabFocus); -else -vcl::Window::GetDockingManager()->EndPopupMode(pFloat); -} -auto pPopup = m_aMenus[nItemId]; -if (pPopup) +if (bActive) +vcl::Window::GetDockingManager()->StartPopupMode(m_xToolBox, pFloat, FloatWinPopupFlags::GrabFocus); +else +vcl::Window::GetDockingManager()->EndPopupMode(pFloat); +} +auto pPopup = m_aMenus[nItemId]; +if (pPopup) +{ +if (bActive) { -if (bActive) -{ -tools::Rectangle aRect = m_xToolBox->GetItemRect(nItemId); -pPopup->Execute(m_xToolBox, aRect, PopupMenuFlags::ExecuteDown); -} -else -pPopup->EndExecute(); +tools::Rectangle aRect = m_xToolBox->GetItemRect(nItemId); +pPopup->Execute(m_xToolBox, aRect, PopupMenuFlags::ExecuteDown); } +else +pPopup->EndExecute(); } } -virtual bool
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/status.hxx |3 ++- svx/source/stbctrls/pszctrl.cxx |6 +- vcl/source/window/status.cxx| 25 ++--- 3 files changed, 25 insertions(+), 9 deletions(-) New commits: commit faa4ebb2cdc99505e9be7e1cbed83b19acfd3c4a Author: Noel Grandin AuthorDate: Tue Oct 8 12:33:41 2019 +0200 Commit: Noel Grandin CommitDate: Thu Oct 24 13:04:21 2019 +0200 tdf#127411 improve sizing of status items in the status bar Change-Id: I6ea3fbb893d0141010ee1abd1720d6cdad97b528 Reviewed-on: https://gerrit.libreoffice.org/80440 Tested-by: Xisco Faulí Reviewed-by: Noel Grandin diff --git a/include/vcl/status.hxx b/include/vcl/status.hxx index fe6ec34e41a4..79497a448014 100644 --- a/include/vcl/status.hxx +++ b/include/vcl/status.hxx @@ -149,7 +149,8 @@ public: longGetItemOffset( sal_uInt16 nItemId ) const; -voidSetItemText( sal_uInt16 nItemId, const OUString& rText ); +/// @param nCharsWidth, if not -1, overrides the normal width calculation +voidSetItemText( sal_uInt16 nItemId, const OUString& rText, int nCharsWidth = -1 ); const OUString& GetItemText( sal_uInt16 nItemId ) const; voidSetItemData( sal_uInt16 nItemId, void* pNewData ); diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx index ddb66bd5253a..084d251c91dd 100644 --- a/svx/source/stbctrls/pszctrl.cxx +++ b/svx/source/stbctrls/pszctrl.cxx @@ -462,22 +462,26 @@ void SvxPosSizeStatusBarControl::ImplUpdateItemText() // set only strings as text at the statusBar, so that the Help-Tips // can work with the text, when it is too long for the statusBar OUString aText; +int nCharsWidth = -1; if ( pImpl->bPos || pImpl->bSize ) { aText = GetMetricStr_Impl( pImpl->aPos.X()); aText += " / "; aText += GetMetricStr_Impl( pImpl->aPos.Y()); +// widest X/Y string looks like "-999,99" +nCharsWidth = 1 + 6 + 3 + 6; // icon + x + slash + y if ( pImpl->bSize ) { aText += " "; aText += GetMetricStr_Impl( pImpl->aSize.Width() ); aText += " x "; aText += GetMetricStr_Impl( pImpl->aSize.Height() ); +nCharsWidth += 1 + 1 + 4 + 3 + 4; // icon + space + w + x + h } } else if ( pImpl->bTable ) aText = pImpl->aStr; -GetStatusBar().SetItemText( GetId(), aText ); +GetStatusBar().SetItemText( GetId(), aText, nCharsWidth ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 03b9b41e62a2..92fb94d66587 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -1126,7 +1127,7 @@ long StatusBar::GetItemOffset( sal_uInt16 nItemId ) const return 0; } -void StatusBar::SetItemText( sal_uInt16 nItemId, const OUString& rText ) +void StatusBar::SetItemText( sal_uInt16 nItemId, const OUString& rText, int nCharsWidth ) { sal_uInt16 nPos = GetItemPos( nItemId ); @@ -1141,12 +1142,22 @@ void StatusBar::SetItemText( sal_uInt16 nItemId, const OUString& rText ) // adjust item width - see also DataChanged() long nFudge = GetTextHeight()/4; -std::unique_ptr pSalLayout = ImplLayout(pItem->maText,0,-1); -const SalLayoutGlyphs* pGlyphs = pSalLayout ? pSalLayout->GetGlyphs() : nullptr; -long nWidth = GetTextWidth( pItem->maText,0,-1,nullptr,pGlyphs ) + nFudge; - -// Store the calculated layout. -pItem->mxLayoutCache = std::move(pSalLayout); +long nWidth; +if (nCharsWidth != -1) +{ +std::unique_ptr pSalLayout = ImplLayout("0",0,-1); +const SalLayoutGlyphs* pGlyphs = pSalLayout ? pSalLayout->GetGlyphs() : nullptr; +nWidth = GetTextWidth("0",0,-1,nullptr,pGlyphs ); +nWidth = nWidth * nCharsWidth + nFudge; +} +else +{ +std::unique_ptr pSalLayout = ImplLayout(pItem->maText,0,-1); +const SalLayoutGlyphs* pGlyphs = pSalLayout ? pSalLayout->GetGlyphs() : nullptr; +nWidth = GetTextWidth( pItem->maText,0,-1,nullptr,pGlyphs ) + nFudge; +// Store the calculated layout. +pItem->mxLayoutCache = std::move(pSalLayout); +} if( (nWidth > pItem->mnWidth + STATUSBAR_OFFSET) || ((nWidth < pItem->mnWidth) && (mnDX - STATUSBAR_OFFSET) < mnItemsWidth )) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/bitmapex.hxx |1 + include/vcl/outdev.hxx |4 +++- svx/source/svdraw/svdoashp.cxx | 32 +--- vcl/source/outdev/bitmap.cxx | 24 4 files changed, 33 insertions(+), 28 deletions(-) New commits: commit 207c368f4bfdbef8fde8efbf75f4fdcf7e0917ba Author: Noel Grandin AuthorDate: Mon Jul 8 11:45:11 2019 +0200 Commit: Noel Grandin CommitDate: Mon Jul 8 14:30:22 2019 +0200 use BitmapEx in ImpCreateShadowObjectClone Change-Id: I7737c8b19dca787eab70b733d07a34a5e5f01c9c Reviewed-on: https://gerrit.libreoffice.org/75208 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index 478b9fdefea9..1067c0c45b52 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -468,6 +468,7 @@ public: private: friend class ImpGraphic; +friend class OutputDevice; friend bool VCL_DLLPUBLIC WriteDIBBitmapEx(const BitmapEx& rSource, SvStream& rOStm); friend void ReadRawDIB(); friend bool VCL_DLLPUBLIC ReadRawDIB(BitmapEx& rTarget, const unsigned char* pBuf, diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index b3159396f9a4..0b92e735914f 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1468,7 +1468,9 @@ public: const basegfx::B2DHomMatrix& rTransformation, const BitmapEx& rBitmapEx); - +voidDrawShadowBitmapEx( +const BitmapEx& rBitmapEx, +::Color aShadowColor); protected: virtual voidDrawDeviceBitmap( diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 45d8db33a2b3..603bedcf9924 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -354,35 +354,13 @@ static SdrObject* ImpCreateShadowObjectClone(const SdrObject& rOriginal, const S { GraphicObject aGraphicObject(rOriginalSet.Get(XATTR_FILLBITMAP).GetGraphicObject()); const BitmapEx aBitmapEx(aGraphicObject.GetGraphic().GetBitmapEx()); -Bitmap aBitmap(aBitmapEx.GetBitmap()); -if(!aBitmap.IsEmpty()) +if(!aBitmapEx.IsEmpty()) { -Bitmap::ScopedReadAccess pReadAccess(aBitmap); - -if(pReadAccess) -{ -ScopedVclPtr pVirDev(VclPtr::Create()); -pVirDev->SetOutputSizePixel(aBitmap.GetSizePixel()); - -for(long y(0); y < pReadAccess->Height(); y++) -{ -for(long x(0); x < pReadAccess->Width(); x++) -{ -const BitmapColor aColor = pReadAccess->GetColor(y, x); -sal_uInt16 nLuminance(static_cast(aColor.GetLuminance()) + 1); -const Color aDestColor( -static_cast((nLuminance * static_cast(aShadowColor.GetRed())) >> 8), -static_cast((nLuminance * static_cast(aShadowColor.GetGreen())) >> 8), -static_cast((nLuminance * static_cast(aShadowColor.GetBlue())) >> 8)); -pVirDev->DrawPixel(Point(x,y), aDestColor); -} -} - -pReadAccess.reset(); - - aGraphicObject.SetGraphic(Graphic(pVirDev->GetBitmapEx(Point(0,0), aBitmap.GetSizePixel(; -} +ScopedVclPtr pVirDev(VclPtr::Create()); +pVirDev->SetOutputSizePixel(aBitmapEx.GetSizePixel()); +pVirDev->DrawShadowBitmapEx(aBitmapEx, aShadowColor); + aGraphicObject.SetGraphic(Graphic(pVirDev->GetBitmapEx(Point(0,0), aBitmapEx.GetSizePixel(; } aTempSet.Put(XFillBitmapItem(aGraphicObject)); diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 5322a0a29cea..b33a5dfcefa6 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -1299,6 +1299,30 @@ void OutputDevice::DrawTransformedBitmapEx( } } +void OutputDevice::DrawShadowBitmapEx( +const BitmapEx& rBitmapEx, +::Color aShadowColor) +{ +Bitmap::ScopedReadAccess pReadAccess(const_cast(rBitmapEx.maBitmap)); + +if(!pReadAccess) +return; + +for(long y(0); y < pReadAccess->Height(); y++) +{ +for(long x(0); x < pReadAccess->Width(); x++) +{ +const BitmapColor aColor = pReadAccess->GetColor(y, x); +sal_uInt16 nLuminance(static_cast(aColor.GetLuminance()) + 1); +const Color aDestColor( +static_cast((nLuminance * static_cast(aShadowColor.GetRed())) >> 8), +static_cast((nLuminance *
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/bitmapex.hxx |8 include/vcl/dibtools.hxx |2 +- svx/source/svdraw/svdpdf.cxx |2 +- vcl/source/gdi/bitmapex.cxx |8 vcl/source/gdi/dibtools.cxx |4 ++-- 5 files changed, 20 insertions(+), 4 deletions(-) New commits: commit 7707cba0bd3f1d544ead634282f8d3415af0cd5e Author: Noel Grandin AuthorDate: Mon Jul 8 11:25:15 2019 +0200 Commit: Noel Grandin CommitDate: Mon Jul 8 12:58:51 2019 +0200 use BitmapEx in ImpSdrPdfImport::ImportImage Change-Id: I80e197ffcda4ebc5d50e611b7a4a5c3fd84fc839 Reviewed-on: https://gerrit.libreoffice.org/75201 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index 71da7cb45dc8..478b9fdefea9 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -47,6 +48,7 @@ public: explicitBitmapEx( const OUString& rIconName ); BitmapEx( const BitmapEx& rBitmapEx ); BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ); +BitmapEx( Size aSize, sal_uInt16 nBitCount ); explicitBitmapEx( const Bitmap& rBmp ); BitmapEx( const Bitmap& rBmp, const Bitmap& rMask ); BitmapEx( const Bitmap& rBmp, const AlphaMask& rAlphaMask ); @@ -467,6 +469,12 @@ public: private: friend class ImpGraphic; friend bool VCL_DLLPUBLIC WriteDIBBitmapEx(const BitmapEx& rSource, SvStream& rOStm); +friend void ReadRawDIB(); +friend bool VCL_DLLPUBLIC ReadRawDIB(BitmapEx& rTarget, const unsigned char* pBuf, +const ScanlineFormat nFormat, +const int nHeight, +const int nStride); + void loadFromIconTheme( const OUString& rIconName ); Bitmap maBitmap; diff --git a/include/vcl/dibtools.hxx b/include/vcl/dibtools.hxx index c5fa662ebb73..6064491f8ec3 100644 --- a/include/vcl/dibtools.hxx +++ b/include/vcl/dibtools.hxx @@ -55,7 +55,7 @@ bool VCL_DLLPUBLIC ReadDIBV5( SvStream& rIStm); bool VCL_DLLPUBLIC ReadRawDIB( -Bitmap& rTarget, +BitmapEx& rTarget, const unsigned char* pBuf, const ScanlineFormat nFormat, const int nHeight, diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 687c3e260341..552575442039 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -992,7 +992,7 @@ void ImpSdrPdfImport::ImportImage(FPDF_PAGEOBJECT pPageObject, int /*nPageObject const int nWidth = FPDFBitmap_GetWidth(bitmap.get()); const int nHeight = FPDFBitmap_GetHeight(bitmap.get()); const int nStride = FPDFBitmap_GetStride(bitmap.get()); -Bitmap aBitmap(Size(nWidth, nHeight), 24); +BitmapEx aBitmap(Size(nWidth, nHeight), 24); switch (format) { diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 3faaf3fd96e1..4bfbfeb5a2ff 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -85,6 +85,14 @@ BitmapEx::BitmapEx( const BitmapEx& rBitmapEx, Point aSrc, Size aSize ) CopyPixel( aDestRect, aSrcRect, ); } +BitmapEx::BitmapEx( Size aSize, sal_uInt16 nBitCount ) +: meTransparent(TransparentType::NONE) +, mbAlpha(false) +{ +maBitmap = Bitmap( aSize, nBitCount ); +SetSizePixel(aSize); +} + BitmapEx::BitmapEx( const OUString& rIconName ) : meTransparent(TransparentType::NONE) , mbAlpha(false) diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index c8f64318f0fd..965a403a0d7d 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -1839,13 +1839,13 @@ bool ReadDIBV5( } bool ReadRawDIB( -Bitmap& rTarget, +BitmapEx& rTarget, const unsigned char* pBuf, const ScanlineFormat nFormat, const int nHeight, const int nStride) { -BitmapScopedWriteAccess pWriteAccess(rTarget.AcquireWriteAccess(), rTarget); +BitmapScopedWriteAccess pWriteAccess(rTarget.maBitmap.AcquireWriteAccess(), rTarget.maBitmap); for (int nRow = 0; nRow < nHeight; ++nRow) { pWriteAccess->CopyScanline(nRow, pBuf + (nStride * nRow), nFormat, nStride); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/font.hxx| 11 +++ include/vcl/outdev.hxx |1 - svx/source/svdraw/svdotextdecomposition.cxx | 14 +- vcl/source/gdi/pdfwriter_impl.cxx |2 +- vcl/source/outdev/text.cxx |2 +- vcl/source/outdev/textline.cxx | 10 -- 6 files changed, 14 insertions(+), 26 deletions(-) New commits: commit 6d3843a415bb74a00a40f312b7771db27060cf0b Author: Jan-Marek Glogowski AuthorDate: Mon Oct 22 18:25:35 2018 + Commit: Jan-Marek Glogowski CommitDate: Tue Oct 23 00:18:55 2018 +0200 Implement IsUnderlineAbove in vcl::Font There was even a duplicate implementation... Change-Id: I192ac2ec8e5b8dd0e6b3ab9b9ddf0bf53df546ab Reviewed-on: https://gerrit.libreoffice.org/62199 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx index 2dc0a5b326cd..02dab4d8b51e 100644 --- a/include/vcl/font.hxx +++ b/include/vcl/font.hxx @@ -163,10 +163,21 @@ public: typedef o3tl::cow_wrapper< ImplFont > ImplType; +inline bool IsUnderlineAbove() const; + private: ImplType mpImplFont; }; +inline bool Font::IsUnderlineAbove() const +{ +if (!IsVertical()) +return false; +// the underline is right for Japanese only +return (LANGUAGE_JAPANESE == GetLanguage()) || + (LANGUAGE_JAPANESE == GetCJKContextLanguage()); +} + } #endif // _VCL_FONT_HXX diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index f661bb377636..c9f9d06db17c 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1201,7 +1201,6 @@ private: SAL_DLLPRIVATE void ImplDrawStrikeoutChar( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor ); SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth ); -SAL_DLLPRIVATE static bool ImplIsUnderlineAbove( const vcl::Font& ); static SAL_DLLPRIVATE long ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, long nWidth, const OUString& rStr, DrawTextFlags nStyle, const vcl::ITextLayout& _rLayout ); diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index b98ee9e053ba..e5e0ee273e11 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -90,7 +90,6 @@ namespace DECL_LINK(decomposeBlockBulletPrimitive, DrawBulletInfo*, void); DECL_LINK(decomposeStretchBulletPrimitive, DrawBulletInfo*, void); -static bool impIsUnderlineAbove(const vcl::Font& rFont); void impCreateTextPortionPrimitive(const DrawPortionInfo& rInfo); static drawinglayer::primitive2d::BasePrimitive2D* impCheckFieldPrimitive(drawinglayer::primitive2d::BasePrimitive2D* pPrimitive, const DrawPortionInfo& rInfo); void impFlushTextPortionPrimitivesToLinePrimitives(); @@ -152,17 +151,6 @@ namespace drawinglayer::primitive2d::Primitive2DContainer const & getPrimitive2DSequence(); }; -bool impTextBreakupHandler::impIsUnderlineAbove(const vcl::Font& rFont) -{ -if(!rFont.IsVertical()) -{ -return false; -} - -// the underline is right for Japanese only -return (LANGUAGE_JAPANESE == rFont.GetLanguage()) || (LANGUAGE_JAPANESE == rFont.GetCJKContextLanguage()); -} - void impTextBreakupHandler::impCreateTextPortionPrimitive(const DrawPortionInfo& rInfo) { if(rInfo.maText.isEmpty() || !rInfo.mnTextLen) @@ -284,7 +272,7 @@ namespace // check UnderlineAbove const bool bUnderlineAbove( -drawinglayer::primitive2d::TEXT_LINE_NONE != eFontLineStyle && impIsUnderlineAbove(rInfo.mrFont)); +drawinglayer::primitive2d::TEXT_LINE_NONE != eFontLineStyle && rInfo.mrFont.IsUnderlineAbove()); // prepare strikeout data const drawinglayer::primitive2d::TextStrikeout eTextStrikeout( diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 48475a52fba8..badc1af9a11c 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -6839,7 +6839,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool ) ) { -bool bUnderlineAbove = OutputDevice::ImplIsUnderlineAbove( m_aCurrentPDFState.m_aFont ); +bool bUnderlineAbove = m_aCurrentPDFState.m_aFont.IsUnderlineAbove(); if( m_aCurrentPDFState.m_aFont.IsWordLineMode() ) { Point aStartPt; diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index cd9ba5e628e3..3bc2ced9a3b5 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -300,7 +300,7 @@ void OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout,
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source vcl/unx
include/vcl/settings.hxx |3 +++ svx/source/unodraw/UnoGraphicExporter.cxx | 14 ++ vcl/source/app/settings.cxx | 19 +++ vcl/unx/generic/gdi/cairotextrender.cxx |5 - 4 files changed, 40 insertions(+), 1 deletion(-) New commits: commit e6538f5bdd876911ea30f84a6512c03908e620fd Author: Miklos Vajna AuthorDate: Fri Jul 27 17:40:31 2018 +0200 Commit: Miklos Vajna CommitDate: Fri Jul 27 20:52:17 2018 +0200 tdf#118966 vcl: add a flag to determine if AA of fonts is used from the system This is on by default (as there are loads of vcl users who expect font AA working even if the default is off and they don't enable it), but the svx UnoGraphicExporter disables it to make everyone happy. The reason in practice AA was on by default is that the gtk backend uses the system settings in GtkInstance::GetCairoFontOptions() (and not the AA setting from the UI), and lclGetSystemTextAntiAliasMode() does the same on Windows (at least in the direct write case). So now these defaults again have higher priority than leaving the vcl-level default unchanged. Change-Id: I81267c0b036211525ac02d3282fa89d75510f4a8 Reviewed-on: https://gerrit.libreoffice.org/58199 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index a004b23e8ebc..6eb7be25d438 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -409,6 +409,9 @@ public: voidSetUseSystemUIFonts( bool bUseSystemUIFonts ); boolGetUseSystemUIFonts() const; +void SetUseFontAAFromSystem(bool bUseFontAAFromSystem); +bool GetUseFontAAFromSystem() const; + voidSetUseFlatBorders( bool bUseFlatBorders ); boolGetUseFlatBorders() const; diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index e5a410b07f54..fc3fb3b22eb9 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -1031,12 +1031,26 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes { SvtOptionsDrawinglayer aOptions; bool bAntiAliasing = aOptions.IsAntiAliasing(); +AllSettings aAllSettings = Application::GetSettings(); +StyleSettings aStyleSettings = aAllSettings.GetStyleSettings(); +bool bUseFontAAFromSystem = aStyleSettings.GetUseFontAAFromSystem(); if (aSettings.meAntiAliasing != TRISTATE_INDET) +{ // This is safe to do globally as we own the solar mutex. aOptions.SetAntiAliasing(aSettings.meAntiAliasing == TRISTATE_TRUE); +// Opt in to have AA affect font rendering as well. +aStyleSettings.SetUseFontAAFromSystem(false); +aAllSettings.SetStyleSettings(aStyleSettings); +Application::SetSettings(aAllSettings); +} nStatus = GetGraphic( aSettings, aGraphic, bVectorType ) ? ERRCODE_NONE : ERRCODE_GRFILTER_FILTERERROR; if (aSettings.meAntiAliasing != TRISTATE_INDET) +{ aOptions.SetAntiAliasing(bAntiAliasing); +aStyleSettings.SetUseFontAAFromSystem(bUseFontAAFromSystem); +aAllSettings.SetStyleSettings(aStyleSettings); +Application::SetSettings(aAllSettings); +} } if( nStatus == ERRCODE_NONE ) diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 4354ff573bee..0dc2558ab36a 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -168,6 +168,11 @@ struct ImplStyleData StyleSettingsOptionsmnOptions; boolmbHighContrast; boolmbUseSystemUIFonts; +/** + * Disabling AA doesn't actually disable AA of fonts, instead it is taken + * from system settings. + */ +bool mbUseFontAAFromSystem; boolmbAutoMnemonic; TriStatemeUseImagesInMenus; boolmnUseFlatBorders; @@ -582,6 +587,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) : mnOptions(rData.mnOptions), mbHighContrast(rData.mbHighContrast), mbUseSystemUIFonts(rData.mbUseSystemUIFonts), +mbUseFontAAFromSystem(rData.mbUseFontAAFromSystem), mbAutoMnemonic(rData.mbAutoMnemonic), meUseImagesInMenus(rData.meUseImagesInMenus), mnUseFlatBorders(rData.mnUseFlatBorders), @@ -697,6 +703,7 @@ void ImplStyleData::SetStandardStyles() mnFloatTitleHeight = 13; mbHighContrast = false; mbUseSystemUIFonts = true; +mbUseFontAAFromSystem = true; mnUseFlatBorders= false; mnUseFlatMenus = false;
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/BitmapTools.hxx |2 svx/source/svdraw/svdfmtf.cxx | 83 -- vcl/source/bitmap/BitmapTools.cxx | 70 3 files changed, 74 insertions(+), 81 deletions(-) New commits: commit 14d49662d32fa2fcf2916682dbf1f974a8eecb08 Author: Noel GrandinDate: Wed Mar 14 17:13:42 2018 +0200 move some GDI import code from svx to vcl part of making ScopedWriteAccess an internal detail of vcl Change-Id: I916f2ca05c9d7c17b62c91e113df6d8454bb4351 Reviewed-on: https://gerrit.libreoffice.org/51283 Reviewed-by: Michael Meeks Tested-by: Jenkins diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx index d7525869320f..7dde62788a53 100644 --- a/include/vcl/BitmapTools.hxx +++ b/include/vcl/BitmapTools.hxx @@ -92,6 +92,8 @@ VCL_DLLPUBLIC BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap, ::basegfx::B2DRectangle const & rDestRect, ::basegfx::B2DHomMatrix const & rLocalTransform ); +VCL_DLLPUBLIC void DrawAlphaBitmapAndAlphaGradient(BitmapEx & rBitmapEx, bool bFixedTransparence, float fTransparence, AlphaMask & rNewMask); + }} // end vcl::bitmap #endif // INCLUDED_VCL_BITMAP_TOOLS_HXX diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 457095f6adc0..f3806362aba6 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -71,6 +71,7 @@ #include #include #include +#include using namespace com::sun::star; @@ -1557,87 +1558,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction const & rAct) } else { -// mix existing and new alpha mask -AlphaMask aOldMask; - -if(aBitmapEx.IsAlpha()) -{ -aOldMask = aBitmapEx.GetAlpha(); -} -else if(TransparentType::Bitmap == aBitmapEx.GetTransparentType()) -{ -aOldMask = aBitmapEx.GetMask(); -} -else if(TransparentType::Color == aBitmapEx.GetTransparentType()) -{ -aOldMask = aBitmapEx.GetBitmap().CreateMask(aBitmapEx.GetTransparentColor()); -} - -AlphaMask::ScopedWriteAccess pOld(aOldMask); - -if(pOld) -{ -const double fFactor(1.0 / 255.0); - -if(bFixedTransparence) -{ -const double fOpNew(1.0 - fTransparence); - -for(long y(0); y < pOld->Height(); y++) -{ -Scanline pScanline = pOld->GetScanline( y ); -for(long x(0); x < pOld->Width(); x++) -{ -const double fOpOld(1.0 - (pOld->GetIndexFromData(pScanline, x) * fFactor)); -const sal_uInt8 aCol(basegfx::fround((1.0 - (fOpOld * fOpNew)) * 255.0)); - -pOld->SetPixelOnData(pScanline, x, BitmapColor(aCol)); -} -} -} -else -{ -AlphaMask::ScopedReadAccess pNew(aNewMask); - -if(pNew) -{ -if(pOld->Width() == pNew->Width() && pOld->Height() == pNew->Height()) -{ -for(long y(0); y < pOld->Height(); y++) -{ -Scanline pScanline = pOld->GetScanline( y ); -for(long x(0); x < pOld->Width(); x++) -{ -const double fOpOld(1.0 - (pOld->GetIndexFromData(pScanline, x) * fFactor)); -const double fOpNew(1.0 - (pNew->GetIndexFromData(pScanline, x) * fFactor)); -const sal_uInt8 aCol(basegfx::fround((1.0 - (fOpOld * fOpNew)) * 255.0)); - -pOld->SetPixelOnData(pScanline, x, BitmapColor(aCol)); -} -} -} -else -{ -OSL_ENSURE(false, "Alpha masks have different sizes (!)"); -} - -pNew.reset(); -} -else -{ -OSL_ENSURE(false, "Got no access to new alpha mask (!)"); -
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/salnativewidgets.hxx |2 +- svx/source/xml/xmlgrhlp.cxx |4 ++-- vcl/source/control/scrbar.cxx|2 +- vcl/source/window/accmgr.cxx |2 +- 4 files changed, 5 insertions(+), 5 deletions(-) New commits: commit 0a01eacb14b3ccf8a874efcf805af0ffd63da44d Author: Andrea GelminiDate: Thu Feb 1 15:19:13 2018 +0100 Fix typos Change-Id: Id9d4f277ec684f4baaa9f16000da1b208d745e03 Reviewed-on: https://gerrit.libreoffice.org/49099 Reviewed-by: Michael Stahl Tested-by: Michael Stahl diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx index 46ffc48f799b..cdc19718f46f 100644 --- a/include/vcl/salnativewidgets.hxx +++ b/include/vcl/salnativewidgets.hxx @@ -157,7 +157,7 @@ enum class ControlPart So all places using HitTestNativeScrollbar on ControlPart::ThumbHorz, ControlPart::ThumbVert, ControlPart::TrackHorzLeft, ControlPart::TrackHorzRight, ControlPart::TrackVertUpper, ControlPart::TrackVertLower -do not use the control rectangle as region but the actuall part rectangle, making +do not use the control rectangle as region but the actual part rectangle, making only small deviations feasible. */ diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index 514732ac76c8..296bd3f9a57e 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -655,7 +655,7 @@ bool SvXMLGraphicHelper::ImplWriteGraphic( const OUString& rPictureStorageName, xProps->setPropertyValue( "MediaType", Any(aMimeType) ); } -// picture formats that actuall _do_ benefit from zip +// picture formats that actually _do_ benefit from zip // storage compression // .svm pics gets compressed via ZBITMAP old-style stream // option below @@ -1116,7 +1116,7 @@ OUString SAL_CALL SvXMLGraphicHelper::saveGraphic(css::uno::ReferencesetPropertyValue("MediaType", uno::Any(aMimeType)); } -// picture formats that actuall _do_ benefit from zip +// picture formats that actually _do_ benefit from zip // storage compression // .svm pics gets compressed via ZBITMAP old-style stream // option below diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 56a23f2c9cc2..313d53b0b199 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -40,7 +40,7 @@ So all places using HitTestNativeScrollbar on ControlPart::ThumbHorz, ControlPart::ThumbVert, ControlPart::TrackHorzLeft, ControlPart::TrackHorzRight, ControlPart::TrackVertUpper, ControlPart::TrackVertLower -do not use the control rectangle as region but the actuall part rectangle, making +do not use the control rectangle as region but the actual part rectangle, making only small deviations feasible. */ diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx index 7ea18d664d16..10e426b27f5c 100644 --- a/vcl/source/window/accmgr.cxx +++ b/vcl/source/window/accmgr.cxx @@ -139,7 +139,7 @@ bool ImplAccelManager::IsAccelKey( const vcl::KeyCode& rKeyCode ) // stop sequence (first call deactivate-handler) EndSequence(); -// set accelerator of the actuel item +// set accelerator of the actual item // and call the handler bool bDel = false; pAccel->maCurKeyCode= rKeyCode; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/window.hxx |2 +- svx/source/accessibility/AccessibleFrameSelector.cxx |2 +- vcl/source/control/edit.cxx |2 +- vcl/source/window/dlgctrl.cxx|8 4 files changed, 7 insertions(+), 7 deletions(-) New commits: commit b406664c0c3f9c8a383e47c7eb045657cd3fdd83 Author: Noel Grandin n...@peralex.com Date: Thu May 28 13:01:56 2015 +0200 GetFocusFlags::Cursor-GetFocusFlags::CURSOR to avoid name-clash with X11 headers Change-Id: I727c523f6d9bd7d4db28fe7427e053903626be00 diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 9f9f73d..0aa057d 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -362,7 +362,7 @@ enum class GetFocusFlags { NONE = 0x, Tab= 0x0001, -Cursor = 0x0002, +CURSOR = 0x0002, // avoid name-clash with X11 #define Mnemonic = 0x0004, F6 = 0x0008, Forward= 0x0010, diff --git a/svx/source/accessibility/AccessibleFrameSelector.cxx b/svx/source/accessibility/AccessibleFrameSelector.cxx index 2227951..1a22ae6 100644 --- a/svx/source/accessibility/AccessibleFrameSelector.cxx +++ b/svx/source/accessibility/AccessibleFrameSelector.cxx @@ -468,7 +468,7 @@ voidAccFrameSelector::NotifyFocusListeners(bool bGetFocus) GetFocusFlags nFocusFlags = mpFrameSel-GetGetFocusFlags(); if(nFocusFlags GetFocusFlags::Tab) aEvent.FocusFlags |= AwtFocusChangeReason::TAB; -if(nFocusFlags GetFocusFlags::Cursor) +if(nFocusFlags GetFocusFlags::CURSOR) aEvent.FocusFlags |= AwtFocusChangeReason::CURSOR; if(nFocusFlags GetFocusFlags::Mnemonic) aEvent.FocusFlags |= AwtFocusChangeReason::MNEMONIC; diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 05eb605..51982fc 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1901,7 +1901,7 @@ void Edit::GetFocus() SelectionOptions nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions(); if ( !( GetStyle() (WB_NOHIDESELECTION|WB_READONLY) ) - ( GetGetFocusFlags() (GetFocusFlags::Init|GetFocusFlags::Tab|GetFocusFlags::Cursor|GetFocusFlags::Mnemonic) ) ) + ( GetGetFocusFlags() (GetFocusFlags::Init|GetFocusFlags::Tab|GetFocusFlags::CURSOR|GetFocusFlags::Mnemonic) ) ) { if ( nSelOptions SelectionOptions::ShowFirst ) { diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 5cd0706..3039e78 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -543,7 +543,7 @@ namespace if (isSuitableDestination(pWindow)) { -pWindow-ImplControlFocus( GetFocusFlags::Cursor | GetFocusFlags::Forward ); +pWindow-ImplControlFocus( GetFocusFlags::CURSOR | GetFocusFlags::Forward ); return true; } } @@ -554,7 +554,7 @@ namespace if (isSuitableDestination(pWindow)) { -pWindow-ImplControlFocus( GetFocusFlags::Cursor | GetFocusFlags::Forward ); +pWindow-ImplControlFocus( GetFocusFlags::CURSOR | GetFocusFlags::Forward ); return true; } } @@ -868,7 +868,7 @@ bool Window::ImplDlgCtrl( const KeyEvent rKEvt, bool bKeyInput ) if (isSuitableDestination(pWindow)) { if ( pWindow != pSWindow ) -pWindow-ImplControlFocus( GetFocusFlags::Cursor | GetFocusFlags::Backward ); +pWindow-ImplControlFocus( GetFocusFlags::CURSOR | GetFocusFlags::Backward ); return true; } @@ -898,7 +898,7 @@ bool Window::ImplDlgCtrl( const KeyEvent rKEvt, bool bKeyInput ) if (isSuitableDestination(pWindow)) { -pWindow-ImplControlFocus( GetFocusFlags::Cursor | GetFocusFlags::Backward ); +pWindow-ImplControlFocus( GetFocusFlags::CURSOR | GetFocusFlags::Backward ); return true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/vcl svx/source vcl/source
include/vcl/window.hxx |4 +++- svx/source/sidebar/PanelLayout.cxx |1 + vcl/source/window/dockwin.cxx |4 +--- vcl/source/window/syswin.cxx |4 +--- vcl/source/window/window2.cxx | 13 ++--- 5 files changed, 16 insertions(+), 10 deletions(-) New commits: commit b39a6449d5debc7cdf55c3f967b441f3de4d50f3 Author: Caolán McNamara caol...@redhat.com Date: Thu Apr 9 14:43:09 2015 +0100 Resolves: tdf#90384 queue_resize needs to Invalidate the optimal cache size but the PanelLayout didn't Change-Id: I38a8975f1488fa2a2ffe91b66745e1a1c6c48a28 diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 5b681f2..bc20cbe 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1192,9 +1192,11 @@ protected: * the preferred widget size. * * Use get_preferred_size to retrieve this value - * mediated via height and width requests + * cached and mediated via height and width requests */ virtual Size GetOptimalSize() const; +/// clear OptimalSize cache +void InvalidateSizeCache(); private: SAL_DLLPRIVATE bool ImplIsAccessibleCandidate() const; diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx index 21fcc2d..829fd3b 100644 --- a/svx/source/sidebar/PanelLayout.cxx +++ b/svx/source/sidebar/PanelLayout.cxx @@ -51,6 +51,7 @@ void PanelLayout::queue_resize(StateChangedType /*eReason*/) return; if (!isLayoutEnabled(this)) return; +InvalidateSizeCache(); m_aPanelLayoutIdle.Start(); } diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 5a0df3c..94e32d3 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -1114,9 +1114,7 @@ void DockingWindow::queue_resize(StateChangedType /*eReason*/) return; if (!isLayoutEnabled()) return; -WindowImpl *pWindowImpl = mpWindowImpl-mpBorderWindow ? mpWindowImpl-mpBorderWindow-mpWindowImpl : mpWindowImpl; -pWindowImpl-mnOptimalWidthCache = -1; -pWindowImpl-mnOptimalHeightCache = -1; +InvalidateSizeCache(); maLayoutIdle.Start(); } diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 1455c3b..c5d0522 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -997,9 +997,7 @@ void SystemWindow::queue_resize(StateChangedType /*eReason*/) return; if (!isLayoutEnabled()) return; -WindowImpl *pWindowImpl = mpWindowImpl-mpBorderWindow ? mpWindowImpl-mpBorderWindow-mpWindowImpl : mpWindowImpl; -pWindowImpl-mnOptimalWidthCache = -1; -pWindowImpl-mnOptimalHeightCache = -1; +InvalidateSizeCache(); maLayoutIdle.Start(); } diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 691b92c..e667287 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1427,16 +1427,23 @@ namespace } } +void Window::InvalidateSizeCache() +{ +WindowImpl *pWindowImpl = mpWindowImpl-mpBorderWindow ? mpWindowImpl-mpBorderWindow-mpWindowImpl : mpWindowImpl; +pWindowImpl-mnOptimalWidthCache = -1; +pWindowImpl-mnOptimalHeightCache = -1; +} + void Window::queue_resize(StateChangedType eReason) { bool bSomeoneCares = queue_ungrouped_resize(this); -WindowImpl *pWindowImpl = mpWindowImpl-mpBorderWindow ? mpWindowImpl-mpBorderWindow-mpWindowImpl : mpWindowImpl; if (eReason != StateChangedType::VISIBLE) { -pWindowImpl-mnOptimalWidthCache = -1; -pWindowImpl-mnOptimalHeightCache = -1; +InvalidateSizeCache(); } + +WindowImpl *pWindowImpl = mpWindowImpl-mpBorderWindow ? mpWindowImpl-mpBorderWindow-mpWindowImpl : mpWindowImpl; if (pWindowImpl-m_xSizeGroup pWindowImpl-m_xSizeGroup-get_mode() != VCL_SIZE_GROUP_NONE) { std::setvcl::Window* rWindows = pWindowImpl-m_xSizeGroup-get_widgets(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits