[Libreoffice-commits] core.git: cui/source include/vcl sc/source sw/source vcl/source
cui/source/dialogs/pastedlg.cxx |4 ++-- include/vcl/transfer.hxx |4 ++-- sc/source/ui/view/cellsh.cxx |2 +- sw/source/uibase/dochdl/swdtflvr.cxx |2 +- vcl/source/treelist/transfer.cxx |4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) New commits: commit 2a9e22157b61a67591057b3926e290236250efd0 Author: Mike Kaganski AuthorDate: Tue Oct 10 12:47:41 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Oct 10 13:07:44 2023 +0200 Make some methods const, and avoid some const_casts Change-Id: I4964abd34836438e3d24ee7c3c3b324f356477b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157746 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx index d86d277cc34f..423637e9d9e9 100644 --- a/cui/source/dialogs/pastedlg.cxx +++ b/cui/source/dialogs/pastedlg.cxx @@ -85,7 +85,7 @@ void SvPasteObjectDialog::PreGetFormat( const TransferableDataHelper &rHelper ) TransferableObjectDescriptor aDesc; if (rHelper.HasFormat(SotClipboardFormatId::OBJECTDESCRIPTOR)) { - (void)const_cast(rHelper).GetTransferableObjectDescriptor( +(void)rHelper.GetTransferableObjectDescriptor( SotClipboardFormatId::OBJECTDESCRIPTOR, aDesc); } const DataFlavorExVector* pFormats = &rHelper.GetDataFlavorExVector(); @@ -204,7 +204,7 @@ SotClipboardFormatId SvPasteObjectDialog::GetFormat( const TransferableDataHelpe TransferableObjectDescriptor aDesc; if (rHelper.HasFormat(SotClipboardFormatId::OBJECTDESCRIPTOR)) { - (void)const_cast(rHelper).GetTransferableObjectDescriptor( +(void)rHelper.GetTransferableObjectDescriptor( SotClipboardFormatId::OBJECTDESCRIPTOR, aDesc); } const DataFlavorExVector* pFormats = &rHelper.GetDataFlavorExVector(); diff --git a/include/vcl/transfer.hxx b/include/vcl/transfer.hxx index e460e9f9c155..e39fe13b039d 100644 --- a/include/vcl/transfer.hxx +++ b/include/vcl/transfer.hxx @@ -337,8 +337,8 @@ public: boolGetImageMap( SotClipboardFormatId nFormat, ImageMap& rIMap ) const; boolGetImageMap( const css::datatransfer::DataFlavor& rFlavor, ImageMap& rImap ) const; -boolGetTransferableObjectDescriptor( SotClipboardFormatId nFormat, TransferableObjectDescriptor& rDesc ); -boolGetTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc ); +boolGetTransferableObjectDescriptor( SotClipboardFormatId nFormat, TransferableObjectDescriptor& rDesc ) const; +boolGetTransferableObjectDescriptor( TransferableObjectDescriptor& rDesc ) const; boolGetINetBookmark( SotClipboardFormatId nFormat, INetBookmark& rBmk ) const; boolGetINetBookmark( const css::datatransfer::DataFlavor& rFlavor, INetBookmark& rBmk ) const; diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index ec5914a2224b..34c87d0e61c6 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -445,7 +445,7 @@ static bool lcl_TestFormat( SvxClipboardFormatItem& rFormats, const Transferable if ( nFormatId == SotClipboardFormatId::EMBED_SOURCE ) { TransferableObjectDescriptor aDesc; -if ( const_cast(rDataHelper).GetTransferableObjectDescriptor( +if ( rDataHelper.GetTransferableObjectDescriptor( SotClipboardFormatId::OBJECTDESCRIPTOR, aDesc ) ) aStrVal = aDesc.maTypeName; } diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 918410957579..fc5f9f73a0a5 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -3550,7 +3550,7 @@ void SwTransferable::FillClipFormatItem( const SwWrtShell& rSh, TransferableObjectDescriptor aDesc; if (rData.HasFormat(SotClipboardFormatId::OBJECTDESCRIPTOR)) { - (void)const_cast(rData).GetTransferableObjectDescriptor( +(void)rData.GetTransferableObjectDescriptor( SotClipboardFormatId::OBJECTDESCRIPTOR, aDesc); } diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index bb13861b9815..812b9609b07f 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -1774,14 +1774,14 @@ bool TransferableDataHelper::GetImageMap( const css::datatransfer::DataFlavor& r } -bool TransferableDataHelper::GetTransferableObjectDescriptor( SotClipboardFormatId nFormat, TransferableObjectDescriptor& rDesc ) +bool TransferableDataHelper::GetTransferableObjectDescriptor( SotClipboardFormatId nFormat, TransferableObjectDes
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source vcl/workben
cui/source/dialogs/cuigrfflt.cxx | 20 ++-- include/vcl/BitmapEmbossGreyFilter.hxx | 13 - vcl/source/bitmap/BitmapEmbossGreyFilter.cxx |4 ++-- vcl/workben/vcldemo.cxx |2 +- 4 files changed, 21 insertions(+), 18 deletions(-) New commits: commit 140dc375adfffa59dff2652eb8b9625c23d81c8b Author: Mike Kaganski AuthorDate: Tue Oct 3 15:09:23 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Oct 3 17:03:34 2023 +0200 Use Degree100 Change-Id: I133dbe40d57eda77b64f3e38631da30f296489f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157517 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 48373e7f1968..c29bc4947e00 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -431,21 +431,21 @@ GraphicFilterEmboss::~GraphicFilterEmboss() Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic, double, double ) { Graphic aRet; -sal_uInt16 nAzim, nElev; +Degree100 nAzim, nElev; switch (maCtlLight.GetActualRP()) { default: OSL_FAIL("svx::GraphicFilterEmboss::GetFilteredGraphic(), unknown Reference Point!" ); [[fallthrough]]; -case RectPoint::LT: nAzim = 4500;nElev = 4500; break; -case RectPoint::MT: nAzim = 9000;nElev = 4500; break; -case RectPoint::RT: nAzim = 13500; nElev = 4500; break; -case RectPoint::LM: nAzim = 0; nElev = 4500; break; -case RectPoint::MM: nAzim = 0; nElev = 9000; break; -case RectPoint::RM: nAzim = 18000; nElev = 4500; break; -case RectPoint::LB: nAzim = 31500; nElev = 4500; break; -case RectPoint::MB: nAzim = 27000; nElev = 4500; break; -case RectPoint::RB: nAzim = 22500; nElev = 4500; break; +case RectPoint::LT: nAzim = 4500_deg100;nElev = 4500_deg100; break; +case RectPoint::MT: nAzim = 9000_deg100;nElev = 4500_deg100; break; +case RectPoint::RT: nAzim = 13500_deg100; nElev = 4500_deg100; break; +case RectPoint::LM: nAzim = 0_deg100; nElev = 4500_deg100; break; +case RectPoint::MM: nAzim = 0_deg100; nElev = 9000_deg100; break; +case RectPoint::RM: nAzim = 18000_deg100; nElev = 4500_deg100; break; +case RectPoint::LB: nAzim = 31500_deg100; nElev = 4500_deg100; break; +case RectPoint::MB: nAzim = 27000_deg100; nElev = 4500_deg100; break; +case RectPoint::RB: nAzim = 22500_deg100; nElev = 4500_deg100; break; } if( rGraphic.IsAnimated() ) diff --git a/include/vcl/BitmapEmbossGreyFilter.hxx b/include/vcl/BitmapEmbossGreyFilter.hxx index 2f1d309e0e59..34d9b5bb8c10 100644 --- a/include/vcl/BitmapEmbossGreyFilter.hxx +++ b/include/vcl/BitmapEmbossGreyFilter.hxx @@ -11,6 +11,9 @@ #ifndef INCLUDED_VCL_BITMAPEMBOSSGREYFILTER_HXX #define INCLUDED_VCL_BITMAPEMBOSSGREYFILTER_HXX +#include + +#include #include class BitmapEx; @@ -18,17 +21,17 @@ class BitmapEx; class VCL_DLLPUBLIC BitmapEmbossGreyFilter final : public BitmapFilter { public: -BitmapEmbossGreyFilter(sal_uInt16 nAzimuthAngle100, sal_uInt16 nElevationAngle100) -: mnAzimuthAngle100(nAzimuthAngle100) -, mnElevationAngle100(nElevationAngle100) +BitmapEmbossGreyFilter(Degree100 nAzimuthAngle, Degree100 nElevationAngle) +: mnAzimuthAngle(nAzimuthAngle) +, mnElevationAngle(nElevationAngle) { } virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override; private: -sal_uInt16 mnAzimuthAngle100; -sal_uInt16 mnElevationAngle100; +Degree100 mnAzimuthAngle; +Degree100 mnElevationAngle; }; #endif diff --git a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx index 06406152d6d6..405a9056b954 100644 --- a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx +++ b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx @@ -39,8 +39,8 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& rBitmapEx) const BitmapColor aGrey(sal_uInt8(0)); const sal_Int32 nWidth = pWriteAcc->Width(); const sal_Int32 nHeight = pWriteAcc->Height(); -const double fAzim = basegfx::deg2rad<100>(mnAzimuthAngle100); -const double fElev = basegfx::deg2rad<100>(mnElevationAngle100); +const double fAzim = toRadians(mnAzimuthAngle); +const double fElev = toRadians(mnElevationAngle); std::vector pHMap(nWidth + 2); std::vector pVMap(nHeight + 2); const double nLx = cos(fAzim) * cos(fElev) * 255.0; diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index 5b9b2b0289e1..346de0b52a09 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -149,7 +149,7 @@ public: maIntroBW = maIntro.GetBitmap(); BitmapEx aTmpBmpEx(maIntroBW); -BitmapFilter:
[Libreoffice-commits] core.git: cui/source include/vcl vcl/inc vcl/source
cui/source/dialogs/FontFeaturesDialog.cxx | 19 +-- include/vcl/font/Feature.hxx | 10 + vcl/inc/font/OpenTypeFeatureDefinitionList.hxx|6 +-- vcl/source/font/FeatureCollector.cxx |2 - vcl/source/font/OpenTypeFeatureDefinitionList.cxx | 38 -- 5 files changed, 30 insertions(+), 45 deletions(-) New commits: commit b6e338fe746028f82c973987eaf04280715110e4 Author: Khaled Hosny AuthorDate: Sat Dec 3 16:07:24 2022 +0200 Commit: خالد حسني CommitDate: Sun Dec 4 08:20:35 2022 + Add and use Feature::isCharacterVariant/isStylisticSet Change-Id: Ifd772da1f4b81aa08440025a5c960fb226281194 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143613 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index e4154e640ab5..f618d0a59ef3 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -87,21 +87,6 @@ void FontFeaturesDialog::initialize() updateFontPreview(); } -namespace -{ -bool isCharacterVariantCode(sal_uInt32 nFeatureCode) -{ -return ((sal_uInt32(nFeatureCode) >> 24) & 0xFF) == 'c' - && ((sal_uInt32(nFeatureCode) >> 16) & 0xFF) == 'v'; -} - -bool isStylisticSetCode(sal_uInt32 nFeatureCode) -{ -return ((sal_uInt32(nFeatureCode) >> 24) & 0xFF) == 's' - && ((sal_uInt32(nFeatureCode) >> 16) & 0xFF) == 's'; -} -} - int FontFeaturesDialog::fillGrid(std::vector const& rFontFeatures) { int nRowHeight(0); @@ -120,13 +105,13 @@ int FontFeaturesDialog::fillGrid(std::vector const& rFontFea if (!aDefinition) aDefinition = { nFontFeatureCode, "" }; -if (isStylisticSetCode(nFontFeatureCode)) +if (rFontFeature.isStylisticSet()) { n = j++; m_xStylisticSetsBox->set_visible(true); m_aFeatureItems.emplace_back(m_xStylisticSetsGrid.get()); } -else if (isCharacterVariantCode(nFontFeatureCode)) +else if (rFontFeature.isCharacterVariant()) { n = k++; m_xCharacterVariantsBox->set_visible(true); diff --git a/include/vcl/font/Feature.hxx b/include/vcl/font/Feature.hxx index acb70bfe6980..c5bd497532e8 100644 --- a/include/vcl/font/Feature.hxx +++ b/include/vcl/font/Feature.hxx @@ -90,6 +90,16 @@ struct Feature Feature(); Feature(uint32_t const nCode, FeatureType eType); +bool isCharacterVariant() const +{ +return ((m_nCode >> 24) & 0xFF) == 'c' && ((m_nCode >> 16) & 0xFF) == 'v'; +} + +bool isStylisticSet() const +{ +return ((m_nCode >> 24) & 0xFF) == 's' && ((m_nCode >> 16) & 0xFF) == 's'; +} + uint32_t m_nCode; FeatureType m_eType; FeatureDefinition m_aDefinition; diff --git a/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx b/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx index 52dbcfb5b9f0..c8fb6f7a449d 100644 --- a/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx +++ b/vcl/inc/font/OpenTypeFeatureDefinitionList.hxx @@ -25,12 +25,12 @@ private: void init(); -static bool isSpecialFeatureCode(sal_uInt32 nFeatureCode); -static FeatureDefinition handleSpecialFeatureCode(sal_uInt32 nFeatureCode); +static bool isSpecialFeature(vcl::font::Feature& rFeature); +static FeatureDefinition handleSpecialFeature(vcl::font::Feature& rFeature); public: OpenTypeFeatureDefinitionListPrivate(); -FeatureDefinition getDefinition(sal_uInt32 nFeatureCode); +FeatureDefinition getDefinition(vcl::font::Feature& rFeature); bool isRequired(sal_uInt32 nFeatureCode); }; diff --git a/vcl/source/font/FeatureCollector.cxx b/vcl/source/font/FeatureCollector.cxx index a97988ca46ce..fd175eade022 100644 --- a/vcl/source/font/FeatureCollector.cxx +++ b/vcl/source/font/FeatureCollector.cxx @@ -102,7 +102,7 @@ void FeatureCollector::collectForTable(hb_tag_t aTableTag) vcl::font::Feature& rFeature = m_rFontFeatures.back(); rFeature.m_nCode = aFeatureTag; -FeatureDefinition aDefinition = OpenTypeFeatureDefinitionList().getDefinition(aFeatureTag); +FeatureDefinition aDefinition = OpenTypeFeatureDefinitionList().getDefinition(rFeature); std::vector aParameters{ { 0, VclResId(STR_FONT_FEATURE_PARAM_NONE) } }; diff --git a/vcl/source/font/OpenTypeFeatureDefinitionList.cxx b/vcl/source/font/OpenTypeFeatureDefinitionList.cxx index f49837ccec43..4cc370cec3c7 100644 --- a/vcl/source/font/OpenTypeFeatureDefinitionList.cxx +++ b/vcl/source/font/OpenTypeFeatureDefinitionList.cxx @@ -127,20 +127,9 @@ void OpenTypeFeatureDefinitionListPrivate::init() namespace { -bool isCharacterVariantCode(sal_uInt32 nFeatureCode) -{ -return ((sal_uInt32(nFeatureCode) >> 24) & 0xFF) == 'c' - && ((sal_uInt32(nFeatureCode) >> 16) & 0xFF) == 'v'; -}
[Libreoffice-commits] core.git: cui/source include/vcl vcl/inc vcl/qa vcl/source vcl/workben
cui/source/dialogs/FontFeaturesDialog.cxx |4 +- include/vcl/font/Feature.hxx | 11 +-- vcl/inc/font/FeatureCollector.hxx |4 -- vcl/qa/cppunit/FontFeatureTest.cxx| 19 +++- vcl/source/font/Feature.cxx |6 +-- vcl/source/font/FeatureCollector.cxx | 47 -- vcl/workben/listfonts.cxx |9 + 7 files changed, 22 insertions(+), 78 deletions(-) New commits: commit 7581fcde3c6a8d098a37b2c89c74e54696d4c346 Author: Khaled Hosny AuthorDate: Tue Aug 23 22:35:10 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Thu Aug 25 13:02:14 2022 +0200 FeatureCollector: Simplify We are not using the script or language information for anything, so we can use HarfBuzz API to query the GSUB/GPOS tables directly. Change-Id: Ie68c51a1662494ba33ec192edb78afa0d8added4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138745 Tested-by: خالد حسني Reviewed-by: Tomaž Vajngerl diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index 53ca5f12f3c1..a23c0083c1b3 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -58,7 +58,7 @@ void FontFeaturesDialog::initialize() for (vcl::font::Feature const& rFontFeature : rFontFeatures) { -sal_uInt32 nFontFeatureCode = rFontFeature.m_aID.m_aFeatureCode; +sal_uInt32 nFontFeatureCode = rFontFeature.m_nCode; if (!aDoneFeatures.insert(nFontFeatureCode).second) continue; rFilteredFontFeatures.push_back(rFontFeature); @@ -90,7 +90,7 @@ int FontFeaturesDialog::fillGrid(std::vector const& rFontFea sal_Int32 i = 0; for (vcl::font::Feature const& rFontFeature : rFontFeatures) { -sal_uInt32 nFontFeatureCode = rFontFeature.m_aID.m_aFeatureCode; +sal_uInt32 nFontFeatureCode = rFontFeature.m_nCode; vcl::font::FeatureDefinition aDefinition; if (rFontFeature.m_aDefinition) diff --git a/include/vcl/font/Feature.hxx b/include/vcl/font/Feature.hxx index addc4836e6ee..acb70bfe6980 100644 --- a/include/vcl/font/Feature.hxx +++ b/include/vcl/font/Feature.hxx @@ -85,19 +85,12 @@ public: operator bool() const; }; -struct VCL_DLLPUBLIC FeatureID -{ -uint32_t m_aFeatureCode; -uint32_t m_aScriptCode; -uint32_t m_aLanguageCode; -}; - struct Feature { Feature(); -Feature(FeatureID const& rID, FeatureType eType); +Feature(uint32_t const nCode, FeatureType eType); -FeatureID m_aID; +uint32_t m_nCode; FeatureType m_eType; FeatureDefinition m_aDefinition; }; diff --git a/vcl/inc/font/FeatureCollector.hxx b/vcl/inc/font/FeatureCollector.hxx index 9148048f1601..976a89fc8d86 100644 --- a/vcl/inc/font/FeatureCollector.hxx +++ b/vcl/inc/font/FeatureCollector.hxx @@ -34,10 +34,6 @@ public: } private: -void collectForLanguage(hb_tag_t aTableTag, sal_uInt32 nScript, hb_tag_t aScriptTag, -sal_uInt32 nLanguage, hb_tag_t aLanguageTag); - -void collectForScript(hb_tag_t aTableTag, sal_uInt32 nScript, hb_tag_t aScriptTag); void collectForTable(hb_tag_t aTableTag); bool collectGraphite(); diff --git a/vcl/qa/cppunit/FontFeatureTest.cxx b/vcl/qa/cppunit/FontFeatureTest.cxx index 0e9ada19cdd4..91bcda29b74f 100644 --- a/vcl/qa/cppunit/FontFeatureTest.cxx +++ b/vcl/qa/cppunit/FontFeatureTest.cxx @@ -54,20 +54,13 @@ void FontFeatureTest::testGetFontFeatures() std::vector rFontFeatures; CPPUNIT_ASSERT(aVDev->GetFontFeatures(rFontFeatures)); -// We're interested only in defaults here -std::vector rDefaultFontFeatures; OUString aFeaturesString; for (vcl::font::Feature const& rFeature : rFontFeatures) { -if (rFeature.m_aID.m_aScriptCode == vcl::font::featureCode("DFLT") -&& rFeature.m_aID.m_aLanguageCode == vcl::font::featureCode("dflt")) -{ -rDefaultFontFeatures.push_back(rFeature); -aFeaturesString += vcl::font::featureCodeAsString(rFeature.m_aID.m_aFeatureCode) + " "; -} +aFeaturesString += vcl::font::featureCodeAsString(rFeature.m_nCode) + " "; } -CPPUNIT_ASSERT_EQUAL(size_t(53), rDefaultFontFeatures.size()); +CPPUNIT_ASSERT_EQUAL(size_t(53), rFontFeatures.size()); CPPUNIT_ASSERT_EQUAL(OUString("c2sc case dlig fina frac hlig liga lnum " "locl onum pnum sa01 sa02 sa03 sa04 sa05 " @@ -80,8 +73,8 @@ void FontFeatureTest::testGetFontFeatures() // Check C2SC feature { -vcl::font::Feature& rFeature = rDefaultFontFeatures[0]; -CPPUNIT_ASSERT_EQUAL(vcl::font::featureCode("c2sc"), rFeature.m_aID.m_aFeatureCode); +vcl::font::Feature& rFeature = rFontFeatures[0]; +CPPUNIT_ASSERT_EQUAL(vcl::font::featureCode("c2sc"), rFeature.m_nCode); vcl::font::Featu
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
cui/source/dialogs/FontFeaturesDialog.cxx | 11 +++ cui/source/inc/FontFeaturesDialog.hxx |4 ++-- include/vcl/font/Feature.hxx |6 +++--- include/vcl/font/FeatureParser.hxx|2 +- vcl/source/font/Feature.cxx | 10 +- vcl/source/font/FeatureCollector.cxx |2 +- vcl/source/font/FeatureParser.cxx |9 +++-- 7 files changed, 22 insertions(+), 22 deletions(-) New commits: commit 783f166793915a1c5a008de7142f773ad3898683 Author: Khaled Hosny AuthorDate: Tue Aug 23 14:22:23 2022 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Aug 23 16:59:56 2022 +0200 tdf#127423: Allow disabling default features in Font Features dialog In OpenType fonts we have no way if detecting what features are on by default and what not (short of hard-coding this, since HarfBuzz has no API of giving us this information, and it is also not a fixed set per-font, depends also on the text being shaped). The dialog currently does not differentiate between a disabled feature and unset feature. To make this distinction, feature value is now signed and negative value means the feature is unset (i.e. the default is used), and the checkbox is now a try state one to reflect this. Change-Id: Iba5d13f02610e7b761677acc19872788c72afde1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138729 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index 0d5d512bf053..53ca5f12f3c1 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -100,7 +100,7 @@ int FontFeaturesDialog::fillGrid(std::vector const& rFontFea m_aFeatureItems.emplace_back(m_xContentGrid.get()); -uint32_t nValue = 0; +int32_t nValue = 0; if (aExistingFeatures.find(nFontFeatureCode) != aExistingFeatures.end()) nValue = aExistingFeatures.at(nFontFeatureCode); else @@ -133,7 +133,10 @@ int FontFeaturesDialog::fillGrid(std::vector const& rFontFea } else { -aCurrentItem.m_xCheck->set_active(nValue > 0); +if (nValue < 0) +aCurrentItem.m_xCheck->set_state(TRISTATE_INDET); +else +aCurrentItem.m_xCheck->set_state(nValue > 0 ? TRISTATE_TRUE : TRISTATE_FALSE); aCurrentItem.m_xCheck->set_label(aDefinition.getDescription()); aCurrentItem.m_xCheck->connect_toggled(aCheckBoxToggleHandler); aCurrentItem.m_xCheck->show(); @@ -183,7 +186,7 @@ OUString FontFeaturesDialog::createFontNameWithFeatures() { if (rItem.m_xCheck->get_visible()) { -if (sal_uInt32(rItem.m_xCheck->get_active()) != rItem.m_nDefault) +if (rItem.m_xCheck->get_state() != TRISTATE_INDET) { if (!bFirst) sNameSuffix.append(vcl::font::FeatureSeparator); @@ -191,7 +194,7 @@ OUString FontFeaturesDialog::createFontNameWithFeatures() bFirst = false; sNameSuffix.append(vcl::font::featureCodeAsString(rItem.m_aFeatureCode)); -if (!rItem.m_xCheck->get_active()) +if (rItem.m_xCheck->get_state() == TRISTATE_FALSE) sNameSuffix.append("=0"); } } diff --git a/cui/source/inc/FontFeaturesDialog.hxx b/cui/source/inc/FontFeaturesDialog.hxx index f542566ae2f5..6b30a33111b2 100644 --- a/cui/source/inc/FontFeaturesDialog.hxx +++ b/cui/source/inc/FontFeaturesDialog.hxx @@ -22,7 +22,7 @@ struct FontFeatureItem { FontFeatureItem(weld::Widget* pParent) : m_aFeatureCode(0) -, m_nDefault(0) +, m_nDefault(-1) , m_xBuilder(Application::CreateBuilder(pParent, "cui/ui/fontfragment.ui")) , m_xContainer(m_xBuilder->weld_widget("fontentry")) , m_xText(m_xBuilder->weld_label("label")) @@ -32,7 +32,7 @@ struct FontFeatureItem } sal_uInt32 m_aFeatureCode; -sal_uInt32 m_nDefault; +sal_Int32 m_nDefault; std::unique_ptr m_xBuilder; std::unique_ptr m_xContainer; std::unique_ptr m_xText; diff --git a/include/vcl/font/Feature.hxx b/include/vcl/font/Feature.hxx index e66c7e2a4d72..addc4836e6ee 100644 --- a/include/vcl/font/Feature.hxx +++ b/include/vcl/font/Feature.hxx @@ -59,7 +59,7 @@ private: TranslateId m_pDescriptionID; OUString m_sNumericPart; uint32_t m_nCode; -uint32_t m_nDefault; +int32_t m_nDefault; FeatureParameterType m_eType; // the index of the parameter defines the enum value, string is the description std::vector m_aEnumParameters; @@ -70,7 +70,7 @@ public: FeatureParameterType eType = FeatureParameterType::BOOL, std::vector&& rEnumParameters = std::vector
[Libreoffice-commits] core.git: cui/source include/vcl sd/source vcl/source
cui/source/customize/cfg.cxx | 31 --- cui/source/inc/cfg.hxx|6 ++ include/vcl/weldutils.hxx | 21 + sd/source/ui/dlg/custsdlg.cxx | 35 +-- sd/source/ui/inc/custsdlg.hxx | 16 ++-- vcl/source/app/weldutils.cxx | 33 + 6 files changed, 63 insertions(+), 79 deletions(-) New commits: commit 0f684565d9246ccc39766289e9a5c383e8f9d838 Author: Caolán McNamara AuthorDate: Tue Nov 2 11:44:47 2021 + Commit: Caolán McNamara CommitDate: Tue Nov 2 17:13:35 2021 +0100 extract a ReorderingDropTarget for reuse Change-Id: I0ae69bbf644e220e1bf3352d98eb4fd735167416 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124596 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 943dc83247d4..79961fe690c2 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -3201,39 +3201,16 @@ SvxIconChangeDialog::SvxIconChangeDialog(weld::Window *pWindow, const OUString& } SvxConfigPageFunctionDropTarget::SvxConfigPageFunctionDropTarget(SvxConfigPage&rPage, weld::TreeView& rTreeView) -: DropTargetHelper(rTreeView.get_drop_target()) +: weld::ReorderingDropTarget(rTreeView) , m_rPage(rPage) -, m_rTreeView(rTreeView) { } -sal_Int8 SvxConfigPageFunctionDropTarget::AcceptDrop(const AcceptDropEvent& rEvt) +sal_Int8 SvxConfigPageFunctionDropTarget::ExecuteDrop(const ExecuteDropEvent& rEvt) { -// to enable the autoscroll when we're close to the edges -m_rTreeView.get_dest_row_at_pos(rEvt.maPosPixel, nullptr, true); -return DND_ACTION_MOVE; -} - -sal_Int8 SvxConfigPageFunctionDropTarget::ExecuteDrop( const ExecuteDropEvent& rEvt ) -{ -weld::TreeView* pSource = m_rTreeView.get_drag_source(); -// only dragging within the same widget allowed -if (!pSource || pSource != &m_rTreeView) -return DND_ACTION_NONE; - -std::unique_ptr xSource(m_rTreeView.make_iterator()); -if (!m_rTreeView.get_selected(xSource.get())) -return DND_ACTION_NONE; - -std::unique_ptr xTarget(m_rTreeView.make_iterator()); -int nTargetPos = -1; -if (m_rTreeView.get_dest_row_at_pos(rEvt.maPosPixel, xTarget.get(), true)) -nTargetPos = m_rTreeView.get_iter_index_in_parent(*xTarget); -m_rTreeView.move_subtree(*xSource, nullptr, nTargetPos); - +sal_Int8 nRet = weld::ReorderingDropTarget::ExecuteDrop(rEvt); m_rPage.ListModified(); - -return DND_ACTION_NONE; +return nRet;; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/inc/cfg.hxx b/cui/source/inc/cfg.hxx index c1b492cb4b90..b143367a547f 100644 --- a/cui/source/inc/cfg.hxx +++ b/cui/source/inc/cfg.hxx @@ -19,9 +19,9 @@ #pragma once -#include #include #include +#include #include #include @@ -352,13 +352,11 @@ public: void CreateDropDown(); }; -class SvxConfigPageFunctionDropTarget : public DropTargetHelper +class SvxConfigPageFunctionDropTarget : public weld::ReorderingDropTarget { private: SvxConfigPage& m_rPage; -weld::TreeView& m_rTreeView; -virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override; virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override; public: diff --git a/include/vcl/weldutils.hxx b/include/vcl/weldutils.hxx index 8cb591ce8140..cadbd5585ef7 100644 --- a/include/vcl/weldutils.hxx +++ b/include/vcl/weldutils.hxx @@ -21,6 +21,7 @@ #include #include #include +#include #include class CalendarWrapper; @@ -418,6 +419,26 @@ public: bool IsModKeyPressed() const { return m_bModKey; } }; +/* + If a TreeView is used as a list, rather than a tree, and DnD should just + reorder rows, then this can be used to implement that. + + Because the TreeView doesn't want or need subnodes, the drop target can be + simply visually indicated as being between rows (the issue of a final drop + location of a child of the drop target doesn't arise), and the meaning of + what a drop before or after the last row should do is unambigious. +*/ +class VCL_DLLPUBLIC ReorderingDropTarget : public DropTargetHelper +{ +protected: +weld::TreeView& m_rTreeView; +virtual sal_Int8 AcceptDrop(const AcceptDropEvent& rEvt) override; +virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent& rEvt) override; + +public: +ReorderingDropTarget(weld::TreeView& rTreeView); +}; + // get the row the iterator is on VCL_DLLPUBLIC size_t GetAbsPos(const weld::TreeView& rTreeView, const weld::TreeIter& rIter); diff --git a/sd/source/ui/dlg/custsdlg.cxx b/sd/source/ui/dlg/custsdlg.cxx index bd629f87bfaa..fc8e774d82e9 100644 --- a/sd/source/ui/dlg/custsdlg.cxx +++ b/sd/source/ui/dlg/custsdlg.cxx @@ -250,7 +250,7 @@ SdDefineCustomShowDlg::SdDefineCustomShowDlg(weld::Window* pWindow, SdDrawDocume , m_xBtnAdd(m_xBuil
[Libreoffice-commits] core.git: cui/source include/vcl vcl/inc vcl/source vcl/unx xmlsecurity/source
cui/source/options/optgenrl.cxx |2 cui/source/options/optinet2.cxx |2 cui/source/tabpages/autocdlg.cxx |2 include/vcl/weld.hxx |2 vcl/inc/salvtables.hxx |2 vcl/source/app/salvtables.cxx|2 vcl/unx/gtk3/gtkinst.cxx | 87 +++ xmlsecurity/source/dialogs/macrosecurity.cxx |8 +- 8 files changed, 74 insertions(+), 33 deletions(-) New commits: commit eb510f21572a35c89ae57ca060a02439e572cbd0 Author: Caolán McNamara AuthorDate: Mon May 17 16:58:17 2021 +0100 Commit: Caolán McNamara CommitDate: Mon May 17 20:36:25 2021 +0200 gtk4: reenable button rename label_line_wrap to label_wrap while I'm at it Change-Id: I3964c4b40d86fb6ef1fd3733088ffd80e57415ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115714 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx index 6fcef33199c3..66c734af1194 100644 --- a/cui/source/options/optgenrl.cxx +++ b/cui/source/options/optgenrl.cxx @@ -315,7 +315,7 @@ void SvxGeneralTabPage::InitCryptography() { m_xSigningKeyLB->set_size_request(nMaxWidth, -1); m_xEncryptionKeyLB->set_size_request(nMaxWidth, -1); - m_xEncryptToSelfCB->set_label_line_wrap(true); + m_xEncryptToSelfCB->set_label_wrap(true); m_xEncryptToSelfCB->set_size_request(nMaxWidth, -1); } } diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index f8648bac62a4..8f33c6a96700 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -496,7 +496,7 @@ SvxSecurityTabPage::SvxSecurityTabPage(weld::Container* pPage, weld::DialogContr int nMaxWidth = m_xSavePasswordsCB->get_approximate_digit_width() * 40; if (aPrefSize.Width() > nMaxWidth) { -m_xSavePasswordsCB->set_label_line_wrap(true); +m_xSavePasswordsCB->set_label_wrap(true); m_xSavePasswordsCB->set_size_request(nMaxWidth, -1); } diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index f1f4ee2bd0b1..8c21991be52b 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -1914,7 +1914,7 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage(weld::Container* pPage, weld::Dia int nMaxWidth = m_xCBRemoveList->get_approximate_digit_width() * 40; if (aPrefSize.Width() > nMaxWidth) { -m_xCBRemoveList->set_label_line_wrap(true); +m_xCBRemoveList->set_label_wrap(true); m_xCBRemoveList->set_size_request(nMaxWidth, -1); } diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index e55ca8d6b534..cd8958dd602b 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1381,7 +1381,7 @@ public: virtual void set_image(const css::uno::Reference& rImage) = 0; virtual void set_from_icon_name(const OUString& rIconName) = 0; virtual OUString get_label() const = 0; -virtual void set_label_line_wrap(bool wrap) = 0; +virtual void set_label_wrap(bool wrap) = 0; void clicked() { signal_clicked(); } // font size is in points, not pixels, e.g. see Window::[G]etPointFont diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 361d26e3d9fe..207e326e43f5 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1021,7 +1021,7 @@ public: virtual void set_from_icon_name(const OUString& rIconName) override; -virtual void set_label_line_wrap(bool wrap) override; +virtual void set_label_wrap(bool wrap) override; virtual OUString get_label() const override; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 813d74470139..d3b60a55c38f 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2596,7 +2596,7 @@ void SalInstanceButton::set_from_icon_name(const OUString& rIconName) m_xButton->SetModeImage(Image(StockImage::Yes, rIconName)); } -void SalInstanceButton::set_label_line_wrap(bool wrap) +void SalInstanceButton::set_label_wrap(bool wrap) { WinBits nBits = m_xButton->GetStyle(); nBits &= ~WB_WORDBREAK; diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 82a506ebc74b..0ca6d49d504f 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -3711,7 +3711,6 @@ GdkPixbuf* load_icon_by_name(const OUString& rIconName) namespace { -#if !GTK_CHECK_VERSION(4, 0, 0) GdkPixbuf* getPixbuf(const css::uno::Reference& rImage) { Image aImage(rImage); @@ -3733,6 +3732,7 @@ namespace return load_icon_from_stream(*xMemStm); } +#if !GTK_CHECK_VERSION(4, 0, 0) GdkPixbuf* getPixbuf(const VirtualDevice& rDevice) { Size aSize(rDevice.GetOutputSizePixel(
[Libreoffice-commits] core.git: cui/source include/vcl sc/source vcl/inc vcl/source vcl/unx
cui/source/tabpages/autocdlg.cxx |4 +- include/vcl/weld.hxx |4 +- sc/source/ui/cctrl/checklistmenu.cxx |4 +- sc/source/ui/navipi/content.cxx | 59 +-- vcl/inc/salvtables.hxx |1 vcl/source/app/salvtables.cxx| 15 +++- vcl/unx/gtk3/gtk3gtkinst.cxx | 27 +++- 7 files changed, 69 insertions(+), 45 deletions(-) New commits: commit 1a891f2fadae01aca95157b09d6ea8e223bee1ea Author: Caolán McNamara AuthorDate: Fri Apr 23 21:09:16 2021 +0100 Commit: Caolán McNamara CommitDate: Tue Apr 27 09:49:25 2021 +0200 Related: tdf#130326 allow bulk_insert_for_each to insert under a node Change-Id: Iad14638a33710ef0b790c702e7eab2283726f2fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114571 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 55fee3ede945..c682662f4fa7 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -836,7 +836,7 @@ void OfaAutocorrReplacePage::RefillReplaceBox(bool bFromReset, { aFormatText.insert(rDouble.sShort); } -}, &m_aReplaceFixedWidths); +}, nullptr, &m_aReplaceFixedWidths); } else { @@ -862,7 +862,7 @@ void OfaAutocorrReplacePage::RefillReplaceBox(bool bFromReset, { aFormatText.insert(elem.GetShort()); } -}, &m_aReplaceFixedWidths); +}, nullptr, &m_aReplaceFixedWidths); m_xNewReplacePB->set_sensitive(false); m_xDeleteReplacePB->set_sensitive(false); } diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 26e7f32618f0..c055ee0e87b3 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1133,7 +1133,8 @@ public: virtual void selected_foreach(const std::function& func) = 0; // call func on each visible element until func returns true or we run out of elements virtual void visible_foreach(const std::function& func) = 0; -// clear the tree, then add nSourceCount rows, call func on each row +// clear the children of pParent (whole tree if nullptr), +// then add nSourceCount rows under pParent, call func on each row // inserted with an arg of the index that this row will be when bulk insert // ends. // @@ -1145,6 +1146,7 @@ public: // be scrolled into view horizontally. virtual void bulk_insert_for_each(int nSourceCount, const std::function& func, + const weld::TreeIter* pParent = nullptr, const std::vector* pFixedWidths = nullptr) = 0; diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 201313f0e41e..55072f5d5f9c 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -802,7 +802,7 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, EdModifyHdl, weld::Entry&, void) size_t nIndex = aShownIndexes[i]; insertMember(*mpChecks, rIter, maMembers[nIndex], true); ++nSelCount; -}, &aFixedWidths); +}, nullptr, &aFixedWidths); } } @@ -1256,7 +1256,7 @@ size_t ScCheckListMenuControl::initMembers(int nMaxMemberWidth) insertMember(*mpChecks, rIter, maMembers[i], maMembers[i].mbVisible); if (maMembers[i].mbVisible) ++nVisMemCount; -}, &aFixedWidths); +}, nullptr, &aFixedWidths); } else { diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 6f4d92198934..53b4e413de50 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -879,52 +879,51 @@ void ScContentTree::GetDrawNames( ScContentId nType ) if (!pDoc) return; -// iterate in flat mode for groups -SdrIterMode eIter = ( nType == ScContentId::DRAWING ) ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups; - ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); +if (!pDrawLayer) +return; + SfxObjectShell* pShell = pDoc->GetDocumentShell(); -if (!(pDrawLayer && pShell)) +if (!pShell) return; +// iterate in flat mode for groups +SdrIterMode eIter = ( nType == ScContentId::DRAWING ) ? SdrIterMode::Flat : SdrIterMode::DeepNoGroups; + +std::vector aNames; SCTAB nTabCount = pDoc->GetTableCount(); -int treeNodeCount = 0; for (SCTAB nTab=0; nTabGetPage(static_cast(nTab)); OSL_ENSURE(pPage,"Page ?"); -if (pPage) +if (!pPage) +continue; +SdrObjListIter aIter(pPage, eIter); +SdrObject* pObject = aIter.Next(); +while (pObject) { -SdrObjListIter aIter( pPage, eIter ); -Sd
[Libreoffice-commits] core.git: cui/source include/vcl sc/IwyuFilter_sc.yaml sc/source vcl/source
cui/source/options/treeopt.cxx | 10 +++--- include/vcl/weldutils.hxx |3 +++ sc/IwyuFilter_sc.yaml |1 - sc/source/ui/app/inputwin.cxx |8 vcl/source/app/weldutils.cxx |9 + 5 files changed, 19 insertions(+), 12 deletions(-) New commits: commit e08b4144d9d0f0b05ef0f1c51c111d5a56e616a5 Author: Caolán McNamara AuthorDate: Fri Aug 28 16:36:00 2020 +0100 Commit: Caolán McNamara CommitDate: Fri Aug 28 22:01:29 2020 +0200 move GetMinimumEditHeight calc to weldutils and reuse in calc Change-Id: I3980bbaf269260243c8fcd8fe95cc03deac144ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101558 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 55447259e940..f96f0ceefab3 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -100,6 +100,7 @@ #include #include #include +#include #include #include @@ -483,13 +484,8 @@ void OfaTreeOptionsDialog::InitWidgets() xTabBox = m_xBuilder->weld_container("box"); Size aSize(xTreeLB->get_approximate_digit_width() * 82, xTreeLB->get_height_rows(30)); #if HAVE_FEATURE_GPGME -{ -// load this little .ui just to measure the height of an Entry -std::unique_ptr xBuilder(Application::CreateBuilder(m_xDialog.get(), "cui/ui/namedialog.ui")); -std::unique_ptr xEntry(xBuilder->weld_entry("name_entry")); -// tdf#115015: make enough space for crypto settings (approx. 14 text edits + padding) -aSize.setHeight((xEntry->get_preferred_size().Height() + 6) * 14); -} +// tdf#115015: make enough space for crypto settings (approx. 14 text edits + padding) +aSize.setHeight((weld::GetMinimumEditHeight() + 6) * 14); #endif xTabBox->set_size_request(aSize.Width(), aSize.Height()); xTreeLB->set_size_request(xTreeLB->get_approximate_digit_width() * 30, aSize.Height()); diff --git a/include/vcl/weldutils.hxx b/include/vcl/weldutils.hxx index 8a57ecead9b8..7eb4334e0156 100644 --- a/include/vcl/weldutils.hxx +++ b/include/vcl/weldutils.hxx @@ -364,6 +364,9 @@ VCL_DLLPUBLIC bool IsEntryVisible(const weld::TreeView& rTreeView, const weld::T // A Parent's Children are turned into Children of the Parent which comes next in hierarchy VCL_DLLPUBLIC void RemoveParentKeepChildren(weld::TreeView& rTreeView, weld::TreeIter& rParent); + +// return the min height of a weld::Entry +VCL_DLLPUBLIC int GetMinimumEditHeight(); } #endif diff --git a/sc/IwyuFilter_sc.yaml b/sc/IwyuFilter_sc.yaml index fe1d0457229e..3510a5f15b57 100644 --- a/sc/IwyuFilter_sc.yaml +++ b/sc/IwyuFilter_sc.yaml @@ -446,7 +446,6 @@ excludelist: sc/source/ui/inc/colorformat.hxx: # Needed for VclPtr type - svx/colorbox.hxx -- vcl/edit.hxx sc/source/ui/inc/condformatdlg.hxx: # Needed for typedef - condformatdlgentry.hxx diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 299f79e1a9b9..04c8f8769c53 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -39,11 +39,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include @@ -1585,9 +1585,9 @@ ScTextWnd::ScTextWnd(ScTextWndGroup* pParent, ScTabViewShell* pViewSh) aTextFont.SetWeight(WEIGHT_NORMAL); Size aSize(1, GetPixelHeightForLines(1)); -Size aMinEditSize(Edit::GetMinimumEditSize()); -if(aMinEditSize.Height() > aSize.Height()) -aSize.setHeight(aMinEditSize.Height()); +auto nMinEditHeight = weld::GetMinimumEditHeight(); +if (nMinEditHeight > aSize.Height()) +aSize.setHeight(nMinEditHeight); SetSizePixel(aSize); SetBackground(aBgColor); diff --git a/vcl/source/app/weldutils.cxx b/vcl/source/app/weldutils.cxx index 8b5532fccc8b..ee074df63d93 100644 --- a/vcl/source/app/weldutils.cxx +++ b/vcl/source/app/weldutils.cxx @@ -479,6 +479,15 @@ PatternFormatter::~PatternFormatter() m_rEntry.connect_changed(Link()); m_rEntry.connect_focus_out(Link()); } + +int GetMinimumEditHeight() +{ +// load this little .ui just to measure the height of an Entry +std::unique_ptr xBuilder( +Application::CreateBuilder(nullptr, "cui/ui/namedialog.ui")); +std::unique_ptr xEntry(xBuilder->weld_entry("name_entry")); +return xEntry->get_preferred_size().Height(); +} } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
cui/source/dialogs/about.cxx | 11 ++- include/vcl/svapp.hxx|2 +- vcl/source/app/svapp.cxx | 24 3 files changed, 23 insertions(+), 14 deletions(-) New commits: commit b4b8665bd370a869196e2f63acc2cdde7a37a4df Author: Heiko Tietze AuthorDate: Fri Jul 10 13:43:04 2020 +0200 Commit: Mike Kaganski CommitDate: Tue Jul 28 23:29:52 2020 +0200 Resolves tdf#132066 - Localization of special text in about window Copy all version infos in English Change-Id: I6719e27f721b0ff9f06efb4ea63e286e6d58ebf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98498 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx index 53f05d52b2e1..efeef5a9c002 100644 --- a/cui/source/dialogs/about.cxx +++ b/cui/source/dialogs/about.cxx @@ -250,16 +250,17 @@ OUString AboutDialog::GetCopyrightString() { return aCopyrightString; } +//special labels to comply with previous version info IMPL_LINK_NOARG(AboutDialog, HandleClick, weld::Button &, void) { css::uno::Reference xClipboard = css::datatransfer::clipboard::SystemClipboard::create( comphelper::getProcessComponentContext()); - OUString sInfo = "Version: " + m_pVersionLabel->get_label() // version - + "\nBuild ID: " + GetBuildString() // build id - + "\n" + m_pEnvLabel->get_label() + "; " + m_pUILabel->get_label() // env+UI - + "\nLocale: " + m_pLocaleLabel->get_label() // locale - + "\n" + m_pMiscLabel->get_label(); // misc + OUString sInfo = "Version: " + m_pVersionLabel->get_label() + "\n" // version + "Build ID: " + GetBuildString() + "\n" + // build id + Application::GetHWOSConfInfo(0,false) + "\n" // env+UI + "Locale: " + m_pLocaleLabel->get_label() + "\n" + // locale + m_pMiscLabel->get_label(); // misc vcl::unohelper::TextDataObject::CopyStringTo(sInfo, xClipboard); } diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 48177cf90535..422f8e23fb50 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -900,7 +900,7 @@ public: * bSelection = 0 to return all info, 1 for environment only, * and 2 for VCL/render related infos */ -static OUString GetHWOSConfInfo(const int bSelection = 0); +static OUString GetHWOSConfInfo(const int bSelection = 0, bool bLocalize = true); /** Load a localized branding PNG file as a bitmap. diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 12a21ee04fac..60bc22d12c6a 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -1135,7 +1135,15 @@ OUString Application::GetAppName() enum {hwAll=0, hwEnv=1, hwUI=2}; -OUString Application::GetHWOSConfInfo(const int bSelection) +static OUString Localize(const char *pId, const bool bLocalize) +{ +if (bLocalize) +return VclResId(pId); +else +return Translate::get(pId, Translate::Create("vcl", LanguageTag("en-US"))); +} + +OUString Application::GetHWOSConfInfo(const int bSelection, const bool bLocalize) { ImplSVData* pSVData = ImplGetSVData(); OUStringBuffer aDetails; @@ -1147,7 +1155,7 @@ OUString Application::GetHWOSConfInfo(const int bSelection) }; if (bSelection != hwUI) { -appendDetails("; ", VclResId(SV_APP_CPUTHREADS) +appendDetails("; ", Localize(SV_APP_CPUTHREADS, bLocalize) + OUString::number(std::thread::hardware_concurrency())); OUString aVersion; @@ -1156,21 +1164,21 @@ OUString Application::GetHWOSConfInfo(const int bSelection) else aVersion = "-"; -appendDetails("; ", VclResId(SV_APP_OSVERSION) + aVersion); +appendDetails("; ", Localize(SV_APP_OSVERSION, bLocalize) + aVersion); } if (bSelection != hwEnv) { -appendDetails("; ", VclResId(SV_APP_UIRENDER)); +appendDetails("; ", Localize(SV_APP_UIRENDER, bLocalize)); #if HAVE_FEATURE_SKIA if ( SkiaHelper::isVCLSkiaEnabled() ) { switch(SkiaHelper::renderMethodToUse()) { case SkiaHelper::RenderVulkan: -appendDetails("", VclResId(SV_APP_SKIA_VULKAN)); +appendDetails("", Localize(SV_APP_SKIA_VULKAN, bLocalize)); break; case SkiaHelper::RenderRaster: -appendDetails("", VclResId(SV_APP_SKIA_RASTER)); +appendDetails("", Localize(SV_APP_SKIA_RASTER, bLocalize)); break; } } @@ -1178,10 +1186,10 @@ OUString Application::GetHWOSConfInfo(const int bSelection) #endif #if HAVE_FEATURE_OPENGL if ( OpenGLWrapper::isVCLOpenGLEnabled() ) -appendDetails("", VclResId(SV_APP_GL)); +
[Libreoffice-commits] core.git: cui/source include/vcl sc/source sd/source sfx2/source test/source vcl/inc vcl/source vcl/unx
cui/source/dialogs/screenshotannotationdlg.cxx |3 - include/vcl/syswin.hxx |2 include/vcl/weld.hxx |5 +- sc/source/ui/attrdlg/scdlgfact.cxx | 42 ++- sd/source/ui/dlg/sddlgfact.cxx | 54 - sfx2/source/dialog/tabdlg.cxx |3 - test/source/screenshot_test.cxx|3 - vcl/inc/salvtables.hxx |6 +- vcl/source/app/salvtables.cxx | 12 +++-- vcl/source/window/syswin.cxx | 12 +++-- vcl/unx/gtk3/gtk3gtkinst.cxx | 40 -- 11 files changed, 86 insertions(+), 96 deletions(-) New commits: commit 19fd82ac6e08896bd17169d1b6ea090458fc18da Author: Caolán McNamara AuthorDate: Tue Jul 7 20:27:51 2020 +0100 Commit: Caolán McNamara CommitDate: Wed Jul 8 13:39:11 2020 +0200 distinguish between dialog screenshoting and rendering a widget Change-Id: I43ee0c68d72c97a15d26e2ffea577c2a44ba91e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98326 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx index 4054fa57336f..b0513931bde8 100644 --- a/cui/source/dialogs/screenshotannotationdlg.cxx +++ b/cui/source/dialogs/screenshotannotationdlg.cxx @@ -205,8 +205,7 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl( maPicture(this), maSaveAsText(CuiResId(RID_SVXSTR_SAVE_SCREENSHOT_AS)) { -VclPtr xParentDialogSurface(VclPtr::Create(DeviceFormat::DEFAULT)); -rParentDialog.draw(*xParentDialogSurface); +VclPtr xParentDialogSurface(rParentDialog.screenshot()); maParentDialogSize = xParentDialogSurface->GetOutputSizePixel(); maParentDialogBitmap = xParentDialogSurface->GetBitmapEx(Point(), maParentDialogSize); maDimmedDialogBitmap = maParentDialogBitmap; diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx index f1cb60015d4c..32f07c87 100644 --- a/include/vcl/syswin.hxx +++ b/include/vcl/syswin.hxx @@ -217,7 +217,7 @@ public: virtualvoiddoDeferredInit(WinBits nBits); // Screenshot interface -void createScreenshot(VirtualDevice& rOutput); +VclPtr createScreenshot(); }; inline void SystemWindow::SetIdleDebugName( const char *pDebugName ) diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index c4577d63c49d..7649accf8b2d 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -272,7 +272,7 @@ public: virtual void connect_get_property_tree(const Link& rLink) = 0; // render the widget to an output device -virtual void draw(VirtualDevice& rOutput) = 0; +virtual void draw(OutputDevice& rOutput, const tools::Rectangle& rRect) = 0; virtual ~Widget() {} }; @@ -468,6 +468,9 @@ public: // collect positions of widgets and their help ids for screenshot purposes virtual ScreenShotCollection collect_screenshot_data() = 0; + +// render the widget to an output device +virtual VclPtr screenshot() = 0; }; class VCL_DLLPUBLIC WaitObject diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index e947993cacd2..55340b185d8b 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -128,8 +128,7 @@ short AbstractScDataFormDlg_Impl::Execute() BitmapEx AbstractScDataFormDlg_Impl::createScreenshot() const { -VclPtr xDialogSurface(VclPtr::Create(DeviceFormat::DEFAULT)); -m_xDlg->getDialog()->draw(*xDialogSurface); +VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -185,8 +184,7 @@ short AbstractScMoveTableDlg_Impl::Execute() BitmapEx AbstractScMoveTableDlg_Impl::createScreenshot() const { -VclPtr xDialogSurface(VclPtr::Create(DeviceFormat::DEFAULT)); -m_xDlg->getDialog()->draw(*xDialogSurface); +VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -291,8 +289,7 @@ void AbstractScImportAsciiDlg_Impl::SaveParameters() BitmapEx AbstractScImportAsciiDlg_Impl::createScreenshot() const { -VclPtr xDialogSurface(VclPtr::Create(DeviceFormat::DEFAULT)); -m_xDlg->getDialog()->draw(*xDialogSurface); +VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurface->GetBitmapEx(Point(), xDialogSurface->GetOutputSizePixel()); } @@ -323,8 +320,7 @@ bool AbstractScColRowLabelDlg_Impl::IsRow() BitmapEx AbstractScColRowLabelDlg_Impl::createScreenshot() const { -VclPtr xDialogSurface(VclPtr::Create(DeviceFormat::DEFAULT)); -m_xDlg->getDialog()->draw(*xDialogSurface); +VclPtr xDialogSurface(m_xDlg->getDialog()->screenshot()); return xDialogSurfac
[Libreoffice-commits] core.git: cui/source include/vcl
cui/source/inc/newtabledlg.hxx |4 ++-- include/vcl/lstbox.hxx |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 708260185151d7e71e7bf5d298eba0e638fd2a1b Author: Noel Grandin AuthorDate: Thu Jun 11 13:00:25 2020 +0200 Commit: Noel Grandin CommitDate: Thu Jun 11 18:30:08 2020 +0200 loplugin:unnecessaryvirtual Change-Id: I40c03b338e00d8a62b8b243d8467b43342c4b093 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96115 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cui/source/inc/newtabledlg.hxx b/cui/source/inc/newtabledlg.hxx index 9ec717c70ab1..d0e21293ca52 100644 --- a/cui/source/inc/newtabledlg.hxx +++ b/cui/source/inc/newtabledlg.hxx @@ -31,8 +31,8 @@ private: public: SvxNewTableDialog(weld::Window* pParent); -virtual sal_Int32 getRows() const; -virtual sal_Int32 getColumns() const; +sal_Int32 getRows() const; +sal_Int32 getColumns() const; }; class SvxNewTableDialogWrapper : public SvxAbstractNewTableDialog diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx index ff44aa59af14..403d429f2605 100644 --- a/include/vcl/lstbox.hxx +++ b/include/vcl/lstbox.hxx @@ -128,7 +128,7 @@ public: virtual voidStateChanged( StateChangedType nType ) override; virtual voidDataChanged( const DataChangedEvent& rDCEvt ) override; -virtual voidSelect(); +voidSelect(); voidDoubleClick(); virtual voidGetFocus() override; virtual voidLoseFocus() override; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl sw/source vcl/source vcl/unx
cui/source/dialogs/multipat.cxx |5 + cui/source/options/certpath.cxx |5 + cui/source/options/optjava.cxx |5 + include/vcl/weld.hxx|5 ++--- sw/source/ui/index/cnttab.cxx |6 +- vcl/source/app/salvtables.cxx | 11 --- vcl/unx/gtk3/gtk3gtkinst.cxx| 18 ++ 7 files changed, 32 insertions(+), 23 deletions(-) New commits: commit 32e49998b2edde7a6a8fecddf5da71f3aa5815c2 Author: Caolán McNamara AuthorDate: Fri Jun 5 12:31:58 2020 +0100 Commit: Caolán McNamara CommitDate: Fri Jun 5 16:57:17 2020 +0200 we can't mix radiobuttons and checkbuttons so don't imply otherwise Change-Id: I11a85090bd14d8655efb95433417764dd1f79052 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95592 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx index 5b38d584d76f..bd121578c3bb 100644 --- a/cui/source/dialogs/multipat.cxx +++ b/cui/source/dialogs/multipat.cxx @@ -197,10 +197,7 @@ SvxMultiPathDialog::SvxMultiPathDialog(weld::Window* pParent) std::vector aWidths; aWidths.push_back(m_xRadioLB->get_checkbox_column_width()); m_xRadioLB->set_column_fixed_widths(aWidths); - -std::vector aRadioColumns; -aRadioColumns.push_back(0); -m_xRadioLB->set_toggle_columns_as_radio(aRadioColumns); +m_xRadioLB->set_toggle_columns_as_radio(); m_xRadioLB->connect_toggled(LINK(this, SvxMultiPathDialog, CheckHdl_Impl)); m_xRadioLB->connect_changed(LINK(this, SvxMultiPathDialog, SelectHdl_Impl)); m_xAddBtn->connect_clicked(LINK(this, SvxMultiPathDialog, AddHdl_Impl)); diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx index 3f2359a5ac50..3b491dadaf89 100644 --- a/cui/source/options/certpath.cxx +++ b/cui/source/options/certpath.cxx @@ -38,10 +38,7 @@ CertPathDialog::CertPathDialog(weld::Window* pParent) aWidths.push_back(m_xCertPathList->get_checkbox_column_width()); aWidths.push_back(m_xCertPathList->get_approximate_digit_width() * 20); m_xCertPathList->set_column_fixed_widths(aWidths); - -std::vector aRadioColumns; -aRadioColumns.push_back(0); -m_xCertPathList->set_toggle_columns_as_radio(aRadioColumns); +m_xCertPathList->set_toggle_columns_as_radio(); m_xCertPathList->connect_toggled(LINK(this, CertPathDialog, CheckHdl_Impl)); m_xManualButton->connect_clicked( LINK( this, CertPathDialog, ManualHdl_Impl ) ); diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 2d4df6cb3069..d9a54e0f250d 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -92,10 +92,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage(weld::Container* pPage, weld::DialogContr aWidths.push_back(m_xJavaList->get_checkbox_column_width()); aWidths.push_back(m_xJavaList->get_pixel_size("Sun Microsystems Inc.").Width()); m_xJavaList->set_column_fixed_widths(aWidths); - -std::vector aRadioColumns; -aRadioColumns.push_back(0); -m_xJavaList->set_toggle_columns_as_radio(aRadioColumns); +m_xJavaList->set_toggle_columns_as_radio(); m_xJavaEnableCB->connect_clicked( LINK( this, SvxJavaOptionsPage, EnableHdl_Impl ) ); m_xJavaList->connect_toggled( LINK( this, SvxJavaOptionsPage, CheckHdl_Impl ) ); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index fedf414432c3..b53bf27c7902 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -793,8 +793,6 @@ protected: std::function m_aCustomSort; protected: -std::vector m_aRadioIndexes; - void signal_changed() { m_aChangeHdl.Call(*this); } bool signal_row_activated() { return m_aRowActivatedHdl.Call(*this); } void signal_column_clicked(int nColumn) { m_aColumnClickedHdl.Call(nColumn); } @@ -1134,7 +1132,8 @@ public: // remove the selected nodes virtual void remove_selection() = 0; -void set_toggle_columns_as_radio(const std::vector& rCols) { m_aRadioIndexes = rCols; } +// call before inserting any content +virtual void set_toggle_columns_as_radio() = 0; virtual void vadjustment_set_value(int value) = 0; virtual int vadjustment_get_value() const = 0; diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 91e41c7a8b2e..300d046df5d0 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -499,11 +499,7 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(weld::Window* pParent, m_xLeftPB->connect_clicked(LINK(this, SwAddStylesDlg_Impl, LeftRightHdl)); m_xRightPB->connect_clicked(LINK(this, SwAddStylesDlg_Impl, LeftRightHdl)); m_xHeaderTree->connect_size_allocate(LINK(this, SwAddStylesDlg_Impl, TreeSizeAllocHdl)); - -std::vector aRadioColumns; -for (sal_uInt16 i = 0; i <= MAXLEVEL; ++i) -aRadioColumns.push_back(i + 1); -m_xHeaderTree->set_toggle_columns_as_radio(aRadioColumns); +m_xHead
[Libreoffice-commits] core.git: cui/source include/vcl sfx2/source vcl/inc vcl/source vcl/unx
cui/source/customize/SvxMenuConfigPage.cxx | 12 ++-- include/vcl/weld.hxx |4 +++- sfx2/source/dialog/templdlg.cxx|2 +- vcl/inc/treeglue.hxx |9 +++-- vcl/source/app/salvtables.cxx |5 +++-- vcl/unx/gtk3/gtk3gtkinst.cxx |4 ++-- 6 files changed, 22 insertions(+), 14 deletions(-) New commits: commit ef9ac1b9874ccd1f1df16e9eeb53f9453311337e Author: Caolán McNamara AuthorDate: Tue May 26 16:37:48 2020 +0100 Commit: Caolán McNamara CommitDate: Tue May 26 20:23:34 2020 +0200 make highlight of get_dest_row_at_pos optional Change-Id: I280e1a49e938f45402f373896669fd6f7e8a66fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94876 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index 064a0d508f8c..a0c6d316a0e5 100644 --- a/cui/source/customize/SvxMenuConfigPage.cxx +++ b/cui/source/customize/SvxMenuConfigPage.cxx @@ -528,9 +528,9 @@ IMPL_LINK( SvxMenuConfigPage, ContentContextMenuHdl, const CommandEvent&, rCEvt, weld::TreeView& rTreeView = m_xContentsListBox->get_widget(); // Select clicked entry -std::unique_ptr rIter(rTreeView.make_iterator()); -rTreeView.get_dest_row_at_pos( rCEvt.GetMousePosPixel(), &*rIter ); -rTreeView.select(*rIter); +std::unique_ptr xIter(rTreeView.make_iterator()); +rTreeView.get_dest_row_at_pos( rCEvt.GetMousePosPixel(), xIter.get(), false ); +rTreeView.select(*xIter); SelectMenuEntry( rTreeView ); int nSelectIndex = m_xContentsListBox->get_selected_index(); @@ -571,9 +571,9 @@ IMPL_LINK( SvxMenuConfigPage, FunctionContextMenuHdl, const CommandEvent&, rCEvt weld::TreeView& rTreeView = m_xFunctions->get_widget(); // Select clicked entry -std::unique_ptr rIter(rTreeView.make_iterator()); -rTreeView.get_dest_row_at_pos( rCEvt.GetMousePosPixel(), &*rIter ); -rTreeView.select(*rIter); +std::unique_ptr xIter(rTreeView.make_iterator()); +rTreeView.get_dest_row_at_pos( rCEvt.GetMousePosPixel(), xIter.get(), false ); +rTreeView.select(*xIter); SelectFunctionHdl( rTreeView ); std::unique_ptr xBuilder(Application::CreateBuilder( &rTreeView, "cui/ui/entrycontextmenu.ui" ) ); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index a57f7f4321c3..7766749cd007 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1157,7 +1157,9 @@ public: virtual void set_column_custom_renderer(int nColumn, bool bEnable) = 0; // for dnd -virtual bool get_dest_row_at_pos(const Point& rPos, weld::TreeIter* pResult) = 0; +virtual bool get_dest_row_at_pos(const Point& rPos, weld::TreeIter* pResult, + bool bHighLightTarget = true) += 0; virtual void unset_drag_dest_row() = 0; virtual tools::Rectangle get_row_area(const weld::TreeIter& rIter) const = 0; // for dragging and dropping between TreeViews, return the active source diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 18be2cd2e1c6..c32c4f9e639b 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -336,7 +336,7 @@ void SfxCommonTemplateDialog_Impl::PrepareMenu(const Point& rPos) { weld::TreeView* pTreeView = mxTreeBox->get_visible() ? mxTreeBox.get() : mxFmtLb.get(); std::unique_ptr xIter(pTreeView->make_iterator()); -if (pTreeView->get_dest_row_at_pos(rPos, xIter.get()) && !pTreeView->is_selected(*xIter)) +if (pTreeView->get_dest_row_at_pos(rPos, xIter.get(), false) && !pTreeView->is_selected(*xIter)) { pTreeView->unselect_all(); pTreeView->select(*xIter); diff --git a/vcl/inc/treeglue.hxx b/vcl/inc/treeglue.hxx index da4cc1ffeaf9..11c61944f5e1 100644 --- a/vcl/inc/treeglue.hxx +++ b/vcl/inc/treeglue.hxx @@ -127,7 +127,7 @@ public: m_aModelChangedHdl.Call(this); } -virtual SvTreeListEntry* GetDropTarget(const Point& rPos) override +SvTreeListEntry* GetTargetAtPoint(const Point& rPos, bool bHighLightTarget) { SvTreeListEntry* pOldTargetEntry = pTargetEntry; pTargetEntry = pImpl->GetEntry(rPos); @@ -150,11 +150,16 @@ public: } } -if (pTargetEntry) +if (pTargetEntry && bHighLightTarget) ImplShowTargetEmphasis(pTargetEntry, true); return pTargetEntry; } +virtual SvTreeListEntry* GetDropTarget(const Point& rPos) override +{ +return GetTargetAtPoint(rPos, true); +} + virtual bool EditingEntry(SvTreeListEntry* pEntry, Selection&) override { return m_aEditingEntryHdl.Call(pEntry); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 67cb4fad45e1..985503444597 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtabl
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
cui/source/customize/acccfg.cxx |4 ++-- include/vcl/svapp.hxx |4 ++-- vcl/source/app/svapp.cxx|4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) New commits: commit 08edc74a6b6ccf0d4d1560f57ec99a1ad9b390ce Author: Muhammet Kara AuthorDate: Sat Feb 1 14:20:44 2020 +0300 Commit: Muhammet Kara CommitDate: Sat Feb 1 14:13:49 2020 +0100 sal_uLong to size_t for sizeof related types Change-Id: I00055ffd7b79d2e5637b69390ca516f11b0cffd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87801 Tested-by: Jenkins Reviewed-by: Muhammet Kara diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index cb1ed554d501..ca602f8e96be 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -1032,8 +1032,8 @@ void SfxAcceleratorConfigPage::Init(const uno::Reference= GetReservedKeyCodeCount() ) return nullptr; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl sfx2/source vcl/source
cui/source/dialogs/SpellDialog.cxx |6 ++--- include/vcl/edit.hxx |5 include/vcl/specialchars.hxx | 43 + sfx2/source/appl/appinit.cxx |4 +-- vcl/source/control/edit.cxx| 16 - vcl/source/edit/vclmedit.cxx |9 --- 6 files changed, 63 insertions(+), 20 deletions(-) New commits: commit 2863247598b8d85e9a284575e9b657f360d21c4d Author: Caolán McNamara AuthorDate: Tue Jan 14 15:08:03 2020 + Commit: Caolán McNamara CommitDate: Tue Jan 14 17:34:47 2020 +0100 move [G|S]etGetSpecialCharsFunction into its own header so the whole of edit.hxx doesn't need to be included just to set that detail Change-Id: I467add023ca59c1ffdccbafb21843cb153ba6a40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86769 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 44bca8f89a5b..fd47ab92d728 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include #include @@ -1501,9 +1501,9 @@ IMPL_LINK(SentenceEditWindow_Impl, ToolbarHdl, const OString&, rCurItemId, void) } else if (rCurItemId == "insert") { -if (Edit::GetGetSpecialCharsFunction()) +if (vcl::GetGetSpecialCharsFunction()) { -OUString aChars = Edit::GetGetSpecialCharsFunction()(GetDrawingArea(), m_xEditEngine->GetStandardFont(0)); +OUString aChars = vcl::GetGetSpecialCharsFunction()(GetDrawingArea(), m_xEditEngine->GetStandardFont(0)); if (!aChars.isEmpty()) { ESelection aCurrentSelection(m_xEditView->GetSelection()); diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index 2606eb27b9d0..a5f12d44f7b0 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -50,8 +50,6 @@ struct Impl_IMEInfos; #define EDIT_NOLIMITSAL_MAX_INT32 -typedef OUString (*FncGetSpecialChars)( weld::Widget* pWin, const vcl::Font& rFont ); - class Timer; class VCL_DLLPUBLIC Edit : public Control, public vcl::unohelper::DragAndDropClient @@ -238,9 +236,6 @@ public: // shows a warning box saying "text too long, truncated" static void ShowTruncationWarning(weld::Widget* pParent); -static void SetGetSpecialCharsFunction( FncGetSpecialChars fn ); -static FncGetSpecialChars GetGetSpecialCharsFunction(); - VclPtr CreatePopupMenu(); virtual OUString GetSurroundingText() const override; diff --git a/include/vcl/specialchars.hxx b/include/vcl/specialchars.hxx new file mode 100644 index ..d310a92a6e0d --- /dev/null +++ b/include/vcl/specialchars.hxx @@ -0,0 +1,43 @@ +/* -*- 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_VCL_SPECIAL_CHARS_HXX +#define INCLUDED_VCL_SPECIAL_CHARS_HXX + +namespace vcl +{ +class Font; +} + +namespace weld +{ +class Widget; +} + +typedef OUString (*FncGetSpecialChars)(weld::Widget* pWin, const vcl::Font& rFont); + +namespace vcl +{ +void VCL_DLLPUBLIC SetGetSpecialCharsFunction(FncGetSpecialChars fn); +FncGetSpecialChars VCL_DLLPUBLIC GetGetSpecialCharsFunction(); +}; + +#endif // INCLUDED_VCL_SPECIAL_CHARS_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx index 5ae244d8e049..472a72e56223 100644 --- a/sfx2/source/appl/appinit.cxx +++ b/sfx2/source/appl/appinit.cxx @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include @@ -238,7 +238,7 @@ void SfxApplication::Initialize_Impl() { SolarMutexGuard aGuard; // Set special characters callback on vcl edit control -Edit::SetGetSpecialCharsFunction(&SfxGetSpecialCharsForEdit); +vcl::SetGetSpecialCharsFunction(&SfxGetSpecialCharsForEdit); } } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/ed
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source vcl/unx
cui/source/options/optcolor.cxx | 17 ++--- include/vcl/weld.hxx|2 ++ vcl/source/app/salvtables.cxx | 12 vcl/unx/gtk3/gtk3gtkinst.cxx| 10 ++ 4 files changed, 38 insertions(+), 3 deletions(-) New commits: commit c5fc7dd4475d21abdfc9663c3ac55cce319c299d Author: Caolán McNamara AuthorDate: Mon Dec 2 17:06:34 2019 + Commit: Caolán McNamara CommitDate: Tue Dec 3 09:56:32 2019 +0100 tdf#129134 ApplicationColors Scrolled List moves too little Change-Id: I5cb6ac017f1d2a916297676724d523634afb2020 Reviewed-on: https://gerrit.libreoffice.org/84252 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 244cbbbf0dea..0e6cb822715a 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -169,7 +169,8 @@ public: public: void SetLinks(Link const&, Link const&, - Link const&); + Link const&, + weld::ScrolledWindow& rScroll); void Update(EditableColorConfig const*, EditableExtendedColorConfig const*); void ClickHdl(EditableColorConfig*, weld::ToggleButton&); void ColorHdl(EditableColorConfig*, EditableExtendedColorConfig*, const ColorListBox*); @@ -212,6 +213,11 @@ private: public: void SetText(const OUString& rLabel) { dynamic_cast(*m_xText).set_label(rLabel); } void set_width_request(int nTextWidth) { m_xText->set_size_request(nTextWidth, -1); } +int get_height_request() const +{ +return std::max(m_xText->get_preferred_size().Height(), + m_xColorList->get_widget().get_preferred_size().Height()); +} void Hide (); public: void SetLinks(Link const&, @@ -458,10 +464,15 @@ void ColorConfigWindow_Impl::AdjustExtraWidths(int nTextWidth) // SetLinks() void ColorConfigWindow_Impl::SetLinks(Link const& aCheckLink, Link const& aColorLink, - Link const& rGetFocusLink) + Link const& rGetFocusLink, + weld::ScrolledWindow& rScroll) { +if (vEntries.empty()) +return; for (auto const & i: vEntries) i->SetLinks(aCheckLink, aColorLink, rGetFocusLink); +// 6 is the spacing set on ColorConfigWindow +rScroll.vadjustment_set_step_increment(vEntries[0]->get_height_request() + 6); } // Update() @@ -622,7 +633,7 @@ ColorConfigCtrl_Impl::ColorConfigCtrl_Impl(weld::Window* pTopLevel, weld::Builde Link aCheckLink = LINK(this, ColorConfigCtrl_Impl, ClickHdl); Link aColorLink = LINK(this, ColorConfigCtrl_Impl, ColorHdl); Link const& aGetFocusLink = LINK(this, ColorConfigCtrl_Impl, ControlFocusHdl); -m_xScrollWindow->SetLinks(aCheckLink, aColorLink, aGetFocusLink); +m_xScrollWindow->SetLinks(aCheckLink, aColorLink, aGetFocusLink, *m_xVScroll); } void ColorConfigCtrl_Impl::Update () diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index e7025b134506..60f705e1e624 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -298,6 +298,7 @@ public: virtual int hadjustment_get_page_size() const = 0; virtual void hadjustment_set_page_size(int size) = 0; virtual void hadjustment_set_page_increment(int size) = 0; +virtual void hadjustment_set_step_increment(int size) = 0; virtual void set_hpolicy(VclPolicyType eHPolicy) = 0; virtual VclPolicyType get_hpolicy() const = 0; void connect_hadjustment_changed(const Link& rLink) @@ -316,6 +317,7 @@ public: virtual int vadjustment_get_page_size() const = 0; virtual void vadjustment_set_page_size(int size) = 0; virtual void vadjustment_set_page_increment(int size) = 0; +virtual void vadjustment_set_step_increment(int size) = 0; virtual int vadjustment_get_lower() const = 0; virtual void vadjustment_set_lower(int upper) = 0; virtual void set_vpolicy(VclPolicyType eVPolicy) = 0; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 3bfc4e1e92a7..f45f550e5985 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2091,6 +2091,12 @@ public: return rHorzScrollBar.SetPageSize(size); } +virtual void hadjustment_set_step_increment(int size) override +{ +ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); +return rHorzScrollBar.SetLineSize(size); +} + virtual void set_hpolicy(VclPolicyType eHPolicy) override { WinBits nWinBits = m_xScrolledWindow->GetStyle() & ~(WB_AUTOHSCROLL|WB_HSCROLL); @@ -2186,6 +2192,12 @@ public: return rVertScrollBar.SetPageSize(size); } +virtual void vadjustment_set_step_increment(int size) override +{
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source vcl/unx
cui/source/customize/SvxMenuConfigPage.cxx| 29 ++--- cui/source/customize/SvxToolbarConfigPage.cxx | 12 ++--- cui/source/customize/cfg.cxx | 57 -- cui/source/inc/cfg.hxx|9 +++- include/vcl/weld.hxx |5 +- vcl/source/app/salvtables.cxx |8 +++ vcl/unx/gtk3/gtk3gtkinst.cxx |6 ++ 7 files changed, 81 insertions(+), 45 deletions(-) New commits: commit 05734503ed36cff64cfaac8afb7c6df5eced8873 Author: Caolán McNamara AuthorDate: Mon Nov 25 14:25:28 2019 + Commit: Caolán McNamara CommitDate: Wed Nov 27 00:27:42 2019 +0100 tdf#126043 use another bulk_insert_for_each Change-Id: I05c3fc6e708d000ba955981dbd8d11371ea99da2 Reviewed-on: https://gerrit.libreoffice.org/83686 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/customize/SvxMenuConfigPage.cxx b/cui/source/customize/SvxMenuConfigPage.cxx index 218d087349ad..7289b3506a7c 100644 --- a/cui/source/customize/SvxMenuConfigPage.cxx +++ b/cui/source/customize/SvxMenuConfigPage.cxx @@ -263,22 +263,21 @@ short SvxMenuConfigPage::QueryReset() void SvxMenuConfigPage::SelectElement() { -m_xContentsListBox->clear(); +weld::TreeView& rTreeView = m_xContentsListBox->get_widget(); SvxConfigEntry* pMenuData = GetTopLevelSelection(); - -if ( pMenuData ) +if (!pMenuData) +rTreeView.clear(); +else { SvxEntries* pEntries = pMenuData->GetEntries(); -int i = 0; -for (auto const& entry : *pEntries) -{ +rTreeView.bulk_insert_for_each(pEntries->size(), [this, &rTreeView, pEntries](weld::TreeIter& rIter, int nIdx) { +auto const& entry = (*pEntries)[nIdx]; OUString sId(OUString::number(reinterpret_cast(entry))); -m_xContentsListBox->insert(i, sId); -InsertEntryIntoUI(entry, i, 0); -++i; -} +rTreeView.set_id(rIter, sId); +InsertEntryIntoUI(entry, rTreeView, rIter, 0); +}); } UpdateButtonStates(); @@ -364,9 +363,10 @@ IMPL_LINK_NOARG( SvxMenuConfigPage, AddCommandHdl, weld::Button&, void ) int nPos = AddFunction(-1, /*bAllowDuplicates*/false); if (nPos == -1) return; +weld::TreeView& rTreeView = m_xContentsListBox->get_widget(); SvxConfigEntry* pEntry = - reinterpret_cast(m_xContentsListBox->get_id(nPos).toInt64()); -InsertEntryIntoUI(pEntry, nPos, 0); +reinterpret_cast(rTreeView.get_id(nPos).toInt64()); +InsertEntryIntoUI(pEntry, rTreeView, nPos, 0); } IMPL_LINK_NOARG( SvxMenuConfigPage, RemoveCommandHdl, weld::Button&, void ) @@ -380,12 +380,13 @@ IMPL_LINK_NOARG( SvxMenuConfigPage, RemoveCommandHdl, weld::Button&, void ) IMPL_LINK(SvxMenuConfigPage, InsertHdl, const OString&, rIdent, void) { +weld::TreeView& rTreeView = m_xContentsListBox->get_widget(); if (rIdent == "insertseparator") { SvxConfigEntry* pNewEntryData = new SvxConfigEntry; pNewEntryData->SetUserDefined(); int nPos = AppendEntry(pNewEntryData, -1); -InsertEntryIntoUI(pNewEntryData, nPos, 0); +InsertEntryIntoUI(pNewEntryData, rTreeView, nPos, 0); } else if (rIdent == "insertsubmenu") { @@ -406,7 +407,7 @@ IMPL_LINK(SvxMenuConfigPage, InsertHdl, const OString&, rIdent, void) pNewEntryData->SetUserDefined(); int nPos = AppendEntry(pNewEntryData, -1); -InsertEntryIntoUI(pNewEntryData, nPos, 0); +InsertEntryIntoUI(pNewEntryData, rTreeView, nPos, 0); ReloadTopLevelListBox(); diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx b/cui/source/customize/SvxToolbarConfigPage.cxx index b8058df387f5..b30302d52ed3 100644 --- a/cui/source/customize/SvxToolbarConfigPage.cxx +++ b/cui/source/customize/SvxToolbarConfigPage.cxx @@ -463,7 +463,7 @@ IMPL_LINK(SvxToolbarConfigPage, InsertHdl, const OString&, rIdent, void) pNewEntryData->SetUserDefined(); int nPos = AppendEntry(pNewEntryData, -1); -InsertEntryIntoUI(pNewEntryData, nPos, 1); +InsertEntryIntoUI(pNewEntryData, m_xContentsListBox->get_widget(), nPos, 1); static_cast( GetSaveInData())->ApplyToolbar( pToolbar ); @@ -561,7 +561,7 @@ IMPL_LINK(SvxToolbarConfigPage, ModifyItemHdl, const OString&, rIdent, void) OUString sId(OUString::number(reinterpret_cast(pEntry))); m_xContentsListBox->insert(nActEntry, sId); m_xContentsListBox->set_toggle(nActEntry, pEntry->IsVisible() ? TRISTATE_TRUE : TRISTATE_FALSE, 0); -InsertEntryIntoUI(pEntry, nActEntry, 1); +InsertEntryIntoUI(pEntry, m_xContentsListBox->get_widget(), nActEntry, 1); m_xContentsListBox->select
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
cui/source/tabpages/autocdlg.cxx |2 +- include/vcl/transfer.hxx |5 + vcl/source/treelist/transfer.cxx | 39 +++ 3 files changed, 29 insertions(+), 17 deletions(-) New commits: commit d61214b7a864fb5006f1efa579383f3cc1c5f9cd Author: Caolán McNamara AuthorDate: Tue Sep 24 12:24:19 2019 +0100 Commit: Caolán McNamara CommitDate: Tue Sep 24 17:23:43 2019 +0200 copy to clipboard without intermediate vcl::Window Change-Id: I36d26e583e08ef66564e232b54fa00a468a280c6 Reviewed-on: https://gerrit.libreoffice.org/79453 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index ca22e820f569..5fa49a106d6a 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -2088,7 +2088,7 @@ void OfaAutoCompleteTabPage::CopyToClipboard() const #endif } pCntnr->CopyByteString( SotClipboardFormatId::STRING, sData.makeStringAndClear() ); -pCntnr->CopyToClipboard( static_cast(const_cast(this)) ); +pCntnr->CopyToClipboard(GetSystemClipboard()); } } diff --git a/include/vcl/transfer.hxx b/include/vcl/transfer.hxx index 3373f3e032a9..8d5e47548592 100644 --- a/include/vcl/transfer.hxx +++ b/include/vcl/transfer.hxx @@ -250,8 +250,13 @@ public: voidPrepareOLE( const TransferableObjectDescriptor& rObjDesc ); +voidCopyToClipboard(const css::uno::Reference &rClipboard) const; +voidCopyToSelection(const css::uno::Reference &rClipboard) const; + +// convenience versions of the above which extract the XClipboard from the pWindow voidCopyToClipboard( vcl::Window *pWindow ) const; voidCopyToSelection( vcl::Window *pWindow ) const; + voidStartDrag( vcl::Window* pWindow, sal_Int8 nDragSourceActions ); static void ClearSelection( vcl::Window *pWindow ); diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index f91f0aff0699..4415dc6fcf01 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -916,17 +916,10 @@ void TransferableHelper::PrepareOLE( const TransferableObjectDescriptor& rObjDes AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); } - -void TransferableHelper::CopyToClipboard( vcl::Window *pWindow ) const +void TransferableHelper::CopyToClipboard(const Reference& rClipboard) const { -DBG_ASSERT( pWindow, "Window pointer is NULL" ); -Reference< XClipboard > xClipboard; - -if( pWindow ) -xClipboard = pWindow->GetClipboard(); - -if( xClipboard.is() ) -mxClipboard = xClipboard; +if( rClipboard.is() ) +mxClipboard = rClipboard; if( !(mxClipboard.is() && !mxTerminateListener.is()) ) return; @@ -945,16 +938,20 @@ void TransferableHelper::CopyToClipboard( vcl::Window *pWindow ) const } } - -void TransferableHelper::CopyToSelection( vcl::Window *pWindow ) const +void TransferableHelper::CopyToClipboard( vcl::Window *pWindow ) const { DBG_ASSERT( pWindow, "Window pointer is NULL" ); -Reference< XClipboard > xSelection; +Reference< XClipboard > xClipboard; if( pWindow ) -xSelection = pWindow->GetPrimarySelection(); +xClipboard = pWindow->GetClipboard(); + +CopyToClipboard(xClipboard); +} -if( !(xSelection.is() && !mxTerminateListener.is()) ) +void TransferableHelper::CopyToSelection(const Reference& rSelection) const +{ +if( !(rSelection.is() && !mxTerminateListener.is()) ) return; try @@ -964,13 +961,23 @@ void TransferableHelper::CopyToSelection( vcl::Window *pWindow ) const Reference< XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() ); xDesktop->addTerminateListener( pThis->mxTerminateListener ); -xSelection->setContents( pThis, pThis ); +rSelection->setContents( pThis, pThis ); } catch( const css::uno::Exception& ) { } } +void TransferableHelper::CopyToSelection( vcl::Window *pWindow ) const +{ +DBG_ASSERT( pWindow, "Window pointer is NULL" ); +Reference< XClipboard > xSelection; + +if( pWindow ) +xSelection = pWindow->GetPrimarySelection(); + +CopyToSelection(xSelection); +} void TransferableHelper::StartDrag( vcl::Window* pWindow, sal_Int8 nDnDSourceActions ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source vcl/unx
cui/source/tabpages/autocdlg.cxx | 36 include/vcl/weld.hxx | 14 +++--- vcl/source/app/salvtables.cxx| 20 vcl/unx/gtk3/gtk3gtkinst.cxx | 16 4 files changed, 63 insertions(+), 23 deletions(-) New commits: commit 50588a1583e3cc5dc647a35889e50478c7bfd033 Author: Caolán McNamara AuthorDate: Fri May 17 12:43:38 2019 +0100 Commit: Caolán McNamara CommitDate: Mon May 20 14:53:12 2019 +0200 Related: tdf#109158 GtkTreeStore append performance is poor so prepend in opposite order Change-Id: Ibfa2878d999b945e774b5a90309a663f11b132b5 Reviewed-on: https://gerrit.libreoffice.org/72488 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 20042f986d47..861f2a70396f 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -801,67 +801,63 @@ void OfaAutocorrReplacePage::RefillReplaceBox(bool bFromReset, } } -m_xReplaceTLB->clear(); if( !bSWriter ) aFormatText.clear(); -m_xReplaceTLB->freeze(); - -if( aDoubleStringTable.find(eLang) != aDoubleStringTable.end() ) +if (aDoubleStringTable.find(eLang) != aDoubleStringTable.end()) { DoubleStringArray& rArray = aDoubleStringTable[eNewLanguage]; -for(DoubleString & rDouble : rArray) -{ + +m_xReplaceTLB->bulk_insert_for_each(rArray.size(), [this, &rArray](weld::TreeIter& rIter, int nIndex) { +DoubleString &rDouble = rArray[nIndex]; bool bTextOnly = nullptr == rDouble.pUserData; // formatted text is only in Writer if (bSWriter || bTextOnly) { -OUString sId; if (!bTextOnly) { // that means: with format info or even with selection text -sId = OUString::number(reinterpret_cast(rDouble.pUserData)); +OUString sId = OUString::number(reinterpret_cast(rDouble.pUserData)); +m_xReplaceTLB->set_id(rIter, sId); } -m_xReplaceTLB->append(sId, rDouble.sShort); -m_xReplaceTLB->set_text(m_xReplaceTLB->n_children() - 1, rDouble.sLong, 1); +m_xReplaceTLB->set_text(rIter, rDouble.sShort, 0); +m_xReplaceTLB->set_text(rIter, rDouble.sLong, 1); } else { aFormatText.insert(rDouble.sShort); } -} +}); } else { SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); SvxAutocorrWordList* pWordList = pAutoCorrect->LoadAutocorrWordList(eLang); SvxAutocorrWordList::Content aContent = pWordList->getSortedContent(); -for (auto const& elem : aContent) -{ +m_xReplaceTLB->bulk_insert_for_each(aContent.size(), [this, &aContent](weld::TreeIter& rIter, int nIndex) { +auto const& elem = aContent[nIndex]; bool bTextOnly = elem->IsTextOnly(); // formatted text is only in Writer if (bSWriter || bTextOnly) { -OUString sId; if (!bTextOnly) { // that means: with format info or even with selection text -sId = OUString::number(reinterpret_cast(m_xTextOnlyCB.get())); +OUString sId = OUString::number(reinterpret_cast(m_xTextOnlyCB.get())); +m_xReplaceTLB->set_id(rIter, sId); } -m_xReplaceTLB->append(sId, elem->GetShort()); -m_xReplaceTLB->set_text(m_xReplaceTLB->n_children() - 1, elem->GetLong(), 1); +m_xReplaceTLB->set_text(rIter, elem->GetShort(), 0); +m_xReplaceTLB->set_text(rIter, elem->GetLong(), 1); } else { aFormatText.insert(elem->GetShort()); } -} +}); m_xNewReplacePB->set_sensitive(false); m_xDeleteReplacePB->set_sensitive(false); } -m_xReplaceTLB->thaw(); - SfxViewShell* pViewShell = SfxViewShell::Current(); if (pViewShell && pViewShell->HasSelection()) { diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 6f01abf567c2..8ba41b4e5851 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -765,12 +765,20 @@ public: virtual void move_subtree(TreeIter& rNode, const TreeIter* pNewParent, int nIndexInNewParent) = 0; -//calling func on each element until func returns true or we run out of elements +// call func on each element until func returns true or we run out of elements virtual void all_foreach(const std::function& func) = 0; -//calling func
[Libreoffice-commits] core.git: cui/source include/vcl sc/source vcl/source
cui/source/inc/paragrph.hxx | 28 cui/source/tabpages/paragrph.cxx | 20 include/vcl/weld.hxx | 12 sc/source/ui/attrdlg/tabpages.cxx | 20 sc/source/ui/inc/tabpages.hxx | 20 vcl/source/app/salvtables.cxx | 20 6 files changed, 44 insertions(+), 76 deletions(-) New commits: commit 8bc7a39223ba55efa6453d540b1d5e6ff52e51ee Author: Caolán McNamara AuthorDate: Wed May 8 12:26:39 2019 +0100 Commit: Caolán McNamara CommitDate: Wed May 8 17:31:12 2019 +0200 merge duplicated TriStateEnabled class Change-Id: I1c10010eb7fd33a03f477af0cba03ae74859b174 Reviewed-on: https://gerrit.libreoffice.org/71959 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index e9de90c4131e..572a8af058b6 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -182,18 +182,6 @@ public: virtual voidPageCreated(const SfxAllItemSet& aSet) override; }; -struct TriStateEnabled -{ -TriState eState; -bool bTriStateEnabled; -TriStateEnabled() -: eState(TRISTATE_INDET) -, bTriStateEnabled(true) -{ -} -void ButtonToggled(weld::ToggleButton& rToggle); -}; - // class SvxExtParagraphTabPage -- /* [Description] @@ -233,14 +221,14 @@ protected: private: SvxExtParagraphTabPage(TabPageParent pParent, const SfxItemSet& rSet); -TriStateEnabled aHyphenState; -TriStateEnabled aPageBreakState; -TriStateEnabled aApplyCollState; -TriStateEnabled aPageNumState; -TriStateEnabled aKeepTogetherState; -TriStateEnabled aKeepParaState; -TriStateEnabled aOrphanState; -TriStateEnabled aWidowState; +weld::TriStateEnabled aHyphenState; +weld::TriStateEnabled aPageBreakState; +weld::TriStateEnabled aApplyCollState; +weld::TriStateEnabled aPageNumState; +weld::TriStateEnabled aKeepTogetherState; +weld::TriStateEnabled aKeepParaState; +weld::TriStateEnabled aOrphanState; +weld::TriStateEnabled aWidowState; boolbPageBreak; boolbHtmlMode; diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index caa7a97b33c3..6c8cf7293f26 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -2065,26 +2065,6 @@ IMPL_LINK(SvxExtParagraphTabPage, WidowHdl_Impl, weld::ToggleButton&, rToggle, v WidowHdl(); } -void TriStateEnabled::ButtonToggled(weld::ToggleButton& rToggle) -{ -if (bTriStateEnabled) -{ -switch (eState) -{ -case TRISTATE_INDET: -rToggle.set_state(TRISTATE_FALSE); -break; -case TRISTATE_TRUE: -rToggle.set_state(TRISTATE_INDET); -break; -case TRISTATE_FALSE: -rToggle.set_state(TRISTATE_TRUE); -break; -} -} -eState = rToggle.get_state(); -} - IMPL_LINK(SvxExtParagraphTabPage, OrphanHdl_Impl, weld::ToggleButton&, rToggle, void) { aOrphanState.ButtonToggled(rToggle); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index c24810f4ebec..15d5b609d1b8 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -896,6 +896,18 @@ public: virtual void connect_toggled(const Link& rLink) { m_aToggleHdl = rLink; } }; +struct VCL_DLLPUBLIC TriStateEnabled +{ +TriState eState; +bool bTriStateEnabled; +TriStateEnabled() +: eState(TRISTATE_INDET) +, bTriStateEnabled(true) +{ +} +void ButtonToggled(ToggleButton& rToggle); +}; + class VCL_DLLPUBLIC MenuButton : virtual public ToggleButton { protected: diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx index c0c2ff5ddabc..6f6fb3928ed7 100644 --- a/sc/source/ui/attrdlg/tabpages.cxx +++ b/sc/source/ui/attrdlg/tabpages.cxx @@ -142,26 +142,6 @@ DeactivateRC ScTabPageProtection::DeactivatePage( SfxItemSet* pSetP ) return DeactivateRC::LeavePage; } -void TriStateEnabled::ButtonToggled(weld::ToggleButton& rToggle) -{ -if (bTriStateEnabled) -{ -switch (eState) -{ -case TRISTATE_INDET: -rToggle.set_state(TRISTATE_FALSE); -break; -case TRISTATE_TRUE: -rToggle.set_state(TRISTATE_INDET); -break; -case TRISTATE_FALSE: -rToggle.set_state(TRISTATE_TRUE); -break; -} -} -eState = rToggle.get_state(); -} - IMPL_LINK(ScTabPageProtection, ProtectClickHdl, weld::ToggleButton&, rBox, void) { aProtectState.ButtonToggled(rBox); diff --git a/sc/source/ui/inc/tabpages.hxx b/sc/source/ui/inc/tabpages.hxx index 5d1
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
cui/source/dialogs/FontFeaturesDialog.cxx | 30 ++ cui/source/inc/FontFeaturesDialog.hxx |1 + include/vcl/font/Feature.hxx |7 +-- vcl/source/font/Feature.cxx |7 ++- vcl/source/font/FeatureCollector.cxx |8 ++-- 5 files changed, 40 insertions(+), 13 deletions(-) New commits: commit 36eb092bed8528eaca295d817ec77fc9a2b73339 Author: Martin Hosken AuthorDate: Mon Mar 25 13:44:10 2019 +0700 Commit: Martin Hosken CommitDate: Tue Mar 26 05:00:33 2019 +0100 Allow irregular feature value structures in feature dialog Change-Id: I92df2d47bebb0b0af38f3527881ac65a11d1bb98 Reviewed-on: https://gerrit.libreoffice.org/69643 Tested-by: Jenkins Reviewed-by: Martin Hosken diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index b4dd8e7fc63e..27b7b18620d2 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -34,11 +34,20 @@ FontFeaturesDialog::FontFeaturesDialog(weld::Window* pParent, OUString const& rF FontFeaturesDialog::~FontFeaturesDialog() {} -static void makeEnumComboBox(weld::ComboBox& rNameBox, - vcl::font::FeatureDefinition const& rFeatureDefinition) +static sal_Int32 makeEnumComboBox(weld::ComboBox& rNameBox, + vcl::font::FeatureDefinition const& rFeatureDefinition, + uint32_t nDefault) { +sal_Int32 nRes = 0; +int count = 0; for (vcl::font::FeatureParameter const& rParameter : rFeatureDefinition.getEnumParameters()) -rNameBox.append_text(rParameter.getDescription()); +{ +rNameBox.append(OUString::number(rParameter.getCode()), rParameter.getDescription()); +if (rParameter.getCode() == nDefault) +nRes = count; +++count; +} +return nRes; } void FontFeaturesDialog::initialize() @@ -94,9 +103,12 @@ void FontFeaturesDialog::fillGrid(std::vector const& rFontFe uint32_t nValue = 0; if (aExistingFeatures.find(nFontFeatureCode) != aExistingFeatures.end()) nValue = aExistingFeatures.at(nFontFeatureCode); +else +nValue = aDefinition.getDefault(); FontFeatureItem& aCurrentItem = m_aFeatureItems.back(); aCurrentItem.m_aFeatureCode = nFontFeatureCode; +aCurrentItem.m_nDefault = aDefinition.getDefault(); sal_Int32 nGridPositionX = (i % 2) * 2; sal_Int32 nGridPositionY = i / 2; @@ -113,9 +125,9 @@ void FontFeaturesDialog::fillGrid(std::vector const& rFontFe aCurrentItem.m_xText->set_label(aDefinition.getDescription()); aCurrentItem.m_xText->show(); -makeEnumComboBox(*aCurrentItem.m_xCombo, aDefinition); +sal_Int32 nInit = makeEnumComboBox(*aCurrentItem.m_xCombo, aDefinition, nValue); -aCurrentItem.m_xCombo->set_active(nValue); +aCurrentItem.m_xCombo->set_active(nInit); aCurrentItem.m_xCombo->connect_changed(aComboBoxSelectHandler); aCurrentItem.m_xCombo->show(); } @@ -166,7 +178,7 @@ OUString FontFeaturesDialog::createFontNameWithFeatures() { if (rItem.m_xCheck->get_visible()) { -if (rItem.m_xCheck->get_active()) +if (sal_uInt32(rItem.m_xCheck->get_active()) != rItem.m_nDefault) { if (!bFirst) sNameSuffix.append(OUString(vcl::font::FeatureSeparator)); @@ -174,12 +186,14 @@ OUString FontFeaturesDialog::createFontNameWithFeatures() bFirst = false; sNameSuffix.append(vcl::font::featureCodeAsString(rItem.m_aFeatureCode)); +if (!rItem.m_xCheck->get_active()) +sNameSuffix.append("=0"); } } else if (rItem.m_xCombo->get_visible() && rItem.m_xText->get_visible()) { -int nSelection = rItem.m_xCombo->get_active(); -if (nSelection > 0) +sal_Int32 nSelection = rItem.m_xCombo->get_active_id().toInt32(); +if (nSelection != int(rItem.m_nDefault)) { if (!bFirst) sNameSuffix.append(OUString(vcl::font::FeatureSeparator)); diff --git a/cui/source/inc/FontFeaturesDialog.hxx b/cui/source/inc/FontFeaturesDialog.hxx index ccecb1fcbcbd..b8c48ce805bc 100644 --- a/cui/source/inc/FontFeaturesDialog.hxx +++ b/cui/source/inc/FontFeaturesDialog.hxx @@ -33,6 +33,7 @@ struct FontFeatureItem } sal_uInt32 m_aFeatureCode; +sal_uInt32 m_nDefault; std::unique_ptr m_xBuilder; std::unique_ptr m_xContainer; std::unique_ptr m_xText; diff --git a/include/vcl/font/Feature.hxx b/include/vcl/font/Feature.hxx index 47092f9bb56e..b56ce19ba194 100644 --- a/include/vcl/font/Feature.hxx +++ b/include/vcl/font/Feature.hxx @@
[Libreoffice-commits] core.git: cui/source include/vcl vcl/qa vcl/source
cui/source/dialogs/FontFeaturesDialog.cxx |4 include/vcl/font/Feature.hxx | 44 --- include/vcl/font/FeatureParser.hxx| 11 - vcl/qa/cppunit/FontFeatureTest.cxx| 182 ++ vcl/source/font/Feature.cxx | 35 - vcl/source/font/FeatureParser.cxx | 35 ++--- vcl/source/gdi/CommonSalLayout.cxx|4 7 files changed, 240 insertions(+), 75 deletions(-) New commits: commit 45deb5b714d2d011eb2a5ad91721a9c2c508a426 Author: Khaled Hosny AuthorDate: Mon Mar 11 20:55:24 2019 +0200 Commit: Khaled Hosny CommitDate: Tue Mar 12 00:54:29 2019 +0100 tdf#123304: Allow the full feature syntax as pre 6.2 Fix regression from: commit dc9ee533dc707cc10b99d537eaccc3ee5aa555fe Author: Tomaž Vajngerl Date: Fri Jun 15 19:32:15 2018 +0200 vcl: parser of font features included in the font name Where hb_feature_from_string() was replaced by a simple parser that supports avery limited subset of the syntax it supports (as documented in https://harfbuzz.github.io/harfbuzz-hb-common.html#hb-feature-from-string) Change-Id: I613190a677d24183e8c718fcfcaf9cf9b37a1e8f Reviewed-on: https://gerrit.libreoffice.org/69062 Reviewed-by: Khaled Hosny Tested-by: Khaled Hosny diff --git a/cui/source/dialogs/FontFeaturesDialog.cxx b/cui/source/dialogs/FontFeaturesDialog.cxx index 85a07e63971b..b4dd8e7fc63e 100644 --- a/cui/source/dialogs/FontFeaturesDialog.cxx +++ b/cui/source/dialogs/FontFeaturesDialog.cxx @@ -76,7 +76,7 @@ void FontFeaturesDialog::initialize() void FontFeaturesDialog::fillGrid(std::vector const& rFontFeatures) { vcl::font::FeatureParser aParser(m_sFontName); -std::unordered_map aExistingFeatures = aParser.getFeaturesMap(); +auto aExistingFeatures = aParser.getFeaturesMap(); sal_Int32 i = 0; for (vcl::font::Feature const& rFontFeature : rFontFeatures) @@ -91,7 +91,7 @@ void FontFeaturesDialog::fillGrid(std::vector const& rFontFe m_aFeatureItems.emplace_back(m_xContentGrid.get()); -sal_uInt32 nValue = 0; +uint32_t nValue = 0; if (aExistingFeatures.find(nFontFeatureCode) != aExistingFeatures.end()) nValue = aExistingFeatures.at(nFontFeatureCode); diff --git a/include/vcl/font/Feature.hxx b/include/vcl/font/Feature.hxx index 85e0d1bcfd0d..390abe33f8b7 100644 --- a/include/vcl/font/Feature.hxx +++ b/include/vcl/font/Feature.hxx @@ -18,13 +18,13 @@ namespace vcl { namespace font { -constexpr sal_uInt32 featureCode(const char sFeature[4]) +constexpr uint32_t featureCode(const char sFeature[4]) { -return static_cast(sFeature[0]) << 24U | static_cast(sFeature[1]) << 16U - | static_cast(sFeature[2]) << 8U | static_cast(sFeature[3]); +return static_cast(sFeature[0]) << 24U | static_cast(sFeature[1]) << 16U + | static_cast(sFeature[2]) << 8U | static_cast(sFeature[3]); } -VCL_DLLPUBLIC OUString featureCodeAsString(sal_uInt32 nFeature); +VCL_DLLPUBLIC OUString featureCodeAsString(uint32_t nFeature); enum class FeatureParameterType { @@ -41,22 +41,22 @@ enum class FeatureType struct VCL_DLLPUBLIC FeatureParameter { private: -sal_uInt32 m_nCode; +uint32_t m_nCode; OUString m_sDescription; const char* m_pDescriptionID; public: -FeatureParameter(sal_uInt32 nCode, OUString aDescription); -FeatureParameter(sal_uInt32 nCode, const char* pDescriptionID); +FeatureParameter(uint32_t nCode, OUString aDescription); +FeatureParameter(uint32_t nCode, const char* pDescriptionID); -sal_uInt32 getCode() const; +uint32_t getCode() const; OUString getDescription() const; }; class VCL_DLLPUBLIC FeatureDefinition { private: -sal_uInt32 m_nCode; +uint32_t m_nCode; OUString m_sDescription; const char* m_pDescriptionID; OUString m_sNumericPart; @@ -66,18 +66,18 @@ private: public: FeatureDefinition(); -FeatureDefinition(sal_uInt32 nCode, OUString const& rDescription, +FeatureDefinition(uint32_t nCode, OUString const& rDescription, FeatureParameterType eType = FeatureParameterType::BOOL, std::vector const& rEnumParameters = std::vector{}); -FeatureDefinition(sal_uInt32 nCode, const char* pDescriptionID, +FeatureDefinition(uint32_t nCode, const char* pDescriptionID, OUString const& rNumericPart = OUString()); -FeatureDefinition(sal_uInt32 nCode, const char* pDescriptionID, +FeatureDefinition(uint32_t nCode, const char* pDescriptionID, std::vector aEnumParameters); const std::vector& getEnumParameters() const; OUString getDescription() const; -sal_uInt32 getCode() const; +uint32_t getCode() const; FeatureParameterType getType() const; operator bool() const; @@ -85,9 +85,9 @@ public: str
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source vcl/unx
cui/source/dialogs/hangulhanjadlg.cxx |3 +-- include/vcl/weld.hxx |3 --- vcl/source/app/salvtables.cxx |5 - vcl/unx/gtk3/gtk3gtkinst.cxx |5 - 4 files changed, 1 insertion(+), 15 deletions(-) New commits: commit d0586b42a715e4d14eeb5b3e729f20c3fb40c391 Author: Caolán McNamara AuthorDate: Thu Mar 7 13:12:59 2019 + Commit: Caolán McNamara CommitDate: Thu Mar 7 16:21:39 2019 +0100 can drop wallpaper if use alpha-enabled virdev Change-Id: I655dca755ed8e1c1266c191f61998b3838fe9797 Reviewed-on: https://gerrit.libreoffice.org/68860 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 6f63cb7d45b8..703d52ddb026 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -227,10 +227,9 @@ namespace svx }; RubyRadioButton::RubyRadioButton(std::unique_ptr xControl) -: m_xVirDev(VclPtr::Create()) +: m_xVirDev(VclPtr::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT)) , m_xControl(std::move(xControl)) { -m_xVirDev->SetBackground(m_xControl->get_wallpaper()); // expand the point size of the desired font to the equivalent pixel size if (vcl::Window* pDefaultDevice = dynamic_cast(Application::GetDefaultDevice())) pDefaultDevice->SetPointFont(*m_xVirDev, m_xControl->get_font()); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index e25911f940da..f0b9a6994f87 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -184,8 +183,6 @@ public: // font size is in points, not pixels, e.g. see Window::[G]etPointFont virtual vcl::Font get_font() = 0; -virtual Wallpaper get_wallpaper() const = 0; - //true for rtl, false otherwise virtual bool get_direction() const = 0; virtual void set_direction(bool bRTL) = 0; diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 35bf1e625c6f..e732939aed78 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -387,11 +387,6 @@ public: return m_xWidget->GetPointFont(*m_xWidget); } -virtual Wallpaper get_wallpaper() const override -{ -return Wallpaper(Application::GetSettings().GetStyleSettings().GetDialogColor()); -} - virtual OString get_buildable_name() const override { return m_xWidget->get_id().toUtf8(); diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index a11c943ae651..7e8334d30e8f 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -1599,11 +1599,6 @@ public: Application::GetSettings().GetUILanguageTag().getLocale()); } -virtual Wallpaper get_wallpaper() const override -{ -return Wallpaper(COL_TRANSPARENT); -} - virtual void set_grid_left_attach(int nAttach) override { GtkContainer* pParent = GTK_CONTAINER(gtk_widget_get_parent(m_pWidget)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl
cui/source/inc/tabstpge.hxx |2 ++ cui/source/tabpages/tabstpge.cxx | 16 ++-- include/vcl/weld.hxx |2 +- 3 files changed, 13 insertions(+), 7 deletions(-) New commits: commit 038634b63e997db80c09af3c6493364fa4431bcf Author: Caolán McNamara AuthorDate: Thu Feb 14 12:36:29 2019 + Commit: Caolán McNamara CommitDate: Thu Feb 14 22:02:49 2019 +0100 Resolves: tdf#123426 don't reformat tabstop pos while editing we want to know what it would format as, but we don't want to do the formatting during typing Change-Id: I817798adf5b3f9325682f43b92fe107659803b4f Reviewed-on: https://gerrit.libreoffice.org/67819 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/inc/tabstpge.hxx b/cui/source/inc/tabstpge.hxx index f3f10c4a3435..7ad63e4cbf38 100644 --- a/cui/source/inc/tabstpge.hxx +++ b/cui/source/inc/tabstpge.hxx @@ -130,6 +130,8 @@ private: voidSetFillAndTabType_Impl(); voidNewHdl_Impl(const weld::Button*); +OUStringFormatTab(); + // Handler DECL_LINK(NewHdl_Impl, weld::Button&, void); DECL_LINK(DelHdl_Impl, weld::Button&, void); diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx index bc2ac9a6a4de..ae4f559a43b1 100644 --- a/cui/source/tabpages/tabstpge.cxx +++ b/cui/source/tabpages/tabstpge.cxx @@ -434,6 +434,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(const weld::Button* pBtn) { // Add a new one and select it // Get the value from the display +ReformatHdl_Impl(*m_xTabBox); m_xTabSpin->set_text(m_xTabBox->get_active_text()); auto nVal = m_xTabSpin->denormalize(m_xTabSpin->get_value(eDefUnit)); @@ -488,8 +489,7 @@ void SvxTabulatorTabPage::NewHdl_Impl(const weld::Button* pBtn) int SvxTabulatorTabPage::FindCurrentTab() { -ReformatHdl_Impl(*m_xTabBox); -return m_xTabBox->find_text(m_xTabBox->get_active_text()); +return m_xTabBox->find_text(FormatTab()); } IMPL_LINK_NOARG(SvxTabulatorTabPage, DelHdl_Impl, weld::Button&, void) @@ -632,11 +632,16 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, SelectHdl_Impl, weld::TreeView&, void) } } -IMPL_LINK_NOARG(SvxTabulatorTabPage, ReformatHdl_Impl, weld::Widget&, void) +OUString SvxTabulatorTabPage::FormatTab() { m_xTabSpin->set_text(m_xTabBox->get_active_text()); -m_xTabSpin->set_value(m_xTabSpin->get_value(FieldUnit::NONE), FieldUnit::NONE); -m_xTabBox->set_entry_text(m_xTabSpin->get_text()); +m_xTabSpin->reformat(); +return m_xTabSpin->get_text(); +} + +IMPL_LINK_NOARG(SvxTabulatorTabPage, ReformatHdl_Impl, weld::Widget&, void) +{ +m_xTabBox->set_entry_text(FormatTab()); } IMPL_LINK_NOARG(SvxTabulatorTabPage, ModifyHdl_Impl, weld::ComboBox&, void) @@ -649,7 +654,6 @@ IMPL_LINK_NOARG(SvxTabulatorTabPage, ModifyHdl_Impl, weld::ComboBox&, void) m_xTabSpin->set_text(m_xTabBox->get_active_text()); aCurrentTab.GetTabPos() = m_xTabSpin->denormalize(m_xTabSpin->get_value(eDefUnit)); - m_xNewBtn->set_sensitive(false); m_xDelBtn->set_sensitive(true); return; diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 806027ca6f48..7a88c60189bf 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -1096,7 +1096,7 @@ public: // typically you only need to call this if set_text (e.g. with "") was // previously called to display some arbitrary text instead of the // formatted value and now you want to show it as formatted again -void reformat() { set_value(get_value(m_eSrcUnit), m_eSrcUnit); } +void reformat() { spin_button_output(*m_xSpinButton); } void set_range(int min, int max, FieldUnit eValueUnit) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl
cui/source/factory/dlgfact.cxx |6 -- cui/source/factory/dlgfact.hxx |6 -- include/vcl/abstdlg.hxx|8 3 files changed, 20 deletions(-) New commits: commit b94d0385903dfb7138d2924e81bf6be558a012d1 Author: Caolán McNamara AuthorDate: Thu Nov 29 09:25:34 2018 + Commit: Caolán McNamara CommitDate: Thu Nov 29 21:12:07 2018 +0100 drop unused VclAbstractRefreshableDialog Change-Id: I11ce3235ee95d7c6e8b1832579d097c7b044ae52 Reviewed-on: https://gerrit.libreoffice.org/64217 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 206d4a13cca9..759b90bc53c6 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -110,7 +110,6 @@ short CuiAbstractSingleTabController_Impl::Execute() } IMPL_ABSTDLG_BASE(CuiVclAbstractDialog_Impl) -IMPL_ABSTDLG_BASE(VclAbstractRefreshableDialog_Impl); IMPL_ABSTDLG_BASE(CuiAbstractTabDialog_Impl); short AbstractSvxDistributeDialog_Impl::Execute() @@ -554,11 +553,6 @@ sal_uInt32 AbstractGalleryIdDialog_Impl::GetId() const return m_xDlg->GetId(); } -void VclAbstractRefreshableDialog_Impl::Update() -{ -pDlg->Update(); -} - OUString AbstractURLDlg_Impl::GetURL() const { return pDlg->GetURL(); diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 40f51fb6c681..1e103792893d 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -97,12 +97,6 @@ public: virtual short Execute() override; }; -class VclAbstractRefreshableDialog_Impl : public VclAbstractRefreshableDialog -{ -DECL_ABSTDLG_BASE(VclAbstractRefreshableDialog_Impl,Dialog) -virtual voidUpdate() override ; -}; - class CuiAbstractSfxDialog_Impl : public SfxAbstractDialog { DECL_ABSTDLG_BASE(CuiAbstractSfxDialog_Impl,SfxModalDialog) diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx index 353a542439cf..f000d92c26e5 100644 --- a/include/vcl/abstdlg.hxx +++ b/include/vcl/abstdlg.hxx @@ -86,14 +86,6 @@ public: virtual voidEndDialog(sal_Int32 nResult) = 0; }; -class VCL_DLLPUBLIC VclAbstractRefreshableDialog : public VclAbstractDialog -{ -protected: -virtual ~VclAbstractRefreshableDialog() override = default; -public: -virtual voidUpdate() = 0; -}; - class VCL_DLLPUBLIC AbstractPasswordToOpenModifyDialog : public VclAbstractDialog { protected: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl svtools/source vcl/source
cui/source/options/optchart.cxx| 21 + include/vcl/lstbox.hxx |1 - svtools/source/control/ctrlbox.cxx | 15 ++- vcl/source/control/imp_listbox.cxx | 18 -- 4 files changed, 19 insertions(+), 36 deletions(-) New commits: commit d4e96a36d78299794ff4ac86e937fbbb0843c6ed Author: Noel Grandin AuthorDate: Wed Oct 31 10:18:27 2018 +0200 Commit: Noel Grandin CommitDate: Thu Nov 1 06:43:29 2018 +0100 drop LISTBOX_ERROR almost nobody checks it, so rather just assert Change-Id: Ic3ad4c04c4f6013db3e8757559d3a773df020a1d Reviewed-on: https://gerrit.libreoffice.org/62684 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx index 089b641ea72c..3fd6630afeaf 100644 --- a/cui/source/options/optchart.cxx +++ b/cui/source/options/optchart.cxx @@ -51,19 +51,16 @@ void SvxDefaultColorOptPage::InsertColorEntry(const XColorEntry& rEntry, sal_Int nPos = m_pLbChartColors->InsertEntry(rStr, Image(aBitmap), nPos); -if (nPos != LISTBOX_ERROR) +if ( static_cast(nPos) < aColorList.size() ) { -if ( static_cast(nPos) < aColorList.size() ) -{ -ImpColorList::iterator it = aColorList.begin(); -std::advance( it, nPos ); -aColorList.insert( it, rColor ); -} -else -{ -aColorList.push_back( rColor ); -nPos = aColorList.size() - 1; -} +ImpColorList::iterator it = aColorList.begin(); +std::advance( it, nPos ); +aColorList.insert( it, rColor ); +} +else +{ +aColorList.push_back( rColor ); +nPos = aColorList.size() - 1; } } diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx index 2e8e8a618ccc..8ee51a2681fb 100644 --- a/include/vcl/lstbox.hxx +++ b/include/vcl/lstbox.hxx @@ -27,7 +27,6 @@ #define LISTBOX_APPEND (SAL_MAX_INT32) #define LISTBOX_ENTRY_NOTFOUND (SAL_MAX_INT32) -#define LISTBOX_ERROR (SAL_MAX_INT32) #define LISTBOX_MAX_ENTRIES (SAL_MAX_INT32 - 1) // the following defines can be used for the SetEntryFlags() diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 6346d3284ad2..ca805b44cab5 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -748,15 +748,12 @@ void FontNameBox::Fill( const FontList* pList ) { const FontMetric& rFontMetric = pList->GetFontName( i ); sal_Int32 nIndex = InsertEntry( rFontMetric.GetFamilyName() ); -if ( nIndex != LISTBOX_ERROR ) -{ -if ( nIndex < static_cast(mpFontList->size()) ) { -ImplFontList::iterator it = mpFontList->begin(); -::std::advance( it, nIndex ); -mpFontList->insert( it, rFontMetric ); -} else { -mpFontList->push_back( rFontMetric ); -} +if ( nIndex < static_cast(mpFontList->size()) ) { +ImplFontList::iterator it = mpFontList->begin(); +::std::advance( it, nIndex ); +mpFontList->insert( it, rFontMetric ); +} else { +mpFontList->push_back( rFontMetric ); } } diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 174e6a01fbd9..6570fb34c578 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -121,8 +121,8 @@ sal_Int32 ListBox::NaturalSortCompare(const OUString &rA, const OUString &rB) sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry, bool bSort ) { -if (nPos < 0 || LISTBOX_MAX_ENTRIES <= maEntries.size()) -return LISTBOX_ERROR; +assert(nPos >= 0); +assert(maEntries.size() < LISTBOX_MAX_ENTRIES); if ( !!pNewEntry->maImage ) mnImages++; @@ -764,8 +764,8 @@ void ImplListBoxWindow::ImplCallSelect() sal_Int32 ImplListBoxWindow::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry ) { -if (nPos < 0 || LISTBOX_MAX_ENTRIES <= mpEntryList->GetEntryCount()) -return LISTBOX_ERROR; +assert(nPos >= 0); +assert(mpEntryList->GetEntryCount() < LISTBOX_MAX_ENTRIES); ImplClearLayoutData(); sal_Int32 nNewPos = mpEntryList->InsertEntry( nPos, pNewEntry, mbSort ); @@ -2220,11 +2220,6 @@ sal_Int32 ImplListBox::InsertEntry( sal_Int32 nPos, const OUString& rStr ) { ImplEntryType* pNewEntry = new ImplEntryType( rStr ); sal_Int32 nNewPos = maLBWindow->InsertEntry( nPos, pNewEntry ); -if (nNewPos == LISTBOX_ERROR) -{ -delete pNewEntry; -return nNewPos; -} CompatStateChanged( StateChangedType::Data ); return nNewPos; } @@ -2233,11 +2228,6 @@ sal_Int32 ImplListBox::InsertEntry( sal_Int32 nPos, const OUString& rStr, const { ImplEntryType* pNewEntry = new ImplEntryT
[Libreoffice-commits] core.git: cui/source include/vcl svx/source vcl/Library_vcl.mk vcl/source vcl/workben
cui/source/dialogs/cuigrfflt.cxx | 36 +++ include/vcl/BitmapFilter.hxx |6 - include/vcl/BitmapSepiaFilter.hxx|6 - include/vcl/animate.hxx |5 include/vcl/bitmap.hxx | 102 include/vcl/bitmapex.hxx | 14 -- svx/source/dialog/grfflt.cxx | 21 ++-- vcl/Library_vcl.mk |1 vcl/source/bitmap/bitmapfilter.cxx | 35 +- vcl/source/gdi/animate.cxx | 21 vcl/source/gdi/bitmap4.cxx | 137 --- vcl/source/gdi/bitmapex.cxx |5 vcl/source/graphic/UnoGraphicTransformer.cxx |9 + vcl/workben/outdevgrind.cxx |7 + vcl/workben/vcldemo.cxx |6 - 15 files changed, 89 insertions(+), 322 deletions(-) New commits: commit b781a6b6b2fc0a6688a6335a9408143fb120aa6e Author: Chris Sherlock Date: Fri Apr 20 22:22:44 2018 +1000 vcl: get rid of Bitmap{Ex}::Filter() and Animation::Filter() Change-Id: I510d7b286df732712aa9206b0a7c7910af34c83f Reviewed-on: https://gerrit.libreoffice.org/53206 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 406e2b6a7f7f..f4959cd3af6c 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -17,6 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include +#include +#include +#include +#include +#include #include #include #include @@ -234,16 +240,15 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic, longnTileHeight = static_cast(mpMtrHeight->GetValue()); const Size aSize( std::max( FRound( nTileWidth * fScaleX ), 1L ), std::max( FRound( nTileHeight * fScaleY ), 1L ) ); -BmpFilterParam aParam( aSize ); if( rGraphic.IsAnimated() ) { Animation aAnim( rGraphic.GetAnimation() ); -if( aAnim.Filter( BmpFilter::Mosaic, &aParam ) ) +if (BitmapFilter::Filter(aAnim, BitmapMosaicFilter(aSize.getWidth(), aSize.getHeight( { if( IsEnhanceEdges() ) -aAnim.Filter( BmpFilter::Sharpen ); +BitmapFilter::Filter(aAnim, BitmapSharpenFilter()); aRet = aAnim; } @@ -252,10 +257,10 @@ Graphic GraphicFilterMosaic::GetFilteredGraphic( const Graphic& rGraphic, { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); -if( aBmpEx.Filter( BmpFilter::Mosaic, &aParam ) ) +if (BitmapFilter::Filter(aBmpEx, BitmapMosaicFilter(aSize.getWidth(), aSize.getHeight( { if( IsEnhanceEdges() ) -(void)aBmpEx.Filter( BmpFilter::Sharpen ); +BitmapFilter::Filter(aBmpEx, BitmapSharpenFilter()); aRet = aBmpEx; } @@ -300,13 +305,12 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double { Graphic aRet; double nRadius = mpMtrRadius->GetValue() / 10.0; -BmpFilterParam aParam( nRadius ); if( rGraphic.IsAnimated() ) { Animation aAnim( rGraphic.GetAnimation() ); -if( aAnim.Filter( BmpFilter::Smooth, &aParam ) ) +if (BitmapFilter::Filter(aAnim, BitmapSmoothenFilter(nRadius))) { aRet = aAnim; } @@ -315,7 +319,7 @@ Graphic GraphicFilterSmooth::GetFilteredGraphic( const Graphic& rGraphic, double { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); -if( aBmpEx.Filter( BmpFilter::Smooth, &aParam ) ) +if (BitmapFilter::Filter(aBmpEx, BitmapSmoothenFilter(nRadius))) { aRet = aBmpEx; } @@ -371,13 +375,12 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub { Graphic aRet; sal_uInt8 nGreyThreshold = static_cast(FRound( mpMtrThreshold->GetValue() * 2.55 )); -BmpFilterParam aParam( nGreyThreshold ); if( rGraphic.IsAnimated() ) { Animation aAnim( rGraphic.GetAnimation() ); -if( aAnim.Filter( BmpFilter::Solarize, &aParam ) ) +if (BitmapFilter::Filter(aAnim, BitmapSolarizeFilter(nGreyThreshold))) { if( IsInvert() ) aAnim.Invert(); @@ -389,7 +392,7 @@ Graphic GraphicFilterSolarize::GetFilteredGraphic( const Graphic& rGraphic, doub { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); -if( aBmpEx.Filter( BmpFilter::Solarize, &aParam ) ) +if (BitmapFilter::Filter(aBmpEx, BitmapSolarizeFilter(nGreyThreshold))) { if( IsInvert() ) aBmpEx.Invert(); @@ -433,20 +436,19 @@ Graphic GraphicFilterSepia::GetFilteredGraphic( const Graphic& rGraphic, double, { G
[Libreoffice-commits] core.git: cui/source include/vcl sc/inc sc/source sc/uiconfig sfx2/source sw/source vcl/source vcl/unx
cui/source/dialogs/insdlg.cxx |2 - include/vcl/weld.hxx | 44 ++ sc/inc/scabstdlg.hxx |9 ++-- sc/source/ui/attrdlg/scdlgfact.cxx | 34 + sc/source/ui/attrdlg/scdlgfact.hxx | 21 +++--- sc/source/ui/inc/shtabdlg.hxx | 23 --- sc/source/ui/miscdlgs/linkarea.cxx |4 +- sc/source/ui/miscdlgs/shtabdlg.cxx | 58 +++-- sc/source/ui/view/tabvwsh3.cxx |6 +-- sc/source/ui/view/tabvwshf.cxx | 10 ++--- sc/uiconfig/scalc/ui/showsheetdialog.ui| 45 -- sfx2/source/doc/new.cxx|4 +- sfx2/source/doc/saveastemplatedlg.cxx |2 - sfx2/source/doc/templatedlg.cxx|2 - sw/source/ui/fldui/DropDownFieldDialog.cxx |4 +- sw/source/ui/misc/outline.cxx |2 - sw/source/ui/table/tautofmt.cxx|4 +- vcl/source/app/salvtables.cxx | 15 +++ vcl/unx/gtk3/gtk3gtkinst.cxx | 25 ++-- 19 files changed, 165 insertions(+), 149 deletions(-) New commits: commit dbb4df8568726173f69297611936976ff354c2cf Author: Caolán McNamara Date: Mon Apr 30 14:43:29 2018 +0100 weld ScShowTabDlg Change-Id: Ice5da193d0efbf8e4a61d68c0fcef90f6c6d8e78 Reviewed-on: https://gerrit.libreoffice.org/53665 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 8e3532aa84f9..ac5e7f096773 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -183,7 +183,7 @@ short SvInsertOleDlg::execute() if ( bCreateNew ) { // create and insert new embedded object -OUString aServerName = m_xLbObjecttype->get_selected(); +OUString aServerName = m_xLbObjecttype->get_selected_text(); const SvObjectServer* pS = m_pServers->Get( aServerName ); if ( pS ) { diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 77f985965c90..702b0cf415c7 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -266,7 +266,6 @@ protected: Link m_aRowActivatedHdl; void signal_changed() { m_aChangeHdl.Call(*this); } - void signal_row_activated() { m_aRowActivatedHdl.Call(*this); } public: @@ -278,19 +277,9 @@ public: { insert(-1, rId, rStr, rImage); } + virtual int n_children() const = 0; -virtual void select(int pos) = 0; -virtual void remove(int pos) = 0; -virtual int find(const OUString& rText) const = 0; -virtual int find_id(const OUString& rId) const = 0; -virtual void set_top_entry(int pos) = 0; virtual void clear() = 0; -virtual OUString get_selected() const = 0; -virtual std::vector get_selected_rows() const = 0; -OUString get_selected_id() const { return get_id(get_selected_index()); } -virtual int get_selected_index() const = 0; -virtual OUString get(int pos) const = 0; -virtual OUString get_id(int pos) const = 0; virtual int get_height_rows(int nRows) const = 0; virtual void freeze() = 0; @@ -300,13 +289,36 @@ public: virtual int count_selected_rows() const = 0; void connect_changed(const Link& rLink) { m_aChangeHdl = rLink; } - void connect_row_activated(const Link& rLink) { m_aRowActivatedHdl = rLink; } -void select(const OUString& rText) { select(find(rText)); } -void select_id(const OUString& rId) { select(find_id(rId)); } +//by index +virtual int get_selected_index() const = 0; +virtual void select(int pos) = 0; +virtual void remove(int pos) = 0; +virtual void set_top_entry(int pos) = 0; +virtual std::vector get_selected_rows() const = 0; -void remove(const OUString& rText) { remove(find(rText)); } +//by text +virtual OUString get(int pos) const = 0; +virtual int find(const OUString& rText) const = 0; +OUString get_selected_text() const { return get(get_selected_index()); } +void select_text(const OUString& rText) { select(find(rText)); } +void remove_text(const OUString& rText) { remove(find(rText)); } +std::vector get_selected_rows_text() const +{ +std::vector aRows(get_selected_rows()); +std::vector aRet; +aRet.reserve(aRows.size()); +for (auto a : aRows) +aRet.push_back(get(a)); +return aRet; +} + +//by id +virtual OUString get_id(int pos) const = 0; +virtual int find_id(const OUString& rId) const = 0; +OUString get_selected_id() const { return get_id(get_selected_index()); } +void select_id(const OUString& rId) { select(find_id(rId)); } }; class VCL_DLLPUBLIC Button : virtual public Container diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index cbe1d45f8d61..247cf444e
[Libreoffice-commits] core.git: cui/source include/vcl starmath/source svtools/source svx/source sw/source sw/uiconfig vcl/unx
cui/source/dialogs/cuicharmap.cxx | 14 - include/vcl/weld.hxx|3 starmath/source/dialog.cxx |2 svtools/source/dialogs/prnsetup.cxx |2 svx/source/dialog/compressgraphicdialog.cxx |2 sw/source/ui/dbui/mmresultdialogs.cxx |6 sw/source/ui/dialog/ascfldlg.cxx|2 sw/source/ui/envelp/envlop1.cxx |2 sw/source/ui/envelp/label1.cxx | 12 - sw/source/ui/index/swuiidxmrk.cxx |2 sw/source/ui/misc/docfnote.cxx | 222 sw/source/ui/misc/impfnote.hxx | 57 +++ sw/source/ui/misc/linenum.cxx |2 sw/source/uibase/dbui/dbmgr.cxx |2 sw/uiconfig/swriter/ui/endnotepage.ui | 68 ++-- sw/uiconfig/swriter/ui/footnotepage.ui | 98 ++-- vcl/unx/generic/print/prtsetup.cxx |2 17 files changed, 182 insertions(+), 316 deletions(-) New commits: commit 288b9a3e22c2495c24d6fd195bd8f33a990a9b81 Author: Caolán McNamara Date: Fri Apr 27 16:31:40 2018 +0100 weld SwEndNoteOptionPage Change-Id: I2313352a66b088a4198ac8a96d2fd218bb2176fd Reviewed-on: https://gerrit.libreoffice.org/53608 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index c579c55059c7..ac0fffe42bdf 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -432,7 +432,7 @@ void SvxCharacterMap::init() } if (bFound) -m_xFontLB->set_active(aDefStr); +m_xFontLB->set_active_text(aDefStr); else if (m_xFontLB->get_count() ) m_xFontLB->set_active(0); FontSelectHdl(*m_xFontLB); @@ -559,7 +559,7 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont ) if (m_xFontLB->find_text(aTmp.GetFamilyName()) == -1) return; -m_xFontLB->set_active(aTmp.GetFamilyName()); +m_xFontLB->set_active_text(aTmp.GetFamilyName()); aFont = aTmp; FontSelectHdl(*m_xFontLB); } @@ -708,7 +708,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, SubsetSelectHdl, weld::ComboBoxText&, void) if( pSubsetMap ) curSubset = pSubsetMap->GetSubsetByUnicode( m_xSearchSet->GetSelectCharacter() ); if( curSubset ) -m_xSubsetLB->set_active(curSubset->GetName()); +m_xSubsetLB->set_active_text(curSubset->GetName()); else m_xSubsetLB->set_active(-1); @@ -947,7 +947,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void) if( pSubsetMap ) pSubset = pSubsetMap->GetSubsetByUnicode( cChar ); if( pSubset ) -m_xSubsetLB->set_active(pSubset->GetName()); +m_xSubsetLB->set_active_text(pSubset->GetName()); else m_xSubsetLB->set_active(-1); } @@ -1006,7 +1006,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchCharHighlightHdl, SvxShowCharSet*, void) if( pSubsetMap ) pSubset = pSubsetMap->GetSubsetByUnicode( cChar ); if( pSubset ) -m_xSubsetLB->set_active(pSubset->GetName()); +m_xSubsetLB->set_active_text(pSubset->GetName()); else m_xSubsetLB->set_active(-1); } @@ -1063,7 +1063,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharPreSelectHdl, SvxShowCharSet*, void) setFavButtonState(OUString(&cChar, 1), aFont.GetFamilyName()); const Subset* pSubset = pSubsetMap->GetSubsetByUnicode( cChar ); if( pSubset ) -m_xSubsetLB->set_active(pSubset->GetName()); +m_xSubsetLB->set_active_text(pSubset->GetName()); } m_xOKBtn->set_sensitive(true); @@ -1079,7 +1079,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchCharPreSelectHdl, SvxShowCharSet*, void) setFavButtonState(OUString(&cChar, 1), aFont.GetFamilyName()); const Subset* pSubset = pSubsetMap->GetSubsetByUnicode( cChar ); if( pSubset ) -m_xSubsetLB->set_active(pSubset->GetName()); +m_xSubsetLB->set_active_text(pSubset->GetName()); } m_xOKBtn->set_sensitive(true); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index d15d593ecc7f..77f985965c90 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -231,6 +231,7 @@ public: virtual void insert(int pos, const OUString& rId, const OUString& rStr) = 0; void append(const OUString& rId, const OUString& rStr) { insert(-1, rId, rStr); } virtual void remove(int pos) = 0; +void remove_text(const OUString& rText) { remove(find_text(rText)); } virtual int find_text(const OUString& rStr) const = 0; virtual int find_id(const OUString& rId) const = 0; virtual int get_count() const = 0; @@ -241,7 +242,7 @@ public: void connect_changed(const Link& rLink) { m_aChangeHdl = rLink; } -void set_active(const OUString& rStr)
[Libreoffice-commits] core.git: cui/source include/vcl sd/source vcl/Library_vcl.mk vcl/source vcl/unx
cui/source/dialogs/cuigrfflt.cxx |3 include/vcl/BitmapColorQuantizationFilter.hxx | 45 + include/vcl/BitmapMedianColorQuantizationFilter.hxx | 49 + include/vcl/BitmapSimpleColorQuantizationFilter.hxx | 39 + include/vcl/bitmap.hxx| 28 include/vcl/bitmapex.hxx |9 sd/source/ui/dlg/vectdlg.cxx |9 vcl/Library_vcl.mk|3 vcl/source/bitmap/BitmapColorQuantizationFilter.cxx | 229 ++ vcl/source/bitmap/BitmapMedianColorQuantizationFilter.cxx | 300 vcl/source/bitmap/BitmapSimpleColorQuantizationFilter.cxx | 108 +++ vcl/source/gdi/animate.cxx| 14 vcl/source/gdi/bitmap3.cxx| 493 -- vcl/source/gdi/bitmapex.cxx |5 vcl/unx/generic/dtrans/bmp.cxx| 39 - 15 files changed, 817 insertions(+), 556 deletions(-) New commits: commit 900b1109a94c1d72c17ab429da1b6c6c2bf79ac6 Author: Chris Sherlock Date: Tue Apr 17 22:06:20 2018 +1000 vcl: move Bitmap{Ex}::ReduceColors() to BitmapColorQuantizationFilter class Change-Id: I32b58e8d451e7303e94788a546a5b5f9a5bb4590 Reviewed-on: https://gerrit.libreoffice.org/53037 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 9f0f60d27aa3..406e2b6a7f7f 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include #include #include @@ -502,7 +503,7 @@ Graphic GraphicFilterPoster::GetFilteredGraphic( const Graphic& rGraphic, double { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); -if( aBmpEx.ReduceColors( nPosterCount ) ) +if (BitmapFilter::Filter(aBmpEx, BitmapColorQuantizationFilter(nPosterCount))) aRet = aBmpEx; } diff --git a/include/vcl/BitmapColorQuantizationFilter.hxx b/include/vcl/BitmapColorQuantizationFilter.hxx new file mode 100644 index ..e695567a7bc0 --- /dev/null +++ b/include/vcl/BitmapColorQuantizationFilter.hxx @@ -0,0 +1,45 @@ +/* -*- 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/. + * + */ + +#ifndef INCLUDED_INCLUDE_VCL_BITMAPCOLORQUANTIZATIONFILTER_HXX +#define INCLUDED_INCLUDE_VCL_BITMAPCOLORQUANTIZATIONFILTER_HXX + +#include + +#include + +class VCL_DLLPUBLIC BitmapColorQuantizationFilter : public BitmapFilter +{ +public: +/** Reduce number of colors for the bitmap using the POPULAR algorithm + +@param nNewColorCount +Maximal number of bitmap colors after the reduce operation + */ +BitmapColorQuantizationFilter(sal_uInt16 nNewColorCount) +: mnNewColorCount(nNewColorCount) +{ +} + +virtual BitmapEx execute(BitmapEx const& rBitmapEx) override; + +private: +sal_uInt16 mnNewColorCount; + +struct PopularColorCount +{ +sal_uInt32 mnIndex; +sal_uInt32 mnCount; +}; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/BitmapMedianColorQuantizationFilter.hxx b/include/vcl/BitmapMedianColorQuantizationFilter.hxx new file mode 100644 index ..c15b0ac80ac7 --- /dev/null +++ b/include/vcl/BitmapMedianColorQuantizationFilter.hxx @@ -0,0 +1,49 @@ +/* -*- 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/. + * + */ + +#ifndef INCLUDED_INCLUDE_VCL_BITMAPMEDIANCOLORQUANTIZATIONFILTER_HXX +#define INCLUDED_INCLUDE_VCL_BITMAPMEDIANCOLORQUANTIZATIONFILTER_HXX + +#include + +#include + +#define RGB15(_def_cR, _def_cG, _def_cB) \ +((static_cast(_def_cR) << 10) | (static_cast(_def_cG) << 5) \ + | static_cast(_def_cB)) +#define GAMMA(_def_cVal, _def_InvGamma) \ +(static_cast(MinMax(FRound(pow(_def_cVal / 255.0, _def_InvGamma) * 255.0), 0, 255))) + +class VCL_DLLPUBLIC BitmapMedianColorQuantizationFilter : public BitmapFilter +{ +public: +/** Reduce number of colors for the bitmap using the median algorithm + +@param nNewColorCount +Maximal numb
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
cui/source/dialogs/SpellAttrib.cxx | 12 ++-- cui/source/dialogs/SpellAttrib.hxx |6 +++--- include/vcl/txtattr.hxx|8 vcl/source/edit/txtattr.cxx| 12 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) New commits: commit 846027306a9edcbdf7bf1a3271fd6f8b0d4b139d Author: Noel Grandin Date: Wed Apr 11 14:06:15 2018 +0200 make TextAttrib::Clone return by std::unique_ptr Change-Id: I8e3941c4c8507e7a898f5f2e0fb13543e5c129cd Reviewed-on: https://gerrit.libreoffice.org/52748 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cui/source/dialogs/SpellAttrib.cxx b/cui/source/dialogs/SpellAttrib.cxx index 7207f6c791e0..9d761a55b3f1 100644 --- a/cui/source/dialogs/SpellAttrib.cxx +++ b/cui/source/dialogs/SpellAttrib.cxx @@ -38,9 +38,9 @@ void SpellErrorAttrib::SetFont( vcl::Font& ) const } -TextAttrib* SpellErrorAttrib::Clone() const +std::unique_ptr SpellErrorAttrib::Clone() const { -return new SpellErrorAttrib(*this); +return std::unique_ptr(new SpellErrorAttrib(*this)); } @@ -64,9 +64,9 @@ void SpellLanguageAttrib::SetFont( vcl::Font& ) const } -TextAttrib* SpellLanguageAttrib::Clone() const +std::unique_ptr SpellLanguageAttrib::Clone() const { -return new SpellLanguageAttrib(*this); +return std::unique_ptr(new SpellLanguageAttrib(*this)); } @@ -90,9 +90,9 @@ void SpellBackgroundAttrib::SetFont( vcl::Font& rFont ) const } -TextAttrib* SpellBackgroundAttrib::Clone() const +std::unique_ptr SpellBackgroundAttrib::Clone() const { -return new SpellBackgroundAttrib(*this); +return std::unique_ptr(new SpellBackgroundAttrib(*this)); } diff --git a/cui/source/dialogs/SpellAttrib.hxx b/cui/source/dialogs/SpellAttrib.hxx index aabf466235c3..2a458166b42d 100644 --- a/cui/source/dialogs/SpellAttrib.hxx +++ b/cui/source/dialogs/SpellAttrib.hxx @@ -103,7 +103,7 @@ public: virtual voidSetFont( vcl::Font& rFont ) const override; -virtual TextAttrib* Clone() const override; +virtual std::unique_ptr Clone() const override; virtual booloperator==( const TextAttrib& rAttr ) const override; }; @@ -118,7 +118,7 @@ public: LanguageTypeGetLanguage() const {return m_eLanguage;} virtual voidSetFont( vcl::Font& rFont ) const override; -virtual TextAttrib* Clone() const override; +virtual std::unique_ptr Clone() const override; virtual booloperator==( const TextAttrib& rAttr ) const override; }; @@ -131,7 +131,7 @@ public: SpellBackgroundAttrib(const Color& rCol); virtual voidSetFont( vcl::Font& rFont ) const override; -virtual TextAttrib* Clone() const override; +virtual std::unique_ptr Clone() const override; virtual booloperator==( const TextAttrib& rAttr ) const override; }; }//namespace svx diff --git a/include/vcl/txtattr.hxx b/include/vcl/txtattr.hxx index 8fadf98cc46f..db8da72f3d47 100644 --- a/include/vcl/txtattr.hxx +++ b/include/vcl/txtattr.hxx @@ -51,7 +51,7 @@ public: sal_uInt16 Which() const { return mnWhich; } virtual voidSetFont( vcl::Font& rFont ) const = 0; -virtual TextAttrib* Clone() const = 0; +virtual std::unique_ptr Clone() const = 0; virtual booloperator==( const TextAttrib& rAttr ) const = 0; booloperator!=( const TextAttrib& rAttr ) const @@ -70,7 +70,7 @@ public: const Color&GetColor() const { return maColor; } virtual voidSetFont( vcl::Font& rFont ) const override; -virtual TextAttrib* Clone() const override; +virtual std::unique_ptr Clone() const override; virtual booloperator==( const TextAttrib& rAttr ) const override; }; @@ -84,7 +84,7 @@ public: TextAttribFontWeight( FontWeight eWeight ); virtual voidSetFont( vcl::Font& rFont ) const override; -virtual TextAttrib* Clone() const override; +virtual std::unique_ptr Clone() const override; virtual booloperator==( const TextAttrib& rAttr ) const override; FontWeight getFontWeight() const { return meWeight; } @@ -96,7 +96,7 @@ public: TextAttribProtect(); virtual voidSetFont( vcl::Font& rFont ) const override; -virtual TextAttrib* Clone() const override; +virtual std::unique_ptr Clone() const override; virtual booloperator==( const TextAttrib& rAttr ) const override; }; diff --git a/vcl/source/edit/txtattr.cxx b/vcl/source/edit/txtattr.cxx index 006c77b99160..8e979c1e3f94 100644 --- a/vcl/source/edit/txtattr.cxx +++ b/vcl/source/edit/txtattr.cxx @@ -39,9 +39,9 @@ void TextAttribFontColor::SetFont( vcl::Font& rFont ) const rFont.SetColor( maColor ); } -TextAttrib* TextAtt
[Libreoffice-commits] core.git: cui/source include/vcl starmath/inc starmath/source starmath/uiconfig sw/source
cui/source/dialogs/colorpicker.cxx | 23 ++-- cui/source/dialogs/zoom.cxx |4 - include/vcl/weld.hxx |9 +-- starmath/inc/dialog.hxx | 21 +++ starmath/source/dialog.cxx | 66 +--- starmath/source/document.cxx |8 +- starmath/uiconfig/smath/ui/fontsizedialog.ui | 74 +++ sw/source/ui/misc/linenum.cxx|2 sw/source/ui/table/colwd.cxx |2 sw/source/ui/table/rowht.cxx |2 10 files changed, 109 insertions(+), 102 deletions(-) New commits: commit ccbaaa04417eac83f9f521e034a3e62821e4b7f3 Author: Caolán McNamara Date: Mon Apr 9 15:04:02 2018 +0100 weld SmFontSizeDialog and give it a parent via SfxRequest::GetFrameWeld Change-Id: I126c300ce4b3f477fd927efbcc83b1a6d315f594 Reviewed-on: https://gerrit.libreoffice.org/52637 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 864281ae3ad1..7c64bb23a136 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -802,25 +802,16 @@ ColorPickerDialog::ColorPickerDialog(weld::Window* pParent, Color nColor, sal_In , m_xMFGreen(m_xBuilder->weld_spin_button("greenSpinbutton")) , m_xMFBlue(m_xBuilder->weld_spin_button("blueSpinbutton")) , m_xEDHex(new weld::HexColorControl(m_xBuilder->weld_entry("hexEntry"))) -, m_xMFHue(m_xBuilder->weld_metric_spin_button("hueSpinbutton")) -, m_xMFSaturation(m_xBuilder->weld_metric_spin_button("satSpinbutton")) -, m_xMFBrightness(m_xBuilder->weld_metric_spin_button("brightSpinbutton")) -, m_xMFCyan(m_xBuilder->weld_metric_spin_button("cyanSpinbutton")) -, m_xMFMagenta(m_xBuilder->weld_metric_spin_button("magSpinbutton")) -, m_xMFYellow(m_xBuilder->weld_metric_spin_button("yellowSpinbutton")) -, m_xMFKey(m_xBuilder->weld_metric_spin_button("keySpinbutton")) +, m_xMFHue(m_xBuilder->weld_metric_spin_button("hueSpinbutton", FUNIT_DEGREE)) +, m_xMFSaturation(m_xBuilder->weld_metric_spin_button("satSpinbutton", FUNIT_PERCENT)) +, m_xMFBrightness(m_xBuilder->weld_metric_spin_button("brightSpinbutton", FUNIT_PERCENT)) +, m_xMFCyan(m_xBuilder->weld_metric_spin_button("cyanSpinbutton", FUNIT_PERCENT)) +, m_xMFMagenta(m_xBuilder->weld_metric_spin_button("magSpinbutton", FUNIT_PERCENT)) +, m_xMFYellow(m_xBuilder->weld_metric_spin_button("yellowSpinbutton", FUNIT_PERCENT)) +, m_xMFKey(m_xBuilder->weld_metric_spin_button("keySpinbutton", FUNIT_PERCENT)) , mnDialogMode( nMode ) , meMode( DefaultMode ) { -m_xMFHue->set_unit(FUNIT_DEGREE); -m_xMFSaturation->set_unit(FUNIT_PERCENT); -m_xMFBrightness->set_unit(FUNIT_PERCENT); - -m_xMFCyan->set_unit(FUNIT_PERCENT); -m_xMFMagenta->set_unit(FUNIT_PERCENT); -m_xMFYellow->set_unit(FUNIT_PERCENT); -m_xMFKey->set_unit(FUNIT_PERCENT); - m_xColorField->SetModifyHdl( LINK( this, ColorPickerDialog, ColorFieldControlModifydl ) ); m_xColorSlider->SetModifyHdl( LINK( this, ColorPickerDialog, ColorSliderControlModifyHdl ) ); diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx index d7f91462f971..9ff5d03f9ace 100644 --- a/cui/source/dialogs/zoom.cxx +++ b/cui/source/dialogs/zoom.cxx @@ -132,7 +132,7 @@ SvxZoomDialog::SvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) , m_xPageWidthBtn(m_xBuilder->weld_radio_button("fitw")) , m_x100Btn(m_xBuilder->weld_radio_button("100pc")) , m_xUserBtn(m_xBuilder->weld_radio_button("variable")) -, m_xUserEdit(m_xBuilder->weld_metric_spin_button("zoomsb")) +, m_xUserEdit(m_xBuilder->weld_metric_spin_button("zoomsb", FUNIT_PERCENT)) , m_xViewFrame(m_xBuilder->weld_widget("viewframe")) , m_xAutomaticBtn(m_xBuilder->weld_radio_button("automatic")) , m_xSingleBtn(m_xBuilder->weld_radio_button("singlepage")) @@ -141,8 +141,6 @@ SvxZoomDialog::SvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) , m_xBookModeChk(m_xBuilder->weld_check_button("bookmode")) , m_xOKBtn(m_xBuilder->weld_button("ok")) { -m_xUserEdit->set_unit(FUNIT_PERCENT); - Link aLink = LINK(this, SvxZoomDialog, UserHdl); m_x100Btn->connect_toggled(aLink); m_xOptimalBtn->connect_toggled(aLink); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 6bb4d6541c1f..ebbd505736d4 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -465,8 +465,8 @@ protected: void update_width_chars(); public: -MetricSpinButton(SpinButton* pSpinButton) -: m_eSrcUnit(FUNIT_CM) +MetricSpinButton(SpinButton* pSpinButton, FieldUnit eSrcUnit) +: m_eSrcUnit(eSrcUnit) , m_xSpinButton(pSpinButton) { update_width_chars(); @@
[Libreoffice-commits] core.git: cui/source include/vcl sfx2/source sw/source vcl/source vcl/unx
cui/source/dialogs/colorpicker.cxx |6 +++--- include/vcl/outdev.hxx |1 + include/vcl/weld.hxx|2 +- sfx2/source/doc/new.cxx |2 +- sfx2/source/doc/saveastemplatedlg.cxx |2 +- sw/source/ui/table/instable.cxx |2 +- sw/source/ui/table/tautofmt.cxx |2 +- sw/source/uibase/dialog/SignatureLineDialog.cxx |2 +- vcl/source/app/salvtables.cxx |4 ++-- vcl/source/outdev/text.cxx |8 vcl/source/window/builder.cxx |2 +- vcl/unx/gtk3/gtk3gtkinst.cxx|5 ++--- 12 files changed, 23 insertions(+), 15 deletions(-) New commits: commit ca1ed645036cab9ba5e94a9d2e22ef8110e852e0 Author: Caolán McNamara Date: Fri Mar 16 12:03:58 2018 + use digit width instead of char width its the same across backends Change-Id: I37c83cbf1139babcd014c7cfdee06a13bea845c7 Reviewed-on: https://gerrit.libreoffice.org/51423 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 70a059a29014..87605abe22d5 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -166,7 +166,7 @@ public: { m_xDrawingArea->connect_size_allocate(LINK(this, ColorPreviewControl, DoResize)); m_xDrawingArea->connect_draw(LINK(this, ColorPreviewControl, DoPaint)); - m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_char_width() * 10, + m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_digit_width() * 10, m_xDrawingArea->get_text_height() * 2); } @@ -212,7 +212,7 @@ public: , mdX( -1.0 ) , mdY( -1.0 ) { - m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_char_width() * 40, + m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_digit_width() * 40, m_xDrawingArea->get_text_height() * 10); m_xDrawingArea->connect_size_allocate(LINK(this, ColorFieldControl, DoResize)); m_xDrawingArea->connect_draw(LINK(this, ColorFieldControl, DoPaint)); @@ -559,7 +559,7 @@ ColorSliderControl::ColorSliderControl(weld::DrawingArea* pDrawingArea) , mnLevel( 0 ) , mdValue( -1.0 ) { - m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_char_width() * 3, -1); + m_xDrawingArea->set_size_request(m_xDrawingArea->get_approximate_digit_width() * 3, -1); m_xDrawingArea->connect_size_allocate(LINK(this, ColorSliderControl, DoResize)); m_xDrawingArea->connect_draw(LINK(this, ColorSliderControl, DoPaint)); m_xDrawingArea->connect_mouse_press(LINK(this, ColorSliderControl, DoButtonDown)); diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index e2cec1c195dd..4b766ccd797a 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1138,6 +1138,7 @@ public: */ longGetTextHeight() const; float approximate_char_width() const; +float approximate_digit_width() const; voidDrawTextArray( const Point& rStartPt, const OUString& rStr, const long* pDXAry, diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 98c53f882e2f..eb1f8501cf04 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -42,7 +42,7 @@ public: } virtual void set_size_request(int nWidth, int nHeight) = 0; virtual Size get_preferred_size() const = 0; -virtual float get_approximate_char_width() const = 0; +virtual float get_approximate_digit_width() const = 0; virtual int get_text_height() const = 0; virtual Size get_pixel_size(const OUString& rText) const = 0; virtual OString get_buildable_name() const = 0; diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index be99751c9a05..ef6fbf939a93 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -253,7 +253,7 @@ SfxNewFileDialog::SfxNewFileDialog(weld::Window *pParent, SfxNewFileDialogMode n , m_sLoadTemplate(m_xAltTitleFt->get_label()) , m_nFlags(nFlags) { -const int nWidth = m_xRegionLb->get_approximate_char_width() * 32; +const int nWidth = m_xRegionLb->get_approximate_digit_width() * 32; const int nHeight = m_xRegionLb->get_height_rows(8); m_xRegionLb->set_size_request(nWidth, nHeight); m_xTemplateLb->set_size_request(nWidth, nHeight); diff --git a/sfx2/source/doc/saveastemplatedlg.cxx b/sfx2/source/doc/saveastemplatedlg.cxx index e1f8101fa78d..76a647e94fa6 100644 --- a/sfx2/source/doc/saveastemplatedlg.cxx +++ b/sfx2/source/doc/saveastemplatedlg.cx
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
cui/source/tabpages/backgrnd.cxx | 20 include/vcl/ctrl.hxx |2 -- include/vcl/window.hxx |2 +- vcl/source/control/ctrl.cxx | 18 -- vcl/source/window/paint.cxx |8 +++- 5 files changed, 8 insertions(+), 42 deletions(-) New commits: commit b33287cde2d270d83e2658529be768a99dba98f0 Author: Tamás Zolnai Date: Sat Feb 10 13:24:21 2018 +0100 lokdialog: Handle dialog items' invalidation in general Change-Id: Ib7b178fe97964bc5fd6ac173a143ba8ba089e237 Reviewed-on: https://gerrit.libreoffice.org/49240 Tested-by: Jenkins Reviewed-by: Tamás Zolnai diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 3926e04f83fd..637f73c34c59 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -156,7 +156,6 @@ protected: virtual voidPaint( vcl::RenderContext& /*rRenderContext*/, const ::tools::Rectangle& rRect ) override; virtual voidDataChanged( const DataChangedEvent& rDCEvt ) override; virtual voidResize() override; -virtual voidLogicInvalidate(const ::tools::Rectangle* pRectangle) override; private: @@ -313,25 +312,6 @@ void BackgroundPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt ) Window::DataChanged( rDCEvt ); } - -void BackgroundPreviewImpl::LogicInvalidate(const ::tools::Rectangle* /*pRectangle*/) -{ -// Invalidate the container dialog or floating window -// The code is same as in Control::LogicInvalidate() method -if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isDialogPainting()) -{ -if (VclPtr pParent = GetParentWithLOKNotifier()) -{ -// invalidate the complete floating window for now -if (pParent->ImplIsFloatingWindow()) -return pParent->LogicInvalidate(nullptr); - -const ::tools::Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel())); -pParent->LogicInvalidate(&aRect); -} -} -} - #define HDL(hdl) LINK(this,SvxBackgroundTabPage,hdl) SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSet& rCoreSet) diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx index 8e2926ae1774..cb68cfe8f78a 100644 --- a/include/vcl/ctrl.hxx +++ b/include/vcl/ctrl.hxx @@ -44,8 +44,6 @@ private: SAL_DLLPRIVATE void ImplInitControlData(); -virtual voidLogicInvalidate(const tools::Rectangle* pRectangle) override; - Control (const Control &) = delete; Control & operator= (const Control &) = delete; diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 2cd63578b0f1..486ae567c1bc 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -567,7 +567,7 @@ public: SAL_DLLPRIVATE bool ImplIsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const; SAL_DLLPRIVATE bool ImplIsChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const; - bool ImplIsFloatingWindow() const; +SAL_DLLPRIVATE bool ImplIsFloatingWindow() const; SAL_DLLPRIVATE bool ImplIsPushButton() const; SAL_DLLPRIVATE bool ImplIsSplitter() const; SAL_DLLPRIVATE bool ImplIsOverlapWindow() const; diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 4ece999ab75b..7cc4cff385bf 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -416,24 +416,6 @@ void Control::ImplInitSettings() ApplySettings(*this); } -void Control::LogicInvalidate(const tools::Rectangle* /*pRectangle*/) -{ -// Several repaint, resize invalidations are emitted when we are painting, -// ignore all of those -if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isDialogPainting()) -{ -if (VclPtr pParent = GetParentWithLOKNotifier()) -{ -// invalidate the complete floating window for now -if (pParent->ImplIsFloatingWindow()) -return pParent->LogicInvalidate(nullptr); - -const tools::Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel())); -pParent->LogicInvalidate(&aRect); -} -} -} - tools::Rectangle Control::DrawControlText( OutputDevice& _rTargetDevice, const tools::Rectangle& rRect, const OUString& _rStr, DrawTextFlags _nStyle, MetricVector* _pVector, OUString* _pDisplayText, const Size* i_pDeviceSize ) const { diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx index 53b4e8cc55f1..80f09b193b66 100644 --- a/vcl/source/window/paint.cxx +++ b/vcl/source/window/paint.cxx @@ -1189,7 +1189
[Libreoffice-commits] core.git: cui/source include/vcl
cui/source/tabpages/backgrnd.cxx | 22 ++ include/vcl/window.hxx |2 +- 2 files changed, 23 insertions(+), 1 deletion(-) New commits: commit 974ea04ddd1b82e5d5c0171bd8ad29310e3f2bd7 Author: Tamás Zolnai Date: Thu Feb 1 19:55:51 2018 +0100 lokdialog: Color/font picker in dialogs don't show preview Invalidation needs to be passed upward to the right parent window. It should work similar to other dialog items, but this preview class is not derived from the Control class. Change-Id: I5fb2b6438b8be92d55609c8d3c25110b49d0e6d7 Reviewed-on: https://gerrit.libreoffice.org/49101 Tested-by: Jenkins Reviewed-by: Tamás Zolnai diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 00bdcd0cadd8..3926e04f83fd 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,7 @@ #include #include #include +#include using namespace css; @@ -154,6 +156,7 @@ protected: virtual voidPaint( vcl::RenderContext& /*rRenderContext*/, const ::tools::Rectangle& rRect ) override; virtual voidDataChanged( const DataChangedEvent& rDCEvt ) override; virtual voidResize() override; +virtual voidLogicInvalidate(const ::tools::Rectangle* pRectangle) override; private: @@ -310,6 +313,25 @@ void BackgroundPreviewImpl::DataChanged( const DataChangedEvent& rDCEvt ) Window::DataChanged( rDCEvt ); } + +void BackgroundPreviewImpl::LogicInvalidate(const ::tools::Rectangle* /*pRectangle*/) +{ +// Invalidate the container dialog or floating window +// The code is same as in Control::LogicInvalidate() method +if (comphelper::LibreOfficeKit::isActive() && !comphelper::LibreOfficeKit::isDialogPainting()) +{ +if (VclPtr pParent = GetParentWithLOKNotifier()) +{ +// invalidate the complete floating window for now +if (pParent->ImplIsFloatingWindow()) +return pParent->LogicInvalidate(nullptr); + +const ::tools::Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel())); +pParent->LogicInvalidate(&aRect); +} +} +} + #define HDL(hdl) LINK(this,SvxBackgroundTabPage,hdl) SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const SfxItemSet& rCoreSet) diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 3fe40355bab3..7028255f5999 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -567,7 +567,7 @@ public: SAL_DLLPRIVATE bool ImplIsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const; SAL_DLLPRIVATE bool ImplIsChild( const vcl::Window* pWindow, bool bSystemWindow = false ) const; -SAL_DLLPRIVATE bool ImplIsFloatingWindow() const; + bool ImplIsFloatingWindow() const; SAL_DLLPRIVATE bool ImplIsPushButton() const; SAL_DLLPRIVATE bool ImplIsSplitter() const; SAL_DLLPRIVATE bool ImplIsOverlapWindow() const; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
cui/source/dialogs/SpellDialog.cxx |9 ++--- include/vcl/texteng.hxx|2 +- vcl/source/edit/textdoc.hxx|7 ++- vcl/source/edit/texteng.cxx|6 -- 4 files changed, 17 insertions(+), 7 deletions(-) New commits: commit 19910c461230f70bb9e98ad44db3525f0d755724 Author: Julien Nabet Date: Thu Sep 28 00:18:05 2017 +0200 tdf#112658: fix leak when calling TextEngine::SetAttrib TextCharAttribList::RemoveAttrib lets a dangling pointer when release unique_ptr obj maAttribs[n] So retrieve a unique_ptr from the different layers until SentenceEditWindow_Impl::ChangeMarkedWord (SpellDialog.cxx). Change-Id: I734909dce86ec28d69c09b2a8c0fc4a6941f422a Reviewed-on: https://gerrit.libreoffice.org/42881 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 82c91910d130..57358d89ad3a 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -1643,11 +1643,14 @@ void SentenceEditWindow_Impl::ChangeMarkedWord(const OUString& rNewWord, Languag ExtTextEngine* pTextEngine = GetTextEngine(); pTextEngine->UndoActionStart(); const TextCharAttrib* pErrorAttrib = pTextEngine->FindCharAttrib( TextPaM(0, m_nErrorStart), TEXTATTR_SPELL_ERROR ); +std::unique_ptr pReleasedErrorAttrib; +std::unique_ptr pReleasedLangAttrib; +std::unique_ptr pReleasedBackAttrib; DBG_ASSERT(pErrorAttrib, "no error attribute found"); const SpellErrorDescription* pSpellErrorDescription = nullptr; if(pErrorAttrib) { -pTextEngine->RemoveAttrib(0, *pErrorAttrib); +pReleasedErrorAttrib = pTextEngine->RemoveAttrib(0, *pErrorAttrib); pSpellErrorDescription = &static_cast(pErrorAttrib->GetAttr()).GetErrorDescription(); } const TextCharAttrib* pBackAttrib = pTextEngine->FindCharAttrib( TextPaM(0, m_nErrorStart), TEXTATTR_SPELL_BACKGROUND ); @@ -1666,7 +1669,7 @@ void SentenceEditWindow_Impl::ChangeMarkedWord(const OUString& rNewWord, Languag nTextLen) { SpellLanguageAttrib aNewLangAttrib( static_cast(pLangAttrib->GetAttr()).GetLanguage()); -pTextEngine->RemoveAttrib(0, *pLangAttrib); +pReleasedLangAttrib = pTextEngine->RemoveAttrib(0, *pLangAttrib); pTextEngine->SetAttrib( aNewLangAttrib, 0, m_nErrorEnd + nDiffLen, nTextLen ); } } @@ -1675,7 +1678,7 @@ void SentenceEditWindow_Impl::ChangeMarkedWord(const OUString& rNewWord, Languag { std::unique_ptr pNewBackground(pBackAttrib->GetAttr().Clone()); const sal_Int32 nStart = pBackAttrib->GetStart(); -pTextEngine->RemoveAttrib(0, *pBackAttrib); +pReleasedBackAttrib = pTextEngine->RemoveAttrib(0, *pBackAttrib); pTextEngine->SetAttrib(*pNewBackground, 0, nStart, m_nErrorStart); } pTextEngine->SetModified(true); diff --git a/include/vcl/texteng.hxx b/include/vcl/texteng.hxx index c9fcb08c5a72..3abf26abf172 100644 --- a/include/vcl/texteng.hxx +++ b/include/vcl/texteng.hxx @@ -297,7 +297,7 @@ public: const TextCharAttrib* FindCharAttrib( const TextPaM& rPaM, sal_uInt16 nWhich ) const; voidRemoveAttribs( sal_uInt32 nPara, sal_uInt16 nWhich ); -voidRemoveAttrib( sal_uInt32 nPara, const TextCharAttrib& rAttrib ); +std::unique_ptr RemoveAttrib( sal_uInt32 nPara, const TextCharAttrib& rAttrib ); voidRemoveAttribs( sal_uInt32 nPara ); voidSetAttrib( const TextAttrib& rAttr, sal_uInt32 nPara, sal_Int32 nStart, sal_Int32 nEnd, bool bIdleFormatAndUpdate = true ); diff --git a/vcl/source/edit/textdoc.hxx b/vcl/source/edit/textdoc.hxx index 1695f9f4c04b..5a6fd869b040 100644 --- a/vcl/source/edit/textdoc.hxx +++ b/vcl/source/edit/textdoc.hxx @@ -44,7 +44,12 @@ public: const TextCharAttrib& GetAttrib( sal_uInt16 n ) const { return *maAttribs[n].get(); } TextCharAttrib& GetAttrib( sal_uInt16 n ) { return *maAttribs[n].get(); } -voidRemoveAttrib( sal_uInt16 n ){ maAttribs[n].release(); maAttribs.erase( maAttribs.begin() + n ); } +std::unique_ptr RemoveAttrib( sal_uInt16 n ) +{ +std::unique_ptr pReleased = std::move(maAttribs[n]); +maAttribs.erase( maAttribs.begin() + n ); +return pReleased; +} voidInsertAttrib( TextCharAttrib* pAttrib ); diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index acdb6b74c427..b847d13da856 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -2504,8 +2504,9 @@ void TextEngine::RemoveAttribs( sal_uInt32 nPara, sal_uInt16 nWhich ) } } -void TextEngine::RemoveAttrib( sal_uInt32 nPara, const TextCharAttrib& rAttrib ) +std::unique_ptr TextEngine::RemoveAttrib( sal_uInt32 nPara, const
[Libreoffice-commits] core.git: cui/source include/vcl svx/source vcl/source
cui/source/tabpages/backgrnd.cxx |2 +- include/vcl/alpha.hxx|5 ++--- include/vcl/bitmap.hxx |6 ++ svx/source/sidebar/nbdtmg.cxx|4 ++-- vcl/source/gdi/bitmap.cxx|2 +- vcl/source/gdi/bitmapex.cxx |4 ++-- 6 files changed, 10 insertions(+), 13 deletions(-) New commits: commit 09917566b6ce86ea65a246f2055b5d1f41df4e76 Author: Noel Grandin Date: Wed Sep 27 14:22:45 2017 +0200 simplify Bitmap operator==/IsEqual (stage2) Now that we've sorted out which bits are rightfully internal (see commit 7a4064cf87d23bffac987b3e39bf87d9b4d158fc), and which bits need a comparison operator, rename IsEqual to operator==. Change-Id: Iec229a7571d76ee18fbc0a4fe672cc2e50a44948 Reviewed-on: https://gerrit.libreoffice.org/42851 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index e93ab92180f7..6d483aecb0f1 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -683,7 +683,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet ) { const Graphic* pGraphic = rOldItem.GetGraphic(); if (pGraphic) -bModifyBrush = !pGraphic->GetBitmap().IsEqual(aBgdGraphic.GetBitmap()); +bModifyBrush = pGraphic->GetBitmap() != aBgdGraphic.GetBitmap(); } if (bModifyBrush) { diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx index f4cd32936d63..e21bcc3b0732 100644 --- a/include/vcl/alpha.hxx +++ b/include/vcl/alpha.hxx @@ -44,9 +44,8 @@ public: AlphaMask& operator=( const AlphaMask& rAlphaMask ) { return static_cast( Bitmap::operator=( rAlphaMask ) ); } AlphaMask& operator=( AlphaMask&& rAlphaMask ) { return static_cast( Bitmap::operator=( std::move(rAlphaMask) ) ); } booloperator!() const { return Bitmap::operator!(); } -booloperator==( const AlphaMask& rAlphaMask ) const = delete; -booloperator!=( const AlphaMask& rAlphaMask ) const = delete; -boolIsEqual( const AlphaMask& rAlphaMask ) const { return Bitmap::IsEqual(rAlphaMask); } +booloperator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==(rAlphaMask); } +booloperator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=(rAlphaMask); } voidSetPrefMapMode( const MapMode& rMapMode ) { Bitmap::SetPrefMapMode( rMapMode ); } diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 321c4969e3e7..0be13c12bf3e 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -224,10 +224,8 @@ public: Bitmap& operator=( const Bitmap& rBitmap ); Bitmap& operator=( Bitmap&& rBitmap ); inline bool operator!() const; -booloperator==( const Bitmap& rBitmap ) const = delete; -booloperator!=( const Bitmap& rBitmap ) const = delete; - -boolIsEqual( const Bitmap& rBmp ) const; +booloperator==( const Bitmap& rBitmap ) const; +booloperator!=( const Bitmap& rBitmap ) const { return !operator==(rBitmap); } inline bool IsEmpty() const; voidSetEmpty(); diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 0b97abe3bbb6..df87e2242620 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -670,8 +670,8 @@ sal_uInt16 OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 /*m const Graphic* pGrf2 = pBrsh2->GetGraphic(); if (pGrf1==pGrf2) bIsMatch = true; if (pGrf1 && pGrf2) { -if ( pGrf1->GetBitmap().IsEqual(pGrf2->GetBitmap()) && - _pSet->aSize==aFmt.GetGraphicSize()) +if ( pGrf1->GetBitmap() == pGrf2->GetBitmap() && + _pSet->aSize == aFmt.GetGraphicSize()) bIsMatch = true; } } diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index aef5cf4b2428..2c1a6bff4f6b 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -231,7 +231,7 @@ Bitmap& Bitmap::operator=( Bitmap&& rBitmap ) return *this; } -bool Bitmap::IsEqual( const Bitmap& rBmp ) const +bool Bitmap::operator==( const Bitmap& rBmp ) const { return rBmp.mxImpBmp == mxImpBmp || // Includes both are nullptr (rBmp.mxImpBmp && mxImpBmp && mxImpBmp->ImplIsEqual(*rBmp.mxImpBmp)); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 4a15547435cf..5f27cb
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
cui/source/tabpages/backgrnd.cxx |2 +- include/vcl/alpha.hxx|5 +++-- include/vcl/bitmap.hxx | 14 ++ vcl/source/gdi/bitmap.cxx|4 ++-- vcl/source/gdi/bitmapex.cxx |4 ++-- 5 files changed, 10 insertions(+), 19 deletions(-) New commits: commit 404630c6052919c1a0b5dab405084c2a39fc2f5c Author: Noel Grandin Date: Wed Sep 27 11:36:18 2017 +0200 simplify Bitmap operator==/IsEqual (stage1) It looks like operator== is actually only useful internally. So inline that, and rename the other call sites to use IsEqual(). As a second stage, I will rename IsEqual to operator==, the intention being to make it obvious how the call sites are modified. Change-Id: I37f2920a8cafaffb25e8c5c16e6559546206684b Reviewed-on: https://gerrit.libreoffice.org/42846 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 6d483aecb0f1..e93ab92180f7 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -683,7 +683,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet ) { const Graphic* pGraphic = rOldItem.GetGraphic(); if (pGraphic) -bModifyBrush = pGraphic->GetBitmap() != aBgdGraphic.GetBitmap(); +bModifyBrush = !pGraphic->GetBitmap().IsEqual(aBgdGraphic.GetBitmap()); } if (bModifyBrush) { diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx index 6e6609d8fd31..f4cd32936d63 100644 --- a/include/vcl/alpha.hxx +++ b/include/vcl/alpha.hxx @@ -44,8 +44,9 @@ public: AlphaMask& operator=( const AlphaMask& rAlphaMask ) { return static_cast( Bitmap::operator=( rAlphaMask ) ); } AlphaMask& operator=( AlphaMask&& rAlphaMask ) { return static_cast( Bitmap::operator=( std::move(rAlphaMask) ) ); } booloperator!() const { return Bitmap::operator!(); } -booloperator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==( rAlphaMask ); } -booloperator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=( rAlphaMask ); } +booloperator==( const AlphaMask& rAlphaMask ) const = delete; +booloperator!=( const AlphaMask& rAlphaMask ) const = delete; +boolIsEqual( const AlphaMask& rAlphaMask ) const { return Bitmap::IsEqual(rAlphaMask); } voidSetPrefMapMode( const MapMode& rMapMode ) { Bitmap::SetPrefMapMode( rMapMode ); } diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 98bd21ded439..321c4969e3e7 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -224,8 +224,8 @@ public: Bitmap& operator=( const Bitmap& rBitmap ); Bitmap& operator=( Bitmap&& rBitmap ); inline bool operator!() const; -inline bool operator==( const Bitmap& rBitmap ) const; -inline bool operator!=( const Bitmap& rBitmap ) const; +booloperator==( const Bitmap& rBitmap ) const = delete; +booloperator!=( const Bitmap& rBitmap ) const = delete; boolIsEqual( const Bitmap& rBmp ) const; @@ -732,16 +732,6 @@ inline bool Bitmap::operator!() const return( mxImpBmp == nullptr ); } -inline bool Bitmap::operator==( const Bitmap& rBitmap ) const -{ -return( rBitmap.mxImpBmp == mxImpBmp ); -} - -inline bool Bitmap::operator!=( const Bitmap& rBitmap ) const -{ -return( rBitmap.mxImpBmp != mxImpBmp ); -} - inline bool Bitmap::IsEmpty() const { return( mxImpBmp == nullptr ); diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index bce74703689c..aef5cf4b2428 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -779,7 +779,7 @@ bool Bitmap::CopyPixel( const tools::Rectangle& rRectDst, if( !aRectDst.IsEmpty() ) { -if( pBmpSrc && ( *pBmpSrc != *this ) ) +if( pBmpSrc && ( pBmpSrc->mxImpBmp != mxImpBmp ) ) { Bitmap* pSrc = const_cast(pBmpSrc); const Size aCopySizePix( pSrc->GetSizePixel() ); @@ -958,7 +958,7 @@ bool Bitmap::CopyPixel_AlphaOptimized( const tools::Rectangle& rRectDst, const t if( !aRectDst.IsEmpty() ) { -if( pBmpSrc && ( *pBmpSrc != *this ) ) +if( pBmpSrc && ( pBmpSrc->mxImpBmp != mxImpBmp ) ) { Bitmap* pSrc = const_cast(pBmpSrc); const Size aCopySizePix( pSrc->GetSizePixel() ); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 99cf6846b243..4a15547435cf 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -193,7 +193,7 @@ bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const if( eTransparent !=
[Libreoffice-commits] core.git: cui/source include/vcl
cui/source/dialogs/iconcdlg.cxx |2 +- include/vcl/lazydelete.hxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit b9f2f43a9b6724fa1a09ba3115ac9abb25d52c8a Author: Andrea Gelmini Date: Mon Sep 11 21:32:13 2017 +0200 Fix typos Change-Id: I7bb62814c8cdf635d1c54f0a1cbb09a3d06a0d5d Reviewed-on: https://gerrit.libreoffice.org/42178 Reviewed-by: Julien Nabet Tested-by: Julien Nabet diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx index 825d846f8635..8c2f7a2f34e8 100644 --- a/cui/source/dialogs/iconcdlg.cxx +++ b/cui/source/dialogs/iconcdlg.cxx @@ -57,7 +57,7 @@ IconChoicePage::~IconChoicePage() /** | -| Activate / Deaktivate +| Activate / Deactivate | \**/ diff --git a/include/vcl/lazydelete.hxx b/include/vcl/lazydelete.hxx index 4bc122457279..930d6c2a4157 100644 --- a/include/vcl/lazydelete.hxx +++ b/include/vcl/lazydelete.hxx @@ -56,7 +56,7 @@ namespace vcl object to be destroyed lazy. The static method creates the LazyDeletor (which in turn registers itself in LazyDelete) if this is the first time a T* is to be destroyed lazy. It then inserts the object. When the LazyDeletor -gets delte it will delete the stored objects in a fashion +gets delete it will delete the stored objects in a fashion that will ensure the correct order of deletion via the specialized is_less method (e.g. if a Window is a child of another Window and therefore should be destroyed first it is "less" in this sense) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl sw/inc sw/source
cui/source/factory/dlgfact.cxx|4 ++-- cui/source/factory/dlgfact.hxx|4 ++-- include/vcl/abstdlg.hxx |4 ++-- sw/inc/swabstdlg.hxx |2 +- sw/source/ui/dialog/swdlgfact.cxx |4 ++-- sw/source/ui/dialog/swdlgfact.hxx |4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) New commits: commit ca83aad3703a2c3b28eb7cca43f3b6d2e9351aa4 Author: Noel Grandin Date: Wed Aug 16 10:37:26 2017 +0200 convert dialog result methods from long->sal_Int32 Change-Id: Id3c56a2c9f8f8813e3bbff4c4ae9156b2185fc9c Reviewed-on: https://gerrit.libreoffice.org/41206 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 05c834392c11..d49a73467796 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -160,7 +160,7 @@ void VclAbstractDialog2_Impl::StartExecuteModal( const Link& rEnd } // virtual -long VclAbstractDialog2_Impl::GetResult() +sal_Int32 VclAbstractDialog2_Impl::GetResult() { return m_pDlg->GetResult(); } @@ -236,7 +236,7 @@ SvxDistributeVertical AbstractSvxDistributeDialog_Impl::GetDistributeVer()const return pDlg->GetDistributeVer(); } -void AbstractHangulHanjaConversionDialog_Impl::EndDialog(long nResult) +void AbstractHangulHanjaConversionDialog_Impl::EndDialog(sal_Int32 nResult) { pDlg->EndDialog(nResult); } diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index e333254d3cc8..a6ce3a9ac050 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -84,7 +84,7 @@ public: virtual ~VclAbstractDialog2_Impl() override; virtual voiddispose() override; virtual voidStartExecuteModal( const Link& rEndDialogHdl ) override; -virtual longGetResult() override; +virtual sal_Int32 GetResult() override; private: DECL_LINK( EndDialogHdl, Dialog&, void ); }; @@ -135,7 +135,7 @@ public: class AbstractHangulHanjaConversionDialog_Impl: public AbstractHangulHanjaConversionDialog { DECL_ABSTDLG_BASE(AbstractHangulHanjaConversionDialog_Impl,HangulHanjaConversionDialog) -virtual void EndDialog(long nResult) override; +virtual void EndDialog(sal_Int32 nResult) override; virtual void EnableRubySupport( bool _bVal ) override; virtual void SetByCharacter( bool _bByCharacter ) override ; virtual void SetConversionDirectionState( bool _bTryBothDirections, editeng::HangulHanjaConversion::ConversionDirection _ePrimaryConversionDirection ) override; diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx index 5303165f2e9b..40f75ed293b6 100644 --- a/include/vcl/abstdlg.hxx +++ b/include/vcl/abstdlg.hxx @@ -55,7 +55,7 @@ protected: virtual ~VclAbstractDialog2() override; public: virtual voidStartExecuteModal( const Link& rEndDialogHdl ) = 0; -virtual longGetResult() = 0; +virtual sal_Int32 GetResult() = 0; }; class VCL_DLLPUBLIC VclAbstractTerminatedDialog : public VclAbstractDialog @@ -63,7 +63,7 @@ class VCL_DLLPUBLIC VclAbstractTerminatedDialog : public VclAbstractDialog protected: virtual ~VclAbstractTerminatedDialog() override = default; public: -virtual voidEndDialog(long nResult) = 0; +virtual voidEndDialog(sal_Int32 nResult) = 0; }; class VCL_DLLPUBLIC VclAbstractRefreshableDialog : public VclAbstractDialog diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index a0b572ae0006..ba607870619d 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -113,7 +113,7 @@ public: //from class SalFrame virtual void SetWindowState( const OString & rStr ) = 0; virtual OString GetWindowState() const = 0; -virtual void EndDialog(long nResult) override = 0; +virtual void EndDialog(sal_Int32 nResult) override = 0; }; class AbstractInsFootNoteDlg : public VclAbstractDialog diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index c3d64b266ed6..9d6f17de3971 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -406,7 +406,7 @@ OString AbstractFieldInputDlg_Impl::GetWindowState() const return pDlg->GetWindowState(); } -void AbstractFieldInputDlg_Impl::EndDialog(long n) +void AbstractFieldInputDlg_Impl::EndDialog(sal_Int32 n) { pDlg->EndDialog(n); } @@ -597,7 +597,7 @@ void AbstractMailMergeWizard_Impl::StartExecuteModal( const Link& LINK( this, AbstractMailMergeWizard_Impl, EndDialogHdl ) ); } -long AbstractMailMergeWizard_Impl::GetResult() +sal_Int32 AbstractMailMergeWizard_Impl::GetResult() { return pDlg->GetResult(); } diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 93598fd0392e..d6375e95103f 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/sw
[Libreoffice-commits] core.git: cui/source include/vcl sd/source svx/source vcl/source
cui/source/customize/cfg.cxx|2 +- cui/source/dialogs/hlmarkwn.cxx |2 +- include/vcl/image.hxx |1 - sd/source/ui/dlg/inspagob.cxx |2 +- svx/source/dialog/svxruler.cxx |2 +- vcl/source/image/Image.cxx |6 -- 6 files changed, 4 insertions(+), 11 deletions(-) New commits: commit e9c17354d3cfb4f808fa2092ffcb3b9de7654dee Author: Caolán McNamara Date: Wed Jan 25 14:21:02 2017 + move Image ctor variant with mask color to callers Change-Id: I81a52aeb855edca823881360831b26e252780053 diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index ca667f3..21c66b2 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -4868,7 +4868,7 @@ Image SvxToolbarEntriesListBox::GetSizedImage( rVDev.DrawLine( Point( aNewSize.Width()-3, 0 ), Point( aNewSize.Width()-3, aNewSize.Height()-1 )); // Create new image that uses the fillcolor as transparent -return Image( rVDev.GetBitmap( Point(), aNewSize ), aFillColor ); +return Image(BitmapEx(rVDev.GetBitmap(Point(), aNewSize), aFillColor)); } void SvxToolbarEntriesListBox::DataChanged( const DataChangedEvent& rDCEvt ) diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx index cd11a88..ca8a282 100644 --- a/cui/source/dialogs/hlmarkwn.cxx +++ b/cui/source/dialogs/hlmarkwn.cxx @@ -446,7 +446,7 @@ int SvxHlinkDlgMarkWnd::FillTree( const uno::Reference< container::XNameAccess > uno::Reference< awt::XBitmap > aXBitmap( xTarget->getPropertyValue( aProp_LinkDisplayBitmap ), uno::UNO_QUERY ); if( aXBitmap.is() ) { -Image aBmp( VCLUnoHelper::GetBitmap( aXBitmap ).GetBitmap(), aMaskColor ); +Image aBmp(BitmapEx(VCLUnoHelper::GetBitmap(aXBitmap).GetBitmap(), aMaskColor)); // insert Displayname into treelist with bitmaps pEntry = mpLbTree->InsertEntry ( aStrDisplayname, aBmp, aBmp, diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx index 5edaf5a..6ee8f89 100644 --- a/include/vcl/image.hxx +++ b/include/vcl/image.hxx @@ -57,7 +57,6 @@ class SAL_WARN_UNUSED VCL_DLLPUBLIC Image public: Image(); explicit Image( const BitmapEx& rBitmapEx ); -Image( const Bitmap& rBitmap, const Color& rColor ); explicit Image( const css::uno::Reference< css::graphic::XGraphic >& rxGraphic ); explicit Image( const OUString &rPNGFileUrl ); diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx index c3a7238..537865b 100644 --- a/sd/source/ui/dlg/inspagob.cxx +++ b/sd/source/ui/dlg/inspagob.cxx @@ -83,7 +83,7 @@ void SdInsertPagesObjsDlg::Reset() { Color aColor( COL_WHITE ); Bitmap aBmpText( SdResId( BMP_DOC_TEXT ) ); -Image aImgText( aBmpText, aColor ); +Image aImgText(BitmapEx(aBmpText, aColor)); m_pLbTree->InsertEntry( rName, aImgText, aImgText ); } diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index e5b2560..6c25518 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -3399,7 +3399,7 @@ void SvxRuler::Command( const CommandEvent& rCommandEvent ) DrawTab(*pDev, aFillColor, aPt, nStyle); aMenu->InsertItem(i + 1, ResId(RID_SVXSTR_RULER_START + i, DIALOG_MGR()).toString(), - Image(pDev->GetBitmap(Point(), aSz), Color(COL_WHITE))); + Image(BitmapEx(pDev->GetBitmap(Point(), aSz), Color(COL_WHITE; aMenu->CheckItem(i + 1, i == mpTabs[mxRulerImpl->nIdx + TAB_GAP].nStyle); pDev->SetOutputSize(aSz); // delete device } diff --git a/vcl/source/image/Image.cxx b/vcl/source/image/Image.cxx index b1d3db9..649bf15 100644 --- a/vcl/source/image/Image.cxx +++ b/vcl/source/image/Image.cxx @@ -49,12 +49,6 @@ Image::Image(const BitmapEx& rBitmapEx) ImplInit(rBitmapEx); } -Image::Image(const Bitmap& rBitmap, const Color& rColor) -{ -const BitmapEx aBitmapEx(rBitmap, rColor); -ImplInit(aBitmapEx); -} - Image::Image(const css::uno::Reference< css::graphic::XGraphic >& rxGraphic) { const Graphic aGraphic(rxGraphic); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl svx/source vcl/source vcl/workben
cui/source/customize/cfg.cxx|3 --- include/vcl/image.hxx |2 +- svx/source/engine3d/float3d.cxx |3 +-- vcl/source/window/toolbox2.cxx |2 -- vcl/workben/outdevgrind.cxx |2 ++ 5 files changed, 4 insertions(+), 8 deletions(-) New commits: commit 370613e5917366698d4d9ec078f79f9a48ce8b02 Author: Caolán McNamara Date: Fri Jan 20 11:42:31 2017 + warn about unused Images Change-Id: I5502b28411282354019af51a09c860099c652006 Reviewed-on: https://gerrit.libreoffice.org/33348 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index d411fa8..4a77f42 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -3539,8 +3539,6 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton, void ) GetSaveInData()->GetImageManager()->replaceImages( GetImageType(), aURLSeq, aGraphicSeq ); -Image aImage( newgraphic ); - m_pContentsListBox->GetModel()->Remove( pActEntry ); SvTreeListEntry* pNewLBEntry = InsertEntryIntoUI( pEntry, nSelectionPos ); @@ -3595,7 +3593,6 @@ IMPL_LINK( SvxToolbarConfigPage, EntrySelectHdl, MenuButton *, pButton, void ) GetSaveInData()->GetImageManager()->replaceImages( GetImageType(), aURLSeq, aGraphicSeq ); -Image aImage( backup ); m_pContentsListBox->GetModel()->Remove( pActEntry ); SvTreeListEntry* pNewLBEntry = diff --git a/include/vcl/image.hxx b/include/vcl/image.hxx index 88a0c04..752b900 100644 --- a/include/vcl/image.hxx +++ b/include/vcl/image.hxx @@ -50,7 +50,7 @@ namespace vcl #define IMAGELIST_IMAGE_NOTFOUND((sal_uInt16)0x) -class VCL_DLLPUBLIC Image +class SAL_WARN_UNUSED VCL_DLLPUBLIC Image { friend class ::OutputDevice; diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index b20b711..6791a73 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -1847,8 +1847,7 @@ void Svx3DWin::GetAttr( SfxItemSet& rAttrs ) else rAttrs.InvalidateItem(SDRATTR_3DSCENE_FOCAL_LENGTH); -// Lighting -Image aImg; +// Lighting basegfx::B3DVector aVector; Color aColor; const SfxItemSet aLightItemSet(m_pCtlLightPreview->GetSvx3DLightControl().Get3DAttributes()); diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 037d228..10cede7 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -972,7 +972,6 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) static Image ImplRotImage( const Image& rImage, long nAngle10 ) { -Image aRet; BitmapExaRotBitmapEx( rImage.GetBitmapEx() ); aRotBitmapEx.Rotate( nAngle10, Color( COL_WHITE ) ); @@ -1011,7 +1010,6 @@ void ToolBox::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 ) static Image ImplMirrorImage( const Image& rImage ) { -Image aRet; BitmapExaMirrBitmapEx( rImage.GetBitmapEx() ); aMirrBitmapEx.Mirror( BmpMirrorFlags::Horizontal ); diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx index 0e0e19d..f4c8c7d 100644 --- a/vcl/workben/outdevgrind.cxx +++ b/vcl/workben/outdevgrind.cxx @@ -138,7 +138,9 @@ void setupMethodStubs( functor_vector_type& res ) const BitmapExaBitmapExAlpha( aBitmap, aBitmapAlien ); const BitmapExaBitmapExAlphaAlien( aBitmapAlien, aBitmapAlien ); +#ifdef NEEDS_QUALIY_PARAMTER const Image aImage( aBitmapEx ); +#endif const Gradient aGradient(GradientStyle::Elliptical,aBlackColor,aWhiteColor); const Hatch aHatch(HatchStyle::Triple,aBlackColor,4,450); const Wallpaper aWallpaper( aWhiteColor ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl reportdesign/source sc/source sfx2/source svx/source sw/source vcl/headless vcl/inc vcl/opengl vcl/source vcl/unx
cui/source/options/optcolor.cxx|2 - include/vcl/builder.hxx|2 - include/vcl/commandevent.hxx |4 +-- include/vcl/field.hxx |3 +- include/vcl/graph.hxx |4 +-- include/vcl/metaact.hxx|5 ++-- include/vcl/oldprintadaptor.hxx|2 - include/vcl/print.hxx |3 +- include/vcl/printerinfomanager.hxx |3 +- include/vcl/textdata.hxx |3 +- include/vcl/txtattr.hxx|4 ++- reportdesign/source/ui/dlg/Condition.cxx |2 - sc/source/ui/condformat/condformatdlgentry.cxx |4 +-- sc/source/ui/dbgui/sortkeydlg.cxx |2 - sfx2/source/appl/newhelp.cxx |2 - sfx2/source/dialog/backingwindow.cxx |2 - sfx2/source/dialog/dinfdlg.cxx |8 +++ svx/source/dialog/ctredlin.cxx |2 - svx/source/form/datanavi.cxx |2 - svx/source/sidebar/PanelLayout.cxx |2 - svx/source/sidebar/paragraph/ParaSpacingWindow.cxx |8 +++ sw/source/ui/index/cnttab.cxx |4 +-- vcl/headless/svpglyphcache.cxx |5 +--- vcl/headless/svpinst.cxx |2 - vcl/inc/controldata.hxx|3 -- vcl/inc/impbmp.hxx |5 ++-- vcl/inc/opengl/x11/salvd.hxx |3 +- vcl/inc/unx/geninst.h |2 - vcl/opengl/x11/salvd.cxx |3 -- vcl/source/control/button.cxx |6 ++--- vcl/source/control/combobox.cxx|2 - vcl/source/control/ctrl.cxx|8 +-- vcl/source/control/edit.cxx| 14 +--- vcl/source/control/field.cxx |3 -- vcl/source/control/fixed.cxx |4 +-- vcl/source/control/group.cxx |2 - vcl/source/control/imp_listbox.cxx |4 +-- vcl/source/control/listbox.cxx |2 - vcl/source/control/notebookbar.cxx |2 - vcl/source/control/spinfld.cxx |2 - vcl/source/edit/textdata.cxx |9 ++- vcl/source/edit/textdoc.cxx|5 +--- vcl/source/filter/ixbm/xbmread.cxx | 13 +++ vcl/source/gdi/impbmp.cxx |1 vcl/source/gdi/impgraph.cxx|7 -- vcl/source/gdi/impvect.cxx | 11 - vcl/source/gdi/metaact.cxx | 24 +++-- vcl/source/gdi/oldprintadaptor.cxx |1 vcl/source/gdi/pdfwriter_impl.cxx | 15 + vcl/source/gdi/pdfwriter_impl.hxx |6 +++-- vcl/source/gdi/print3.cxx |1 vcl/source/window/commandevent.cxx | 17 +++--- vcl/source/window/dialog.cxx |1 vcl/source/window/dockwin.cxx |2 - vcl/source/window/printdlg.cxx |6 ++--- vcl/source/window/syswin.cxx | 18 +++ vcl/source/window/tabpage.cxx |2 - vcl/source/window/toolbox.cxx |4 +-- vcl/unx/generic/app/geninst.cxx|9 +++ vcl/unx/generic/printer/printerinfomanager.cxx |6 + 60 files changed, 140 insertions(+), 163 deletions(-) New commits: commit e8b49f09074fe184374bee5062715357427ae044 Author: Noel Grandin Date: Wed Jan 11 09:48:18 2017 +0200 new loplugin: useuniqueptr: vcl Change-Id: Idcbc8655108ff57c06c33bbcabd652387bf3c4ec Reviewed-on: https://gerrit.libreoffice.org/32948 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx index 5af0986..5508d98 100644 --- a/cui/source/options/optcolor.cxx +++ b/cui/source/options/optcolor.cxx @@ -481,7 +481,7 @@ void ColorConfigWindow_Impl::Entry::SetColor (Color aColor) ColorConfigWindow_Impl::ColorConfigWindow_Impl(vcl::Window* pParent) : VclContainer(pParent) { -m_pUIBuilder = new VclBuilder(this, getUIRootDir(), "cui/ui/colorconfigwin.ui"); +m_pUIBuilder.reset(new VclBuilder(this, getUIRootDir(), "cui/ui/colorconfigwin.ui")); get(m_pGrid, "ColorConfigWindow"); CreateEntries(); SetAppearance(); diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index 428f9aa..e849ee5d 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.h
[Libreoffice-commits] core.git: cui/source include/vcl sd/source sfx2/source svtools/source uui/source vcl/qa vcl/source
cui/source/factory/dlgfact.cxx |4 ++-- cui/source/factory/dlgfact.hxx |2 +- include/vcl/abstdlg.hxx |2 +- include/vcl/bitmap.hxx | 12 +--- include/vcl/bitmapex.hxx|4 include/vcl/field.hxx |2 +- include/vcl/fontcharmap.hxx |3 +-- include/vcl/graphicfilter.hxx |2 +- include/vcl/layout.hxx | 17 - sd/source/ui/dlg/vectdlg.cxx|2 +- sd/source/ui/view/viewoverlaymanager.cxx|2 +- sfx2/source/doc/graphhelp.cxx |2 +- svtools/source/filter/SvFilterOptionsDialog.cxx |7 ++- uui/source/iahndl-authentication.cxx|2 +- vcl/qa/cppunit/BitmapTest.cxx |4 ++-- vcl/source/control/field.cxx|4 ++-- vcl/source/filter/graphicfilter.cxx |6 ++ vcl/source/font/fontcharmap.cxx |7 +++ vcl/source/gdi/bitmap3.cxx |8 vcl/source/gdi/bitmapex.cxx |4 ++-- vcl/source/gdi/impvect.cxx | 24 +--- vcl/source/gdi/impvect.hxx |5 ++--- vcl/source/outdev/text.cxx |2 +- vcl/source/window/layout.cxx|9 - 24 files changed, 53 insertions(+), 83 deletions(-) New commits: commit 673b436c3592c5747f3dce4947168d6fa3ba45ea Author: Noel Grandin Date: Tue Sep 6 15:39:01 2016 +0200 loplugin:constantparam in vcl Change-Id: I0cae8e5de1170dec4c82df7f1f5377143a079876 Reviewed-on: https://gerrit.libreoffice.org/28686 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 7010cfc..14ffacf 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1590,9 +1590,9 @@ SvxAbstractInsRowColDlg* AbstractDialogFactory_Impl::CreateSvxInsRowColDlg( vcl: AbstractPasswordToOpenModifyDialog * AbstractDialogFactory_Impl::CreatePasswordToOpenModifyDialog( vcl::Window * pParent, -sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) +sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) { -VclPtrInstance pDlg( pParent, nMinPasswdLen, nMaxPasswdLen, bIsPasswordToModify ); +VclPtrInstance pDlg( pParent, 0, nMaxPasswdLen, bIsPasswordToModify ); return new AbstractPasswordToOpenModifyDialog_Impl( pDlg ); } diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index b8737d4..f3dff69 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -628,7 +628,7 @@ public: virtual SvxAbstractInsRowColDlg* CreateSvxInsRowColDlg( vcl::Window* pParent, bool bCol, const OString& sHelpId ) override; -virtual AbstractPasswordToOpenModifyDialog * CreatePasswordToOpenModifyDialog(vcl::Window * pParent, sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override; +virtual AbstractPasswordToOpenModifyDialog * CreatePasswordToOpenModifyDialog(vcl::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify) override; virtual AbstractScreenshotAnnotationDlg* CreateScreenshotAnnotationDlg(vcl::Window * pParent, Dialog& rParentDialog) override; }; diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx index d063807..bbbe51a 100644 --- a/include/vcl/abstdlg.hxx +++ b/include/vcl/abstdlg.hxx @@ -85,7 +85,7 @@ public: virtual VclAbstractDialog* CreateVclDialog( vcl::Window* pParent, sal_uInt32 nResId ) = 0; // creates instance of PasswordToOpenModifyDialog from cui -virtual AbstractPasswordToOpenModifyDialog* CreatePasswordToOpenModifyDialog( vcl::Window * pParent, sal_uInt16 nMinPasswdLen, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) = 0; +virtual AbstractPasswordToOpenModifyDialog* CreatePasswordToOpenModifyDialog( vcl::Window * pParent, sal_uInt16 nMaxPasswdLen, bool bIsPasswordToModify ) = 0; // creates instance of ScreenshotAnnotationDlg from cui virtual AbstractScreenshotAnnotationDlg* CreateScreenshotAnnotationDlg( diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index f509e18..e206700 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -609,15 +609,10 @@ public: @param rPolyPoly The resulting PolyPolygon -@param nFlags -Whether the inline or the outline of the color areas should be -represented by the polygon - @return true, if the operation was completed successfully. */ boolVectorize( -tools::PolyPolygon& rPolyPoly, -BmpVectorizeFlags nFlags ); +
[Libreoffice-commits] core.git: cui/source include/vcl sfx2/source svtools/source sw/source vcl/source vcl/unx
cui/source/tabpages/page.cxx |2 +- include/vcl/print.hxx | 10 +- sfx2/source/doc/printhelper.cxx |6 +++--- svtools/source/dialogs/prnsetup.cxx |4 ++-- sw/source/ui/dbui/mmresultdialogs.cxx |2 +- vcl/source/gdi/print.cxx | 20 ++-- vcl/source/window/printdlg.cxx|2 +- vcl/unx/generic/print/genprnpsp.cxx |2 +- 8 files changed, 24 insertions(+), 24 deletions(-) New commits: commit fafb2cf4de2eb2de46afab0738b7fd95663c0164 Author: Noel Grandin Date: Mon May 30 10:55:13 2016 +0200 Convert PrinterSupport to scoped enum Change-Id: I2bde7261b8e8f31e6dd5a02cd4130156a04b8a7f Reviewed-on: https://gerrit.libreoffice.org/25657 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 0fa0782..1b72b7e 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -527,7 +527,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) aPaperSize = static_cast(pItem)->GetSize(); bool bOrientationSupport = -mpDefPrinter->HasSupport( SUPPORT_SET_ORIENTATION ); +mpDefPrinter->HasSupport( PrinterSupport::SetOrientation ); if ( !bOrientationSupport && aPaperSize.Width() > aPaperSize.Height() ) diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx index e38372d..fcb11bc 100644 --- a/include/vcl/print.hxx +++ b/include/vcl/print.hxx @@ -50,12 +50,12 @@ namespace vcl { } -enum PrinterSupport +enum class PrinterSupport { -SUPPORT_SET_ORIENTATION, SUPPORT_SET_PAPERBIN, -SUPPORT_SET_PAPERSIZE, SUPPORT_SET_PAPER, -SUPPORT_COPY, SUPPORT_COLLATECOPY, -SUPPORT_SETUPDIALOG, SUPPORT_FAX, SUPPORT_PDF +SetOrientation, SetPaperBin, +SetPaperSize, SetPaper, +Copy, CollateCopy, +SetupDialog, Fax, Pdf }; diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index fa13268..5c3b4b8 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -278,13 +278,13 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxPrintHelper::getPrinter() thro uno::Sequence< beans::PropertyValue > aPrinter(8); aPrinter.getArray()[7].Name = "CanSetPaperSize"; -aPrinter.getArray()[7].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_PAPERSIZE ) ); +aPrinter.getArray()[7].Value <<= ( pPrinter->HasSupport( PrinterSupport::SetPaperSize ) ); aPrinter.getArray()[6].Name = "CanSetPaperFormat"; -aPrinter.getArray()[6].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_PAPER ) ); +aPrinter.getArray()[6].Value <<= ( pPrinter->HasSupport( PrinterSupport::SetPaper ) ); aPrinter.getArray()[5].Name = "CanSetPaperOrientation"; -aPrinter.getArray()[5].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_ORIENTATION ) ); +aPrinter.getArray()[5].Value <<= ( pPrinter->HasSupport( PrinterSupport::SetOrientation ) ); aPrinter.getArray()[4].Name = "IsBusy"; aPrinter.getArray()[4].Value <<= ( pPrinter->IsPrinting() ); diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx index 8663722..2608486 100644 --- a/svtools/source/dialogs/prnsetup.cxx +++ b/svtools/source/dialogs/prnsetup.cxx @@ -38,7 +38,7 @@ void ImplFillPrnDlgListBox( const Printer* pPrinter, } pBox->Enable( nCount != 0 ); -pPropBtn->Show( pPrinter->HasSupport( SUPPORT_SETUPDIALOG ) ); +pPropBtn->Show( pPrinter->HasSupport( PrinterSupport::SetupDialog ) ); } @@ -76,7 +76,7 @@ Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn, } } -pPropBtn->Enable( pTempPrinter->HasSupport( SUPPORT_SETUPDIALOG ) ); +pPropBtn->Enable( pTempPrinter->HasSupport( PrinterSupport::SetupDialog ) ); } else pPropBtn->Disable(); diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 1c6218a..ded7030 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -786,7 +786,7 @@ IMPL_LINK_TYPED(SwMMResultPrintDialog, PrinterChangeHdl_Impl, ListBox&, rBox, vo else if( ! m_pTempPrinter ) m_pTempPrinter = VclPtr::Create(); -m_pPrinterSettingsPB->Enable( m_pTempPrinter->HasSupport( SUPPORT_SETUPDIALOG ) ); +m_pPrinterSettingsPB->Enable( m_pTempPrinter->HasSupport( PrinterSupport::SetupDialog ) ); } else m_pPrinterSettingsPB->Disable(); diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 8c267db..c0cfdf59 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1031,23 +1031,23 @@ bool Printer::HasSupport( PrinterSupport eFeature ) const { switch ( eFeature ) { -case SUPPORT_SET_ORIENTATION: +case PrinterSupport::SetOrientation: return GetCapabilities( PrinterCapTy
[Libreoffice-commits] core.git: cui/source include/vcl vcl/inc vcl/source vcl/unx
cui/source/dialogs/cuigrfflt.cxx |2 +- include/vcl/bitmapex.hxx |9 ++--- include/vcl/builder.hxx |4 ++-- include/vcl/button.hxx |6 +++--- include/vcl/window.hxx |2 +- vcl/inc/listbox.hxx |2 +- vcl/inc/salsession.hxx |6 ++ vcl/inc/unx/salbmp.h |2 +- vcl/source/app/session.cxx |2 +- vcl/source/control/button.cxx| 26 +++--- vcl/source/control/imp_listbox.cxx |6 +++--- vcl/source/control/listbox.cxx |2 +- vcl/source/edit/textdoc.cxx |6 +++--- vcl/source/edit/textdoc.hxx |2 +- vcl/source/gdi/animate.cxx |4 ++-- vcl/source/gdi/bitmapex.cxx |4 ++-- vcl/source/gdi/impvect.cxx | 21 + vcl/source/gdi/pdfwriter.cxx |2 +- vcl/source/gdi/pdfwriter_impl.cxx|4 ++-- vcl/source/gdi/pdfwriter_impl.hxx|2 +- vcl/source/window/window.cxx | 33 - vcl/unx/generic/app/sm.cxx |2 +- vcl/unx/generic/gdi/gdiimpl.cxx |2 +- vcl/unx/generic/gdi/salbmp.cxx |6 +++--- vcl/unx/generic/gdi/xrender_peer.hxx |6 +++--- 25 files changed, 66 insertions(+), 97 deletions(-) New commits: commit 64a06ba4bd35e91acd1d9743f9851904eebd1add Author: Noel Grandin Date: Fri Apr 1 13:31:59 2016 +0200 loplugin:constantparam in vcl Change-Id: I5af0906ced6d0e917b54dee22577fa40d134464c Reviewed-on: https://gerrit.libreoffice.org/23719 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 58aa725..3723f81 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -511,7 +511,7 @@ Graphic GraphicFilterPoster::GetFilteredGraphic( const Graphic& rGraphic, double { BitmapEx aBmpEx( rGraphic.GetBitmapEx() ); -if( aBmpEx.ReduceColors( nPosterCount, BMP_REDUCE_POPULAR ) ) +if( aBmpEx.ReduceColors( nPosterCount ) ) aRet = aBmpEx; } diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx index cdf1414..28e1d89 100644 --- a/include/vcl/bitmapex.hxx +++ b/include/vcl/bitmapex.hxx @@ -104,19 +104,14 @@ public: */ boolConvert( BmpConversion eConversion ); -/** Reduce number of colors for the bitmap +/** Reduce number of colors for the bitmap using the POPULAR algorithm @param nNewColorCount Maximal number of bitmap colors after the reduce operation -@param eReduce -Algorithm to use for color reduction - @return true, if the color reduction operation was completed successfully. */ -boolReduceColors( -sal_uInt16 nNewColorCount, -BmpReduce eReduce = BMP_REDUCE_SIMPLE ); +boolReduceColors( sal_uInt16 nNewColorCount ); /** Apply a dither algorithm to the bitmap diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index a1db0f6..1af5bc5 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -130,9 +130,9 @@ private: { bool m_bVerticalOrient; sal_Int32 m_nPosition; -PackingData(bool bVerticalOrient = false, sal_Int32 nPosition = -1) +PackingData(bool bVerticalOrient = false) : m_bVerticalOrient(bVerticalOrient) -, m_nPosition(nPosition) +, m_nPosition(-1) { } }; diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx index e6eb446..5f33899 100644 --- a/include/vcl/button.hxx +++ b/include/vcl/button.hxx @@ -54,7 +54,7 @@ public: SAL_DLLPRIVATE DrawButtonFlags& ImplGetButtonState(); SAL_DLLPRIVATE DrawTextFlagsImplGetTextStyle( OUString& rText, WinBits nWinStyle, DrawFlags nDrawFlags ); SAL_DLLPRIVATE void ImplDrawAlignedImage(OutputDevice* pDev, Point& rPos, Size& rSize, - bool bLayout, sal_uLong nImageSep, DrawFlags nDrawFlags, + sal_uLong nImageSep, DrawFlags nDrawFlags, DrawTextFlags nTextStyle, Rectangle *pSymbolRect=nullptr, bool bAddImageSep = false ); SAL_DLLPRIVATE void ImplSetFocusRect( const Rectangle &rFocusRect ); SAL_DLLPRIVATE const Rectangle& ImplGetFocusRect() const; @@ -523,7 +523,7 @@ class VCL_DLLPUBLIC ImageRadioButton : public RadioButton ImageRadioButton & operator= ( const ImageRadioButton & ) = delete; public: -explicitImageRadioButton( vcl::Window* pParent, WinBits nStyle = 0 ); +explicitImageRadioButton( vcl::Window* pParent ); }; @@ -543,7 +543,7 @@ protected: SAL_DLLPRIVATE vi
[Libreoffice-commits] core.git: cui/source include/vcl vcl/inc vcl/source
cui/source/dialogs/hangulhanjadlg.cxx|4 ++-- include/vcl/floatwin.hxx |2 +- include/vcl/menu.hxx |5 + include/vcl/window.hxx |4 ++-- vcl/inc/svdata.hxx |7 +-- vcl/source/window/floatwin.cxx | 10 +- vcl/source/window/menu.cxx | 29 +++-- vcl/source/window/menubarwindow.cxx | 22 ++ vcl/source/window/menubarwindow.hxx |6 +++--- vcl/source/window/menufloatingwindow.cxx | 21 + vcl/source/window/menufloatingwindow.hxx |8 vcl/source/window/window2.cxx| 20 +++- 12 files changed, 56 insertions(+), 82 deletions(-) New commits: commit 9c09d4d0d36076d39926eeaf7774171df3b55e52 Author: Ras-al-Ghul Date: Thu Jan 14 01:38:03 2016 +0530 tdf#96888 - Kill internal vcl dog-tags ... Modifications done as per CR Change-Id: I0b57f5c32fc217929d71411ca5176e3cab3f6e73 Reviewed-on: https://gerrit.libreoffice.org/21457 Reviewed-by: Michael Meeks Tested-by: Michael Meeks Tested-by: Jenkins Reviewed-by: jan iversen diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 8ebe2f4..0be8100 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -825,9 +825,9 @@ namespace svx // give the focus to the new def button temporarily - VCL is somewhat peculiar // in recognizing a new default button -sal_uInt32 nSaveFocusId = Window::SaveFocus(); +VclPtr xSaveFocusId = Window::SaveFocus(); pNewDefButton->GrabFocus(); -Window::EndSaveFocus( nSaveFocusId ); +Window::EndSaveFocus( xSaveFocusId ); } } diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx index d999e65..61d724b 100644 --- a/include/vcl/floatwin.hxx +++ b/include/vcl/floatwin.hxx @@ -134,7 +134,7 @@ public: SAL_DLLPRIVATE static Point ImplCalcPos( vcl::Window* pWindow, const Rectangle& rRect, FloatWinPopupFlags nFlags, sal_uInt16& rArrangeIndex ); -SAL_DLLPRIVATE void ImplEndPopupMode( FloatWinPopupEndFlags nFlags = FloatWinPopupEndFlags::NONE, sal_uLong nFocusId = 0 ); +SAL_DLLPRIVATE void ImplEndPopupMode( FloatWinPopupEndFlags nFlags = FloatWinPopupEndFlags::NONE, VclPtr xFocusId = nullptr ); SAL_DLLPRIVATE Rectangle& ImplGetItemEdgeClipRect(); SAL_DLLPRIVATE bool ImplIsInPrivatePopupMode() const { return mbInPopupMode; } virtualvoid doDeferredInit(WinBits nBits) override; diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index d5eec40..7e6b244 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -207,9 +207,6 @@ protected: /// Close the 'pStartedFrom' menu window. virtual void ClosePopup(Menu* pMenu) = 0; -/// Deactivate the MenuBarWindow. -virtual sal_uLong DeactivateMenuBar(sal_uLong nFocusId); - /// Forward the KeyInput call to the MenuBar. virtual void MenuBarKeyInput(const KeyEvent& rEvent); @@ -451,7 +448,7 @@ public: virtual void ClosePopup(Menu* pMenu) override; /// Deactivate the MenuBarWindow. -virtual sal_uLong DeactivateMenuBar(sal_uLong nFocusId) override; +virtual void DeactivateMenuBar(VclPtr& xFocusId); /// Forward the KeyInput call to the MenuBar. virtual void MenuBarKeyInput(const KeyEvent& rEvent) override; diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 6b383bd..e757170 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -1142,8 +1142,8 @@ public: boolIsCompoundControl() const; -static sal_uIntPtr SaveFocus(); -static bool EndSaveFocus( sal_uIntPtr nSaveId, bool bRestore = true ); +static VclPtr SaveFocus(); +static bool EndSaveFocus( const VclPtr& xFocusWin, bool bRestore = true ); voidCaptureMouse(); voidReleaseMouse(); diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 7f6090b..285d847 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -406,11 +406,6 @@ private: }; -struct ImplFocusDelData : public ImplDelData -{ -VclPtr mpFocusWin; -}; - struct ImplSVEvent { void* mpData; @@ -423,4 +418,4 @@ struct ImplSVEvent #endif // INCLUDED_VCL_INC_SVDATA_HXX -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index b5c038c..8
[Libreoffice-commits] core.git: cui/source include/vcl sc/source starmath/source svtools/source svx/source vcl/generic vcl/headless vcl/inc vcl/qa vcl/quartz vcl/source vcl/unx vcl/win
cui/source/dialogs/cuicharmap.cxx |1 include/vcl/fontcharmap.hxx | 169 include/vcl/metric.hxx | 161 -- include/vcl/textrectinfo.hxx| 57 ++ sc/source/filter/excel/xistyle.cxx |1 starmath/source/dialog.cxx |1 svtools/source/misc/sampletext.cxx |1 svx/source/dialog/charmap.cxx |1 vcl/generic/fontmanager/fontmanager.cxx |1 vcl/generic/glyphs/gcach_ftyp.cxx |3 vcl/generic/print/genpspgraphics.cxx|1 vcl/headless/svptext.cxx|1 vcl/inc/win/salgdi.h|1 vcl/qa/cppunit/fontcharmap.cxx |2 vcl/quartz/salgdi.cxx |1 vcl/source/filter/wmf/wmfwr.cxx |1 vcl/source/gdi/impfont.cxx |2 vcl/source/outdev/font.cxx |1 vcl/source/outdev/text.cxx |1 vcl/source/window/brdwin.cxx|1 vcl/source/window/msgbox.cxx|1 vcl/unx/generic/gdi/cairotextrender.cxx |1 vcl/unx/generic/gdi/salgdi3.cxx |1 vcl/win/gdi/salfont.cxx |1 24 files changed, 249 insertions(+), 163 deletions(-) New commits: commit 21f152a52397bf99364e5dc5ba9519e11452f260 Author: Chris Sherlock Date: Mon Jan 4 16:06:13 2016 +1100 vcl: split classes out of metric.hxx Change-Id: Id3b155abec7b7a2ff43d0a35e98709f5ee51c6b9 Reviewed-on: https://gerrit.libreoffice.org/21069 Reviewed-by: Chris Sherlock Tested-by: Chris Sherlock diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index 62346d8..ee26bca 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include diff --git a/include/vcl/fontcharmap.hxx b/include/vcl/fontcharmap.hxx new file mode 100644 index 000..c4d495c --- /dev/null +++ b/include/vcl/fontcharmap.hxx @@ -0,0 +1,169 @@ +/* -*- 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/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_FONTCHARMAP_METRIC_HXX +#define INCLUDED_FONTCHARMAP_METRIC_HXX + +#include +#include +#include + +#include + +class ImplFontCharMap; +class CmapResult; + +typedef sal_uInt32 sal_UCS4; +typedef boost::intrusive_ptr< ImplFontCharMap > ImplFontCharMapPtr; +typedef boost::intrusive_ptr< FontCharMap > FontCharMapPtr; + +class VCL_DLLPUBLIC FontCharMap +{ +public: +/** A new FontCharMap is created based on a "default" map, which includes +all codepoints in the Unicode BMP range, including surrogates. + **/ +FontCharMap(); +FontCharMap( const CmapResult& rCR ); +~FontCharMap(); + +/** Get the default font character map + +@returns the default font character map. + */ +static FontCharMapPtr GetDefaultMap( bool bSymbols=false ); + +/** Determines if the font character map is the "default". The default map +includes all codepoints in the Unicode BMP range, including surrogates. + +@returns true if default map, false if not default map. + */ +boolIsDefaultMap() const; + +/** Does the font character map include the UCS4 character? + +@returns true if character exists in font character map, false is not. + */ +boolHasChar( sal_UCS4 ) const; + +/** Returns the number of chars supported by the font, which +are inside the unicode range from cMin to cMax (inclusive). + +@param cMinLowest codepoint in range to be counted +@param cMaxHighest codepoitn in range to be counted + +@returns number of characters in the font charmap between the two + codepoints. + */ +int CountCharsInRange( sal_UCS4 cMin, sal_UCS4 cMax ) const; + +/** Get the number of characters in the font character map. + +@returns number of characters in the font character map. +
[Libreoffice-commits] core.git: cui/source include/vcl vcl/source
cui/source/options/personalization.cxx |1 + include/vcl/builder.hxx|2 +- vcl/source/window/builder.cxx |1 + vcl/source/window/window.cxx |2 +- 4 files changed, 4 insertions(+), 2 deletions(-) New commits: commit f5fc81616ccf45edd180cfb8c7002eb50284f90d Author: Stephan Bergmann Date: Wed Oct 22 13:14:43 2014 +0200 Avoid unnecessary #include Change-Id: I6ec5de40ce2f4cbcce751dcae16dae60abbc1a37 diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 5f02689..5399dab 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index c314134..9d952c0 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -39,6 +38,7 @@ class DateField; class TimeField; class VclExpander; class VclMultiLineEdit; +namespace xmlreader { class XmlReader; } class VCL_DLLPUBLIC VclBuilder: private boost::noncopyable { diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index e534e41..e1e70c6 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -45,6 +45,7 @@ #include #include #include +#include using namespace com::sun::star; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index f773bc2..8c1fe90 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -18,7 +18,7 @@ */ #include - +#include #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cui/source include/vcl
cui/source/tabpages/paragrph.cxx |2 +- include/vcl/builder.hxx |1 + 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit 6ea2cc95f5996213c370dff61a36fb667dd6771e Author: Caolán McNamara Date: Sat Jun 8 14:43:27 2013 +0100 Resolves: fdo#65536 check if builder is NULL Change-Id: Ieabd56d6da06b480ade662a55aebd35d0769f2ea diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 29949ae..e17f61c 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -646,7 +646,7 @@ namespace pChild = pChild->GetWindow(WINDOW_NEXT)) { VclBuilderContainer *pPeer = dynamic_cast(pChild); -if (pPeer != pPage) +if (pPeer != pPage && pPeer->hasBuilder()) { Window *pOtherGrid = pPeer->get("maingrid"); Window *pOurGrid = pPage->get("maingrid"); diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index d699d50..13aba58 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -381,6 +381,7 @@ public: VclBuilderContainer(); virtual ~VclBuilderContainer(); static OUString getUIRootDir(); +bool hasBuilder() const { return m_pUIBuilder != NULL; } template T* get(T*& ret, OString sID) { return m_pUIBuilder->get(ret, sID); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits