[Libreoffice-commits] core.git: linguistic/source

2021-08-11 Thread Noel Grandin (via logerrit)
 linguistic/source/lngsvcmgr.cxx |   30 +++---
 linguistic/source/lngsvcmgr.hxx |   11 ++-
 2 files changed, 21 insertions(+), 20 deletions(-)

New commits:
commit f9871d218bcae184a5845d63366175ea2df2086a
Author: Noel Grandin 
AuthorDate: Wed Aug 11 18:11:18 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 12 08:40:30 2021 +0200

flatten LngSvcMgr

Change-Id: I757cf9512fc3b87dd826eb39c2bbe456dc14d097
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120339
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 9e0100538809..898eeaf2256a 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -922,7 +922,7 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl()
 if (pAvailSpellSvcs)
 return;
 
-pAvailSpellSvcs.reset(new SvcInfoArray);
+pAvailSpellSvcs.emplace();
 
 uno::Reference< uno::XComponentContext > xContext( 
comphelper::getProcessComponentContext() );
 
@@ -960,7 +960,7 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl()
 uno::Sequence 
aLocaleSequence(xSvc->getLocales());
 aLanguages = LocaleSeqToLangVec( aLocaleSequence );
 
-pAvailSpellSvcs->push_back( std::make_unique( 
aImplName, aLanguages ) );
+pAvailSpellSvcs->push_back( SvcInfo( aImplName, aLanguages ) );
 }
 catch (const uno::Exception &)
 {
@@ -976,7 +976,7 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl()
 if (pAvailGrammarSvcs)
 return;
 
-pAvailGrammarSvcs.reset(new SvcInfoArray);
+pAvailGrammarSvcs.emplace();
 
 uno::Reference< uno::XComponentContext > xContext( 
comphelper::getProcessComponentContext() );
 
@@ -1018,7 +1018,7 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl()
 uno::Sequence 
aLocaleSequence(xSvc->getLocales());
 aLanguages = LocaleSeqToLangVec( aLocaleSequence );
 
-pAvailGrammarSvcs->push_back( std::make_unique( 
aImplName, aLanguages ) );
+pAvailGrammarSvcs->push_back( SvcInfo( aImplName, aLanguages ) 
);
 }
 catch (const uno::Exception &)
 {
@@ -1035,7 +1035,7 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl()
 if (pAvailHyphSvcs)
 return;
 
-pAvailHyphSvcs.reset(new SvcInfoArray);
+pAvailHyphSvcs.emplace();
 uno::Reference< uno::XComponentContext > xContext( 
comphelper::getProcessComponentContext() );
 
 uno::Reference< container::XContentEnumerationAccess > xEnumAccess( 
xContext->getServiceManager(), uno::UNO_QUERY );
@@ -1070,7 +1070,7 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl()
 SAL_WARN_IF( aImplName.isEmpty(), "linguistic", "empty 
implementation name" );
 uno::Sequence 
aLocaleSequence(xSvc->getLocales());
 aLanguages = LocaleSeqToLangVec( aLocaleSequence );
-pAvailHyphSvcs->push_back( std::make_unique( 
aImplName, aLanguages ) );
+pAvailHyphSvcs->push_back( SvcInfo( aImplName, aLanguages ) );
 }
 catch (const uno::Exception &)
 {
@@ -1086,7 +1086,7 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl()
 if (pAvailThesSvcs)
 return;
 
-pAvailThesSvcs.reset(new SvcInfoArray);
+pAvailThesSvcs.emplace();
 
 uno::Reference< uno::XComponentContext > xContext( 
comphelper::getProcessComponentContext() );
 
@@ -1124,7 +1124,7 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl()
 uno::Sequence 
aLocaleSequence(xSvc->getLocales());
 aLanguages = LocaleSeqToLangVec( aLocaleSequence );
 
-pAvailThesSvcs->push_back( std::make_unique( 
aImplName, aLanguages ) );
+pAvailThesSvcs->push_back( SvcInfo( aImplName, aLanguages ) );
 }
 catch (const uno::Exception &)
 {
@@ -1376,22 +1376,22 @@ uno::Sequence< OUString > SAL_CALL
 if (rServiceName == SN_SPELLCHECKER)
 {
 GetAvailableSpellSvcs_Impl();
-pInfoArray = pAvailSpellSvcs.get();
+pInfoArray = &*pAvailSpellSvcs;
 }
 else if (rServiceName == SN_GRAMMARCHECKER)
 {
 GetAvailableGrammarSvcs_Impl();
-pInfoArray = pAvailGrammarSvcs.get();
+pInfoArray = &*pAvailGrammarSvcs;
 }
 else if (rServiceName == SN_HYPHENATOR)
 {
 GetAvailableHyphSvcs_Impl();
-pInfoArray = pAvailHyphSvcs.get();
+pInfoArray = &*pAvailHyphSvcs;
 }
 else if (rServiceName == SN_THESAURUS)
 {
 GetAvailableThesSvcs_Impl();
-pInfoArray = pAvailThesSvcs.get();
+pInfoArray = &*pAvailThesSvcs;
 }
 
 if (pInfoArray)
@@ -1400,12 +1400,12 @@ uno::Sequence< OUString > SAL_CALL
 aVec.reserve(pInfoArray->size());
 
 LanguageType nLanguage = LinguLocaleToLanguage( rLocale );
-for (const auto& pInfo 

[Libreoffice-commits] core.git: include/tools tools/source

2021-08-11 Thread Mike Kaganski (via logerrit)
 include/tools/gen.hxx|   93 ++-
 tools/source/generic/gen.cxx |   10 
 2 files changed, 15 insertions(+), 88 deletions(-)

New commits:
commit 5351e837a11fb9d19759cd1b91ca4b5d43e2f75a
Author: Mike Kaganski 
AuthorDate: Thu Aug 12 03:43:27 2021 +0200
Commit: Mike Kaganski 
CommitDate: Thu Aug 12 04:48:48 2021 +0200

Unify and simplify tools::Rectangle methods returning Point

Make the methods use Left()/Top()/Right()/Bottom(), allowing to
avoid explicit checks for emptiness.

Also do not use std::min/max in *Center(), so that e.g. TopCenter
returns top value the same way as TopLeft and TopRight do.

Change-Id: Ie1edd7a0ab7e32b4f98d0c2fb3917ce2902bdf7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120353
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index 5386de129c56..b8bd6eeb35d4 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -474,37 +474,25 @@ public:
 
 static RectangleJustify( const Point& rLT, const Point& rRB );
 
-tools::Long Left() const{ return nLeft;   }
-tools::Long Right() const;
-tools::Long Top() const { return nTop;}
-tools::Long Bottom() const;
+constexpr tools::Long Left() const { return nLeft; }
+constexpr tools::Long Right() const { return nRight == RECT_EMPTY ? nLeft 
: nRight; }
+constexpr tools::Long Top() const { return nTop; }
+constexpr tools::Long Bottom() const { return nBottom == RECT_EMPTY ? nTop 
: nBottom; }
 
 voidSetLeft(tools::Long v){ nLeft = v;   }
 voidSetRight(tools::Long v)   { nRight = v;  }
 voidSetTop(tools::Long v) { nTop = v;}
 voidSetBottom(tools::Long v)  { nBottom = v; }
 
-constexpr Point TopLeft() const
-{
-return Point( nLeft, nTop );
-}
-constexpr Point TopRight() const
-{
-return Point( (nRight == RECT_EMPTY) ? nLeft : nRight, nTop );
-}
-constexpr Point TopCenter() const
-{
-if (IsEmpty())
-return Point(nLeft, nTop);
-else
-return Point((nLeft + nRight) / 2, std::min(nTop, nBottom));
-}
-inline Point BottomLeft() const;
-inline Point BottomRight() const;
-inline Point BottomCenter() const;
-inline Point LeftCenter() const;
-inline Point RightCenter() const;
-inline Point Center() const;
+constexpr Point TopLeft() const { return { Left(), Top() }; }
+constexpr Point TopRight() const { return { Right(), Top() }; }
+constexpr Point TopCenter() const { return { (Left() + Right()) / 2, Top() 
}; }
+constexpr Point BottomLeft() const { return { Left(), Bottom() }; }
+constexpr Point BottomRight() const { return { Right(), Bottom() }; }
+constexpr Point BottomCenter() const { return { (Left() + Right()) / 2, 
Bottom() }; }
+constexpr Point LeftCenter() const { return { Left(), (Top() + Bottom()) / 
2 }; }
+constexpr Point RightCenter() const { return { Right(), (Top() + Bottom()) 
/ 2 }; }
+constexpr Point Center() const { return { (Left() + Right()) / 2, (Top() + 
Bottom()) / 2 }; }
 
 /// Move the top and left edges by a delta, preserving width and height
 inline void Move( tools::Long nHorzMoveDelta, tools::Long 
nVertMoveDelta );
@@ -516,10 +504,7 @@ public:
 inline void SetPos( const Point& rPoint );
 voidSetSize( const Size& rSize );
 
-constexpr Size GetSize() const
-{
-return Size(GetWidth(), GetHeight());
-}
+constexpr Size GetSize() const { return { GetWidth(), GetHeight() }; }
 
 /// Returns the difference between right and left, assuming the range is 
inclusive.
 constexpr tools::Long GetWidth() const
@@ -569,7 +554,7 @@ public:
 voidSetEmpty() { nRight = nBottom = RECT_EMPTY; }
 voidSetWidthEmpty() { nRight = RECT_EMPTY; }
 voidSetHeightEmpty() { nBottom = RECT_EMPTY; }
-constexpr bool IsEmpty() const;
+constexpr bool IsEmpty() const { return (nRight == RECT_EMPTY) || (nBottom 
== RECT_EMPTY); }
 boolIsWidthEmpty() const { return nRight == RECT_EMPTY; }
 boolIsHeightEmpty() const { return nBottom == RECT_EMPTY; }
 
@@ -655,54 +640,6 @@ constexpr inline tools::Rectangle::Rectangle( const Point& 
rLT, const Size& rSiz
 , nBottom( rSize.Height() ? nTop+(rSize.Height()-1) : RECT_EMPTY )
 {}
 
-constexpr inline bool tools::Rectangle::IsEmpty() const
-{
-return (nRight == RECT_EMPTY) || (nBottom == RECT_EMPTY);
-}
-
-inline Point tools::Rectangle::BottomLeft() const
-{
-return Point( nLeft, (nBottom == RECT_EMPTY) ? nTop : nBottom );
-}
-
-inline Point tools::Rectangle::BottomRight() const
-{
-return Point( (nRight  == RECT_EMPTY) ? nLeft : 

[Libreoffice-commits] core.git: include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|1 +
 vcl/source/filter/svm/SvmWriter.cxx |   15 +++
 2 files changed, 16 insertions(+)

New commits:
commit 7ddf7375fb5a8c6699d4128a80b9f24ec6b914ae
Author: panoskorovesis 
AuthorDate: Thu Aug 5 10:37:48 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 12 02:24:25 2021 +0200

Add Handler for LineColor Write

The handler separates MetaLineColorAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: Id308ce7c1b2efc7c58caf8e492eed242ccfb5c66
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120313
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 0eb559b46366..ff5e60d133b0 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -73,6 +73,7 @@ public:
 void ISectRectClipRegionHandler(MetaISectRectClipRegionAction* pAction);
 void ISectRegionClipRegionHandler(MetaISectRegionClipRegionAction* 
pAction);
 void MoveClipRegionHandler(MetaMoveClipRegionAction* pAction);
+void LineColorHandler(MetaLineColorAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index 017cdb770185..401b86fd4b72 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -319,6 +319,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::LINECOLOR:
+{
+auto* pMetaAction = static_cast(pAction);
+LineColorHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -864,6 +871,14 @@ void 
SvmWriter::MoveClipRegionHandler(MetaMoveClipRegionAction* pAction)
 
mrStream.WriteInt32(pAction->GetHorzMove()).WriteInt32(pAction->GetVertMove());
 }
 
+void SvmWriter::LineColorHandler(MetaLineColorAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+WriteColor(pAction->GetColor());
+mrStream.WriteBool(pAction->IsSetting());
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|1 +
 vcl/source/filter/svm/SvmWriter.cxx |   14 ++
 2 files changed, 15 insertions(+)

New commits:
commit 9c0b114d1487868f4af189838c3136ce0cc6b751
Author: panoskorovesis 
AuthorDate: Thu Aug 5 10:33:17 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 12 02:24:00 2021 +0200

Add Handler for MoveClipRegion Write

The handler separates MetaMoveClipRegionAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: Ida80faec0c2389b267d77d5d12e4bde5ece24de8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120312
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index c89b93fb52e7..0eb559b46366 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -72,6 +72,7 @@ public:
 void ClipRegionHandler(MetaClipRegionAction* pAction);
 void ISectRectClipRegionHandler(MetaISectRectClipRegionAction* pAction);
 void ISectRegionClipRegionHandler(MetaISectRegionClipRegionAction* 
pAction);
+void MoveClipRegionHandler(MetaMoveClipRegionAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index 402d397dc21b..017cdb770185 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -312,6 +312,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::MOVECLIPREGION:
+{
+auto* pMetaAction = 
static_cast(pAction);
+MoveClipRegionHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -850,6 +857,13 @@ void 
SvmWriter::ISectRegionClipRegionHandler(MetaISectRegionClipRegionAction* pA
 WriteRegion(mrStream, pAction->GetRegion());
 }
 
+void SvmWriter::MoveClipRegionHandler(MetaMoveClipRegionAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+
mrStream.WriteInt32(pAction->GetHorzMove()).WriteInt32(pAction->GetVertMove());
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|1 +
 vcl/source/filter/svm/SvmWriter.cxx |   14 ++
 2 files changed, 15 insertions(+)

New commits:
commit d7fc4cfb90d688ff2b5a774f60f87d8d120ddb1e
Author: panoskorovesis 
AuthorDate: Thu Aug 5 10:20:49 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 12 02:23:33 2021 +0200

Add Handler for ISectRegionClipRegion Write

The handler separates MetaISectRegionClipRegionAction::Write from 
metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: I734e574c9a292fd44f36c155ba976908512ee588
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120309
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 10d7658c3bb7..c89b93fb52e7 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -71,6 +71,7 @@ public:
 void WallpaperHandler(MetaWallpaperAction* pAction);
 void ClipRegionHandler(MetaClipRegionAction* pAction);
 void ISectRectClipRegionHandler(MetaISectRectClipRegionAction* pAction);
+void ISectRegionClipRegionHandler(MetaISectRegionClipRegionAction* 
pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index e5635e31a141..402d397dc21b 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -305,6 +305,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::ISECTREGIONCLIPREGION:
+{
+auto* pMetaAction = 
static_cast(pAction);
+ISectRegionClipRegionHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -836,6 +843,13 @@ void 
SvmWriter::ISectRectClipRegionHandler(MetaISectRectClipRegionAction* pActio
 aSerializer.writeRectangle(pAction->GetRect());
 }
 
+void SvmWriter::ISectRegionClipRegionHandler(MetaISectRegionClipRegionAction* 
pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+WriteRegion(mrStream, pAction->GetRegion());
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|1 +
 vcl/source/filter/svm/SvmWriter.cxx |   15 +++
 2 files changed, 16 insertions(+)

New commits:
commit 526646cb631bf56fc0fae25499a867399db81b02
Author: panoskorovesis 
AuthorDate: Thu Aug 5 10:18:36 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 12 02:23:10 2021 +0200

Add Handler for ISectRectClipRegion Write

The handler separates MetaISectRectClipRegionAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: I999fa1baa4e3c34f3f83dc1d3973f961857f89d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120308
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index e7c2a0adfbfe..10d7658c3bb7 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -70,6 +70,7 @@ public:
 void HatchHandler(MetaHatchAction* pAction);
 void WallpaperHandler(MetaWallpaperAction* pAction);
 void ClipRegionHandler(MetaClipRegionAction* pAction);
+void ISectRectClipRegionHandler(MetaISectRectClipRegionAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index b310824f1beb..e5635e31a141 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -298,6 +298,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::ISECTRECTCLIPREGION:
+{
+auto* pMetaAction = 
static_cast(pAction);
+ISectRectClipRegionHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -821,6 +828,14 @@ void SvmWriter::ClipRegionHandler(MetaClipRegionAction* 
pAction)
 mrStream.WriteBool(pAction->IsClipping());
 }
 
+void SvmWriter::ISectRectClipRegionHandler(MetaISectRectClipRegionAction* 
pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+TypeSerializer aSerializer(mrStream);
+aSerializer.writeRectangle(pAction->GetRect());
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|2 ++
 vcl/source/filter/svm/SvmWriter.cxx |   30 ++
 2 files changed, 32 insertions(+)

New commits:
commit b0d1f39266ec0a3bef63e66c8d97ba1d6652734b
Author: panoskorovesis 
AuthorDate: Thu Aug 5 10:07:27 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 12 02:22:46 2021 +0200

Add Handler for ClipRegion Write

The handler separates MetaClipRegionAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: If3f4682dbdef6a2a0bd11a51c4a4eb3a6ab8b0d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120307
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index c98570ff491a..e7c2a0adfbfe 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -69,6 +69,7 @@ public:
 void GradientExHandler(MetaGradientExAction* pAction);
 void HatchHandler(MetaHatchAction* pAction);
 void WallpaperHandler(MetaWallpaperAction* pAction);
+void ClipRegionHandler(MetaClipRegionAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index 765bcb10e354..b310824f1beb 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -291,6 +291,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::CLIPREGION:
+{
+auto* pMetaAction = static_cast(pAction);
+ClipRegionHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -806,6 +813,14 @@ void SvmWriter::WallpaperHandler(MetaWallpaperAction* 
pAction)
 WriteWallpaper(mrStream, pAction->GetWallpaper());
 }
 
+void SvmWriter::ClipRegionHandler(MetaClipRegionAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+WriteRegion(mrStream, pAction->GetRegion());
+mrStream.WriteBool(pAction->IsClipping());
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));
commit f6032e23bbedebcbf32eeb56627d89489b52f024
Author: panoskorovesis 
AuthorDate: Thu Aug 5 10:05:26 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Thu Aug 12 02:22:29 2021 +0200

Add Handler for Wallpaper Write

The handler separates MetaWallpaperAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: Icfbb4ab5cf3d7ea803cb55405e82dc262f3958c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120306
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 5bd4ea67dde3..c98570ff491a 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -68,6 +68,7 @@ public:
 void GradientHandler(MetaGradientAction* pAction);
 void GradientExHandler(MetaGradientExAction* pAction);
 void HatchHandler(MetaHatchAction* pAction);
+void WallpaperHandler(MetaWallpaperAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index 93f0c2b2baa6..765bcb10e354 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -284,6 +284,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::WALLPAPER:
+{
+auto* pMetaAction = static_cast(pAction);
+WallpaperHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -791,6 +798,14 @@ void SvmWriter::HatchHandler(MetaHatchAction* pAction)
 WriteHatch(mrStream, pAction->GetHatch());
 }
 
+void SvmWriter::WallpaperHandler(MetaWallpaperAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+
+WriteWallpaper(mrStream, pAction->GetWallpaper());
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: sc/qa

2021-08-11 Thread Xisco Fauli (via logerrit)
 sc/qa/unit/data/ods/tdf76310.ods   |binary
 sc/qa/unit/subsequent_filters-test.cxx |   21 +
 2 files changed, 21 insertions(+)

New commits:
commit 3c0c1b79b689775f09b3bff75bb01118b380f41f
Author: Xisco Fauli 
AuthorDate: Wed Aug 11 20:42:17 2021 +0200
Commit: Xisco Fauli 
CommitDate: Thu Aug 12 00:20:50 2021 +0200

tdf#76310: subsequent_filters: Add unittest

Change-Id: If39bb4e3c7e767f273351cb381ea055e3934de2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120338
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/unit/data/ods/tdf76310.ods b/sc/qa/unit/data/ods/tdf76310.ods
new file mode 100644
index ..219437acfe29
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf76310.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index 75ff20e23034..b48e9a2df575 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -115,6 +115,7 @@ public:
 void testUpdateCircleInMergedCellODS();
 void testDeleteCircleInMergedCellODS();
 void testBooleanFormatXLSX();
+void testTdf76310();
 void testBasicCellContentODS();
 void testRangeNameXLS();
 void testRangeNameLocalXLS();
@@ -224,6 +225,7 @@ public:
 CPPUNIT_TEST(testUpdateCircleInMergedCellODS);
 CPPUNIT_TEST(testDeleteCircleInMergedCellODS);
 CPPUNIT_TEST(testBooleanFormatXLSX);
+CPPUNIT_TEST(testTdf76310);
 CPPUNIT_TEST(testBasicCellContentODS);
 CPPUNIT_TEST(testRangeNameXLS);
 CPPUNIT_TEST(testRangeNameLocalXLS);
@@ -671,6 +673,25 @@ void ScFiltersTest::testBooleanFormatXLSX()
 xDocSh->DoClose();
 }
 
+void ScFiltersTest::testTdf76310()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf76310.", FORMAT_ODS);
+
+ScDocument& rDoc = xDocSh->GetDocument();
+
+OUString aFormula;
+rDoc.GetFormula(0, 0, 0, aFormula);
+// Without the fix in place, this test would have failed with
+// - Expected: =1
+// +
+// 2
+// - Actual  : =1 + 2
+CPPUNIT_ASSERT_EQUAL(OUString("=1\n+\n2"), aFormula);
+ASSERT_DOUBLES_EQUAL(3.0, rDoc.GetValue(0, 0, 0));
+
+xDocSh->DoClose();
+}
+
 void ScFiltersTest::testRangeNameXLS()
 {
 ScDocShellRef xDocSh = loadDoc(u"named-ranges-global.", FORMAT_XLS);


[Libreoffice-commits] core.git: sc/inc sc/source

2021-08-11 Thread Eike Rathke (via logerrit)
 sc/inc/compiler.hxx  |1 +
 sc/source/core/tool/compiler.cxx |   37 ++---
 2 files changed, 31 insertions(+), 7 deletions(-)

New commits:
commit b37fd7f38165dadc5b1a674b73f4b18824e4789e
Author: Eike Rathke 
AuthorDate: Wed Aug 11 20:03:36 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Aug 11 22:20:57 2021 +0200

Resolves: tdf#143809 "INF" may be a named expression or DB area name

... to not be caught by rtl::math::stringToDouble() handling
XMLSchema-2 "INF" and "NaN" and set as error.

Change-Id: I9bf7aad416a69d4c3c0d49d6c80168097040a3e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120337
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 8ae65a4eb8b3..be4c4cadcb1a 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -363,6 +363,7 @@ private:
 bool IsColRowName( const OUString& );
 bool IsBoolean( const OUString& );
 void AutoCorrectParsedSymbol();
+const ScRangeData* GetRangeData( SCTAB& rSheet, const OUString& rUpperName 
) const;
 
 void AdjustSheetLocalNameRelReferences( SCTAB nDelta );
 void SetRelNameReference();
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index d6ae770e5c91..434bd157bd4c 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3126,7 +3126,24 @@ bool ScCompiler::IsValue( const OUString& rSym )
 return false;
 }
 if (eStatus == rtl_math_ConversionStatus_OutOfRange)
+{
+// rtl::math::stringToDouble() recognizes XMLSchema-2 "INF" and
+// "NaN" (case sensitive) that could be named expressions or DB
+// areas as well.
+// rSym is already upper so "NaN" is not possible here.
+if (!std::isfinite(fVal) && rSym == "INF")
+{
+SCTAB nSheet = -1;
+if (GetRangeData( nSheet, rSym))
+return false;
+if 
(rDoc.GetDBCollection()->getNamedDBs().findByUpperName(rSym))
+return false;
+}
+/* TODO: is there a specific reason why we don't accept an infinity
+ * value that would raise an error in the interpreter, instead of
+ * setting the hard error at the token array already? */
 SetError( FormulaError::IllegalArgument );
+}
 maRawToken.SetDouble( fVal );
 return true;
 }
@@ -3544,13 +3561,11 @@ bool ScCompiler::IsMacro( const OUString& rName )
 #endif
 }
 
-bool ScCompiler::IsNamedRange( const OUString& rUpperName )
+const ScRangeData* ScCompiler::GetRangeData( SCTAB& rSheet, const OUString& 
rUpperName ) const
 {
-// IsNamedRange is called only from NextNewToken, with an upper-case string
-
 // try local names first
-sal_Int16 nSheet = aPos.Tab();
-ScRangeName* pRangeName = rDoc.GetRangeName(nSheet);
+rSheet = aPos.Tab();
+const ScRangeName* pRangeName = rDoc.GetRangeName(rSheet);
 const ScRangeData* pData = nullptr;
 if (pRangeName)
 pData = pRangeName->findByUpperName(rUpperName);
@@ -3560,9 +3575,17 @@ bool ScCompiler::IsNamedRange( const OUString& 
rUpperName )
 if (pRangeName)
 pData = pRangeName->findByUpperName(rUpperName);
 if (pData)
-nSheet = -1;
+rSheet = -1;
 }
+return pData;
+}
+
+bool ScCompiler::IsNamedRange( const OUString& rUpperName )
+{
+// IsNamedRange is called only from NextNewToken, with an upper-case string
 
+SCTAB nSheet = -1;
+const ScRangeData* pData = GetRangeData( nSheet, rUpperName);
 if (pData)
 {
 maRawToken.SetName( nSheet, pData->GetIndex());
@@ -3573,7 +3596,7 @@ bool ScCompiler::IsNamedRange( const OUString& rUpperName 
)
 if (mnCurrentSheetEndPos > 0 && mnCurrentSheetTab >= 0)
 {
 OUString aName( rUpperName.copy( mnCurrentSheetEndPos));
-pRangeName = rDoc.GetRangeName( mnCurrentSheetTab);
+const ScRangeName* pRangeName = rDoc.GetRangeName( mnCurrentSheetTab);
 if (pRangeName)
 {
 pData = pRangeName->findByUpperName(aName);


[Libreoffice-commits] core.git: sw/qa

2021-08-11 Thread Xisco Fauli (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf44278.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport16.cxx  |9 +
 2 files changed, 9 insertions(+)

New commits:
commit 2316e21b2c6f3d1f18613408a8deb41af17c03bb
Author: Xisco Fauli 
AuthorDate: Wed Aug 11 20:06:26 2021 +0200
Commit: Xisco Fauli 
CommitDate: Wed Aug 11 21:27:45 2021 +0200

tdf#44278: sw_ooxmlexport16: Add unittest

Change-Id: I31de23db13083ce98e75d3ec1d65d970161b3b92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120335
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf44278.docx 
b/sw/qa/extras/ooxmlexport/data/tdf44278.docx
new file mode 100644
index ..588416cdb09b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf44278.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 61f6b0be7176..9533db4d369e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -177,6 +177,15 @@ DECLARE_OOXMLEXPORT_TEST(testTdf138892_noNumbering, 
"tdf138892_noNumbering.docx"
 CPPUNIT_ASSERT_MESSAGE("Para3: ", 
getProperty(getParagraph(3), "NumberingStyleName").isEmpty());
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf44278, "tdf44278.docx")
+{
+// Without the fix in place, this test would have failed with
+// - Expected: 1
+// - Actual  : 2
+CPPUNIT_ASSERT_EQUAL(1, getShapes());
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf141231_arabicHebrewNumbering, 
"tdf141231_arabicHebrewNumbering.docx")
 {
 // The page's numbering type: instead of Hebrew, this was default 
style::NumberingType::ARABIC (4).


GSoC Week#9 Progress Report

2021-08-11 Thread Tushar Kumar Rai
Hello everyone.

This week I fixed the errors which I was getting in the implementation of
Extension Data Providers and submitted the patch.
My work can be found at https://gerrit.libreoffice.org/c/core/+/120088

Also I submitted a patch for Delete Row Transformation in Internal Data
Providers which deletes all the entries from the sheet which have a given
value in a specific column .
Here is the patch link https://gerrit.libreoffice.org/c/core/+/120296 .

Please provide feedback and suggestions.
Thank You.
Regards
Tushar Kumar Rai


[Libreoffice-commits] core.git: vcl/uiconfig

2021-08-11 Thread Caolán McNamara (via logerrit)
 vcl/uiconfig/ui/menutogglebutton4.ui |8 
 1 file changed, 8 insertions(+)

New commits:
commit 59c9274ec408ec074d4b4b9e4645b0787312a370
Author: Caolán McNamara 
AuthorDate: Wed Aug 11 15:50:02 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 11 20:41:19 2021 +0200

gtk4: add a separator between toggle and menu buttons

Change-Id: I00e9245801529ce817781e65fb75fa59cd3d7f79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120331
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/uiconfig/ui/menutogglebutton4.ui 
b/vcl/uiconfig/ui/menutogglebutton4.ui
index 74c1e2fe3353..cfecfda02c28 100644
--- a/vcl/uiconfig/ui/menutogglebutton4.ui
+++ b/vcl/uiconfig/ui/menutogglebutton4.ui
@@ -1,6 +1,7 @@
 
 
 
+  
   
 True
 False
@@ -14,6 +15,13 @@
 True
   
 
+
+  
+True
+False
+vertical
+  
+
 
   
 True


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/qa writerfilter/source

2021-08-11 Thread László Németh (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf143583_emptyParaAtEndOfFootnote.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx|   13 
++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |5 
+++
 3 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 65b64d70875bc65d0a0da7ef85a98e2152cbbe53
Author: László Németh 
AuthorDate: Tue Aug 10 13:05:48 2021 +0200
Commit: Xisco Fauli 
CommitDate: Wed Aug 11 20:28:08 2021 +0200

tdf#143583 DOCX import: fix lost empty paragraphs of footnotes

Last empty paragraphs of footnotes were removed (except
in the case of the first footnote), related to the double
call of RemoveLastParagraph() during footnote load and
later during its copying.

Regression from commit 9b39ce0e66acfe812e1d50e530dc2ccdef3e1357
"tdf#76260 DOCX import: fix slow footnote import".

Change-Id: I61d9aa6765f3af1893451684dde12c199251d06b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120270
Tested-by: Jenkins
Reviewed-by: László Németh 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120334
Reviewed-by: Xisco Fauli 

diff --git 
a/sw/qa/extras/ooxmlexport/data/tdf143583_emptyParaAtEndOfFootnote.docx 
b/sw/qa/extras/ooxmlexport/data/tdf143583_emptyParaAtEndOfFootnote.docx
new file mode 100644
index ..e8b42b840a93
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf143583_emptyParaAtEndOfFootnote.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 9944636960c0..aefa24911b43 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -1177,6 +1177,19 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf143399, 
"tdf143399.docx")
 assertXPathContent(pXml2, "/w:endnotes/w:endnote[3]/w:p/w:r[3]/w:t[1]", 
"Endnotes");
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf143583, 
"tdf143583_emptyParaAtEndOfFootnote.docx")
+{
+xmlDocUniquePtr pXml = parseExport("word/footnotes.xml");
+CPPUNIT_ASSERT(pXml);
+assertXPath(pXml, "/w:footnotes/w:footnote[3]/w:p", 2);
+// This was 1
+assertXPath(pXml, "/w:footnotes/w:footnote[4]/w:p", 2);
+// This was 2
+assertXPath(pXml, "/w:footnotes/w:footnote[5]/w:p", 3);
+// This was 2
+assertXPath(pXml, "/w:footnotes/w:footnote[6]/w:p", 3);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, 
"cont-sect-break-header-footer.docx")
 {
 // Load a document with a continuous section break on page 2.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index b52b24162344..56451b752221 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3135,6 +3135,7 @@ void DomainMapper_Impl::PopFootOrEndnote()
 // FIXME: add footnote IDs to handle possible differences in footnote 
serialization
 uno::Reference< text::XFootnotesSupplier> xFootnotesSupplier( 
GetTextDocument(), uno::UNO_QUERY );
 uno::Reference< text::XEndnotesSupplier> xEndnotesSupplier( 
GetTextDocument(), uno::UNO_QUERY );
+bool bCopied = false;
 if ( IsInFootOrEndnote() && ( ( IsInFootnote() && GetFootnoteCount() > -1 
&& xFootnotesSupplier.is() ) ||
  ( !IsInFootnote() && GetEndnoteCount() > -1 && xEndnotesSupplier.is() 
) ) )
 {
@@ -3173,6 +3174,8 @@ void DomainMapper_Impl::PopFootOrEndnote()
 // remove processed redlines
 for( size_t i = 0; redIdx > -1 && i <= 
sal::static_int_cast(redIdx) + 2; i++)
 m_aStoredRedlines[eType].pop_front();
+
+bCopied = true;
 }
 
 // remove temporary footnote
@@ -3180,7 +3183,7 @@ void DomainMapper_Impl::PopFootOrEndnote()
 }
 }
 
-if (!IsRTFImport())
+if (!IsRTFImport() && !bCopied)
 RemoveLastParagraph();
 
 // In case the foot or endnote did not contain a tab.


Review for: tdf#143432 and more, improve wrap contour export

2021-08-11 Thread Regina Henschel

Hi all,

this is about patch: "tdf#143432 and more, improve wrap contour export"
https://gerrit.libreoffice.org/c/core/+/120169

The patch is ready for now. I would be happy about a review. In case, 
please let me know, that you want to have a look at the patch.


The patch still contains some ToDo, but they can be solved later.
In particular, wrap polygons for the shapes of the legacy oval and 
legacy rectangle toolbars are missing.


Kind regards
Regina


[Libreoffice-commits] core.git: xmloff/CppunitTest_xmloff_text.mk

2021-08-11 Thread Michael Stahl (via logerrit)
 xmloff/CppunitTest_xmloff_text.mk |4 
 1 file changed, 4 insertions(+)

New commits:
commit 4db18506b43a63af36767d609a762f8d2e3b7634
Author: Michael Stahl 
AuthorDate: Wed Aug 11 11:38:55 2021 +0200
Commit: Michael Stahl 
CommitDate: Wed Aug 11 18:36:36 2021 +0200

xmloff: work around LD_LIBRARY_PATH breaking odfvalidator

Validator calls ResourceBundle.getBundle("com.sun.msv.reader.Messages")
which can't find the com/sun/msv/reader/Messages.properties in its jar.

bootstrapfixture.cxx:241:Assertion
Test name: testBibliographyLocalUrl::TestBody
forced failure
- 
/lo/master/schema/libreoffice/OpenDocument-v1.3+libreoffice-manifest-schema.rng[-1,-1]:
  Error: Can't find bundle for base name com.sun.msv.reader.Messages, locale 
en_US

This is triggered by gb_CppunitTest_CPPTESTPRECOMMAND.

No idea how this happens, or why it started to happen sometime during
the last ~4 weeks, but propagating the same workaround of commit
e854abe076155fc085b56549ced50b3ee9a095d2 to more tests seems to fix it.

Change-Id: Iaef2b41f81c4a659e66cfb7a40f7b1a4517552c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120322
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/xmloff/CppunitTest_xmloff_text.mk 
b/xmloff/CppunitTest_xmloff_text.mk
index 8e757fd584b2..14640cf8d7d7 100644
--- a/xmloff/CppunitTest_xmloff_text.mk
+++ b/xmloff/CppunitTest_xmloff_text.mk
@@ -42,4 +42,8 @@ $(eval $(call gb_CppunitTest_use_custom_headers,xmloff_text,\
 
 $(eval $(call gb_CppunitTest_use_configuration,xmloff_text))
 
+$(eval $(call gb_CppunitTest_add_arguments,xmloff_text, \
+
-env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"{$(gb_Helper_LIBRARY_PATH_VAR)+=$(gb_Helper_LIBRARY_PATH_VAR)}"
 \
+))
+
 # vim: set noet sw=4 ts=4:


[Libreoffice-commits] core.git: 2 commits - vcl/unx

2021-08-11 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   34 ++
 1 file changed, 22 insertions(+), 12 deletions(-)

New commits:
commit ad1ba0f58ee5cb7db3a856d49f73e3b543a497aa
Author: Caolán McNamara 
AuthorDate: Wed Aug 11 15:26:48 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 11 17:41:27 2021 +0200

gtk4: fill menu MenuToggleButton menu

Change-Id: I512846cda2c8f06838a499043a4cd08314fd7b97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120329
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index f67aab429bca..afe7bef66f16 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -10227,6 +10227,10 @@ public:
 #if !GTK_CHECK_VERSION(4, 0, 0)
 gtk_menu_detach(m_pMenu);
 gtk_menu_attach_to_widget(m_pMenu, GTK_WIDGET(m_pToggleButton), 
nullptr);
+#else
+gtk_widget_insert_action_group(GTK_WIDGET(m_pContainer), "menu", 
m_pActionGroup);
+
+update_action_group_from_popover_model();
 #endif
 
 g_signal_connect(m_pContainer, "mnemonic-activate", 
G_CALLBACK(signalMenuToggleButton), this);
commit 2ece952c4ae1c65975a4e80645719ad14daa95da
Author: Caolán McNamara 
AuthorDate: Wed Aug 11 15:11:10 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 11 17:41:12 2021 +0200

gtk4: get startcenter MenuToggleButton menu appearing

though still without contents

Change-Id: Ieb7048a74f33fe65ededd1ff8730b2d061ae325f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120328
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 2147a1e49956..f67aab429bca 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -10039,9 +10039,7 @@ private:
 GtkBox* m_pContainer;
 GtkButton* m_pToggleMenuButton;
 GtkMenuButton* m_pMenuButton;
-#if !GTK_CHECK_VERSION(4, 0, 0)
 gulong m_nMenuBtnClickedId;
-#endif
 gulong m_nToggleStateFlagsChangedId;
 gulong m_nMenuBtnStateFlagsChangedId;
 
@@ -10063,7 +10061,6 @@ private:
 gtk_widget_set_state_flags(GTK_WIDGET(pThis->m_pToggleButton), 
eFinalFlags, true);
 }
 
-#if !GTK_CHECK_VERSION(4, 0, 0)
 static void signalMenuBtnClicked(GtkButton*, gpointer widget)
 {
 GtkInstanceMenuToggleButton* pThis = 
static_cast(widget);
@@ -10080,6 +10077,16 @@ private:
 //launching PopupMenu to be destroyed, instead run the subloop here
 //until the gtk menu is destroyed
 GMainLoop* pLoop = g_main_loop_new(nullptr, true);
+
+#if  GTK_CHECK_VERSION(4, 0, 0)
+gulong nSignalId = g_signal_connect_swapped(G_OBJECT(m_pMenu), 
"closed", G_CALLBACK(g_main_loop_quit), pLoop);
+
+g_object_ref(m_pMenu);
+gtk_menu_button_set_popover(m_pMenuButton, nullptr);
+gtk_widget_set_parent(GTK_WIDGET(m_pMenu), pWidget);
+gtk_popover_set_position(GTK_POPOVER(m_pMenu), GTK_POS_BOTTOM);
+gtk_popover_popup(GTK_POPOVER(m_pMenu));
+#else
 gulong nSignalId = g_signal_connect_swapped(G_OBJECT(m_pMenu), 
"deactivate", G_CALLBACK(g_main_loop_quit), pLoop);
 
 #if GTK_CHECK_VERSION(3,22,0)
@@ -10123,15 +10130,22 @@ private:
 
 gtk_menu_popup(m_pMenu, nullptr, nullptr, nullptr, nullptr, 
nButton, nTime);
 }
+#endif
 
 if (g_main_loop_is_running(pLoop))
 main_loop_run(pLoop);
 
 g_main_loop_unref(pLoop);
 g_signal_handler_disconnect(m_pMenu, nSignalId);
-}
+
+#if GTK_CHECK_VERSION(4, 0, 0)
+gtk_widget_unparent(GTK_WIDGET(m_pMenu));
+gtk_menu_button_set_popover(m_pMenuButton, GTK_WIDGET(m_pMenu));
+g_object_unref(m_pMenu);
 #endif
 
+}
+
 static gboolean signalMenuToggleButton(GtkWidget*, gboolean bGroupCycling, 
gpointer widget)
 {
 GtkInstanceMenuToggleButton* pThis = 
static_cast(widget);
@@ -10151,9 +10165,7 @@ public:
 , 
m_pContainer(GTK_BOX(gtk_builder_get_object(pMenuToggleButtonBuilder, "box")))
 , 
m_pToggleMenuButton(GTK_BUTTON(gtk_builder_get_object(pMenuToggleButtonBuilder, 
"menubutton")))
 , m_pMenuButton(pMenuButton)
-#if !GTK_CHECK_VERSION(4, 0, 0)
 , m_nMenuBtnClickedId(g_signal_connect(m_pToggleMenuButton, "clicked", 
G_CALLBACK(signalMenuBtnClicked), this))
-#endif
 , m_nToggleStateFlagsChangedId(g_signal_connect(m_pToggleButton, 
"state-flags-changed", G_CALLBACK(signalToggleStateFlagsChanged), this))
 , m_nMenuBtnStateFlagsChangedId(g_signal_connect(m_pToggleMenuButton, 
"state-flags-changed", G_CALLBACK(signalMenuBtnStateFlagsChanged), this))
 {
@@ -10222,27 +10234,21 @@ public:
 
 virtual void disable_notify_events() override
 {
-#if !GTK_CHECK_VERSION(4, 0, 0)
 g_signal_handler_block(m_pToggleMenuButton, m_nMenuBtnClickedId);
-#endif
 GtkInstanceToggleButton::disable_notify_events();
 }
 
 virtual void enable_notify_e

[Libreoffice-commits] core.git: sc/qa

2021-08-11 Thread Karan Abrol (via logerrit)
 sc/qa/extras/sccellfieldsobj.cxx  |1 -
 sc/qa/extras/sccellformatsenumeration.cxx |1 -
 sc/qa/extras/sccellformatsobj.cxx |1 -
 3 files changed, 3 deletions(-)

New commits:
commit 7b21c25354d16b9d9e04f36c1370b9a2edfe09fc
Author: Karan Abrol 
AuthorDate: Wed Aug 11 16:49:13 2021 +0530
Commit: Mike Kaganski 
CommitDate: Wed Aug 11 17:26:50 2021 +0200

tdf#139734 Remove redundant asserts after MacrosTest::loadFromDesktop

Change-Id: Ia1b63a38b6522ecf52cc2e923e93d6bf0a41ea86
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120319
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/sc/qa/extras/sccellfieldsobj.cxx b/sc/qa/extras/sccellfieldsobj.cxx
index 98f0db3e23c3..573942b4028b 100644
--- a/sc/qa/extras/sccellfieldsobj.cxx
+++ b/sc/qa/extras/sccellfieldsobj.cxx
@@ -95,7 +95,6 @@ void ScCellFieldsObj::setUp()
 {
 CalcUnoApiTest::setUp();
 m_xComponent = loadFromDesktop("private:factory/scalc");
-CPPUNIT_ASSERT_MESSAGE("no component", m_xComponent.is());
 }
 
 void ScCellFieldsObj::tearDown()
diff --git a/sc/qa/extras/sccellformatsenumeration.cxx 
b/sc/qa/extras/sccellformatsenumeration.cxx
index 93e07be162b2..0ecb6aea359d 100644
--- a/sc/qa/extras/sccellformatsenumeration.cxx
+++ b/sc/qa/extras/sccellformatsenumeration.cxx
@@ -73,7 +73,6 @@ void ScCellFormatsEnumeration::setUp()
 {
 CalcUnoApiTest::setUp();
 m_xComponent = loadFromDesktop("private:factory/scalc");
-CPPUNIT_ASSERT_MESSAGE("no component", m_xComponent.is());
 }
 
 void ScCellFormatsEnumeration::tearDown()
diff --git a/sc/qa/extras/sccellformatsobj.cxx 
b/sc/qa/extras/sccellformatsobj.cxx
index c2d7e91d1baa..58d570f8be26 100644
--- a/sc/qa/extras/sccellformatsobj.cxx
+++ b/sc/qa/extras/sccellformatsobj.cxx
@@ -86,7 +86,6 @@ void ScCellFormatsObj::setUp()
 {
 CalcUnoApiTest::setUp();
 m_xComponent = loadFromDesktop("private:factory/scalc");
-CPPUNIT_ASSERT_MESSAGE("no component", m_xComponent.is());
 }
 
 void ScCellFormatsObj::tearDown()


[Libreoffice-commits] core.git: 2 commits - sc/source solenv/sanitizers vcl/uiconfig vcl/UIConfig_vcl.mk vcl/unx

2021-08-11 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/documen2.cxx |3 
 sc/source/ui/docshell/docfunc.cxx|5 
 solenv/sanitizers/ui/vcl.suppr   |6 -
 vcl/UIConfig_vcl.mk  |3 
 vcl/uiconfig/ui/menutogglebutton4.ui |   29 +
 vcl/unx/gtk3/gtkinst.cxx |  153 ++--
 vcl/unx/gtk4/convert3to4.cxx |  186 ++-
 7 files changed, 237 insertions(+), 148 deletions(-)

New commits:
commit 3ad8347f25935d60e55ff12fd1844001a50bedc4
Author: Caolán McNamara 
AuthorDate: Wed Aug 11 14:45:02 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 11 16:56:15 2021 +0200

add some --disable-scripting fixes

Change-Id: I28c4d38a035201acc2b0e5acc5908c4e74ae80e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120327
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 1db11be0c777..28f19df43539 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -87,6 +87,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace com::sun::star;
 
@@ -1026,11 +1027,13 @@ sal_uLong ScDocument::TransferTab( ScDocument& rSrcDoc, 
SCTAB nSrcPos,
 if ( pSrcShell )
 {
 OUString aLibName("Standard");
+#if HAVE_FEATURE_SCRIPTING
 const BasicManager *pBasicManager = pSrcShell->GetBasicManager();
 if (pBasicManager && !pBasicManager->GetName().isEmpty())
 {
 aLibName = pSrcShell->GetBasicManager()->GetName();
 }
+#endif
 OUString sSource;
 uno::Reference< script::XLibraryContainer > xLibContainer = 
pSrcShell->GetBasicContainer();
 uno::Reference< container::XNameContainer > xLib;
diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index ac011281dd36..d0ad63f1ff95 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -94,6 +94,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -3198,10 +3199,12 @@ void VBA_InsertModule( ScDocument& rDoc, SCTAB nTab, 
const OUString& sSource )
 if( xLibContainer.is() )
 {
 OUString aLibName( "Standard" );
+#if HAVE_FEATURE_SCRIPTING
 if ( rDocSh.GetBasicManager() && 
!rDocSh.GetBasicManager()->GetName().isEmpty() )
 {
 aLibName = rDocSh.GetBasicManager()->GetName();
 }
+#endif
 uno::Any aLibAny = xLibContainer->getByName( aLibName );
 aLibAny >>= xLib;
 }
@@ -3238,10 +3241,12 @@ void VBA_DeleteModule( ScDocShell& rDocSh, const 
OUString& sModuleName )
 if( xLibContainer.is() )
 {
 OUString aLibName( "Standard" );
+#if HAVE_FEATURE_SCRIPTING
 if ( rDocSh.GetBasicManager() && 
!rDocSh.GetBasicManager()->GetName().isEmpty() )
 {
 aLibName = rDocSh.GetBasicManager()->GetName();
 }
+#endif
 uno::Any aLibAny = xLibContainer->getByName( aLibName );
 aLibAny >>= xLib;
 }
commit 54c2de7e77dad1a1151c074f2ec5bfe1527d4d12
Author: Caolán McNamara 
AuthorDate: Wed Aug 11 10:53:44 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 11 16:56:02 2021 +0200

gtk4: get startcenter MenuToggleButton working

the button parts, not the menu part yet

Change-Id: I016d2c2160a4e8c0c4d1e096f49d0e518b89a55b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120326
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/solenv/sanitizers/ui/vcl.suppr b/solenv/sanitizers/ui/vcl.suppr
index c053a035fd32..a07c25780a76 100644
--- a/solenv/sanitizers/ui/vcl.suppr
+++ b/solenv/sanitizers/ui/vcl.suppr
@@ -7,8 +7,10 @@ vcl/uiconfig/ui/combobox.ui://GtkEntry[@id='entry'] 
no-labelled-by
 vcl/uiconfig/ui/combobox.ui://GtkToggleButton[@id='button'] button-no-label
 vcl/uiconfig/ui/combobox.ui://GtkMenuButton[@id='overlaybutton'] 
button-no-label
 vcl/uiconfig/ui/cupspassworddialog.ui://GtkLabel[@id='text'] orphan-label
-vcl/uiconfig/ui/menutogglebutton.ui://GtkToggleButton[@id='togglebutton'] 
button-no-label
-vcl/uiconfig/ui/menutogglebutton.ui://GtkButton[@id='menubutton'] 
button-no-label
+vcl/uiconfig/ui/menutogglebutton3.ui://GtkToggleButton[@id='togglebutton'] 
button-no-label
+vcl/uiconfig/ui/menutogglebutton3.ui://GtkButton[@id='menubutton'] 
button-no-label
+vcl/uiconfig/ui/menutogglebutton4.ui://GtkToggleButton[@id='togglebutton'] 
button-no-label
+vcl/uiconfig/ui/menutogglebutton4.ui://GtkButton[@id='menubutton'] 
button-no-label
 vcl/uiconfig/ui/printdialog.ui://GtkLabel[@id='totalnumpages'] orphan-label
 vcl/uiconfig/ui/printdialog.ui://GtkImage[@id='collateimage'] no-labelled-by
 vcl/uiconfig/ui/printdialog.ui://GtkLabel[@id='pagemargintxt2'] orphan-label
diff --git a/vcl/UIConfig_vcl.mk b/vcl/UIConfig_vcl.mk
index 72b7e08d2700..703cef1e6e1c 100644
--- a/vcl/UIConfig_vcl.mk
+++ b/vcl/UIConfig

[Libreoffice-commits] core.git: vcl/unx

2021-08-11 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ebf494123720806a99e12001bdee9cae4a86c44f
Author: Caolán McNamara 
AuthorDate: Wed Aug 11 10:20:42 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 11 15:39:57 2021 +0200

gtk: use explicit GtkBox instead of generic GtkContainer

cause gtk4 doesn't have GtkContainer anymore

Change-Id: I32893716654ba308277ee34ecd8c3c944a9bc575
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120314
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 238e2aa72571..9ad49d81d9e8 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -10040,7 +10040,7 @@ class GtkInstanceMenuToggleButton : public 
GtkInstanceToggleButton, public MenuH
   , public virtual weld::MenuToggleButton
 {
 private:
-GtkContainer* m_pContainer;
+GtkBox* m_pContainer;
 GtkButton* m_pToggleMenuButton;
 gulong m_nMenuBtnClickedId;
 gulong m_nToggleStateFlagsChangedId;
@@ -10143,7 +10143,7 @@ public:
 : 
GtkInstanceToggleButton(GTK_TOGGLE_BUTTON(gtk_builder_get_object(pMenuToggleButtonBuilder,
 "togglebutton")),
   pBuilder, bTakeOwnership)
 , MenuHelper(gtk_menu_button_get_popup(pMenuButton), false)
-, 
m_pContainer(GTK_CONTAINER(gtk_builder_get_object(pMenuToggleButtonBuilder, 
"box")))
+, 
m_pContainer(GTK_BOX(gtk_builder_get_object(pMenuToggleButtonBuilder, "box")))
 , 
m_pToggleMenuButton(GTK_BUTTON(gtk_builder_get_object(pMenuToggleButtonBuilder, 
"menubutton")))
 , m_nMenuBtnClickedId(g_signal_connect(m_pToggleMenuButton, "clicked", 
G_CALLBACK(signalMenuBtnClicked), this))
 , m_nToggleStateFlagsChangedId(g_signal_connect(m_pToggleButton, 
"state-flags-changed", G_CALLBACK(signalToggleStateFlagsChanged), this))


[Libreoffice-commits] core.git: vcl/inc

2021-08-11 Thread Zeynep Yavuz (via logerrit)
 vcl/inc/osx/a11yfactory.h|4 +---
 vcl/inc/osx/a11yfocustracker.hxx |4 +---
 vcl/inc/osx/a11ylistener.hxx |5 +
 vcl/inc/osx/a11ywrapper.h|4 +---
 4 files changed, 4 insertions(+), 13 deletions(-)

New commits:
commit b0a75847738060266ed1b0d5c046132b97e4e158
Author: Zeynep Yavuz 
AuthorDate: Tue Aug 10 22:28:42 2021 +0300
Commit: Michael Stahl 
CommitDate: Wed Aug 11 15:17:11 2021 +0200

tdf#143148: Use pragma once instead of include guards

Change-Id: I483d494a11b951fd415a314fddd4823db11dcb44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120295
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/vcl/inc/osx/a11yfactory.h b/vcl/inc/osx/a11yfactory.h
index b20755a0313a..cec49bf93b6d 100644
--- a/vcl/inc/osx/a11yfactory.h
+++ b/vcl/inc/osx/a11yfactory.h
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_OSX_A11YFACTORY_H
-#define INCLUDED_VCL_INC_OSX_A11YFACTORY_H
+#pragma once
 
 #include "osxvcltypes.h"
 #include "a11ywrapper.h"
@@ -37,6 +36,5 @@
 +(void)revokeView: (NSView *) theViewt;
 @end
 
-#endif // INCLUDED_VCL_INC_OSX_A11YFACTORY_H
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/osx/a11yfocustracker.hxx b/vcl/inc/osx/a11yfocustracker.hxx
index 59f2e579c5e9..5a979c26c86b 100644
--- a/vcl/inc/osx/a11yfocustracker.hxx
+++ b/vcl/inc/osx/a11yfocustracker.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_OSX_A11YFOCUSTRACKER_HXX
-#define INCLUDED_VCL_INC_OSX_A11YFOCUSTRACKER_HXX
+#pragma once
 
 #include 
 
@@ -98,6 +97,5 @@ struct TheAquaA11yFocusTracker:
 rtl::Static
 {};
 
-#endif // INCLUDED_VCL_INC_OSX_A11YFOCUSTRACKER_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/osx/a11ylistener.hxx b/vcl/inc/osx/a11ylistener.hxx
index 43aa6df66987..7211e81d4676 100644
--- a/vcl/inc/osx/a11ylistener.hxx
+++ b/vcl/inc/osx/a11ylistener.hxx
@@ -17,9 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_OSX_A11YLISTENER_HXX
-#define INCLUDED_VCL_INC_OSX_A11YLISTENER_HXX
-
+#pragma once
 #include 
 #include 
 
@@ -48,5 +46,4 @@ private:
 css::awt::Rectangle m_oldBounds;
 };
 
-#endif // INCLUDED_VCL_INC_OSX_A11YLISTENER_HXX
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/osx/a11ywrapper.h b/vcl/inc/osx/a11ywrapper.h
index e33d247a1f39..f9b30eb98fcd 100644
--- a/vcl/inc/osx/a11ywrapper.h
+++ b/vcl/inc/osx/a11ywrapper.h
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_OSX_A11YWRAPPER_H
-#define INCLUDED_VCL_INC_OSX_A11YWRAPPER_H
+#pragma once
 
 #include "osxvcltypes.h"
 #include 
@@ -105,6 +104,5 @@ struct ReferenceWrapper
 -(css::accessibility::XAccessibleTextMarkup *)accessibleTextMarkup;
 @end
 
-#endif // INCLUDED_VCL_INC_OSX_A11YWRAPPER_H
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source

2021-08-11 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/fillctrl.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b79925cb839093aa11e21e618318bd23630d0b65
Author: Caolán McNamara 
AuthorDate: Tue Aug 10 21:58:27 2021 +0100
Commit: Michael Stahl 
CommitDate: Wed Aug 11 15:15:55 2021 +0200

tdf#143769 don't crash on null XFillColorItem

use same solution as:

commit 5ee0e6ab93ad791f5e79506efafd16cb7364ffb1
Author: Markus Mohrhard 
Date:   Tue Jul 21 19:01:26 2015 +0200

avoid crash with color listbox for now

Change-Id: I36ac6513546961ec8d8d1e9437a8ef88574acbf4

Change-Id: I46c55461e5867431a6e9c838b5ef462f9581eb28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120248
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index 788a8fe1c1a1..e327be070b16 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -700,10 +700,11 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, 
weld::ComboBox&, void)
 {
 mpLbFillAttr->hide();
 mpToolBoxColor->show();
-const ::Color aColor = mpColorItem->GetColorValue();
-const XFillColorItem aXFillColorItem( "", aColor );
 if (pSh)
 {
+const ::Color aColor = mpColorItem ? 
mpColorItem->GetColorValue() : COL_AUTO;
+const XFillColorItem aXFillColorItem( "", aColor );
+
 // #i122676# change FillStyle and Color in one call
 pSh->GetDispatcher()->ExecuteList(
 SID_ATTR_FILL_COLOR, SfxCallMode::RECORD,


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - svx/source

2021-08-11 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/fillctrl.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 2a01c0b7a621a4f2bb6b25c0ef45897c0124c370
Author: Caolán McNamara 
AuthorDate: Tue Aug 10 21:58:27 2021 +0100
Commit: Michael Stahl 
CommitDate: Wed Aug 11 15:15:49 2021 +0200

tdf#143769 don't crash on null XFillColorItem

use same solution as:

commit 5ee0e6ab93ad791f5e79506efafd16cb7364ffb1
Author: Markus Mohrhard 
Date:   Tue Jul 21 19:01:26 2015 +0200

avoid crash with color listbox for now

Change-Id: I36ac6513546961ec8d8d1e9437a8ef88574acbf4

Change-Id: I46c55461e5867431a6e9c838b5ef462f9581eb28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120247
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index 5541475c78c8..c8187454888e 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -699,10 +699,11 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, 
weld::ComboBox&, void)
 {
 mpLbFillAttr->hide();
 mpToolBoxColor->show();
-const ::Color aColor = mpColorItem->GetColorValue();
-const XFillColorItem aXFillColorItem( "", aColor );
 if (pSh)
 {
+const ::Color aColor = mpColorItem ? 
mpColorItem->GetColorValue() : COL_AUTO;
+const XFillColorItem aXFillColorItem( "", aColor );
+
 // #i122676# change FillStyle and Color in one call
 pSh->GetDispatcher()->ExecuteList(
 SID_ATTR_FILL_COLOR, SfxCallMode::RECORD,


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/source

2021-08-11 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/shells/basesh.cxx |   49 +++--
 1 file changed, 26 insertions(+), 23 deletions(-)

New commits:
commit d3f5f1b0068b8ab57f7aae9588cc0cff4af1db54
Author: Jim Raykowski 
AuthorDate: Sun Aug 8 21:43:25 2021 -0800
Commit: Michael Stahl 
CommitDate: Wed Aug 11 15:06:12 2021 +0200

tdf#143577 check node is a text node before use as such

Change-Id: I337c94aa90ed906c5b744171728022ba5f9c64b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120191
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 
(cherry picked from commit 0ff5eb97b89f89e770d4397bf76f24fb7cd76b57)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120250
Reviewed-by: Michael Stahl 

diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index a81ae435829c..9752f24ad189 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -199,25 +199,26 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq)
 case SID_DELETE:
 if (rSh.GetViewOptions()->IsShowOutlineContentVisibilityButton())
 {
+// Disallow if the cursor is at the end of a paragraph and the 
document model
+// node at this position is an outline node with folded 
content or the next node
+// is an outline node with folded content.
 if (rSh.IsEndPara())
 {
 SwNodeIndex aIdx(rSh.GetCursor()->GetNode());
-// disallow if this is an outline node having folded 
content
-bool bVisible = true;
-
aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
-if (!bVisible)
-return;
-// disallow if the next text node is an outline node 
having folded content
-++aIdx;
-SwNodeType aNodeType;
-while ((aNodeType = aIdx.GetNode().GetNodeType()) != 
SwNodeType::Text)
-++aIdx;
 if (aIdx.GetNode().IsTextNode())
 {
-bVisible = true;
+bool bVisible = true;
 
aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
 if (!bVisible)
-return;
+break;
+++aIdx;
+if (aIdx.GetNode().IsTextNode())
+{
+bVisible = true;
+
aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
+if (!bVisible)
+break;
+}
 }
 }
 }
@@ -227,21 +228,23 @@ void SwBaseShell::ExecDelete(SfxRequest &rReq)
 case FN_BACKSPACE:
 if (rSh.GetViewOptions()->IsShowOutlineContentVisibilityButton())
 {
+// Disallow if the cursor is at the start of a paragraph and 
the document model
+// node at this position is an outline node with folded 
content or the previous
+// node is a content node without a layout frame.
 if (rSh.IsSttPara())
 {
 SwNodeIndex aIdx(rSh.GetCursor()->GetNode());
-// disallow if this is a folded outline node
-bool bVisible = true;
-
aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
-if (!bVisible)
-return;
-// disallow if previous text node does not have a layout 
frame
---aIdx;
-SwNodeType aNodeType;
-while ((aNodeType = aIdx.GetNode().GetNodeType()) != 
SwNodeType::Text)
+if (aIdx.GetNode().IsTextNode())
+{
+bool bVisible = true;
+
aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
+if (!bVisible)
+break;
 --aIdx;
-if (aIdx.GetNode().IsContentNode() && 
!aIdx.GetNode().GetContentNode()->getLayoutFrame(nullptr))
-return;
+if (aIdx.GetNode().IsContentNode() &&
+
!aIdx.GetNode().GetContentNode()->getLayoutFrame(nullptr))
+break;
+}
 }
 }
 if( rSh.IsNoNum() )


[Libreoffice-commits] core.git: sw/source

2021-08-11 Thread Tomaž Vajngerl (via logerrit)
 sw/source/uibase/dochdl/swdtflvr.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 749a14a7cee3ef6353b99d25422f996518c2284c
Author: Tomaž Vajngerl 
AuthorDate: Wed Aug 11 20:00:02 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 11 14:47:33 2021 +0200

sw: fixed regression from [1] - OLE height in mm instead 100th mm

OLE height is 3cm, but converted to 30 (mm) where the Size is
expected to be in 100th mm. This uses the correct value of 3000,
which correcponds to 30mm and the expected 3cm.

[1] 0d356f93e4d5ca073a6e866168f76103c60c6a45

Change-Id: I77cab1641b948a8839da543c12835c5c64825a5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120316
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index b66f251e55c7..cb32fb1f852e 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -139,7 +139,7 @@ constexpr tools::Long constOleWidthInMm = 210 - 2 * 
lMinBorderInMm;
 
 constexpr Size constOleSize100mm(
 constOleWidthInMm * 100, // convert from mm to 100mm
-30 // 3 cm
+3000 // 3 cm
 );
 
 constexpr Size constOleSizeTwip = o3tl::convert(constOleSize100mm, 
o3tl::Length::mm100, o3tl::Length::twip);


[Libreoffice-commits] core.git: editeng/source include/tools sc/qa sc/source sd/qa sd/source svl/source svx/source sw/qa sw/source tools/qa vcl/source writerfilter/source xmloff/source

2021-08-11 Thread Mike Kaganski (via logerrit)
 editeng/source/items/frmitems.cxx|   68 +++
 editeng/source/items/numitem.cxx |4 -
 editeng/source/items/paraitem.cxx|8 +-
 editeng/source/items/textitem.cxx|   34 ---
 include/tools/UnitConversion.hxx |4 -
 sc/qa/unit/ucalc.cxx |8 +-
 sc/source/core/data/drwlayer.cxx |   13 +---
 sc/source/core/data/patattr.cxx  |6 +-
 sc/source/core/tool/docoptio.cxx |2 
 sc/source/filter/oox/worksheethelper.cxx |4 -
 sc/source/ui/unoobj/cellsuno.cxx |   12 ++--
 sc/source/ui/unoobj/defltuno.cxx |2 
 sc/source/ui/unoobj/docuno.cxx   |8 +-
 sc/source/ui/unoobj/styleuno.cxx |2 
 sc/source/ui/view/cellsh3.cxx|   12 ++--
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   56 +-
 sd/source/ui/unoidl/unomodel.cxx |2 
 svl/source/items/ptitem.cxx  |6 +-
 svx/source/dialog/rulritem.cxx   |   12 ++--
 svx/source/items/algitem.cxx |8 +-
 svx/source/items/grfitem.cxx |8 +-
 svx/source/table/svdotable.cxx   |   24 
 svx/source/table/tablertfexporter.cxx|2 
 svx/source/unodraw/SvxXTextColumns.cxx   |2 
 svx/source/xoutdev/xattr.cxx |2 
 sw/qa/core/layout/layout.cxx |8 +-
 sw/qa/extras/rtfimport/rtfimport.cxx |8 +-
 sw/source/core/draw/dflyobj.cxx  |8 +-
 sw/source/core/inc/rootfrm.hxx   |2 
 sw/source/core/layout/atrfrm.cxx |   18 +++---
 sw/source/core/para/paratr.cxx   |4 -
 sw/source/core/unocore/unodraw.cxx   |6 +-
 sw/source/core/unocore/unoidx.cxx|2 
 sw/source/core/unocore/unosett.cxx   |   22 +++
 sw/source/core/unocore/unotbl.cxx|   20 +++---
 sw/source/filter/ww8/docxattributeoutput.cxx |8 +-
 sw/source/filter/ww8/rtfattributeoutput.cxx  |4 -
 sw/source/filter/xml/xmltexti.cxx|4 -
 sw/source/uibase/app/appopt.cxx  |2 
 sw/source/uibase/app/docshini.cxx|2 
 sw/source/uibase/config/fontcfg.cxx  |2 
 sw/source/uibase/config/modcfg.cxx   |8 +-
 sw/source/uibase/config/usrpref.cxx  |4 -
 sw/source/uibase/envelp/envimg.cxx   |   16 ++---
 sw/source/uibase/envelp/labelcfg.cxx |   16 ++---
 sw/source/uibase/envelp/labimg.cxx   |   16 ++---
 sw/source/uibase/shells/grfsh.cxx|8 +-
 sw/source/uibase/uiview/view.cxx |   12 ++--
 sw/source/uibase/uno/unomod.cxx  |4 -
 sw/source/uibase/uno/unotxdoc.cxx|   12 ++--
 sw/source/uibase/utlui/uiitems.cxx   |4 -
 tools/qa/cppunit/test_100mm2twips.cxx|7 --
 vcl/source/filter/ipdf/pdfread.cxx   |   12 ++--
 writerfilter/source/dmapper/NumberingManager.cxx |4 -
 xmloff/source/transform/TransformerBase.cxx  |2 
 55 files changed, 267 insertions(+), 287 deletions(-)

New commits:
commit bfed58821fc3a83fec4a985087cd45fa963bed3e
Author: Mike Kaganski 
AuthorDate: Wed Aug 11 13:13:35 2021 +0300
Commit: Mike Kaganski 
CommitDate: Wed Aug 11 14:19:24 2021 +0200

Drop convertMm100ToTwip in favor of the new o3tl::toTwips

Step by step, duplicates from  may go

Change-Id: Id4c03ff8adc120ae06dbfdbdfb4f5ff0bb51f489
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120315
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index add9c3654f65..6aec451c8024 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -181,8 +181,8 @@ bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 
nMemberId )
 {
 if(bConvert)
 {
-aTmp.Height = convertMm100ToTwip(aTmp.Height);
-aTmp.Width = convertMm100ToTwip(aTmp.Width);
+aTmp.Height = o3tl::toTwips(aTmp.Height, 
o3tl::Length::mm100);
+aTmp.Width = o3tl::toTwips(aTmp.Width, 
o3tl::Length::mm100);
 }
 m_aSize = Size( aTmp.Width, aTmp.Height );
 }
@@ -198,7 +198,7 @@ bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 
nMemberId )
 if(!(rVal >>= nVal ))
 return false;
 
-m_aSize.setWidth( bConvert ? convertMm100ToTwip(nVal) : nVal );
+m_aSize.setWidth( bConvert ? o3tl::toTwips(nVal, 
o3tl::Length::mm100) : nVal );
 

[Libreoffice-commits] core.git: sw/qa writerfilter/source

2021-08-11 Thread László Németh (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf143583_emptyParaAtEndOfFootnote.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport14.cxx|   13 
++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |4 
++-
 3 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit c46950fee11f5207fb8324947280cd565ae483e7
Author: László Németh 
AuthorDate: Tue Aug 10 13:05:48 2021 +0200
Commit: László Németh 
CommitDate: Wed Aug 11 13:58:26 2021 +0200

tdf#143583 DOCX import: fix lost empty paragraphs of footnotes

Last empty paragraphs of footnotes were removed (except
in the case of the first footnote), related to the double
call of RemoveLastParagraph() during footnote load and
later during its copying.

Regression from commit 9b39ce0e66acfe812e1d50e530dc2ccdef3e1357
"tdf#76260 DOCX import: fix slow footnote import".

Change-Id: I61d9aa6765f3af1893451684dde12c199251d06b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120270
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git 
a/sw/qa/extras/ooxmlexport/data/tdf143583_emptyParaAtEndOfFootnote.docx 
b/sw/qa/extras/ooxmlexport/data/tdf143583_emptyParaAtEndOfFootnote.docx
new file mode 100644
index ..e8b42b840a93
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf143583_emptyParaAtEndOfFootnote.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index d783c8f448de..41a5f26acb8b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -1177,6 +1177,19 @@ DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf143399, 
"tdf143399.docx")
 assertXPathContent(pXml2, "/w:endnotes/w:endnote[3]/w:p/w:r[3]/w:t[1]", 
"Endnotes");
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf143583, 
"tdf143583_emptyParaAtEndOfFootnote.docx")
+{
+xmlDocUniquePtr pXml = parseExport("word/footnotes.xml");
+CPPUNIT_ASSERT(pXml);
+assertXPath(pXml, "/w:footnotes/w:footnote[3]/w:p", 2);
+// This was 1
+assertXPath(pXml, "/w:footnotes/w:footnote[4]/w:p", 2);
+// This was 2
+assertXPath(pXml, "/w:footnotes/w:footnote[5]/w:p", 3);
+// This was 2
+assertXPath(pXml, "/w:footnotes/w:footnote[6]/w:p", 3);
+}
+
 DECLARE_OOXMLEXPORT_TEST(testContSectBreakHeaderFooter, 
"cont-sect-break-header-footer.docx")
 {
 // Load a document with a continuous section break on page 2.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index c5bfed90ae1a..1249d45c82dd 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -3210,6 +3210,7 @@ void DomainMapper_Impl::PopFootOrEndnote()
 // FIXME: add footnote IDs to handle possible differences in footnote 
serialization
 uno::Reference< text::XFootnotesSupplier> xFootnotesSupplier( 
GetTextDocument(), uno::UNO_QUERY );
 uno::Reference< text::XEndnotesSupplier> xEndnotesSupplier( 
GetTextDocument(), uno::UNO_QUERY );
+bool bCopied = false;
 if ( IsInFootOrEndnote() && ( ( IsInFootnote() && GetFootnoteCount() > -1 
&& xFootnotesSupplier.is() ) ||
  ( !IsInFootnote() && GetEndnoteCount() > -1 && xEndnotesSupplier.is() 
) ) )
 {
@@ -3251,11 +3252,12 @@ void DomainMapper_Impl::PopFootOrEndnote()
 
 // remove temporary footnote
 xFootnoteFirst->getAnchor()->setString("");
+bCopied = true;
 }
 }
 }
 
-if (!IsRTFImport())
+if (!IsRTFImport() && !bCopied)
 RemoveLastParagraph();
 
 // In case the foot or endnote did not contain a tab.


Karan Abrol license statement

2021-08-11 Thread karan abrol
All of my past and future contributions to LibreOffice may be licensed
under the MPLv2/LGPLv3+ dual license.


[Libreoffice-commits] core.git: comphelper/source

2021-08-11 Thread Noel Grandin (via logerrit)
 comphelper/source/container/enumerablemap.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit d39d87bbffe8e731bad92f2fe90526c3610689f5
Author: Noel Grandin 
AuthorDate: Tue Aug 10 19:54:28 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 11 13:23:08 2021 +0200

no need to allocate KeyedValues separately

Change-Id: If28471436d224e88dfee07f3b8465648867197fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120291
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/comphelper/source/container/enumerablemap.cxx 
b/comphelper/source/container/enumerablemap.cxx
index ae6053d7520c..a8897c293da4 100644
--- a/comphelper/source/container/enumerablemap.cxx
+++ b/comphelper/source/container/enumerablemap.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 namespace comphelper
@@ -89,7 +90,7 @@ namespace comphelper
 {
 Typem_aKeyType;
 Typem_aValueType;
-std::unique_ptr< KeyedValues >m_pValues;
+std::optional< KeyedValues >m_pValues;
 std::shared_ptr< IKeyPredicateLess >  m_pKeyCompare;
 boolm_bMutable;
 std::vector< MapEnumerator* > m_aModListeners;
@@ -102,11 +103,11 @@ namespace comphelper
 MapData( const MapData& _source )
 :m_aKeyType( _source.m_aKeyType )
 ,m_aValueType( _source.m_aValueType )
-,m_pValues( new KeyedValues( *_source.m_pValues ) )
 ,m_pKeyCompare( _source.m_pKeyCompare )
 ,m_bMutable( false )
 ,m_aModListeners()
 {
+m_pValues.emplace( *_source.m_pValues );
 }
 private:
 MapData& operator=( const MapData& _source ) = delete;
@@ -356,7 +357,7 @@ namespace comphelper
 m_aData.m_aKeyType = aKeyType;
 m_aData.m_aValueType = aValueType;
 m_aData.m_pKeyCompare = std::move(pComparator);
-m_aData.m_pValues.reset( new KeyedValues( *m_aData.m_pKeyCompare ) );
+m_aData.m_pValues.emplace( *m_aData.m_pKeyCompare );
 m_aData.m_bMutable = bMutable;
 
 if ( aInitialValues.hasElements() )


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - desktop/qa sw/source tools/qa tools/source

2021-08-11 Thread Noel Grandin (via logerrit)
 desktop/qa/desktop_lib/test_desktop_lib.cxx |2 
 sw/source/core/crsr/crsrsh.cxx  |   69 +---
 tools/qa/cppunit/test_json_writer.cxx   |2 
 tools/source/misc/json_writer.cxx   |2 
 4 files changed, 36 insertions(+), 39 deletions(-)

New commits:
commit d46c7bd597e51453ac420db97fd898ed2f3b26bf
Author: Noel Grandin 
AuthorDate: Tue Aug 3 14:42:13 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 11 13:22:30 2021 +0200

use tools::Json for cursor messages

and tweak the JsonWriter to produce output more like the boost propertytree,
to make the cypress tests happier.

Change-Id: Ia2062508ae9f14a5f89306042c33884ff300f478
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119936
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Noel Grandin 

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index d41777c5e77b..9d454752239c 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -2027,7 +2027,7 @@ public:
 break;
 case LOK_CALLBACK_TABLE_SELECTED:
 {
-m_bEmptyTableSelection = (std::string(pPayload).compare("{\n}\n") 
== 0);
+m_bEmptyTableSelection = (std::string(pPayload).compare("{ }") == 
0);
 ++m_nTableSelectionCount;
 }
 break;
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index fd0e4aef29a8..dd0ca592aabe 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -73,7 +73,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 using namespace com::sun::star;
 using namespace util;
@@ -2044,69 +2044,66 @@ void SwCursorShell::sendLOKCursorUpdates()
 SwFrame* pCurrentFrame = GetCurrFrame();
 SelectionType eType = pShell->GetSelectionType();
 
-boost::property_tree::ptree aRootTree;
+tools::JsonWriter aJsonWriter;
 
 if (pCurrentFrame && (eType & SelectionType::Table) && 
pCurrentFrame->IsInTab())
 {
 const SwRect& rPageRect = pShell->GetAnyCurRect(CurRectType::Page, 
nullptr);
 
-boost::property_tree::ptree aTableColumns;
 {
+auto columnsNode = aJsonWriter.startNode("columns");
 SwTabCols aTabCols;
 pShell->GetTabCols(aTabCols);
 
 const int nColumnOffset = aTabCols.GetLeftMin() + rPageRect.Left();
 
-aTableColumns.put("left", aTabCols.GetLeft());
-aTableColumns.put("right", aTabCols.GetRight());
-aTableColumns.put("tableOffset", nColumnOffset);
+aJsonWriter.put("left", aTabCols.GetLeft());
+aJsonWriter.put("right", aTabCols.GetRight());
+aJsonWriter.put("tableOffset", nColumnOffset);
 
-boost::property_tree::ptree aEntries;
-for (size_t i = 0; i < aTabCols.Count(); ++i)
 {
-auto const & rEntry = aTabCols.GetEntry(i);
-boost::property_tree::ptree aTableColumnEntry;
-aTableColumnEntry.put("position", rEntry.nPos);
-aTableColumnEntry.put("min", rEntry.nMin);
-aTableColumnEntry.put("max", rEntry.nMax);
-aTableColumnEntry.put("hidden", rEntry.bHidden);
-aEntries.push_back(std::make_pair("", aTableColumnEntry));
+auto entriesNode = aJsonWriter.startArray("entries");
+for (size_t i = 0; i < aTabCols.Count(); ++i)
+{
+auto entryNode = aJsonWriter.startStruct();
+auto const & rEntry = aTabCols.GetEntry(i);
+aJsonWriter.put("position", rEntry.nPos);
+aJsonWriter.put("min", rEntry.nMin);
+aJsonWriter.put("max", rEntry.nMax);
+aJsonWriter.put("hidden", rEntry.bHidden);
+}
 }
-aTableColumns.push_back(std::make_pair("entries", aEntries));
 }
 
-boost::property_tree::ptree aTableRows;
 {
+auto rowsNode = aJsonWriter.startNode("rows");
 SwTabCols aTabRows;
 pShell->GetTabRows(aTabRows);
 
 const int nRowOffset = aTabRows.GetLeftMin() + rPageRect.Top();
 
-aTableRows.put("left", aTabRows.GetLeft());
-aTableRows.put("right", aTabRows.GetRight());
-aTableRows.put("tableOffset", nRowOffset);
+aJsonWriter.put("left", aTabRows.GetLeft());
+aJsonWriter.put("right", aTabRows.GetRight());
+aJsonWriter.put("tableOffset", nRowOffset);
 
-boost::property_tree::ptree aEntries;
-for (size_t i = 0; i < aTabRows.Count(); ++i)
 {
-auto const & rEntry = aTabRows.GetEntry(i);
-boost::property_tree::ptree aTableRowEntry;
-aTableRowEntry.put("position", rEntry

[Libreoffice-commits] core.git: Branch 'distro/vector/vector-7.0-10.0' - embeddedobj/source

2021-08-11 Thread Miklos Vajna (via logerrit)
 embeddedobj/source/commonembedding/miscobj.cxx   |   46 +++
 embeddedobj/source/commonembedding/specialobject.cxx |   18 +++
 embeddedobj/source/general/dummyobject.cxx   |   16 ++
 embeddedobj/source/inc/commonembobj.hxx  |   12 
 embeddedobj/source/inc/dummyobject.hxx   |8 ++-
 embeddedobj/source/inc/oleembobj.hxx |9 +++
 embeddedobj/source/inc/specialobject.hxx |5 ++
 embeddedobj/source/msole/olemisc.cxx |   16 ++
 8 files changed, 128 insertions(+), 2 deletions(-)

New commits:
commit d8b550deae18c3c13aa8abb0dc4878a00f832515
Author: Miklos Vajna 
AuthorDate: Tue Aug 10 16:37:15 2021 +0200
Commit: Miklos Vajna 
CommitDate: Wed Aug 11 13:18:59 2021 +0200

embeddedobj: implement XServiceInfo in the various embedded obj 
implementations

This gives UNO clients a reliable way to detect e.g.
OSpecialEmbeddedObject, where it's expected that double-clicking on the
object doesn't do anything.

(cherry picked from commit 15a524a1ed2bf464b0b727e628bb5af9685f49b9)

Conflicts:
embeddedobj/source/commonembedding/miscobj.cxx
embeddedobj/source/general/dummyobject.cxx
embeddedobj/source/inc/commonembobj.hxx
embeddedobj/source/inc/oleembobj.hxx

Change-Id: I595453490b157b64214cd7359da1e3a3c959191d

diff --git a/embeddedobj/source/commonembedding/miscobj.cxx 
b/embeddedobj/source/commonembedding/miscobj.cxx
index ea2a3cb3c110..8a1dd801f6ea 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -32,6 +32,7 @@
 #include 
 
 #include 
+#include 
 
 #include "persistence.hxx"
 
@@ -341,6 +342,16 @@ uno::Any SAL_CALL OCommonEmbeddedObject::queryInterface( 
const uno::Type& rType
 void* p = static_cast(this);
 return uno::Any(&p, rType);
 }
+else if (rType == cppu::UnoType::get())
+{
+void* p = static_cast(this);
+return uno::Any(&p, rType);
+}
+else if (rType == cppu::UnoType::get())
+{
+void* p = static_cast(this);
+return uno::Any(&p, rType);
+}
 else
 aReturn = ::cppu::queryInterface(
 rType,
@@ -583,4 +594,39 @@ void SAL_CALL OCommonEmbeddedObject::removeEventListener( 
const uno::Reference<
 xListener );
 }
 
+OUString SAL_CALL OCommonEmbeddedObject::getImplementationName()
+{
+return "com.sun.star.comp.embed.OCommonEmbeddedObject";
+}
+
+sal_Bool SAL_CALL OCommonEmbeddedObject::supportsService(const OUString& 
ServiceName)
+{
+return cppu::supportsService(this, ServiceName);
+}
+
+uno::Sequence SAL_CALL 
OCommonEmbeddedObject::getSupportedServiceNames()
+{
+return { "com.sun.star.comp.embed.OCommonEmbeddedObject" };
+}
+
+uno::Sequence SAL_CALL OCommonEmbeddedObject::getTypes()
+{
+static const uno::Sequence aTypes{
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+};
+return aTypes;
+}
+
+uno::Sequence SAL_CALL OCommonEmbeddedObject::getImplementationId()
+{
+return uno::Sequence();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/embeddedobj/source/commonembedding/specialobject.cxx 
b/embeddedobj/source/commonembedding/specialobject.cxx
index 683fe0aab3f2..809ffce1f2c4 100644
--- a/embeddedobj/source/commonembedding/specialobject.cxx
+++ b/embeddedobj/source/commonembedding/specialobject.cxx
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -51,6 +52,8 @@ uno::Any SAL_CALL OSpecialEmbeddedObject::queryInterface( 
const uno::Type& rType
 static_cast< embed::XClassifiedObject* 
>( this ),
 static_cast< 
embed::XComponentSupplier* >( this ),
 static_cast< util::XCloseable* >( this 
),
+static_cast< lang::XServiceInfo* >( 
this ),
+static_cast< lang::XTypeProvider* >( 
this ),
 static_cast< 
document::XEventBroadcaster* >( this ) );
 if ( aReturn.hasValue() )
 return aReturn;
@@ -160,4 +163,19 @@ void SAL_CALL OSpecialEmbeddedObject::doVerb( sal_Int32 
nVerbID )
 OCommonEmbeddedObject::doVerb( nVerbID );
 }
 
+OUString SAL_CALL OSpecialEmbeddedObject::getImplementationName()
+{
+return "com.sun.star.comp.embed.OSpecialEmbeddedObject";
+}
+
+sal_Bool SAL_CALL OSpecialEmbeddedObject::supportsService(const OUString& 
ServiceName)
+{
+return cppu::supportsService(this, ServiceName);
+}
+
+uno::Sequence SAL_CALL 
OSpecialEmbeddedObject::getSupportedServiceNames()
+

[Libreoffice-commits] core.git: Branch 'distro/vector/vector-7.0' - embeddedobj/source

2021-08-11 Thread Miklos Vajna (via logerrit)
 embeddedobj/source/commonembedding/miscobj.cxx   |   46 +++
 embeddedobj/source/commonembedding/specialobject.cxx |   18 +++
 embeddedobj/source/general/dummyobject.cxx   |   16 ++
 embeddedobj/source/inc/commonembobj.hxx  |   12 
 embeddedobj/source/inc/dummyobject.hxx   |8 ++-
 embeddedobj/source/inc/oleembobj.hxx |9 +++
 embeddedobj/source/inc/specialobject.hxx |5 ++
 embeddedobj/source/msole/olemisc.cxx |   16 ++
 8 files changed, 128 insertions(+), 2 deletions(-)

New commits:
commit 578843ba169a3e2610df5a1543b24366d2aad49c
Author: Miklos Vajna 
AuthorDate: Tue Aug 10 16:37:15 2021 +0200
Commit: Miklos Vajna 
CommitDate: Wed Aug 11 13:06:45 2021 +0200

embeddedobj: implement XServiceInfo in the various embedded obj 
implementations

This gives UNO clients a reliable way to detect e.g.
OSpecialEmbeddedObject, where it's expected that double-clicking on the
object doesn't do anything.

(cherry picked from commit 15a524a1ed2bf464b0b727e628bb5af9685f49b9)

Conflicts:
embeddedobj/source/commonembedding/miscobj.cxx
embeddedobj/source/general/dummyobject.cxx
embeddedobj/source/inc/commonembobj.hxx
embeddedobj/source/inc/oleembobj.hxx

Change-Id: I595453490b157b64214cd7359da1e3a3c959191d

diff --git a/embeddedobj/source/commonembedding/miscobj.cxx 
b/embeddedobj/source/commonembedding/miscobj.cxx
index ea2a3cb3c110..8a1dd801f6ea 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -32,6 +32,7 @@
 #include 
 
 #include 
+#include 
 
 #include "persistence.hxx"
 
@@ -341,6 +342,16 @@ uno::Any SAL_CALL OCommonEmbeddedObject::queryInterface( 
const uno::Type& rType
 void* p = static_cast(this);
 return uno::Any(&p, rType);
 }
+else if (rType == cppu::UnoType::get())
+{
+void* p = static_cast(this);
+return uno::Any(&p, rType);
+}
+else if (rType == cppu::UnoType::get())
+{
+void* p = static_cast(this);
+return uno::Any(&p, rType);
+}
 else
 aReturn = ::cppu::queryInterface(
 rType,
@@ -583,4 +594,39 @@ void SAL_CALL OCommonEmbeddedObject::removeEventListener( 
const uno::Reference<
 xListener );
 }
 
+OUString SAL_CALL OCommonEmbeddedObject::getImplementationName()
+{
+return "com.sun.star.comp.embed.OCommonEmbeddedObject";
+}
+
+sal_Bool SAL_CALL OCommonEmbeddedObject::supportsService(const OUString& 
ServiceName)
+{
+return cppu::supportsService(this, ServiceName);
+}
+
+uno::Sequence SAL_CALL 
OCommonEmbeddedObject::getSupportedServiceNames()
+{
+return { "com.sun.star.comp.embed.OCommonEmbeddedObject" };
+}
+
+uno::Sequence SAL_CALL OCommonEmbeddedObject::getTypes()
+{
+static const uno::Sequence aTypes{
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+cppu::UnoType::get(),
+};
+return aTypes;
+}
+
+uno::Sequence SAL_CALL OCommonEmbeddedObject::getImplementationId()
+{
+return uno::Sequence();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/embeddedobj/source/commonembedding/specialobject.cxx 
b/embeddedobj/source/commonembedding/specialobject.cxx
index 683fe0aab3f2..809ffce1f2c4 100644
--- a/embeddedobj/source/commonembedding/specialobject.cxx
+++ b/embeddedobj/source/commonembedding/specialobject.cxx
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -51,6 +52,8 @@ uno::Any SAL_CALL OSpecialEmbeddedObject::queryInterface( 
const uno::Type& rType
 static_cast< embed::XClassifiedObject* 
>( this ),
 static_cast< 
embed::XComponentSupplier* >( this ),
 static_cast< util::XCloseable* >( this 
),
+static_cast< lang::XServiceInfo* >( 
this ),
+static_cast< lang::XTypeProvider* >( 
this ),
 static_cast< 
document::XEventBroadcaster* >( this ) );
 if ( aReturn.hasValue() )
 return aReturn;
@@ -160,4 +163,19 @@ void SAL_CALL OSpecialEmbeddedObject::doVerb( sal_Int32 
nVerbID )
 OCommonEmbeddedObject::doVerb( nVerbID );
 }
 
+OUString SAL_CALL OSpecialEmbeddedObject::getImplementationName()
+{
+return "com.sun.star.comp.embed.OSpecialEmbeddedObject";
+}
+
+sal_Bool SAL_CALL OSpecialEmbeddedObject::supportsService(const OUString& 
ServiceName)
+{
+return cppu::supportsService(this, ServiceName);
+}
+
+uno::Sequence SAL_CALL 
OSpecialEmbeddedObject::getSupportedServiceNames()
+

[Libreoffice-commits] core.git: vcl/unx

2021-08-11 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkframe.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 56ba9c544d2e5dce9022a245a6835d79bbf0f31d
Author: Caolán McNamara 
AuthorDate: Wed Aug 11 09:52:36 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 11 12:16:35 2021 +0200

gtk4: use monitor size for workarea

which is better than nothing now that gdk_monitor_get_workarea is gone

Change-Id: I8e691f733ec05d981a621f17efa5c968fd078193
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120311
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index 3b23b5c2a07e..cd596b3a4297 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -1835,20 +1835,24 @@ void GtkSalFrame::GetClientSize( tools::Long& rWidth, 
tools::Long& rHeight )
 
 void GtkSalFrame::GetWorkArea( tools::Rectangle& rRect )
 {
+GdkRectangle aRect;
 #if !GTK_CHECK_VERSION(4, 0, 0)
 GdkScreen  *pScreen = gtk_widget_get_screen(m_pWindow);
 tools::Rectangle aRetRect;
 int max = gdk_screen_get_n_monitors (pScreen);
 for (int i = 0; i < max; ++i)
 {
-GdkRectangle aRect;
 gdk_screen_get_monitor_workarea(pScreen, i, &aRect);
 tools::Rectangle aMonitorRect(aRect.x, aRect.y, aRect.x+aRect.width, 
aRect.y+aRect.height);
 aRetRect.Union(aMonitorRect);
 }
 rRect = aRetRect;
 #else
-(void)rRect;
+GdkDisplay* pDisplay = gtk_widget_get_display(m_pWindow);
+GdkSurface* gdkWindow = widget_get_surface(m_pWindow);
+GdkMonitor* pMonitor = gdk_display_get_monitor_at_surface(pDisplay, 
gdkWindow);
+gdk_monitor_get_geometry(pMonitor, &aRect);
+rRect = tools::Rectangle(aRect.x, aRect.y, aRect.x+aRect.width, 
aRect.y+aRect.height);
 #endif
 }
 


[Libreoffice-commits] core.git: i18npool/inc i18npool/source

2021-08-11 Thread Noel Grandin (via logerrit)
 i18npool/inc/characterclassificationImpl.hxx|5 
+--
 i18npool/inc/collatorImpl.hxx   |5 
+--
 i18npool/inc/inputsequencechecker.hxx   |5 
+--
 i18npool/source/characterclassification/characterclassificationImpl.cxx |   16 
+-
 i18npool/source/collator/collatorImpl.cxx   |   15 
-
 i18npool/source/inputchecker/inputsequencechecker.cxx   |8 
+
 6 files changed, 27 insertions(+), 27 deletions(-)

New commits:
commit 5ef182586ae2019fa6f6a59dae1b41b2225665bf
Author: Noel Grandin 
AuthorDate: Tue Aug 10 20:53:07 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 11 10:54:22 2021 +0200

no need to allocate the lookupTableItem separately

Change-Id: I43919a002df01c6329ee483bf69f04669cdce1f6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120293
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/i18npool/inc/characterclassificationImpl.hxx 
b/i18npool/inc/characterclassificationImpl.hxx
index 34723ef74123..4e03a54fd3be 100644
--- a/i18npool/inc/characterclassificationImpl.hxx
+++ b/i18npool/inc/characterclassificationImpl.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 namespace com::sun::star::uno { class XComponentContext; }
@@ -81,8 +82,8 @@ private:
 aLocale.Variant == rLocale.Variant;
 };
 };
-std::vector> lookupTable;
-lookupTableItem *cachedItem;
+std::vector lookupTable;
+std::optional cachedItem;
 
 css::uno::Reference < css::uno::XComponentContext > m_xContext;
 css::uno::Reference < XCharacterClassification > xUCI;
diff --git a/i18npool/inc/collatorImpl.hxx b/i18npool/inc/collatorImpl.hxx
index 14a4489a256a..c1068638d8bc 100644
--- a/i18npool/inc/collatorImpl.hxx
+++ b/i18npool/inc/collatorImpl.hxx
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::i18n { class XLocaleData5; }
 namespace com::sun::star::uno { class XComponentContext; }
@@ -89,8 +90,8 @@ private:
 algorithm == _algorithm;
 }
 };
-std::vector>   lookupTable;
-lookupTableItem *   cachedItem;
+std::vector   lookupTable;
+std::optional cachedItem;
 
 // Service Factory
 css::uno::Reference < css::uno::XComponentContext > m_xContext;
diff --git a/i18npool/inc/inputsequencechecker.hxx 
b/i18npool/inc/inputsequencechecker.hxx
index 52963b3be171..eff426f5caa3 100644
--- a/i18npool/inc/inputsequencechecker.hxx
+++ b/i18npool/inc/inputsequencechecker.hxx
@@ -25,6 +25,7 @@
 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::uno { class XComponentContext; }
 
@@ -63,8 +64,8 @@ private:
 const char* aLanguage;
 css::uno::Reference < css::i18n::XExtendedInputSequenceChecker > xISC;
 };
-std::vector> lookupTable;
-lookupTableItem *cachedItem;
+std::vector lookupTable;
+std::optional cachedItem;
 
 css::uno::Reference < css::uno::XComponentContext > m_xContext;
 
diff --git 
a/i18npool/source/characterclassification/characterclassificationImpl.cxx 
b/i18npool/source/characterclassification/characterclassificationImpl.cxx
index 721c82bf9304..8146612a87fc 100644
--- a/i18npool/source/characterclassification/characterclassificationImpl.cxx
+++ b/i18npool/source/characterclassification/characterclassificationImpl.cxx
@@ -125,10 +125,10 @@ bool 
CharacterClassificationImpl::createLocaleSpecificCharacterClassification(co
 {
 // to share service between same Language but different Country code, like 
zh_CN and zh_SG
 for (size_t l = 0; l < lookupTable.size(); l++) {
-cachedItem = lookupTable[l].get();
+cachedItem = lookupTable[l];
 if (serviceName == cachedItem->aName) {
-lookupTable.emplace_back( new lookupTableItem(rLocale, 
serviceName, cachedItem->xCI) );
-cachedItem = lookupTable.back().get();
+lookupTable.emplace_back( rLocale, serviceName, cachedItem->xCI );
+cachedItem = lookupTable.back();
 return true;
 }
 }
@@ -140,8 +140,8 @@ bool 
CharacterClassificationImpl::createLocaleSpecificCharacterClassification(co
 if ( xI.is() ) {
 xCI.set( xI, UNO_QUERY );
 if (xCI.is()) {
-lookupTable.emplace_back( new lookupTableItem(rLocale, 
serviceName, xCI) );
-cachedItem = lookupTable.back().get();
+lookupTable.emplace_back( rLocale, serviceName, xCI );
+cachedItem = lookupTable.back();
 return true;
 }
 }
@@ -156,7 +156,7 @@ 
CharacterClassificationImpl::getLocaleSpecificCharacterClassification(const Loca
 return cachedItem->xCI;
 else {
 for (const auto & i : lookupTable) {
-cachedItem = i.get();
+cachedItem = i;
 if (cachedItem->equals(rLoc

[Libreoffice-commits] core.git: configmgr/source

2021-08-11 Thread Noel Grandin (via logerrit)
 configmgr/source/childaccess.cxx |6 +++---
 configmgr/source/childaccess.hxx |3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit da40449dc5f1841ac3e6f6aa1194834a363455b6
Author: Noel Grandin 
AuthorDate: Tue Aug 10 20:01:50 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 11 09:59:17 2021 +0200

no need to allocate changedValue_ separately

Change-Id: Ibda7c7a055790f6eb87ac6bd62554e745181cea7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120292
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx
index 41636b0e1bbe..ecaae9f522e5 100644
--- a/configmgr/source/childaccess.cxx
+++ b/configmgr/source/childaccess.cxx
@@ -236,14 +236,14 @@ void ChildAccess::setProperty(
 }
 checkValue(value, type, isNillable);
 getParentAccess()->markChildAsModified(this);
-changedValue_.reset(new css::uno::Any(value));
+changedValue_.emplace(value);
 localModifications->add(getRelativePath());
 }
 
 
 css::uno::Any ChildAccess::asValue()
 {
-if (changedValue_ != nullptr)
+if (changedValue_)
 {
 return *changedValue_;
 }
@@ -287,7 +287,7 @@ void ChildAccess::commitChanges(bool valid, Modifications * 
globalModifications)
 {
 assert(globalModifications != nullptr);
 commitChildChanges(valid, globalModifications);
-if (valid && changedValue_ != nullptr)
+if (valid && changedValue_)
 {
 std::vector path(getAbsolutePath());
 getComponents().addModification(path);
diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx
index 2aecdf6757ea..2c0eabfcaa4e 100644
--- a/configmgr/source/childaccess.hxx
+++ b/configmgr/source/childaccess.hxx
@@ -22,6 +22,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -125,7 +126,7 @@ private:
 rtl::Reference< Access > parent_; // null if free node
 OUString name_;
 rtl::Reference< Node > node_;
-std::unique_ptr< css::uno::Any > changedValue_;
+std::optional< css::uno::Any > changedValue_;
 bool inTransaction_;
 // to determine if a free node can be inserted underneath some root
 std::shared_ptr lock_;


[Libreoffice-commits] core.git: svx/source

2021-08-11 Thread Caolán McNamara (via logerrit)
 svx/source/tbxctrls/fillctrl.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 0c4cdfa9c9ba9548a61c7314858eae01f90f2782
Author: Caolán McNamara 
AuthorDate: Tue Aug 10 21:58:27 2021 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 11 09:58:56 2021 +0200

tdf#143769 don't crash on null XFillColorItem

use same solution as:

commit 5ee0e6ab93ad791f5e79506efafd16cb7364ffb1
Author: Markus Mohrhard 
Date:   Tue Jul 21 19:01:26 2015 +0200

avoid crash with color listbox for now

Change-Id: I36ac6513546961ec8d8d1e9437a8ef88574acbf4

Change-Id: I46c55461e5867431a6e9c838b5ef462f9581eb28
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120297
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index 282f294f095a..3711d7fc4053 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -740,10 +740,11 @@ IMPL_LINK_NOARG(SvxFillToolBoxControl, SelectFillTypeHdl, 
weld::ComboBox&, void)
 {
 mpLbFillAttr->hide();
 mpToolBoxColor->show();
-const ::Color aColor = mpColorItem->GetColorValue();
-const XFillColorItem aXFillColorItem( "", aColor );
 if (pSh)
 {
+const ::Color aColor = mpColorItem ? 
mpColorItem->GetColorValue() : COL_AUTO;
+const XFillColorItem aXFillColorItem( "", aColor );
+
 // #i122676# change FillStyle and Color in one call
 pSh->GetDispatcher()->ExecuteList(
 SID_ATTR_FILL_COLOR, SfxCallMode::RECORD,


[Libreoffice-commits] core.git: include/vcl vcl/backendtest vcl/inc vcl/qa

2021-08-11 Thread homeboy445 (via logerrit)
 include/vcl/test/GraphicsRenderTests.hxx  |6 
 vcl/backendtest/GraphicsRenderTests.cxx   |  631 +++---
 vcl/backendtest/outputdevice/common.cxx   |   64 ++
 vcl/backendtest/outputdevice/polygon.cxx  |   12 
 vcl/backendtest/outputdevice/polyline.cxx |   12 
 vcl/backendtest/outputdevice/polyline_b2d.cxx |   13 
 vcl/inc/test/outputdevice.hxx |5 
 vcl/qa/cppunit/BackendTest.cxx|   67 ++
 8 files changed, 559 insertions(+), 251 deletions(-)

New commits:
commit fc8c97f55c509a75ee18de3d9d5e793e37bb0c36
Author: homeboy445 
AuthorDate: Tue Jul 6 14:13:51 2021 +0530
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 11 09:25:47 2021 +0200

backendtest:Irregular HalfEllipse test via various drawing methods

Change-Id: If1a6f224f6ff4118617128630077a81da4c469a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118656
Reviewed-by: Tomaž Vajngerl 
Tested-by: Jenkins

diff --git a/include/vcl/test/GraphicsRenderTests.hxx 
b/include/vcl/test/GraphicsRenderTests.hxx
index b8307b97ab25..eacf07c6f312 100644
--- a/include/vcl/test/GraphicsRenderTests.hxx
+++ b/include/vcl/test/GraphicsRenderTests.hxx
@@ -108,6 +108,12 @@ class VCL_PLUGIN_PUBLIC GraphicsRenderTests
 void testLineCapRound();
 void testLineCapSquare();
 void testLineCapButt();
+void testHalfEllipseWithPolyLine();
+void testHalfEllipseAAWithPolyLine();
+void testHalfEllipseWithPolyLineB2D();
+void testHalfEllipseAAWithPolyLineB2D();
+void testHalfEllipseWithPolygon();
+void testHalfEllipseAAWithPolygon();
 static OUString returnTestStatus(vcl::test::TestResult const result);
 void runALLTests();
 void appendTestResult(OUString aTestName, OUString aTestStatus, Bitmap 
aTestBitmap = Bitmap());
diff --git a/vcl/backendtest/GraphicsRenderTests.cxx 
b/vcl/backendtest/GraphicsRenderTests.cxx
index eae05149840b..707938cb1902 100644
--- a/vcl/backendtest/GraphicsRenderTests.cxx
+++ b/vcl/backendtest/GraphicsRenderTests.cxx
@@ -53,19 +53,19 @@ void GraphicsRenderTests::testDrawRectWithRectangle()
 vcl::test::OutputDeviceTestRect aOutDevTest;
 Bitmap aBitmap = aOutDevTest.setupRectangle(false);
 m_aCurGraphicsBackend = aOutDevTest.getRenderBackendName();
-OUString atestName = "testDrawRectWithRectangle";
+OUString aTestName = "testDrawRectWithRectangle";
 if (!SHOULD_ASSERT)
 {
-appendTestResult(atestName, "SKIPPED");
+appendTestResult(aTestName, "SKIPPED");
 return;
 }
 vcl::test::TestResult eResult = 
vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap);
-appendTestResult(atestName, returnTestStatus(eResult),
+appendTestResult(aTestName, returnTestStatus(eResult),
  (m_aStoreResultantBitmap ? aBitmap : Bitmap()));
 if (m_aStoreResultantBitmap)
 {
 BitmapEx aBitmapEx(aBitmap);
-exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", 
aBitmapEx);
+exportBitmapExToImage(m_aUserInstallPath + aTestName + ".png", 
aBitmapEx);
 }
 }
 
@@ -73,19 +73,19 @@ void GraphicsRenderTests::testDrawRectWithPixel()
 {
 vcl::test::OutputDeviceTestPixel aOutDevTest;
 Bitmap aBitmap = aOutDevTest.setupRectangle(false);
-OUString atestName = "testDrawRectWithPixel";
+OUString aTestName = "testDrawRectWithPixel";
 if (!SHOULD_ASSERT)
 {
-appendTestResult(atestName, "SKIPPED");
+appendTestResult(aTestName, "SKIPPED");
 return;
 }
 vcl::test::TestResult eResult = 
vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap);
-appendTestResult(atestName, returnTestStatus(eResult),
+appendTestResult(aTestName, returnTestStatus(eResult),
  (m_aStoreResultantBitmap ? aBitmap : Bitmap()));
 if (m_aStoreResultantBitmap)
 {
 BitmapEx aBitmapEx(aBitmap);
-exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", 
aBitmapEx);
+exportBitmapExToImage(m_aUserInstallPath + aTestName + ".png", 
aBitmapEx);
 }
 }
 
@@ -93,19 +93,19 @@ void GraphicsRenderTests::testDrawRectWithLine()
 {
 vcl::test::OutputDeviceTestLine aOutDevTest;
 Bitmap aBitmap = aOutDevTest.setupRectangle(false);
-OUString atestName = "testDrawRectWithLine";
+OUString aTestName = "testDrawRectWithLine";
 if (!SHOULD_ASSERT)
 {
-appendTestResult(atestName, "SKIPPED");
+appendTestResult(aTestName, "SKIPPED");
 return;
 }
 vcl::test::TestResult eResult = 
vcl::test::OutputDeviceTestCommon::checkRectangle(aBitmap);
-appendTestResult(atestName, returnTestStatus(eResult),
+appendTestResult(aTestName, returnTestStatus(eResult),
  (m_aStoreResultantBitmap ? aBitmap : Bitmap()));
 if (m_aStoreResultantBitmap)
 {
 BitmapEx aBitmapEx(aBitmap);
-exportBitmapExToImage(m_aUserInstallPath + atestName + ".png", 
aBitmapEx);
+export

[Libreoffice-commits] core.git: sw/qa

2021-08-11 Thread Xisco Fauli (via logerrit)
 sw/qa/extras/uiwriter/uiwriter3.cxx |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 67329f8b75101a78a00bf646bb2c3b9f4575aa5a
Author: Xisco Fauli 
AuthorDate: Tue Aug 10 19:47:42 2021 +0200
Commit: Xisco Fauli 
CommitDate: Wed Aug 11 09:25:28 2021 +0200

tdf#135247: sw_uiwriter3: Add unittest

Change-Id: I4f78b42600c0b7316aee9e6c106a25cc8cff983a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120285
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index e835acf648cf..c88abacb9536 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -247,11 +247,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132911)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount());
 CPPUNIT_ASSERT_EQUAL(0, getShapes());
 
-//FIXME: tdf#135247
-//dispatchCommand(mxComponent, ".uno:Undo", {});
-//Scheduler::ProcessEventsToIdle();
-//CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
-//CPPUNIT_ASSERT_EQUAL(4, getShapes());
+//tdf#135247: Without the fix in place, this would have crashed
+dispatchCommand(mxComponent, ".uno:Undo", {});
+Scheduler::ProcessEventsToIdle();
+CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+//FIXME: tdf#143815: Number of images should be 4 and not 8
+CPPUNIT_ASSERT_EQUAL(8, getShapes());
 }
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf61154)


[Libreoffice-commits] core.git: include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|1 +
 vcl/source/filter/svm/SvmWriter.cxx |   20 
 2 files changed, 21 insertions(+)

New commits:
commit b50ea6333e31757ab7fb365299351d6aabe4c101
Author: panoskorovesis 
AuthorDate: Thu Aug 5 10:02:19 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 11 09:23:40 2021 +0200

Add Handler for Hatch Write

The handler separates MetaHatchAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: I29587d4a9e9129c5425792e2f8873ee7414bdaa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120264
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index c52b7387d79a..5bd4ea67dde3 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -67,6 +67,7 @@ public:
 void MaskScalePartHandler(MetaMaskScalePartAction* pAction);
 void GradientHandler(MetaGradientAction* pAction);
 void GradientExHandler(MetaGradientExAction* pAction);
+void HatchHandler(MetaHatchAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index 8e9972e08a0d..93f0c2b2baa6 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -277,6 +277,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::HATCH:
+{
+auto* pMetaAction = static_cast(pAction);
+HatchHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -771,6 +778,19 @@ void SvmWriter::GradientExHandler(MetaGradientExAction* 
pAction)
 aSerializer.writeGradient(pAction->GetGradient());
 }
 
+void SvmWriter::HatchHandler(MetaHatchAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+
+// #i105373# see comment at MetaTransparentAction::Write
+tools::PolyPolygon aNoCurvePolyPolygon;
+pAction->GetPolyPolygon().AdaptiveSubdivide(aNoCurvePolyPolygon);
+
+WritePolyPolygon(mrStream, aNoCurvePolyPolygon);
+WriteHatch(mrStream, pAction->GetHatch());
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|1 +
 vcl/source/filter/svm/SvmWriter.cxx |   21 +
 2 files changed, 22 insertions(+)

New commits:
commit 79522b8e63c6435331f3cbf623c25f0849d7fd43
Author: panoskorovesis 
AuthorDate: Thu Aug 5 09:54:02 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 11 09:23:08 2021 +0200

Add Handler for GradientEx Write

The handler separates MetaGradientExAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: I984e21b7d4b19b16432cabe9709d41f07187f268
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120263
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index c1dccf57525b..c52b7387d79a 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -66,6 +66,7 @@ public:
 void MaskScaleHandler(MetaMaskScaleAction* pAction);
 void MaskScalePartHandler(MetaMaskScalePartAction* pAction);
 void GradientHandler(MetaGradientAction* pAction);
+void GradientExHandler(MetaGradientExAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index 3296221d6f11..8e9972e08a0d 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -270,6 +270,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::GRADIENTEX:
+{
+auto* pMetaAction = static_cast(pAction);
+GradientExHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -750,6 +757,20 @@ void SvmWriter::GradientHandler(MetaGradientAction* 
pAction)
 aSerializer.writeGradient(pAction->GetGradient());
 }
 
+void SvmWriter::GradientExHandler(MetaGradientExAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+
+// #i105373# see comment at MetaTransparentAction::Write
+tools::PolyPolygon aNoCurvePolyPolygon;
+pAction->GetPolyPolygon().AdaptiveSubdivide(aNoCurvePolyPolygon);
+
+WritePolyPolygon(mrStream, aNoCurvePolyPolygon);
+TypeSerializer aSerializer(mrStream);
+aSerializer.writeGradient(pAction->GetGradient());
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|1 +
 vcl/source/filter/svm/SvmWriter.cxx |   16 
 2 files changed, 17 insertions(+)

New commits:
commit 33243f20831f6efac14047f38d3e7d987aa632e0
Author: panoskorovesis 
AuthorDate: Thu Aug 5 09:50:02 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 11 09:20:23 2021 +0200

Add Handler for Gradient Write

The handler separates MetaGradientAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: I31ae5f5331f780e095caaf200ea289332233fb52
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120259
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 3763ef8ab8c2..c1dccf57525b 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -65,6 +65,7 @@ public:
 void MaskHandler(MetaMaskAction* pAction);
 void MaskScaleHandler(MetaMaskScaleAction* pAction);
 void MaskScalePartHandler(MetaMaskScalePartAction* pAction);
+void GradientHandler(MetaGradientAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index 879909267071..3296221d6f11 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -263,6 +263,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::GRADIENT:
+{
+auto* pMetaAction = static_cast(pAction);
+GradientHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -734,6 +741,15 @@ void 
SvmWriter::MaskScalePartHandler(MetaMaskScalePartAction* pAction)
 }
 }
 
+void SvmWriter::GradientHandler(MetaGradientAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+TypeSerializer aSerializer(mrStream);
+aSerializer.writeRectangle(pAction->GetRect());
+aSerializer.writeGradient(pAction->GetGradient());
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|1 +
 vcl/source/filter/svm/SvmWriter.cxx |   23 +++
 2 files changed, 24 insertions(+)

New commits:
commit 1f875634f8edaf40dcf083024f03e6a623e48599
Author: panoskorovesis 
AuthorDate: Thu Aug 5 09:47:54 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 11 09:20:00 2021 +0200

Add Handler for MaskScalePart Write

The handler separates MetaMaskScalePartAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: I3c881495c013e6827c91027319a9cedcea7f96c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120258
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 4ec64cf9142f..3763ef8ab8c2 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -64,6 +64,7 @@ public:
 void BmpExScalePartHandler(MetaBmpExScalePartAction* pAction);
 void MaskHandler(MetaMaskAction* pAction);
 void MaskScaleHandler(MetaMaskScaleAction* pAction);
+void MaskScalePartHandler(MetaMaskScalePartAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index 4f045d710d32..879909267071 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -256,6 +256,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::MASKSCALEPART:
+{
+auto* pMetaAction = static_cast(pAction);
+MaskScalePartHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -711,6 +718,22 @@ void SvmWriter::MaskScaleHandler(MetaMaskScaleAction* 
pAction)
 }
 }
 
+void SvmWriter::MaskScalePartHandler(MetaMaskScalePartAction* pAction)
+{
+if (!pAction->GetBitmap().IsEmpty())
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+WriteDIB(pAction->GetBitmap(), mrStream, false, true);
+WriteColor(pAction->GetColor());
+TypeSerializer aSerializer(mrStream);
+aSerializer.writePoint(pAction->GetDestPoint());
+aSerializer.writeSize(pAction->GetDestSize());
+aSerializer.writePoint(pAction->GetSrcPoint());
+aSerializer.writeSize(pAction->GetSrcSize());
+}
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|1 +
 vcl/source/filter/svm/SvmWriter.cxx |   20 
 2 files changed, 21 insertions(+)

New commits:
commit dc23042b6adb62eb5b0963be04aa121d0cd66ff5
Author: panoskorovesis 
AuthorDate: Thu Aug 5 09:41:47 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 11 09:19:38 2021 +0200

Add Handler for MaskScale Write

The handler separates MetaMaskScaleAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: I1fee84e7c79da96755d20611a36b58f92349585f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120257
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index b1dae51ef845..4ec64cf9142f 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -63,6 +63,7 @@ public:
 void BmpExScaleHandler(MetaBmpExScaleAction* pAction);
 void BmpExScalePartHandler(MetaBmpExScalePartAction* pAction);
 void MaskHandler(MetaMaskAction* pAction);
+void MaskScaleHandler(MetaMaskScaleAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index dbe813b9c663..4f045d710d32 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -249,6 +249,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::MASKSCALE:
+{
+auto* pMetaAction = static_cast(pAction);
+MaskScaleHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -691,6 +698,19 @@ void SvmWriter::MaskHandler(MetaMaskAction* pAction)
 }
 }
 
+void SvmWriter::MaskScaleHandler(MetaMaskScaleAction* pAction)
+{
+if (!pAction->GetBitmap().IsEmpty())
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+WriteDIB(pAction->GetBitmap(), mrStream, false, true);
+TypeSerializer aSerializer(mrStream);
+aSerializer.writePoint(pAction->GetPoint());
+aSerializer.writeSize(pAction->GetSize());
+}
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: include/vcl vcl/source

2021-08-11 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|1 +
 vcl/source/filter/svm/SvmWriter.cxx |   19 +++
 2 files changed, 20 insertions(+)

New commits:
commit 86433ad00e5ac0133e0657f335b08931784b7f34
Author: panoskorovesis 
AuthorDate: Thu Aug 5 09:36:46 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 11 09:19:17 2021 +0200

Add Handler for Mask Write

The handler separates MetaMaskAction::Write from metaact.hxx
Write implementation is now in SvmWriter.hxx

Change-Id: I8c204d767e8474fbf67fc5b8f610f4b8e5244903
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120256
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index c57002e0a5d7..b1dae51ef845 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -62,6 +62,7 @@ public:
 void BmpExHandler(MetaBmpExAction* pAction);
 void BmpExScaleHandler(MetaBmpExScaleAction* pAction);
 void BmpExScalePartHandler(MetaBmpExScalePartAction* pAction);
+void MaskHandler(MetaMaskAction* pAction);
 void OverlineColorHandler(MetaOverlineColorAction* pAction);
 void TextAlignHandler(MetaTextAlignAction* pAction);
 void MapModeHandler(MetaMapModeAction* pAction);
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index bd4557c0c653..dbe813b9c663 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -242,6 +242,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::MASK:
+{
+auto* pMetaAction = static_cast(pAction);
+MaskHandler(pMetaAction);
+}
+break;
+
 case MetaActionType::OVERLINECOLOR:
 {
 auto* pMetaAction = static_cast(pAction);
@@ -672,6 +679,18 @@ void 
SvmWriter::BmpExScalePartHandler(MetaBmpExScalePartAction* pAction)
 }
 }
 
+void SvmWriter::MaskHandler(MetaMaskAction* pAction)
+{
+if (!pAction->GetBitmap().IsEmpty())
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+WriteDIB(pAction->GetBitmap(), mrStream, false, true);
+TypeSerializer aSerializer(mrStream);
+aSerializer.writePoint(pAction->GetPoint());
+}
+}
+
 void SvmWriter::OverlineColorHandler(MetaOverlineColorAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));


[Libreoffice-commits] core.git: 2 commits - include/svx sw/inc sw/source

2021-08-11 Thread Tomaž Vajngerl (via logerrit)
 include/svx/svdglue.hxx  |  174 +--
 sw/inc/swtypes.hxx   |3 
 sw/source/uibase/dochdl/swdtflvr.cxx |   21 ++--
 3 files changed, 141 insertions(+), 57 deletions(-)

New commits:
commit 4cb9b2b3e9bd61ab630aa16d9e382a3b90deb77d
Author: Tomaž Vajngerl 
AuthorDate: Wed Aug 11 12:32:27 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Wed Aug 11 09:18:25 2021 +0200

svx: cleanup formatting of svdglue.hxx

Change-Id: I4aa4d25a5097813feeb7d6ebb654b9b0ce0c1c14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120302
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/svx/svdglue.hxx b/include/svx/svdglue.hxx
index bddaf349c4a8..1bca84ca319f 100644
--- a/include/svx/svdglue.hxx
+++ b/include/svx/svdglue.hxx
@@ -78,70 +78,150 @@ class SVXCORE_DLLPUBLIC SdrGluePoint {
 bool bReallyAbsolute:1; // temp for transformations on the reference object
 bool bUserDefined:1; // #i38892#
 public:
-SdrGluePoint(): 
nEscDir(SdrEscapeDirection::SMART),nId(0),nAlign(SdrAlign::NONE),bNoPercent(false),bReallyAbsolute(false),bUserDefined(true)
 {}
-SdrGluePoint(const Point& rNewPos): 
aPos(rNewPos),nEscDir(SdrEscapeDirection::SMART),nId(0),nAlign(SdrAlign::NONE),bNoPercent(false),bReallyAbsolute(false),bUserDefined(true)
 {}
-const Point& GetPos() const { return aPos; }
-void SetPos(const Point& rNewPos)   { aPos=rNewPos; }
-SdrEscapeDirection GetEscDir() const  { return 
nEscDir; }
-void SetEscDir(SdrEscapeDirection nNewEsc)  { 
nEscDir=nNewEsc; }
-sal_uInt16   GetId() const  { return nId; }
-void SetId(sal_uInt16 nNewId)   { nId=nNewId; }
-bool IsPercent() const  { return 
!bNoPercent; }
-void SetPercent(bool bOn)   { bNoPercent  = !bOn; }
+SdrGluePoint()
+: nEscDir(SdrEscapeDirection::SMART)
+, nId(0)
+, nAlign(SdrAlign::NONE)
+, bNoPercent(false)
+, bReallyAbsolute(false)
+, bUserDefined(true)
+{}
+SdrGluePoint(const Point& rNewPos)
+: aPos(rNewPos)
+, nEscDir(SdrEscapeDirection::SMART)
+, nId(0)
+, nAlign(SdrAlign::NONE)
+, bNoPercent(false)
+, bReallyAbsolute(false)
+, bUserDefined(true)
+{}
+const Point& GetPos() const
+{
+return aPos;
+}
+void SetPos(const Point& rNewPos)
+{
+aPos = rNewPos;
+}
+SdrEscapeDirection GetEscDir() const
+{
+return nEscDir;
+}
+void SetEscDir(SdrEscapeDirection nNewEsc)
+{
+nEscDir = nNewEsc;
+}
+sal_uInt16   GetId() const
+{
+return nId;
+}
+void SetId(sal_uInt16 nNewId)
+{
+nId = nNewId;
+}
+bool IsPercent() const
+{
+return !bNoPercent;
+}
+void SetPercent(bool bOn)
+{
+bNoPercent  = !bOn;
+}
 // temp for transformations on the reference object
-void SetReallyAbsolute(bool bOn, const SdrObject& rObj);
+void SetReallyAbsolute(bool bOn, const SdrObject& rObj);
 
 // #i38892#
-bool IsUserDefined() const  { return 
bUserDefined; }
-void SetUserDefined(bool bNew)  { bUserDefined = bNew; 
}
-
-SdrAlign GetAlign() const   { return nAlign; }
-void SetAlign(SdrAlign nAlg){ nAlign=nAlg; }
-SdrAlign GetHorzAlign() const   { return nAlign & 
static_cast(0x00FF); }
-void SetHorzAlign(SdrAlign nAlg){ assert((nAlg & 
static_cast(0xFF00)) == SdrAlign::NONE); nAlign = SdrAlign(nAlign & 
static_cast(0xFF00)) | (nAlg & static_cast(0x00FF)); }
-SdrAlign GetVertAlign() const   { return nAlign & 
static_cast(0xFF00); }
-void SetVertAlign(SdrAlign nAlg){ assert((nAlg & 
static_cast(0x00FF)) == SdrAlign::NONE); nAlign = SdrAlign(nAlign & 
static_cast(0x00FF)) | (nAlg & static_cast(0xFF00)); }
-bool IsHit(const Point& rPnt, const OutputDevice& rOut, const 
SdrObject* pObj) const;
-void Invalidate(vcl::Window& rWin, const SdrObject* pObj) const;
-PointGetAbsolutePos(const SdrObject& rObj) const;
-void SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj);
-Degree100GetAlignAngle() const;
-void SetAlignAngle(Degree100 nAngle);
-static Degree100  EscDirToAngle(SdrEscapeDirection nEsc);
+bool IsUserDefined() const
+{
+return bUserDefined;
+}
+void SetUserDefined(bool bNew)
+{
+bUserDefined = bNew;
+}
+
+SdrAlign GetAlign() const
+{
+return nAlign;
+}
+void SetAlign(SdrAlign nAlg)
+{
+   

Re: pointers for updating tests after changing PDF export defaults

2021-08-11 Thread Miklos Vajna
Hi Stéphane,

>  * when asserting an equality, e.g.:
>CPPUNIT_ASSERT_EQUAL(OString("Im19"), rIDs[0])
>
> 
>  o what do strings like "Im19" or "Im12" mean in these contexts?

There are comments above the assert, they are meant to verify that "we
don't have 3 times the same page". You can also run 'git blame' on the
relevant lines to see this was added in commit
4505bc1701be73aab6543520cd342f0f0c8b7853.

>  * what is the "W array" that is not found in: CPPUNIT_ASSERT(pWArray)
>
> 

It's a key in a PDF dictionary for a font object, did you attempt to
search in the PDF spec to see what is the exact meaning?

>  * why could it be that rDocument.Read() fails at:
>CPPUNIT_ASSERT(rDocument.Read(aStream))
>
> 
>(in the load function)

That means that the pdf tokenizer was unable to create a list of PDF
tokens from the input byte array. Usually there are some warnings
printed (in debug builds) before that happens, pointing at some more
specific problem.

> Is there someone with more knowledge about tests and PDFs who could put me
> on the right path?

In general, running git blame on the code you don't understand is
useful. You can also read comments around the code.

Last, it seems your patch changes 2 settings at the same time: it would
be good to change one at a time: it's always easier to debug a problem
if you only changed one thing and you know the breakage is caused by
exactly that change.

> (I am not subscribed to the dev mailing list so please send a reply to me as
> well as the list! 😁)

It would great to subscribe though; that way only we can help you, but
you can't help others.

Regards,

Miklos


[Libreoffice-commits] core.git: vcl/inc vcl/source

2021-08-11 Thread Noel Grandin (via logerrit)
 vcl/inc/svdata.hxx   |3 ++-
 vcl/source/app/svapp.cxx |   22 +++---
 vcl/source/app/svmain.cxx|6 +++---
 vcl/source/window/window.cxx |4 ++--
 4 files changed, 18 insertions(+), 17 deletions(-)

New commits:
commit 5433564debb280949afcaa92dc3f9faf59765e65
Author: Noel Grandin 
AuthorDate: Tue Aug 10 18:57:43 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 11 09:02:47 2021 +0200

no need to allocate AllSettings separately in ImplSVAppData

Change-Id: I16b21d2bec8de9e5f4e8402c838c99d73637fe99
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120290
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 06515c5ccbb2..d428b5b301a0 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -131,7 +132,7 @@ struct ImplSVAppData
 {
 ~ImplSVAppData();
 
-std::unique_ptr mpSettings;   // Application settings
+std::optional mxSettings;   // Application settings
 LocaleConfigurationListener* mpCfgListener = nullptr;
 VclEventListeners   maEventListeners; // listeners for vcl events 
(eg, extended toolkit)
 std::vector >
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index be8e600f026e..4c60886e4503 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -628,7 +628,7 @@ void Application::MergeSystemSettings( AllSettings& 
rSettings )
 if ( !pSVData->maAppData.mbSettingsInit )
 {
 // side effect: ImplUpdateGlobalSettings does an 
ImplGetFrame()->UpdateSettings
-pWindow->ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings 
);
+pWindow->ImplUpdateGlobalSettings( *pSVData->maAppData.mxSettings 
);
 pSVData->maAppData.mbSettingsInit = true;
 }
 // side effect: ImplUpdateGlobalSettings does an 
ImplGetFrame()->UpdateSettings
@@ -641,21 +641,21 @@ void Application::SetSettings( const AllSettings& 
rSettings )
 const SolarMutexGuard aGuard;
 
 ImplSVData* pSVData = ImplGetSVData();
-if ( !pSVData->maAppData.mpSettings )
+if ( !pSVData->maAppData.mxSettings )
 {
 InitSettings(pSVData);
-*pSVData->maAppData.mpSettings = rSettings;
+*pSVData->maAppData.mxSettings = rSettings;
 }
 else
 {
-AllSettings aOldSettings = *pSVData->maAppData.mpSettings;
+AllSettings aOldSettings = *pSVData->maAppData.mxSettings;
 if (aOldSettings.GetUILanguageTag().getLanguageType() != 
rSettings.GetUILanguageTag().getLanguageType() &&
 pSVData->mbResLocaleSet)
 {
 pSVData->mbResLocaleSet = false;
 }
-*pSVData->maAppData.mpSettings = rSettings;
-AllSettingsFlags nChangeFlags = aOldSettings.GetChangeFlags( 
*pSVData->maAppData.mpSettings );
+*pSVData->maAppData.mxSettings = rSettings;
+AllSettingsFlags nChangeFlags = aOldSettings.GetChangeFlags( 
*pSVData->maAppData.mxSettings );
 if ( bool(nChangeFlags) )
 {
 DataChangedEvent aDCEvt( DataChangedEventType::SETTINGS, 
&aOldSettings, nChangeFlags );
@@ -733,25 +733,25 @@ void Application::SetSettings( const AllSettings& 
rSettings )
 const AllSettings& Application::GetSettings()
 {
 ImplSVData* pSVData = ImplGetSVData();
-if ( !pSVData->maAppData.mpSettings )
+if ( !pSVData->maAppData.mxSettings )
 {
 InitSettings(pSVData);
 }
 
-return *(pSVData->maAppData.mpSettings);
+return *(pSVData->maAppData.mxSettings);
 }
 
 namespace {
 
 void InitSettings(ImplSVData* pSVData)
 {
-assert(!pSVData->maAppData.mpSettings && "initialization should not happen 
twice!");
+assert(!pSVData->maAppData.mxSettings && "initialization should not happen 
twice!");
 
-pSVData->maAppData.mpSettings.reset(new AllSettings());
+pSVData->maAppData.mxSettings.emplace();
 if (!utl::ConfigManager::IsFuzzing())
 {
 pSVData->maAppData.mpCfgListener = new LocaleConfigurationListener;
-
pSVData->maAppData.mpSettings->GetSysLocale().GetOptions().AddListener( 
pSVData->maAppData.mpCfgListener );
+
pSVData->maAppData.mxSettings->GetSysLocale().GetOptions().AddListener( 
pSVData->maAppData.mpCfgListener );
 }
 }
 
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index fec1748d1c05..d3559ed029bd 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -530,15 +530,15 @@ void DeInitVCL()
 }
 }
 
-if ( pSVData->maAppData.mpSettings )
+if ( pSVData->maAppData.mxSettings )
 {
 if ( pSVData->maAppData.mpCfgListener )
 {
-
pSVData->maAppData.mpSettings->GetSysLocale().GetOptions().RemoveListener( 
pSVData->maAppData.mpCfgListener );
+
pSVData->maAppData.mxSettings->GetSysLocale().GetOptions().