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

2021-07-30 Thread Noel Grandin (via logerrit)
 vcl/source/control/PriorityHBox.cxx   |6 +++---
 vcl/source/control/PriorityMergedHBox.cxx |4 ++--
 vcl/source/uitest/uiobject.cxx|4 ++--
 vcl/source/window/menu.cxx|2 +-
 vcl/source/window/winproc.cxx |2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit b595a93f3022badf4f8a1e0edd19475778b0fddc
Author: Noel Grandin 
AuthorDate: Wed Jul 28 20:40:30 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 09:24:45 2021 +0200

use less GetOutDev()

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

diff --git a/vcl/source/control/PriorityHBox.cxx 
b/vcl/source/control/PriorityHBox.cxx
index c3477d23f30d..c893cc8332eb 100644
--- a/vcl/source/control/PriorityHBox.cxx
+++ b/vcl/source/control/PriorityHBox.cxx
@@ -128,10 +128,10 @@ void PriorityHBox::Resize()
 
 if (pWindow && pWindow->GetParent() == this)
 {
-nCurrentWidth -= pWindow->GetOutDev()->GetOutputWidthPixel() + 
get_spacing();
+nCurrentWidth -= pWindow->GetOutputSizePixel().Width() + 
get_spacing();
 pWindow->Show();
 pPrioritable->HideContent();
-nCurrentWidth += pWindow->GetOutDev()->GetOutputWidthPixel() + 
get_spacing();
+nCurrentWidth += pWindow->GetOutputSizePixel().Width() + 
get_spacing();
 }
 }
 
@@ -150,7 +150,7 @@ void PriorityHBox::Resize()
 
 if (pWindow)
 {
-nCurrentWidth -= pWindow->GetOutDev()->GetOutputWidthPixel() + 
get_spacing();
+nCurrentWidth -= pWindow->GetOutputSizePixel().Width() + 
get_spacing();
 pWindow->Show();
 pPrioritable->ShowContent();
 nCurrentWidth += getLayoutRequisition(*pWindow).Width() + 
get_spacing();
diff --git a/vcl/source/control/PriorityMergedHBox.cxx 
b/vcl/source/control/PriorityMergedHBox.cxx
index b67368d87628..75a26daa52c1 100644
--- a/vcl/source/control/PriorityMergedHBox.cxx
+++ b/vcl/source/control/PriorityMergedHBox.cxx
@@ -69,8 +69,8 @@ void PriorityMergedHBox::Resize()
 
 if (pWindow && pWindow->GetParent() == this && pWindow->IsVisible())
 {
-if (pWindow->GetOutDev()->GetOutputWidthPixel())
-nCurrentWidth -= pWindow->GetOutDev()->GetOutputWidthPixel();
+if (pWindow->GetOutputSizePixel().Width())
+nCurrentWidth -= pWindow->GetOutputSizePixel().Width();
 else
 nCurrentWidth -= DUMMY_WIDTH;
 pWindow->Hide();
diff --git a/vcl/source/uitest/uiobject.cxx b/vcl/source/uitest/uiobject.cxx
index fe9791c83aba..da71b7d3e41d 100644
--- a/vcl/source/uitest/uiobject.cxx
+++ b/vcl/source/uitest/uiobject.cxx
@@ -1758,8 +1758,8 @@ void DrawingAreaUIObject::execute(const OUString& 
rAction, const StringMap& rPar
 double fPosX = std::atof(sPosX2.getStr());
 double fPosY = std::atof(sPoxY2.getStr());
 
-fPosX = fPosX * 
mxDrawingArea->GetOutDev()->GetOutputWidthPixel();
-fPosY = fPosY * 
mxDrawingArea->GetOutDev()->GetOutputHeightPixel();
+fPosX = fPosX * mxDrawingArea->GetOutputSizePixel().Width();
+fPosY = fPosY * mxDrawingArea->GetOutputSizePixel().Height();
 
 MouseEvent aEvent(Point(fPosX, fPosY), 1, 
MouseEventModifiers::NONE, MOUSE_LEFT, 0);
 mxDrawingArea->MouseButtonDown(aEvent);
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 6225f25a6d16..d9555da15de5 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2725,7 +2725,7 @@ int MenuBar::GetMenuBarHeight() const
 else
 {
 vcl::Window* pMenubarWin = GetWindow();
-nMenubarHeight = pMenubarWin ? 
pMenubarWin->GetOutDev()->GetOutputHeightPixel() : 0;
+nMenubarHeight = pMenubarWin ? 
pMenubarWin->GetOutputSizePixel().Height() : 0;
 }
 return nMenubarHeight;
 }
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 3361b0d77858..890f4874aa6c 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1638,7 +1638,7 @@ static void KillOwnPopups( vcl::Window const * pWindow )
 
 void ImplHandleResize( vcl::Window* pWindow, tools::Long nNewWidth, 
tools::Long nNewHeight )
 {
-const bool bChanged = (nNewWidth != 
pWindow->GetOutDev()->GetOutputWidthPixel()) || (nNewHeight != 
pWindow->GetOutDev()->GetOutputHeightPixel());
+const bool bChanged = (nNewWidth != pWindow->GetOutputSizePixel().Width()) 
|| (nNewHeight != pWindow->GetOutDev()->GetOutputHeightPixel());
 if (bChanged && pWindow->GetStyle() & (WB_MOVEABLE|WB_SIZEABLE))
 {
 KillOwnPopups( pWindow );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.or

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

2021-07-30 Thread Noel Grandin (via logerrit)
 comphelper/source/misc/accessiblekeybindinghelper.cxx |8 
 include/comphelper/accessiblekeybindinghelper.hxx |9 +++--
 2 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit f107e6893491bdf9e9bd1a8620218640ea76095a
Author: Noel Grandin 
AuthorDate: Thu Jul 29 19:42:51 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 11:03:04 2021 +0200

osl::Mutex->std::mutex in OAccessibleKeyBindingHelper

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

diff --git a/comphelper/source/misc/accessiblekeybindinghelper.cxx 
b/comphelper/source/misc/accessiblekeybindinghelper.cxx
index ce1203e42fcd..c30cb3307d48 100644
--- a/comphelper/source/misc/accessiblekeybindinghelper.cxx
+++ b/comphelper/source/misc/accessiblekeybindinghelper.cxx
@@ -55,7 +55,7 @@ namespace comphelper
 
 void OAccessibleKeyBindingHelper::AddKeyBinding( const Sequence< 
awt::KeyStroke >& rKeyBinding )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 
 m_aKeyBindings.push_back( rKeyBinding );
 }
@@ -63,7 +63,7 @@ namespace comphelper
 
 void OAccessibleKeyBindingHelper::AddKeyBinding( const awt::KeyStroke& 
rKeyStroke )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 m_aKeyBindings.push_back( { rKeyStroke } );
 }
 
@@ -73,7 +73,7 @@ namespace comphelper
 
 sal_Int32 OAccessibleKeyBindingHelper::getAccessibleKeyBindingCount()
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 
 return m_aKeyBindings.size();
 }
@@ -81,7 +81,7 @@ namespace comphelper
 
 Sequence< awt::KeyStroke > 
OAccessibleKeyBindingHelper::getAccessibleKeyBinding( sal_Int32 nIndex )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 
 if ( nIndex < 0 || nIndex >= 
static_cast(m_aKeyBindings.size()) )
 throw IndexOutOfBoundsException();
diff --git a/include/comphelper/accessiblekeybindinghelper.hxx 
b/include/comphelper/accessiblekeybindinghelper.hxx
index 4de48bf3ec39..fe6b03521f5b 100644
--- a/include/comphelper/accessiblekeybindinghelper.hxx
+++ b/include/comphelper/accessiblekeybindinghelper.hxx
@@ -21,14 +21,11 @@
 #define INCLUDED_COMPHELPER_ACCESSIBLEKEYBINDINGHELPER_HXX
 
 #include 
+#include 
 #include 
-#include 
-
+#include 
 #include 
 
-#include 
-
-
 namespace comphelper
 {
 
@@ -46,7 +43,7 @@ namespace comphelper
 private:
 typedef ::std::vector< css::uno::Sequence< css::awt::KeyStroke > > 
KeyBindings;
 KeyBindings m_aKeyBindings;
-::osl::Mutexm_aMutex;
+std::mutex  m_aMutex;
 
 virtual ~OAccessibleKeyBindingHelper() override;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-07-30 Thread Noel Grandin (via logerrit)
 comphelper/source/streaming/seqstream.cxx |   23 ++-
 include/comphelper/seqstream.hxx  |5 +++--
 2 files changed, 17 insertions(+), 11 deletions(-)

New commits:
commit 957a66e58444a2ac4bb77d978fd08e84fceffc38
Author: Noel Grandin 
AuthorDate: Fri Jul 30 09:45:01 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 11:33:00 2021 +0200

osl::Mutex->std::mutex in SequenceInputStream

also
(*) check params before taking mutex to minimise the time holding the
mutex
(*) some methods were missing a lock_guard

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

diff --git a/comphelper/source/streaming/seqstream.cxx 
b/comphelper/source/streaming/seqstream.cxx
index 7cffb774232f..b33c63f0931b 100644
--- a/comphelper/source/streaming/seqstream.cxx
+++ b/comphelper/source/streaming/seqstream.cxx
@@ -57,13 +57,13 @@ inline sal_Int32 SequenceInputStream::avail()
 
 sal_Int32 SAL_CALL SequenceInputStream::readBytes( Sequence& aData, 
sal_Int32 nBytesToRead )
 {
-::osl::MutexGuard aGuard( m_aMutex );
-
-sal_Int32 nAvail = avail();
-
 if (nBytesToRead < 0)
 throw BufferSizeExceededException(OUString(),*this);
 
+std::lock_guard aGuard( m_aMutex );
+
+sal_Int32 nAvail = avail();
+
 if (nAvail < nBytesToRead)
 nBytesToRead = nAvail;
 
@@ -84,13 +84,13 @@ sal_Int32 SAL_CALL SequenceInputStream::readSomeBytes( 
Sequence& aData
 
 void SAL_CALL SequenceInputStream::skipBytes( sal_Int32 nBytesToSkip )
 {
-::osl::MutexGuard aGuard( m_aMutex );
-
-sal_Int32 nAvail = avail();
-
 if (nBytesToSkip < 0)
 throw BufferSizeExceededException(OUString(),*this);
 
+std::lock_guard aGuard( m_aMutex );
+
+sal_Int32 nAvail = avail();
+
 if (nAvail < nBytesToSkip)
 nBytesToSkip = nAvail;
 
@@ -100,7 +100,7 @@ void SAL_CALL SequenceInputStream::skipBytes( sal_Int32 
nBytesToSkip )
 
 sal_Int32 SAL_CALL SequenceInputStream::available(  )
 {
-::osl::MutexGuard aGuard( m_aMutex );
+std::lock_guard aGuard( m_aMutex );
 
 return avail();
 }
@@ -108,6 +108,8 @@ sal_Int32 SAL_CALL SequenceInputStream::available(  )
 
 void SAL_CALL SequenceInputStream::closeInput(  )
 {
+std::lock_guard aGuard( m_aMutex );
+
 if (m_nPos == -1)
 throw NotConnectedException(OUString(), *this);
 
@@ -118,16 +120,19 @@ void SAL_CALL SequenceInputStream::seek( sal_Int64 
location )
 {
 if ( location > m_aData.getLength() || location < 0 || location > 
SAL_MAX_INT32 )
 throw IllegalArgumentException("bad location", 
static_cast(this), 1);
+std::lock_guard aGuard( m_aMutex );
 m_nPos = static_cast(location);
 }
 
 sal_Int64 SAL_CALL SequenceInputStream::getPosition()
 {
+std::lock_guard aGuard( m_aMutex );
 return m_nPos;
 }
 
 sal_Int64 SAL_CALL SequenceInputStream::getLength(  )
 {
+std::lock_guard aGuard( m_aMutex );
 return m_aData.getLength();
 }
 
diff --git a/include/comphelper/seqstream.hxx b/include/comphelper/seqstream.hxx
index 6ea3ebc2c777..88db729832c5 100644
--- a/include/comphelper/seqstream.hxx
+++ b/include/comphelper/seqstream.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace comphelper
 {
@@ -39,7 +40,7 @@ namespace comphelper
 class COMPHELPER_DLLPUBLIC SequenceInputStream final
 : public ::cppu::WeakImplHelper< css::io::XInputStream, css::io::XSeekable 
>
 {
-::osl::Mutexm_aMutex;
+std::mutexm_aMutex;
 css::uno::Sequence const m_aData;
 sal_Int32   m_nPos;
 
@@ -62,7 +63,7 @@ public:
 virtual sal_Int64 SAL_CALL getLength(  ) override;
 
 private:
-inline sal_Int32 avail();
+sal_Int32 avail();
 };
 
 // don't export to avoid duplicate WeakImplHelper definitions with MSVC


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

2021-07-30 Thread Noel Grandin (via logerrit)
 comphelper/source/streaming/seqstream.cxx |8 +++-
 include/comphelper/seqstream.hxx  |5 ++---
 2 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit bb2470ffb749ed95e77cc112ee08a46c8b99be36
Author: Noel Grandin 
AuthorDate: Fri Jul 30 09:48:57 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 11:33:17 2021 +0200

osl::Mutex->std::mutx in OSequenceOutputStream

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

diff --git a/comphelper/source/streaming/seqstream.cxx 
b/comphelper/source/streaming/seqstream.cxx
index b33c63f0931b..9ad5db7254b8 100644
--- a/comphelper/source/streaming/seqstream.cxx
+++ b/comphelper/source/streaming/seqstream.cxx
@@ -153,7 +153,7 @@ OSequenceOutputStream::OSequenceOutputStream(Sequence< 
sal_Int8 >& _rSeq, double
 
 void SAL_CALL OSequenceOutputStream::writeBytes( const Sequence< sal_Int8 >& 
_rData )
 {
-MutexGuard aGuard(m_aMutex);
+std::lock_guard aGuard(m_aMutex);
 if (!m_bConnected)
 throw NotConnectedException();
 
@@ -193,7 +193,7 @@ void SAL_CALL OSequenceOutputStream::writeBytes( const 
Sequence< sal_Int8 >& _rD
 
 void SAL_CALL OSequenceOutputStream::flush(  )
 {
-MutexGuard aGuard(m_aMutex);
+std::lock_guard aGuard(m_aMutex);
 if (!m_bConnected)
 throw NotConnectedException();
 
@@ -203,8 +203,6 @@ void SAL_CALL OSequenceOutputStream::flush(  )
 
 void OSequenceOutputStream::finalizeOutput()
 {
-MutexGuard aGuard(m_aMutex);
-
 // cut the sequence to the real size
 m_rSequence.realloc(m_nSize);
 // and don't allow any further accesses
@@ -213,7 +211,7 @@ void OSequenceOutputStream::finalizeOutput()
 
 void SAL_CALL OSequenceOutputStream::closeOutput()
 {
-MutexGuard aGuard(m_aMutex);
+std::lock_guard aGuard(m_aMutex);
 if (!m_bConnected)
 throw NotConnectedException();
 
diff --git a/include/comphelper/seqstream.hxx b/include/comphelper/seqstream.hxx
index 88db729832c5..6cf22fdb6ebb 100644
--- a/include/comphelper/seqstream.hxx
+++ b/include/comphelper/seqstream.hxx
@@ -24,7 +24,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -74,7 +73,6 @@ class SAL_DLLPUBLIC_TEMPLATE OSequenceOutputStream_Base
 class UNLESS_MERGELIBS(COMPHELPER_DLLPUBLIC) OSequenceOutputStream final : 
public OSequenceOutputStream_Base
 {
 private:
-void finalizeOutput();
 css::uno::Sequence< sal_Int8 >& m_rSequence;
 double  m_nResizeFactor;
 sal_Int32 const m_nMinimumResize;
@@ -85,8 +83,9 @@ private:
 boolm_bConnected;
 // closeOutput has been called ?
 
-::osl::Mutexm_aMutex;
+std::mutex  m_aMutex;
 
+void finalizeOutput();
 virtual ~OSequenceOutputStream() override { if (m_bConnected) 
finalizeOutput(); }
 
 public:


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

2021-07-30 Thread Noel Grandin (via logerrit)
 comphelper/qa/unit/threadpooltest.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8618707dd9d7de2a439ab361d7ff6bca373670c4
Author: Noel Grandin 
AuthorDate: Fri Jul 30 09:34:51 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 11:33:31 2021 +0200

tsan:data race in ThreadPoolTest::testWorkerUsage

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

diff --git a/comphelper/qa/unit/threadpooltest.cxx 
b/comphelper/qa/unit/threadpooltest.cxx
index 890fdfe93f22..14da59988ef4 100644
--- a/comphelper/qa/unit/threadpooltest.cxx
+++ b/comphelper/qa/unit/threadpooltest.cxx
@@ -16,6 +16,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -74,7 +75,7 @@ public:
 mutex.lock();
 mutex.unlock();
 }
-static inline int count = 0;
+static inline std::atomic count = 0;
 static inline std::mutex mutex;
 };
 } // namespace


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

2021-07-30 Thread Caolán McNamara (via logerrit)
 include/vcl/font.hxx|5 ++---
 svx/source/svdraw/svdfmtf.cxx   |2 +-
 svx/source/svdraw/svdpdf.cxx|2 +-
 sw/source/core/inc/swfont.hxx   |8 
 vcl/source/filter/wmf/wmfwr.cxx |2 +-
 vcl/source/filter/wmf/wmfwr.hxx |6 +++---
 vcl/source/font/font.cxx|4 ++--
 vcl/source/gdi/svmconverter.cxx |2 +-
 8 files changed, 15 insertions(+), 16 deletions(-)

New commits:
commit 5c9001acf25bf1795f683fc1a43dc6ec0ba6ced9
Author: Caolán McNamara 
AuthorDate: Thu Jul 29 12:58:07 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 30 12:11:51 2021 +0200

drop FontAlign alias of TextAlign

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

diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx
index 3147f57aba14..ddc98c0223b9 100644
--- a/include/vcl/font.hxx
+++ b/include/vcl/font.hxx
@@ -34,7 +34,6 @@
 class Size;
 class LanguageTag;
 class SvStream;
-#define FontAlign TextAlign
 
 class ImplFont;
 class FontAttributes;
@@ -69,7 +68,7 @@ public:
 FontPitch   GetPitch() const;
 FontWidth   GetWidthType();
 FontWidth   GetWidthType() const;
-FontAlign   GetAlignment() const;
+TextAlign   GetAlignment() const;
 rtl_TextEncodingGetCharSet() const;
 
 boolIsSymbolFont() const;
@@ -82,7 +81,7 @@ public:
 voidSetItalic( FontItalic );
 voidSetWeight( FontWeight );
 voidSetWidthType( FontWidth );
-voidSetAlignment( FontAlign );
+voidSetAlignment( TextAlign );
 voidSetCharSet( rtl_TextEncoding );
 
 voidSetSymbolFlag( bool );
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 66d2acc86b9b..de91990ccde8 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -1006,7 +1006,7 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& 
rPos, const OUString& rSt
 
 FontMetric aFontMetric( mpVD->GetFontMetric() );
 vcl::Font aFnt( mpVD->GetFont() );
-FontAlign eAlg( aFnt.GetAlignment() );
+TextAlign eAlg( aFnt.GetAlignment() );
 
 sal_Int32 nTextWidth = static_cast( mpVD->GetTextWidth( rStr ) 
* mfScaleX );
 sal_Int32 nTextHeight = static_cast( mpVD->GetTextHeight() * 
mfScaleY );
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index 9605a4dfeb42..471aa47375c3 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -790,7 +790,7 @@ void ImpSdrPdfImport::InsertTextObject(const Point& rPos, 
const Size& rSize, con
 
 FontMetric aFontMetric(mpVD->GetFontMetric());
 vcl::Font aFont(mpVD->GetFont());
-FontAlign eAlignment(aFont.GetAlignment());
+TextAlign eAlignment(aFont.GetAlignment());
 
 // sal_Int32 nTextWidth = static_cast(mpVD->GetTextWidth(rStr) 
* mfScaleX);
 sal_Int32 nTextHeight = static_cast(mpVD->GetTextHeight() * 
mfScaleY);
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 59b31a3946a6..a2eedaca5f64 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -86,7 +86,7 @@ class SwSubFont final : public SvxFont
 inline void SetFillColor( const Color& rColor );
 inline void SetCharSet( const rtl_TextEncoding eCharSet );
 inline void SetPitch( const FontPitch ePitch );
-inline void SetAlign( const FontAlign eAlign );
+inline void SetAlign( const TextAlign eAlign );
 inline void SetUnderline( const FontLineStyle eUnderline );
 inline void SetOverline( const FontLineStyle eOverline );
 inline void SetStrikeout( const FontStrikeout eStrikeout );
@@ -209,7 +209,7 @@ public:
 // the encapsulated SV-Font-methods (set bFntChg to true)
 inline void SetColor( const Color& rColor );
 inline void SetFillColor( const Color& rColor );
-inline void SetAlign( const FontAlign eAlign );
+inline void SetAlign( const TextAlign eAlign );
 inline void SetUnderline( const FontLineStyle eUnderline );
 void SetUnderColor( const Color &rColor ) { m_aUnderColor = rColor; }
 inline void SetOverline( const FontLineStyle eOverline );
@@ -505,13 +505,13 @@ inline void SwFont::SetPitch( const FontPitch ePitch, 
const SwFontScript nWhich
 }
 
 // encapsulated SV-Font-method
-inline void SwSubFont::SetAlign( const FontAlign eAlign )
+inline void SwSubFont::SetAlign( const TextAlign eAlign )
 {
 m_nFontCacheId = nullptr;
 Font::SetAlignment( eAlign );
 }
 
-inline void SwFont::SetAlign( const FontAlign eAlign )
+inline void SwFont::SetAlign( const TextAlign eAlign )
 {
 m_bFontChg = true;
 m_aSub[SwFontScript::Latin].SetAlign( eAlign );
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index 2fa1a0839d38..9b3751b9cea9 10064

[Libreoffice-commits] core.git: sfx2/Library_sfx.mk sfx2/source

2021-07-30 Thread Anshu (via logerrit)
 sfx2/Library_sfx.mk  |1 
 sfx2/source/dialog/StyleList.cxx | 1814 +++
 sfx2/source/dialog/templdlg.cxx  | 1776 --
 sfx2/source/inc/StyleList.hxx|  235 +
 sfx2/source/inc/templdgi.hxx |  243 ++---
 5 files changed, 2354 insertions(+), 1715 deletions(-)

New commits:
commit 172f589471edcac9a4974132a3145b721942879a
Author: Anshu 
AuthorDate: Sat Jun 26 08:34:06 2021 +0530
Commit: Mike Kaganski 
CommitDate: Fri Jul 30 12:14:24 2021 +0200

tdf#38194 related: introduce StylesList control

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

diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index fff97d011a02..39b5438c65a2 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -203,6 +203,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
 sfx2/source/dialog/styledlg \
 sfx2/source/dialog/tabdlg \
 sfx2/source/dialog/templdlg \
+sfx2/source/dialog/StyleList \
 sfx2/source/dialog/titledockwin \
 sfx2/source/dialog/tplcitem \
 sfx2/source/dialog/tplpitem \
diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
new file mode 100644
index ..8525c620b2dd
--- /dev/null
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -0,0 +1,1814 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+using namespace css;
+using namespace css::beans;
+using namespace css::frame;
+using namespace css::uno;
+
+// Constructor
+
+StyleList::StyleList(weld::Builder* pBuilder, std::optional 
xFamilies,
+ SfxBindings* pBindings, SfxCommonTemplateDialog_Impl* 
Parent,
+ SfxModule* Module, weld::Container* pC, OString 
treeviewname,
+ OString flatviewname)
+: m_bHierarchical(false)
+, m_bAllowReParentDrop(false)
+, m_bNewByExampleDisabled(false)
+, m_bDontUpdate(false)
+, m_bTreeDrag(true)
+, m_bCanEdit(false)
+, m_bCanHide(true)
+, m_bCanShow(false)
+, m_bCanNew(true)
+, m_bUpdateFamily(false)
+, m_bCanDel(false)
+, m_bBindingUpdate(true)
+, m_pStyleSheetPool(nullptr)
+, m_nActFilter(0)
+, m_xFmtLb(pBuilder->weld_tree_view(flatviewname))
+, m_xTreeBox(pBuilder->weld_tree_view(treeviewname))
+, m_xStyleFamilies(xFamilies)
+, m_nActFamily(0x)
+, m_nAppFilter(SfxStyleSearchBits::Auto)
+, m_pParentDialog(Parent)
+, m_pBindings(pBindings)
+, m_Module(Module)
+, m_nModifier(0)
+, m_pContainer(pC)
+{
+m_xFmtLb->set_help_id(HID_TEMPLATE_FMT);
+}
+
+// Destructor
+
+StyleList::~StyleList() {}
+
+// Called in the destructor of Dialog
+// Cleans up the StyleList individual components while closing the application
+IMPL_LINK_NOARG(StyleList, Cleanup, void*, void)
+{
+if (m_pStyleSheetPool)
+EndListening(*m_pStyleSheetPool);
+m_pStyleSheetPool = nullptr;
+m_xTreeView1DropTargetHelper.reset();
+m_xTreeView2DropTargetHelper.reset();
+m_xTreeBox.reset();
+m_xFmtLb.reset();
+pIdle.reset();
+}
+
+void StyleList::CreateContextMenu()
+{
+if (m_bBindingUpdate)
+{
+m_pBindings->Invalidate(SID_STYLE_NEW, true);
+m_pBindings->Update(SID_STYLE_NEW);
+m_bBindingUpdate = false;
+}
+mxMenu.reset();
+mxMenuBuilder.reset(Application::CreateBuilder(nullptr, 
"sfx/ui/stylecontextmenu.ui"));
+mxMenu = mxMenuBuilder->weld_menu("menu");
+mxMenu->set_sensitive(

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

2021-07-30 Thread Gopi Krishna Menon (via logerrit)
 comphelper/source/misc/traceevent.cxx |7 ++-
 include/comphelper/profilezone.hxx|   12 +++-
 2 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 74f4a1796f94477d459c71d0a0aaa8f4a430e208
Author: Gopi Krishna Menon 
AuthorDate: Thu Jul 29 15:21:13 2021 +0530
Commit: Tor Lillqvist 
CommitDate: Fri Jul 30 13:07:49 2021 +0200

Fix Nesting Level Bug in ProfileZone

Moves the profile zone global nesting variable into the source from header 
and makes it threadlocal

Change-Id: I97751f5c532d8e0e36adb7d9d383bd88f752953f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119662
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 

diff --git a/comphelper/source/misc/traceevent.cxx 
b/comphelper/source/misc/traceevent.cxx
index c379bbb97f7e..8b1a9c09427a 100644
--- a/comphelper/source/misc/traceevent.cxx
+++ b/comphelper/source/misc/traceevent.cxx
@@ -29,7 +29,8 @@ std::size_t TraceEvent::s_nBufferSize = 0;
 void (*TraceEvent::s_pBufferFullCallback)() = nullptr;
 
 int AsyncEvent::s_nIdCounter = 0;
-int ProfileZone::s_nNesting = 0;
+
+static thread_local int nProfileZoneNesting = 0; // Level of Nested Profile 
Zones
 
 namespace
 {
@@ -134,6 +135,10 @@ void ProfileZone::addRecording()
  + 
OUString::number(osl_getThreadIdentifier(nullptr)) + "},");
 }
 
+int ProfileZone::getNestingLevel() { return nProfileZoneNesting; }
+
+void ProfileZone::setNestingLevel(int nNestingLevel) { nProfileZoneNesting = 
nNestingLevel; }
+
 } // namespace comphelper
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/profilezone.hxx 
b/include/comphelper/profilezone.hxx
index b96b26baffc1..71f9fa30b6dc 100644
--- a/include/comphelper/profilezone.hxx
+++ b/include/comphelper/profilezone.hxx
@@ -22,13 +22,14 @@ namespace comphelper
 {
 class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent
 {
-static int s_nNesting; // level of nested zones.
-
 long long m_nCreateTime;
 int m_nNesting;
 
 void addRecording();
 
+static void setNestingLevel(int nNestingLevel);
+static int getNestingLevel();
+
 ProfileZone(const char* sName, const OUString& sArgs)
 : NamedEvent(sName, sArgs)
 , m_nNesting(-1)
@@ -37,7 +38,8 @@ class COMPHELPER_DLLPUBLIC ProfileZone : public NamedEvent
 {
 m_nCreateTime = getNow();
 
-m_nNesting = s_nNesting++;
+m_nNesting = getNestingLevel();
+setNestingLevel(getNestingLevel() + 1);
 }
 else
 m_nCreateTime = 0;
@@ -65,9 +67,9 @@ public:
 {
 if (m_nCreateTime > 0)
 {
-s_nNesting--;
+setNestingLevel(getNestingLevel() - 1);
 
-if (m_nNesting != s_nNesting)
+if (m_nNesting != getNestingLevel())
 {
 SAL_WARN("comphelper.traceevent", "Incorrect ProfileZone 
nesting for " << m_sName);
 }


Re: How to create a lockedCanvas in MSWord?

2021-07-30 Thread Regina Henschel

Hi Miklos, hi all,

my patch is now in https://gerrit.libreoffice.org/c/core/+/119684

I have included tests with image, line, group, and custom-shape.

The lockedCanvas can have child element GvmlGraphicObjectFrame in 
addition. That is TableShape, ChartShape or OLE2Shape, I think. So if 
someone has a test document for that, I could test whether it really 
works and write a unittest with it.


If you can generate such document, please attach it to 
https://bugs.documentfoundation.org/show_bug.cgi?id=143476


Besides that, the patch is ready. Because it changes the way 
lockedCanvas is imported, it would be good, if you review it.


Kind regards
Regina




Miklos Vajna schrieb am 27.07.2021 um 08:56:

Hi Regina,

On Mon, Jul 26, 2021 at 02:21:51AM +0200, Regina Henschel 
 wrote:

does someone know, how to create a document in MSWord, which uses a
lockedCanvas? Or is that only possible via macro? It would be good to be
able to generate own test documents.


My understanding is that lockedCanvas is a workaround, because the
drawingML impl in PowerPoint 2007 was ready but not in Word 2007. So
when you copy a set of shapes from PowerPoint to Word in that version,
Word can render but not edit those shapes, locking them down.

I think 2010 and newer versions don't have this behavior anymore, but
the lockedCanvas element is now with us forever.

I attach a sample I just created this way in MSO 2007.

Regards,

Miklos





New Defects reported by Coverity Scan for LibreOffice

2021-07-30 Thread scan-admin
Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found 
with Coverity Scan.

2 new defect(s) introduced to LibreOffice found with Coverity Scan.
1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent 
build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)


** CID 1489568:  Null pointer dereferences  (NULL_RETURNS)



*** CID 1489568:  Null pointer dereferences  (NULL_RETURNS)
/sc/source/ui/docshell/dbdocfun.cxx: 605 in ScDBDocFunc::Sort(short, const 
ScSortParam &, bool, bool, bool)()
599 SfxViewShell* pViewShell = SfxViewShell::GetFirst();
600 while (pViewShell)
601 {
602 ScTabViewShell* pTabViewShell = 
dynamic_cast(pViewShell);
603 if (pTabViewShell && pTabViewShell->GetDocId() == 
pSomeViewForThisDoc->GetDocId())
604 {
>>> CID 1489568:  Null pointer dereferences  (NULL_RETURNS)
>>> Dereferencing a pointer that might be "nullptr" 
>>> "pTabViewShell->GetViewData()->GetLOKHeightHelper(nTab)" when calling 
>>> "invalidateByIndex".
605 
pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)->invalidateByIndex(nStartRow);
606 }
607 pViewShell = SfxViewShell::GetNext(*pViewShell);
608 }
609 
610 ScTabViewShell::notifyAllViewsSheetGeomInvalidation(

** CID 1399290:(UNCAUGHT_EXCEPT)
/sw/source/uibase/lingu/hhcwrp.cxx: 110 in SwHHCWrapper::~SwHHCWrapper()()
/sw/source/uibase/lingu/hhcwrp.cxx: 110 in SwHHCWrapper::~SwHHCWrapper()()
/sw/source/uibase/lingu/hhcwrp.cxx: 110 in SwHHCWrapper::~SwHHCWrapper()()
/sw/source/uibase/lingu/hhcwrp.cxx: 110 in SwHHCWrapper::~SwHHCWrapper()()



*** CID 1399290:(UNCAUGHT_EXCEPT)
/sw/source/uibase/lingu/hhcwrp.cxx: 110 in SwHHCWrapper::~SwHHCWrapper()()
104 , m_bIsSelection( bSelection )
105 , m_bStartDone( bOther || bStart )
106 , m_bEndDone( false )
107 {
108 }
109 
>>> CID 1399290:(UNCAUGHT_EXCEPT)
>>> An exception of type "com::sun::star::uno::RuntimeException" is thrown 
>>> but the throw list "noexcept" doesn't allow it to be thrown. This will 
>>> cause a call to unexpected() which usually calls terminate().
110 SwHHCWrapper::~SwHHCWrapper()
111 {
112 m_pConvArgs.reset();
113 
114 SwViewShell::SetCareDialog(nullptr);
115 
/sw/source/uibase/lingu/hhcwrp.cxx: 110 in SwHHCWrapper::~SwHHCWrapper()()
104 , m_bIsSelection( bSelection )
105 , m_bStartDone( bOther || bStart )
106 , m_bEndDone( false )
107 {
108 }
109 
>>> CID 1399290:(UNCAUGHT_EXCEPT)
>>> An exception of type "com::sun::star::uno::RuntimeException" is thrown 
>>> but the throw list "noexcept" doesn't allow it to be thrown. This will 
>>> cause a call to unexpected() which usually calls terminate().
110 SwHHCWrapper::~SwHHCWrapper()
111 {
112 m_pConvArgs.reset();
113 
114 SwViewShell::SetCareDialog(nullptr);
115 
/sw/source/uibase/lingu/hhcwrp.cxx: 110 in SwHHCWrapper::~SwHHCWrapper()()
104 , m_bIsSelection( bSelection )
105 , m_bStartDone( bOther || bStart )
106 , m_bEndDone( false )
107 {
108 }
109 
>>> CID 1399290:(UNCAUGHT_EXCEPT)
>>> An exception of type "com::sun::star::uno::RuntimeException" is thrown 
>>> but the throw list "noexcept" doesn't allow it to be thrown. This will 
>>> cause a call to unexpected() which usually calls terminate().
110 SwHHCWrapper::~SwHHCWrapper()
111 {
112 m_pConvArgs.reset();
113 
114 SwViewShell::SetCareDialog(nullptr);
115 
/sw/source/uibase/lingu/hhcwrp.cxx: 110 in SwHHCWrapper::~SwHHCWrapper()()
104 , m_bIsSelection( bSelection )
105 , m_bStartDone( bOther || bStart )
106 , m_bEndDone( false )
107 {
108 }
109 
>>> CID 1399290:(UNCAUGHT_EXCEPT)
>>> An exception of type "com::sun::star::uno::RuntimeException" is thrown 
>>> but the throw list "noexcept" doesn't allow it to be thrown. This will 
>>> cause a call to unexpected() which usually calls terminate().
110 SwHHCWrapper::~SwHHCWrapper()
111 {
112 m_pConvArgs.reset();
113 
114 SwViewShell::SetCareDialog(nullptr);
115 



To view the defects in Coverity Scan visit, 
https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DPY7m_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJietkHBXvmLgytlgz4Pdt1z6bc8Fr

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

2021-07-30 Thread Noel Grandin (via logerrit)
 framework/source/services/dispatchhelper.cxx |   28 ---
 include/framework/dispatchhelper.hxx |   11 --
 2 files changed, 22 insertions(+), 17 deletions(-)

New commits:
commit 7b5922eb666e5f153060468b271d99510adb422e
Author: Noel Grandin 
AuthorDate: Fri Jul 30 10:10:55 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 14:07:43 2021 +0200

osl::Mutex->std::mutex in DispatchHelper

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

diff --git a/framework/source/services/dispatchhelper.cxx 
b/framework/source/services/dispatchhelper.cxx
index 380eab11ec67..cfa4a8a2bbe1 100644
--- a/framework/source/services/dispatchhelper.cxx
+++ b/framework/source/services/dispatchhelper.cxx
@@ -53,6 +53,7 @@ css::uno::Sequence SAL_CALL 
DispatchHelper::getSupportedServiceNames()
 */
 DispatchHelper::DispatchHelper(const 
css::uno::Reference& xContext)
 : m_xContext(xContext)
+, m_aBlockFlag(false)
 {
 }
 
@@ -91,11 +92,12 @@ css::uno::Any SAL_CALL DispatchHelper::executeDispatch(
 }
 
 // parse given URL
+css::uno::Reference xParser;
 /* SAFE { */
-osl::ClearableMutexGuard aReadLock(m_mutex);
-css::uno::Reference xParser
-= css::util::URLTransformer::create(m_xContext);
-aReadLock.clear();
+{
+std::lock_guard aReadLock(m_mutex);
+xParser = css::util::URLTransformer::create(m_xContext);
+}
 /* } SAFE */
 
 css::util::URL aURL;
@@ -148,16 +150,18 @@ DispatchHelper::executeDispatch(const 
css::uno::Reference

css::uno::UNO_QUERY);
 /* SAFE { */
 {
-osl::MutexGuard aWriteLock(m_mutex);
+std::lock_guard aWriteLock(m_mutex);
 m_xBroadcaster = xNotifyDispatch;
-m_aBlock.reset();
+m_aBlockFlag = false;
 }
 /* } SAFE */
 
 // dispatch it and wait for a notification
 // TODO/MBA: waiting in main thread?!
 xNotifyDispatch->dispatchWithNotification(aURL, aArguments, 
xListener);
-m_aBlock.wait(); // wait for result
+
+std::unique_lock aWriteLock(m_mutex);
+m_aBlock.wait(aWriteLock, [this] { return m_aBlockFlag; }); // 
wait for result
 }
 else
 {
@@ -180,9 +184,10 @@ DispatchHelper::executeDispatch(const 
css::uno::Reference
  */
 void SAL_CALL DispatchHelper::dispatchFinished(const 
css::frame::DispatchResultEvent& aResult)
 {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 m_aResult <<= aResult;
-m_aBlock.set();
+m_aBlockFlag = true;
+m_aBlock.notify_one();
 m_xBroadcaster.clear();
 }
 
@@ -193,9 +198,10 @@ void SAL_CALL DispatchHelper::dispatchFinished(const 
css::frame::DispatchResultE
  */
 void SAL_CALL DispatchHelper::disposing(const css::lang::EventObject&)
 {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 m_aResult.clear();
-m_aBlock.set();
+m_aBlockFlag = true;
+m_aBlock.notify_one();
 m_xBroadcaster.clear();
 }
 }
diff --git a/include/framework/dispatchhelper.hxx 
b/include/framework/dispatchhelper.hxx
index f362f30ab633..ca7e2b2ccf12 100644
--- a/include/framework/dispatchhelper.hxx
+++ b/include/framework/dispatchhelper.hxx
@@ -28,7 +28,8 @@
 
 #include 
 #include 
-#include 
+#include 
+#include 
 
 namespace com::sun::star::lang
 {
@@ -57,17 +58,15 @@ class UNLESS_MERGELIBS(FWK_DLLPUBLIC) DispatchHelper final
 : public ::cppu::WeakImplHelper
 {
-// member
-
-private:
-osl::Mutex m_mutex;
+std::mutex m_mutex;
 
 /** global uno service manager.
 Can be used to create own needed services. */
 css::uno::Reference m_xContext;
 
 /** used to wait for asynchronous listener callbacks. */
-::osl::Condition m_aBlock;
+std::condition_variable m_aBlock;
+bool m_aBlockFlag;
 
 css::uno::Any m_aResult;
 


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

2021-07-30 Thread Noel Grandin (via logerrit)
 include/svx/fmtools.hxx |3 ++-
 svx/source/form/fmtools.cxx |2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 66fceca24ee0fccd03f23afc689d82c794a2d57e
Author: Noel Grandin 
AuthorDate: Fri Jul 30 14:29:27 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 15:23:52 2021 +0200

osl::Mutex->std::mutex in FmXDisposeListener

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

diff --git a/include/svx/fmtools.hxx b/include/svx/fmtools.hxx
index 1ead9069b4f0..869023f06f7f 100644
--- a/include/svx/fmtools.hxx
+++ b/include/svx/fmtools.hxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::awt { class XWindow; }
 namespace com::sun::star::beans { class XPropertySet; }
@@ -132,7 +133,7 @@ class SAL_WARN_UNUSED FmXDisposeListener
 friend class FmXDisposeMultiplexer;
 
 rtl::Reference m_pAdapter;
-osl::Mutex   m_aMutex;
+std::mutex   m_aMutex;
 
 public:
 virtual ~FmXDisposeListener();
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index e9f641309d0b..e8e0a5e1a328 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -235,7 +235,7 @@ FmXDisposeListener::~FmXDisposeListener()
 
 void FmXDisposeListener::setAdapter(FmXDisposeMultiplexer* pAdapter)
 {
-::osl::MutexGuard aGuard(m_aMutex);
+std::lock_guard aGuard(m_aMutex);
 m_pAdapter = pAdapter;
 }
 


[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 3308 commits - accessibility/inc accessibility/Library_acc.mk accessibility/source android/source animations/source apple_remote/sou

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 5ecce4ae4e4e8ba4735c36b9d94292cbd769bdf6
Author: Tomaž Vajngerl 
AuthorDate: Fri Apr 2 16:11:50 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jul 30 22:36:50 2021 +0900

drawinglayer: ITextLayouter and use it as a VisitingParameter

Change-Id: I04aa42716c2bde4a2652d10892b6b2392a20fb3b

diff --git a/basegfx/Library_basegfx.mk b/basegfx/Library_basegfx.mk
index 8359969ae80c..957f1b45ac08 100644
--- a/basegfx/Library_basegfx.mk
+++ b/basegfx/Library_basegfx.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_add_exception_objects,basegfx,\
 basegfx/source/vector/b2dvector \
 basegfx/source/vector/b2ivector \
 basegfx/source/vector/b3dvector \
+basegfx/source/text/UnoTextLayouter \
 ))
 
 
diff --git a/basegfx/source/text/UnoTextLayouter.cxx 
b/basegfx/source/text/UnoTextLayouter.cxx
new file mode 100644
index ..e3f48264c624
--- /dev/null
+++ b/basegfx/source/text/UnoTextLayouter.cxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include 
+#include 
+
+using namespace css;
+
+namespace gfx
+{
+// css::lang::XUnoTunnel
+UNO3_GETIMPLEMENTATION_IMPL(UnoTextLayouter);
+
+std::shared_ptr
+getTextLayouterFromUno(uno::Reference const& 
xTextLayouter)
+{
+gfx::UnoTextLayouter* pUnoTextLayouter
+= 
comphelper::getUnoTunnelImplementation(xTextLayouter);
+if (pUnoTextLayouter)
+return pUnoTextLayouter->getTextLayouter();
+
+return std::shared_ptr();
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/attribute/fontattribute.cxx 
b/drawinglayer/source/attribute/fontattribute.cxx
index e423b8367f1c..b14397fe9d87 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -112,15 +112,31 @@ FontAttribute::FontAttribute()
 {
 }
 
-FontAttribute::FontAttribute(const FontAttribute&) = default;
+FontAttribute::FontAttribute(const FontAttribute& rOther)
+: mpFontAttribute(rOther.mpFontAttribute)
+{
+}
+
+FontAttribute::FontAttribute(FontAttribute&& rOther) noexcept
+: mpFontAttribute(std::move(rOther.mpFontAttribute))
+{
+}
 
-FontAttribute::FontAttribute(FontAttribute&&) = default;
+FontAttribute::~FontAttribute() {}
 
-FontAttribute::~FontAttribute() = default;
+FontAttribute& FontAttribute::operator=(const FontAttribute& rOther)
+{
+mpFontAttribute = rOther.mpFontAttribute;
 
-FontAttribute& FontAttribute::operator=(const FontAttribute&) = default;
+return *this;
+}
 
-FontAttribute& FontAttribute::operator=(FontAttribute&&) = default;
+FontAttribute& FontAttribute::operator=(FontAttribute&& rOther) noexcept
+{
+mpFontAttribute = std::move(rOther.mpFontAttribute);
+
+return *this;
+}
 
 bool FontAttribute::operator==(const FontAttribute& rCandidate) const
 {
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx 
b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index f0e677c0cedb..78e2ea02a0eb 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -118,7 +119,8 @@ namespace drawinglayer::unorenderer
 }
 
 const geometry::ViewInformation2D 
aViewInformation2D(aViewInformationSequence);
-primitive2d::VisitingParameters 
aVisitingParameters(aViewInformation2D);
+auto pTextLayouter = 
std::make_shared();
+primitive2d::VisitingParameters 
aVisitingParameters(aViewInformation2D, pTextLayouter);
 const sal_uInt32 
nDiscreteWidth(basegfx::fround(o3tl::convert(fWidth, eRangeUnit, 
o3tl::Length::in) * DPI_X));
 const sal_uInt32 
nDiscreteHeight(basegfx::fround(o3tl::convert(fHeight, eRangeUnit, 
o3tl::Length::in) * DPI_Y));
 
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx 
b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index 085ccc1b8c58..7ec09582886f 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -23,7 +23,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 
 using namespace css;
 
@@ -85,12 +88,39 @@ void 
BasePrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& /*rVis
 {
 }
 
+namespace
+{
+std::shared_ptr
+getTextLayouter(const uno::Sequence& rProperties)
+{
+std::shared_ptr pTextLayouter;
+
+if (!rProperties.hasElements())
+return pTextLayouter;
+
+for (const 

[Libreoffice-commits] help.git: source/text

2021-07-30 Thread Rafael Lima (via logerrit)
 source/text/sbasic/shared/03/sf_services.xhp |  317 ++-
 1 file changed, 80 insertions(+), 237 deletions(-)

New commits:
commit 1951014d9e7c5270904789c2964d35fca8487134
Author: Rafael Lima 
AuthorDate: Wed Jul 28 15:06:14 2021 +0200
Commit: Jean-Pierre Ledure 
CommitDate: Fri Jul 30 15:53:01 2021 +0200

Rewrite SF_Services with Python support focusing user scripts only

Change-Id: Ib3748c3fbe43e25e3a9aa895519f08ec3b11b953
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/119612
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure 

diff --git a/source/text/sbasic/shared/03/sf_services.xhp 
b/source/text/sbasic/shared/03/sf_services.xhp
index 241eac25f..aaedbd394 100644
--- a/source/text/sbasic/shared/03/sf_services.xhp
+++ b/source/text/sbasic/shared/03/sf_services.xhp
@@ -17,248 +17,91 @@
 
 
 
-   
-  Services service
-   
-
-ScriptForge.Services 
service
-
-
-The ScriptForge library is built upon an extensible collection of 
so-called "Services".
-This collection is implemented as categories of Basic libraries or 
Python modules:
-
-
-   
-  the standard ScriptForge library shipped 
with %PRODUCTNAME
-   
-   
-  a number of "associated" libraries shipped with %PRODUCTNAME 
as well
-   
-   
-  any user/contributor LibreOffice extension wanting to fit into 
the same framework
-   
-
+  
+Services service
+  
+  ScriptForge.Services 
service
+  The main purpose of 
the Services module is to provide access to the 
CreateScriptService method, which can be called in user 
scripts to instantiate services that are implemented using the ScriptForge 
framework.
 
+In ScriptForge 
terminology a service is a collection of methods and properties that can be 
used for a common purpose. For example, the String service 
provides methods for manipulating strings whereas the 
FileSystem service allows for the manipulation of files and 
folders.
+The Services module of the 
ScriptForge library provides additional methods that are used either internally 
to register available services or by developers who are interested in extending 
ScriptForge by creating new services. The only method that is relevant for user 
scripts is CreateScriptService.
 
-A 
service is a collection of properties or methods which implement 
the service.
-For the author of a user 
script, a service may be either a module within a library, or an 
instance of a class module.
-An 
event manager is a script contained in a library which binds an 
event triggering a macro - usually defined by the Tools - 
Customize  menu - to the concerned service instance.
-As an example, if several 
documents trigger the same macro when they are loaded, it might be useful to 
know which document triggered the macro this time. That's where an event 
manager plays its role.
-
-The 
following methods make up the kernel of the ScriptForge 
framework:
-
-   
-  RegisterScriptServices
-  Called internally by ScriptForge to 
register for a library the list of services it implements.
- Each library associated to Scriptforge or 
extending it must implement its own RegisterScriptServices 
method.
-   
-   
-  RegisterService
-  Called - as many times as there are services to register in 
the library - by RegisterScriptServices.
-   
-   
-  RegisterEventManager
-  Called to register a library event manager by 
RegisterScriptServices.
-   
-   
-  CreateScriptService
-  Called by user scripts to get an object giving access to the 
service given as argument.
- All services should be invoked through the 
CreateScriptService method.
-   
-
-Conventionally, the 
String, Array and 
Exception services may be invoked directly respectively as 
SF_String, SF_Array and 
SF_Exception.
-
-
-   
- List of Methods in the Services 
Service
-   
-   
-   
-   
- CreateScriptService
-   
-   
-   
-   
- RegisterScriptServices
- RegisterService
-   
-   
-   
-   
- RegisterEventManager
-   
-   
-   
-
-
-  
-   CreateScriptService 
--
 
-  
- Services service;CreateScriptService
-  
+
+   CreateScriptService 
---
 
+  
+Services service;CreateScriptService
+  
   CreateScriptService
-
-   Gain access to one of the services of a library for the benefit of a 
user script.
-   The returned value is a Basic object or 
Nothing if an error occurred.
-
-
-   A service can be understood as either:
-
-  
-   
-  as a set of methods gathered in a Basic standard 
module
-   
-   
-  or a set of methods and properties gathered in a Basic class 
module.
-   
-  
-  

[Libreoffice-commits] core.git: helpcontent2

2021-07-30 Thread Rafael Lima (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 350f994d43660b75bfd21990edabdb1c8adb839e
Author: Rafael Lima 
AuthorDate: Fri Jul 30 15:53:01 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Fri Jul 30 15:53:01 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 1951014d9e7c5270904789c2964d35fca8487134
  - Rewrite SF_Services with Python support focusing user scripts only

Change-Id: Ib3748c3fbe43e25e3a9aa895519f08ec3b11b953
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/119612
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure 

diff --git a/helpcontent2 b/helpcontent2
index 4a07d8d492c5..1951014d9e7c 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 4a07d8d492c50f0e2db3200790f92e9e18bb5144
+Subproject commit 1951014d9e7c5270904789c2964d35fca8487134


[Libreoffice-commits] core.git: Changes to 'feature/drawinglayercore2'

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
New branch 'feature/drawinglayercore2' available with the following commits:
commit 4874765bfbf2ffbc86989df8d6d4fc9a4fe0d0ed
Author: Tomaž Vajngerl 
Date:   Fri Jul 23 16:31:02 2021 +0900

drawinglayer: extract Prop. Value conversion from ViewInformation2D

ViewInformation2D doesn't need to know anything about the Sequence
of PropertyValue that is used for parameters when constructing it
through UNO API. This can be done outside of ViewInfromation2D and
it doesn't need to be responsible for that internally inside the
ViewInformation2D. With this we get ViewInformation2D, which is much
simpler and isn't prone to YAGNI.

Change-Id: I3836237a1d26e38145b52136c3204931ae7c6b79

commit ab82922fe1a4436ed19932580c86c5babe3f
Author: Tomaž Vajngerl 
Date:   Thu Jul 22 18:06:30 2021 +0900

drawinglayer: remove extendedInformation from ViewInformation2D

We actually never use extended information when normally using
the ViewInformation2D. The exception here is when we construct it
from property values, where the unknown property values are then
stored into the extended information sequence and then later
reconstructed when we convert it back to a sequence of property
values. Just for that case we don't neeed to expose the extended
information to the outside and create it, as that is then a
implementation detail for the UNO use case.

I am also not convinced we need it when creating ViewInformation2D
with the sequence of property values - it certantly not expected
that we need to preserve the property values at all, but that is
something that needs to be checked.

Change-Id: I3b8d533cd412aac8b89ca2921738d6487be5cf45

commit 1d8241386a82a2c6387745256a00512a04581358
Author: Tomaž Vajngerl 
Date:   Tue Jul 20 21:39:02 2021 +0900

svx: cleanup some forward decls, unneeded pragma once, whitespace

Change-Id: I26cd723e0ffe907a7aa8cb4f73ba6bfbd6db5fbc

commit 21875ba4e650f3e64f8fbfaa4dde65268c36023f
Author: Tomaž Vajngerl 
Date:   Fri Jul 9 18:55:15 2021 +0900

drawinglayer: make Primitive2DConteiner header only

Change-Id: I4755f97c32bea33a37ebc2b703a3e71a82508117



[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - 107 commits - accessibility/inc accessibility/Library_acc.mk accessibility/source basegfx/source basic/qa basic/source bridges/sour

2021-07-30 Thread Rafael Lima (via logerrit)
Rebased ref, commits from common ancestor:
commit 350f994d43660b75bfd21990edabdb1c8adb839e
Author: Rafael Lima 
AuthorDate: Fri Jul 30 15:53:01 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Fri Jul 30 15:53:01 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 1951014d9e7c5270904789c2964d35fca8487134
  - Rewrite SF_Services with Python support focusing user scripts only

Change-Id: Ib3748c3fbe43e25e3a9aa895519f08ec3b11b953
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/119612
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure 

diff --git a/helpcontent2 b/helpcontent2
index 4a07d8d492c5..1951014d9e7c 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 4a07d8d492c50f0e2db3200790f92e9e18bb5144
+Subproject commit 1951014d9e7c5270904789c2964d35fca8487134
commit 66fceca24ee0fccd03f23afc689d82c794a2d57e
Author: Noel Grandin 
AuthorDate: Fri Jul 30 14:29:27 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 15:23:52 2021 +0200

osl::Mutex->std::mutex in FmXDisposeListener

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

diff --git a/include/svx/fmtools.hxx b/include/svx/fmtools.hxx
index 1ead9069b4f0..869023f06f7f 100644
--- a/include/svx/fmtools.hxx
+++ b/include/svx/fmtools.hxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::awt { class XWindow; }
 namespace com::sun::star::beans { class XPropertySet; }
@@ -132,7 +133,7 @@ class SAL_WARN_UNUSED FmXDisposeListener
 friend class FmXDisposeMultiplexer;
 
 rtl::Reference m_pAdapter;
-osl::Mutex   m_aMutex;
+std::mutex   m_aMutex;
 
 public:
 virtual ~FmXDisposeListener();
diff --git a/svx/source/form/fmtools.cxx b/svx/source/form/fmtools.cxx
index e9f641309d0b..e8e0a5e1a328 100644
--- a/svx/source/form/fmtools.cxx
+++ b/svx/source/form/fmtools.cxx
@@ -235,7 +235,7 @@ FmXDisposeListener::~FmXDisposeListener()
 
 void FmXDisposeListener::setAdapter(FmXDisposeMultiplexer* pAdapter)
 {
-::osl::MutexGuard aGuard(m_aMutex);
+std::lock_guard aGuard(m_aMutex);
 m_pAdapter = pAdapter;
 }
 
commit 7b5922eb666e5f153060468b271d99510adb422e
Author: Noel Grandin 
AuthorDate: Fri Jul 30 10:10:55 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 14:07:43 2021 +0200

osl::Mutex->std::mutex in DispatchHelper

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

diff --git a/framework/source/services/dispatchhelper.cxx 
b/framework/source/services/dispatchhelper.cxx
index 380eab11ec67..cfa4a8a2bbe1 100644
--- a/framework/source/services/dispatchhelper.cxx
+++ b/framework/source/services/dispatchhelper.cxx
@@ -53,6 +53,7 @@ css::uno::Sequence SAL_CALL 
DispatchHelper::getSupportedServiceNames()
 */
 DispatchHelper::DispatchHelper(const 
css::uno::Reference& xContext)
 : m_xContext(xContext)
+, m_aBlockFlag(false)
 {
 }
 
@@ -91,11 +92,12 @@ css::uno::Any SAL_CALL DispatchHelper::executeDispatch(
 }
 
 // parse given URL
+css::uno::Reference xParser;
 /* SAFE { */
-osl::ClearableMutexGuard aReadLock(m_mutex);
-css::uno::Reference xParser
-= css::util::URLTransformer::create(m_xContext);
-aReadLock.clear();
+{
+std::lock_guard aReadLock(m_mutex);
+xParser = css::util::URLTransformer::create(m_xContext);
+}
 /* } SAFE */
 
 css::util::URL aURL;
@@ -148,16 +150,18 @@ DispatchHelper::executeDispatch(const 
css::uno::Reference

css::uno::UNO_QUERY);
 /* SAFE { */
 {
-osl::MutexGuard aWriteLock(m_mutex);
+std::lock_guard aWriteLock(m_mutex);
 m_xBroadcaster = xNotifyDispatch;
-m_aBlock.reset();
+m_aBlockFlag = false;
 }
 /* } SAFE */
 
 // dispatch it and wait for a notification
 // TODO/MBA: waiting in main thread?!
 xNotifyDispatch->dispatchWithNotification(aURL, aArguments, 
xListener);
-m_aBlock.wait(); // wait for result
+
+std::unique_lock aWriteLock(m_mutex);
+m_aBlock.wait(aWriteLock, [this] { return m_aBlockFlag; }); // 
wait for result
 }
 else
 {
@@ -180,9 +184,10 @@ DispatchHelper::executeDispatch(const 
css::uno::Reference
  */
 void SAL_CALL DispatchHelper::dispatchFinished(const 
css::frame::DispatchResultEvent& aResult)
 {
-osl::MutexGuard g(m_mutex);
+std::lock_guard g(m_mutex);
 m_aResult <<= aResult;
-m_aBlock.set();
+m_aBlockFlag = true;
+m_aBlock.notify_one();
 m_xBroadcaster.clea

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - 4 commits - drawinglayer/Library_drawinglayer.mk drawinglayer/source include/drawinginterface include/drawinglayer include/svx incl

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/Library_drawinglayer.mk |1 
 drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx |2 
 drawinglayer/source/geometry/viewinformation2d.cxx   |  311 
+++---
 drawinglayer/source/primitive2d/Primitive2DContainer.cxx |  123 ---
 drawinglayer/source/primitive2d/Tools.cxx|6 
 drawinglayer/source/primitive2d/baseprimitive2d.cxx  |4 
 drawinglayer/source/processor2d/baseprocessor2d.cxx  |4 
 drawinglayer/source/processor2d/contourextractor2d.cxx   |3 
 drawinglayer/source/processor2d/hittestprocessor2d.cxx   |3 
 drawinglayer/source/processor2d/linegeometryextractor2d.cxx  |3 
 drawinglayer/source/processor2d/textaspolygonextractor2d.cxx |3 
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx   |6 
 drawinglayer/source/processor2d/vclprocessor2d.cxx   |6 
 include/drawinginterface/BasicPrimitive2D.hxx|   26 
 include/drawinglayer/geometry/viewinformation2d.hxx  |   44 -
 include/drawinglayer/primitive2d/PolyPolygonColorPrimitive2D.hxx |5 
 include/drawinglayer/primitive2d/Primitive2DContainer.hxx|  115 +++
 include/svx/svdograf.hxx |   13 
 include/svx/svdpage.hxx  |2 
 include/svx/svdpagv.hxx  |   16 
 include/vcl/outdev.hxx   |5 
 sc/source/ui/view/output.cxx |3 
 svx/source/dialog/pagectrl.cxx   |3 
 svx/source/dialog/weldeditview.cxx   |3 
 svx/source/sdr/contact/objectcontact.cxx |2 
 svx/source/sdr/contact/objectcontactofobjlistpainter.cxx |3 
 svx/source/sdr/contact/objectcontactofpageview.cxx   |3 
 svx/source/sdr/contact/viewobjectcontactofpageobj.cxx|3 
 svx/source/sdr/overlay/overlaymanager.cxx|5 
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |3 
 sw/source/core/doc/notxtfrm.cxx  |3 
 sw/source/core/layout/paintfrm.cxx   |6 
 vcl/source/outdev/outdev.cxx |5 
 33 files changed, 295 insertions(+), 448 deletions(-)

New commits:
commit dc6dc274fd438ef2e0aaebcfdc95c13c6d20309b
Author: Tomaž Vajngerl 
AuthorDate: Fri Jul 23 16:31:02 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jul 30 23:08:12 2021 +0900

drawinglayer: extract Prop. Value conversion from ViewInformation2D

ViewInformation2D doesn't need to know anything about the Sequence
of PropertyValue that is used for parameters when constructing it
through UNO API. This can be done outside of ViewInfromation2D and
it doesn't need to be responsible for that internally inside the
ViewInformation2D. With this we get ViewInformation2D, which is much
simpler and isn't prone to YAGNI.

Change-Id: I3836237a1d26e38145b52136c3204931ae7c6b79

diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx 
b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 63b4ffd6986d..98ca81433f12 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -117,7 +117,7 @@ namespace drawinglayer::unorenderer
 MaximumQuadraticPixels = 50;
 }
 
-const geometry::ViewInformation2D 
aViewInformation2D(aViewInformationSequence);
+const auto aViewInformation2D = 
geometry::createViewInformation2D(aViewInformationSequence);
 const sal_uInt32 
nDiscreteWidth(basegfx::fround(o3tl::convert(fWidth, eRangeUnit, 
o3tl::Length::in) * DPI_X));
 const sal_uInt32 
nDiscreteHeight(basegfx::fround(o3tl::convert(fHeight, eRangeUnit, 
o3tl::Length::in) * DPI_Y));
 
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx 
b/drawinglayer/source/geometry/viewinformation2d.cxx
index 5b276cf52a59..6698f3b38b1f 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -84,162 +84,24 @@ protected:
 // Viewport, VisualizedPage or ViewTime
 uno::Sequence mxExtendedInformation;
 
-void impInterpretPropertyValues(const uno::Sequence& 
rViewParameters)
-{
-if (!rViewParameters.hasElements())
-return;
-
-const sal_Int32 nCount(rViewParameters.getLength());
-sal_Int32 nExtendedInsert(0);
-
-// prepare extended information for filtering. Maximum size is nCount
-mxExtendedInformation.realloc(nCount);
-
-for (sal_Int32 a(0); a

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

2021-07-30 Thread Attila Szűcs (via logerrit)
 sc/qa/extras/scpdfexport.cxx|   19 
 sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods |binary
 sc/source/ui/view/printfun.cxx  |6 +++--
 3 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit 8b2a2de2481843502f0566e773ed11532520bc70
Author: Attila Szűcs 
AuthorDate: Thu Jul 15 15:50:09 2021 +0200
Commit: László Németh 
CommitDate: Fri Jul 30 16:30:52 2021 +0200

tdf#64703 sc: fix regression of printing page breaks

After hidden rows or rows hidden by Autofilter,
printing removed the page breaks between the visible
rows, too. Now Calc supports WYSWYG: it prints all the
visible page breaks, which includes the page breaks
between the visible rows, and page breaks between the
hidden rows (multiple page breaks of a hidden row
sequence converted to a single page break).

This was a regression since LO 3.6, introducing
Autofilter with multichoice.

Co-authored-by: Tibor Nagy (NISZ)

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

diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx
index 6dfa426fddc0..825c4e248403 100644
--- a/sc/qa/extras/scpdfexport.cxx
+++ b/sc/qa/extras/scpdfexport.cxx
@@ -65,11 +65,13 @@ public:
 void testExportRange_Tdf120161();
 void testExportFitToPage_Tdf103516();
 void testUnoCommands_Tdf120161();
+void testTdf64703_hiddenPageBreak();
 
 CPPUNIT_TEST_SUITE(ScPDFExportTest);
 CPPUNIT_TEST(testExportRange_Tdf120161);
 CPPUNIT_TEST(testExportFitToPage_Tdf103516);
 CPPUNIT_TEST(testUnoCommands_Tdf120161);
+CPPUNIT_TEST(testTdf64703_hiddenPageBreak);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -437,6 +439,23 @@ void ScPDFExportTest::testUnoCommands_Tdf120161()
 }
 }
 
+void ScPDFExportTest::testTdf64703_hiddenPageBreak()
+{
+mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY)
+  + "tdf64703_hiddenPageBreak.ods",
+  "com.sun.star.sheet.SpreadsheetDocument");
+uno::Reference xModel(mxComponent, uno::UNO_QUERY);
+
+// A1:A11: 4-page export
+{
+ScRange range1(0, 0, 0, 0, 10, 0);
+std::shared_ptr pPDFFile = exportToPDF(xModel, range1);
+bool bFound = false;
+CPPUNIT_ASSERT(hasTextInPdf(pPDFFile, "/Count 4>>", bFound));
+CPPUNIT_ASSERT_EQUAL(true, bFound);
+}
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(ScPDFExportTest);
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods 
b/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods
new file mode 100644
index ..87f110915d69
Binary files /dev/null and 
b/sc/qa/extras/testdocuments/tdf64703_hiddenPageBreak.ods differ
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index e02e4badcab6..0fc79a76b397 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -3197,8 +3197,10 @@ void PrintPageRanges::calculate(ScDocument& rDoc,
 nLastVisibleRow = nLastRow;
 }
 else
-// skip all hidden rows.
-nRow = nLastRow;
+{
+// Skip all hidden rows until next pagebreak.
+nRow = std::min(nLastRow, nNextPageBreak - 1);
+}
 }
 
 if (!bVisRow)


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

2021-07-30 Thread Caolán McNamara (via logerrit)
 bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit d4d8fb12e81152ad75d1ab4cabfa300aa982e589
Author: Caolán McNamara 
AuthorDate: Thu Jul 29 12:42:17 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 30 16:39:21 2021 +0200

cid#1489551 silence Uninitialized scalar variable

and

cid#1489552 Uninitialized scalar variable

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

diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx 
b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
index 355a0a7500d7..f36678ed3695 100644
--- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx
@@ -224,9 +224,8 @@ classify_argument( typelib_TypeDescriptionReference 
*pTypeRef, enum x86_64_reg_c
 bool x86_64::examine_argument( typelib_TypeDescriptionReference *pTypeRef, int 
&nUsedGPR, int &nUsedSSE ) noexcept
 {
 enum x86_64_reg_class classes[MAX_CLASSES];
-int n;
-
-n = classify_argument( pTypeRef, classes, 0 );
+// coverity[uninit_use_in_call : FALSE]
+int n = classify_argument( pTypeRef, classes, 0 );
 
 if ( n == 0 )
 return false;
@@ -255,12 +254,14 @@ bool x86_64::return_in_hidden_param( 
typelib_TypeDescriptionReference *pTypeRef
 if (pTypeRef->eTypeClass == typelib_TypeClass_VOID) {
 return false;
 }
-x86_64_reg_class classes[MAX_CLASSES];
+enum x86_64_reg_class classes[MAX_CLASSES];
+// coverity[uninit_use_in_call : FALSE]
 return classify_argument(pTypeRef, classes, 0) == 0;
 }
 
 x86_64::ReturnKind x86_64::getReturnKind(typelib_TypeDescriptionReference * 
type) noexcept {
 x86_64_reg_class classes[MAX_CLASSES];
+// coverity[uninit_use_in_call : FALSE]
 auto const n = classify_argument(type, classes, 0);
 if (n == 0) {
 return ReturnKind::Memory;
@@ -276,9 +277,8 @@ x86_64::ReturnKind 
x86_64::getReturnKind(typelib_TypeDescriptionReference * type
 void x86_64::fill_struct( typelib_TypeDescriptionReference *pTypeRef, const 
sal_uInt64 *pGPR, const double *pSSE, void *pStruct ) noexcept
 {
 enum x86_64_reg_class classes[MAX_CLASSES];
-int n;
-
-n = classify_argument( pTypeRef, classes, 0 );
+// coverity[uninit_use_in_call : FALSE]
+int n = classify_argument( pTypeRef, classes, 0 );
 
 sal_uInt64 *pStructAlign = static_cast( pStruct );
 for ( int i = 0; i != n; ++i )


[Libreoffice-commits] core.git: basctl/source canvas/source cppcanvas/source cui/source desktop/source drawinglayer/source editeng/source emfio/source filter/source include/tools sc/source sfx2/source

2021-07-30 Thread Caolán McNamara (via logerrit)
 basctl/source/basicide/baside2.cxx  |4 +-
 basctl/source/dlged/dlged.cxx   |4 +-
 canvas/source/cairo/cairo_canvasfont.cxx|2 -
 canvas/source/directx/dx_textlayout_drawhelper.cxx  |4 +-
 canvas/source/opengl/ogl_canvashelper.cxx   |2 -
 canvas/source/vcl/canvasfont.cxx|2 -
 canvas/source/vcl/spritecanvashelper.cxx|2 -
 canvas/source/vcl/spritehelper.cxx  |2 -
 cppcanvas/source/inc/outdevstate.hxx|2 -
 cppcanvas/source/mtfrenderer/mtftools.cxx   |   26 ++--
 cui/source/dialogs/cuicharmap.cxx   |2 -
 desktop/source/splash/splash.cxx|2 -
 drawinglayer/source/primitive2d/textlayoutdevice.cxx|2 -
 drawinglayer/source/tools/wmfemfhelper.cxx  |6 +--
 editeng/source/editeng/editdoc.cxx  |2 -
 editeng/source/items/bulitem.cxx|2 -
 editeng/source/outliner/outliner.cxx|4 +-
 emfio/source/reader/mtftools.cxx|6 +--
 filter/source/pdf/pdfexport.cxx |4 +-
 filter/source/svg/svgfontexport.cxx |2 -
 filter/source/svg/svgwriter.cxx |8 ++--
 include/tools/fontenum.hxx  |   10 +-
 sc/source/ui/view/gridwin4.cxx  |2 -
 sc/source/ui/view/output2.cxx   |2 -
 sfx2/source/control/charwin.cxx |2 -
 slideshow/source/engine/rehearsetimingsactivity.cxx |2 -
 starmath/source/dialog.cxx  |   10 +++---
 starmath/source/format.cxx  |4 +-
 starmath/source/rect.cxx|2 -
 starmath/source/symbol.cxx  |4 +-
 starmath/source/unomodel.cxx|2 -
 starmath/source/utility.cxx |2 -
 starmath/source/view.cxx|4 +-
 starmath/source/visitors.cxx|4 +-
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |4 +-
 svx/source/dialog/charmap.cxx   |4 +-
 svx/source/dialog/fntctrl.cxx   |4 +-
 svx/source/dialog/searchcharmap.cxx |2 -
 svx/source/svdraw/svdfmtf.cxx   |4 +-
 svx/source/svdraw/svdpdf.cxx|4 +-
 sw/source/core/text/inftxt.cxx  |2 -
 sw/source/core/text/porrst.cxx  |2 -
 sw/source/core/txtnode/swfont.cxx   |4 +-
 sw/source/uibase/uiview/srcview.cxx |2 -
 vcl/qa/cppunit/font.cxx |6 +--
 vcl/qa/cppunit/svm/svmtest.cxx  |2 -
 vcl/source/app/help.cxx |2 -
 vcl/source/edit/texteng.cxx |2 -
 vcl/source/filter/eps/eps.cxx   |8 ++--
 vcl/source/filter/idxf/dxf2mtf.cxx  |2 -
 vcl/source/filter/imet/ios2met.cxx  |2 -
 vcl/source/filter/ipict/ipict.cxx   |2 -
 vcl/source/filter/wmf/emfwr.cxx |   12 +--
 vcl/source/filter/wmf/wmfwr.cxx |   22 -
 vcl/source/font/font.cxx|2 -
 vcl/source/gdi/metaact.cxx  |4 +-
 vcl/source/gdi/mtfxmldump.cxx   |7 +---
 vcl/source/gdi/pdfwriter_impl.cxx   |   12 +++
 vcl/source/outdev/font.cxx  |   10 +++---
 vcl/source/outdev/outdevstate.cxx   |2 -
 vcl/source/outdev/text.cxx  |8 ++--
 vcl/workben/vcldemo.cxx |2 -
 62 files changed, 147 insertions(+), 132 deletions(-)

New commits:
commit 8689bd5490b473a7ffb149bbe5f7f0683f679c72
Author: Caolán McNamara 
AuthorDate: Thu Jul 29 20:49:29 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 30 16:40:56 2021 +0200

convert TextAlign to scoped enum

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

diff --git a/basctl/source/basicide/baside2.cxx 
b/basctl/source/basicide/baside2.cxx
index 4e562420ef19..d5f1e07e6e4f 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -121,7 +121,7 @@ void lcl_PrintHeader( Printer* pPrinter, sal_uInt16 nPages, 
sal_uInt16 nCurPage,
 
 vcl::Font aFont( aO

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

2021-07-30 Thread Caolán McNamara (via logerrit)
 editeng/source/misc/hangulhanja.cxx |2 +-
 include/editeng/hangulhanja.hxx |2 +-
 sw/inc/hhcwrp.hxx   |2 +-
 sw/source/uibase/lingu/hhcwrp.cxx   |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b7322c23a69d0727d0ecb3185d6516ca457e2f14
Author: Caolán McNamara 
AuthorDate: Fri Jul 30 11:37:40 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 30 16:41:27 2021 +0200

cid#1399290 silence Uncaught exception

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

diff --git a/editeng/source/misc/hangulhanja.cxx 
b/editeng/source/misc/hangulhanja.cxx
index c6057413d2d6..9ea8fba5d8ca 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -947,7 +947,7 @@ namespace editeng
 {
 }
 
-HangulHanjaConversion::~HangulHanjaConversion( )
+HangulHanjaConversion::~HangulHanjaConversion() COVERITY_NOEXCEPT_FALSE
 {
 }
 
diff --git a/include/editeng/hangulhanja.hxx b/include/editeng/hangulhanja.hxx
index cbbeaef658f0..f2a5dcf9992f 100644
--- a/include/editeng/hangulhanja.hxx
+++ b/include/editeng/hangulhanja.hxx
@@ -117,7 +117,7 @@ namespace editeng
 bool _bIsInteractive
 );
 
-virtual ~HangulHanjaConversion( );
+virtual ~HangulHanjaConversion() COVERITY_NOEXCEPT_FALSE;
 
 // converts the whole document
 voidConvertDocument();
diff --git a/sw/inc/hhcwrp.hxx b/sw/inc/hhcwrp.hxx
index f565401d830c..2a6bcb688d27 100644
--- a/sw/inc/hhcwrp.hxx
+++ b/sw/inc/hhcwrp.hxx
@@ -91,7 +91,7 @@ public:
 sal_Int32 nConvOptions, bool bIsInteractive,
 bool bStart, bool bOther, bool bSelection );
 
-virtual ~SwHHCWrapper() override;
+virtual ~SwHHCWrapper() COVERITY_NOEXCEPT_FALSE override;
 
 voidConvert();
 };
diff --git a/sw/source/uibase/lingu/hhcwrp.cxx 
b/sw/source/uibase/lingu/hhcwrp.cxx
index 7e78777fef51..fd0d7adee111 100644
--- a/sw/source/uibase/lingu/hhcwrp.cxx
+++ b/sw/source/uibase/lingu/hhcwrp.cxx
@@ -107,7 +107,7 @@ SwHHCWrapper::SwHHCWrapper(
 {
 }
 
-SwHHCWrapper::~SwHHCWrapper()
+SwHHCWrapper::~SwHHCWrapper() COVERITY_NOEXCEPT_FALSE
 {
 m_pConvArgs.reset();
 


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

2021-07-30 Thread Mike Kaganski (via logerrit)
 sd/qa/unit/import-tests.cxx |   38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

New commits:
commit 1119f5fb482c82124f99bbeffe6b507a377247de
Author: Mike Kaganski 
AuthorDate: Fri Jul 30 15:15:11 2021 +0200
Commit: Mike Kaganski 
CommitDate: Fri Jul 30 17:18:47 2021 +0200

Use u16string_view here

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

diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 77f7c90b34c9..79122bb60afa 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -402,42 +402,42 @@ the test, and re-running; it should break.
 */
 void SdImportTest::testDocumentLayout()
 {
-static const struct { const char *pInput, *pDump; sal_Int32 nFormat; 
sal_Int32 nExportType; } aFilesToCompare[] =
+static const struct { std::u16string_view sInput, sDump; sal_Int32 
nFormat; sal_Int32 nExportType; } aFilesToCompare[] =
 {
-{ "odp/shapes-test.odp", "xml/shapes-test_page", ODP, -1 },
-{ "fdo47434.pptx", "xml/fdo47434_", PPTX, -1 },
-{ "n758621.ppt", "xml/n758621_", PPT, -1 },
-{ "fdo64586.ppt", "xml/fdo64586_", PPT, -1 },
-{ "n819614.pptx", "xml/n819614_", PPTX, -1 },
-{ "n820786.pptx", "xml/n820786_", PPTX, -1 },
-{ "n762695.pptx", "xml/n762695_", PPTX, -1 },
-{ "n593612.pptx", "xml/n593612_", PPTX, -1 },
-{ "fdo71434.pptx", "xml/fdo71434_", PPTX, -1 },
-{ "n902652.pptx", "xml/n902652_", PPTX, -1 },
-{ "tdf90403.pptx", "xml/tdf90403_", PPTX, -1 },
-{ "tdf90338.odp", "xml/tdf90338_", ODP, PPTX },
-{ "tdf92001.odp", "xml/tdf92001_", ODP, PPTX },
+{ u"odp/shapes-test.odp", u"xml/shapes-test_page", ODP, -1 },
+{ u"fdo47434.pptx", u"xml/fdo47434_", PPTX, -1 },
+{ u"n758621.ppt", u"xml/n758621_", PPT, -1 },
+{ u"fdo64586.ppt", u"xml/fdo64586_", PPT, -1 },
+{ u"n819614.pptx", u"xml/n819614_", PPTX, -1 },
+{ u"n820786.pptx", u"xml/n820786_", PPTX, -1 },
+{ u"n762695.pptx", u"xml/n762695_", PPTX, -1 },
+{ u"n593612.pptx", u"xml/n593612_", PPTX, -1 },
+{ u"fdo71434.pptx", u"xml/fdo71434_", PPTX, -1 },
+{ u"n902652.pptx", u"xml/n902652_", PPTX, -1 },
+{ u"tdf90403.pptx", u"xml/tdf90403_", PPTX, -1 },
+{ u"tdf90338.odp", u"xml/tdf90338_", ODP, PPTX },
+{ u"tdf92001.odp", u"xml/tdf92001_", ODP, PPTX },
 // GCC -mfpmath=387 rounding issues in lclPushMarkerProperties
 // (oox/source/drawingml/lineproperties.cxx); see mail sub-thread starting at
 //  "Re: Test File: sc/qa/unit/data/functions/fods/chiinv.fods:
 // fails with Assertion" for how "-mfpmath=sse -msse2" would fix that:
 #if !(defined LINUX && defined X86)
-{ "tdf100491.pptx", "xml/tdf100491_", PPTX, -1 },
+{ u"tdf100491.pptx", u"xml/tdf100491_", PPTX, -1 },
 #endif
-{ "tdf109317.pptx", "xml/tdf109317_", PPTX, ODP},
-// { "pptx/n828390.pptx", "pptx/xml/n828390_", PPTX, PPTX }, // Example
+{ u"tdf109317.pptx", u"xml/tdf109317_", PPTX, ODP},
+// { u"pptx/n828390.pptx", u"pptx/xml/n828390_", PPTX, PPTX }, // 
Example
 };
 
 for ( int i = 0; i < static_cast< int >( SAL_N_ELEMENTS( aFilesToCompare ) 
); ++i )
 {
 int const nUpdateMe = -1; // index of test we want to update; 
supposedly only when the test is created
 
-sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc( 
u"/sd/qa/unit/data/" ) + OUString::createFromAscii( aFilesToCompare[i].pInput 
), aFilesToCompare[i].nFormat );
+sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc( 
u"/sd/qa/unit/data/" ) + aFilesToCompare[i].sInput, aFilesToCompare[i].nFormat 
);
 if( aFilesToCompare[i].nExportType >= 0 )
 xDocShRef = saveAndReload( xDocShRef.get(), 
aFilesToCompare[i].nExportType );
 compareWithShapesDump( xDocShRef,
-OUString(m_directories.getPathFromSrc( u"/sd/qa/unit/data/" ) 
+ OUString::createFromAscii( aFilesToCompare[i].pDump )),
+OUString(m_directories.getPathFromSrc( u"/sd/qa/unit/data/" ) 
+ aFilesToCompare[i].sDump),
 i == nUpdateMe );
 }
 }


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

2021-07-30 Thread Noel Grandin (via logerrit)
 include/svx/fmsrcimp.hxx |8 +++-
 svx/source/form/fmsrcimp.cxx |6 +-
 2 files changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 9edb0f8641b5c01fff57cb5b5c492f3f525d49c8
Author: Noel Grandin 
AuthorDate: Fri Jul 30 14:22:41 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 17:53:23 2021 +0200

osl::Mutex->std::atomic in FmSearchEngine

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

diff --git a/include/svx/fmsrcimp.hxx b/include/svx/fmsrcimp.hxx
index 68cd77b17fe2..1c9d55829e69 100644
--- a/include/svx/fmsrcimp.hxx
+++ b/include/svx/fmsrcimp.hxx
@@ -26,11 +26,11 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -193,12 +193,10 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC FmSearchEngine final
 
 // The link we broadcast the progress and the result to
 Link  m_aProgressHandler;
-boolm_bSearchingCurrently : 1;  // is an 
(asynchronous) search running?
-boolm_bCancelAsynchRequest : 1; // should be cancelled?
-::osl::Mutexm_aCancelAsynchAccess;  // access 
to_bCancelAsynchRequest (technically only
-// relevant for 
m_eMode == SM_USETHREAD)
+std::atomic   m_bCancelAsynchRequest; // should be cancelled?
 
 // parameters for the search
+boolm_bSearchingCurrently : 1;  // is an (asynchronous) search 
running?
 boolm_bFormatter : 1;   // use field formatting
 boolm_bForward : 1; // direction
 boolm_bWildcard : 1;// wildcard search
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index 60613663eda5..eb292abd8ce4 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -547,8 +547,8 @@ FmSearchEngine::FmSearchEngine(const Reference< 
XComponentContext >& _rxContext,
 ,m_xClonedIterator(m_xOriginalIterator, true)
 ,m_eSearchForType(SearchFor::String)
 ,m_srResult(SearchResult::Found)
-,m_bSearchingCurrently(false)
 ,m_bCancelAsynchRequest(false)
+,m_bSearchingCurrently(false)
 ,m_bFormatter(true) // this must be consistent with m_xSearchCursor, 
which is generally == m_xOriginalIterator
 ,m_bForward(false)
 ,m_bWildcard(false)
@@ -915,18 +915,14 @@ IMPL_LINK(FmSearchEngine, OnNewRecordCount, sal_Int32, 
theCounter, void)
 
 bool FmSearchEngine::CancelRequested()
 {
-m_aCancelAsynchAccess.acquire();
 bool bReturn = m_bCancelAsynchRequest;
-m_aCancelAsynchAccess.release();
 return bReturn;
 }
 
 
 void FmSearchEngine::CancelSearch()
 {
-m_aCancelAsynchAccess.acquire();
 m_bCancelAsynchRequest = true;
-m_aCancelAsynchAccess.release();
 }
 
 


[Libreoffice-commits] core.git: tsan-suppress.txt

2021-07-30 Thread Noel Grandin (via logerrit)
 tsan-suppress.txt |   37 +
 1 file changed, 37 insertions(+)

New commits:
commit f1600c169bd2114505344a100cdc383539f76dbc
Author: Noel Grandin 
AuthorDate: Fri Jul 30 15:22:30 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 17:54:00 2021 +0200

TSAN suppression file

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

diff --git a/tsan-suppress.txt b/tsan-suppress.txt
new file mode 100644
index ..d6130b285df8
--- /dev/null
+++ b/tsan-suppress.txt
@@ -0,0 +1,37 @@
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+# Use via environment variable TSAN_OPTIONS=suppressions=.../tsan-suppress.txt
+
+# There looks to be a lock ordering problem here, but I can't see how it could
+# actually be hit in practice.
+deadlock:cppuhelper::ServiceManager::disposing()
+deadlock:cppuhelper::ServiceManager::loadImplementation
+
+# Ignore stuff in external DBUS library
+# Some kind of dbus lock issue when we call it from psp::CUPSManager
+deadlock:_dbus_lock
+
+# inside an assert so I don't care
+race:cppu::OWeakConnectionPoint::acquire
+race:AffineBridge::v_enter
+race:__vsnprintf_chk
+
+# right now, I'm not interested in deadlocks at all, too many false+
+deadlock:
+
+# This is checking  SAL_STRING_IS_STATIC, which is safe because that is 
written at compile time
+race:rtl::str::acquire<_rtl_uString>
+race:rtl::str::release<_rtl_uString>
+
+# I've convinced myself this is a false+, caused by ping-ponging the buffer 
between two
+# threads, but I might be wrong
+race:XBufferedThreadedStream::getNextBlock
+
+# not introduced in stuff the embedded JVM does
+race:libjvm.so


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

2021-07-30 Thread Noel Grandin (via logerrit)
 package/source/zipapi/XBufferedThreadedStream.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4bf1fbc9572741c665ae200303e929d908896820
Author: Noel Grandin 
AuthorDate: Fri Jul 30 11:48:45 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 17:54:32 2021 +0200

tsan:data race in XBufferedThreadedStream

cannot read from maInUseBuffer without holding the lock

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

diff --git a/package/source/zipapi/XBufferedThreadedStream.cxx 
b/package/source/zipapi/XBufferedThreadedStream.cxx
index ceb5f6895ba1..c36a1845be6c 100644
--- a/package/source/zipapi/XBufferedThreadedStream.cxx
+++ b/package/source/zipapi/XBufferedThreadedStream.cxx
@@ -93,10 +93,10 @@ void XBufferedThreadedStream::produce()
  */
 const Buffer& XBufferedThreadedStream::getNextBlock()
 {
+std::unique_lock aGuard( maBufferProtector );
 const sal_Int32 nBufSize = maInUseBuffer.getLength();
 if( nBufSize <= 0 || mnOffset >= nBufSize )
 {
-std::unique_lock aGuard( maBufferProtector );
 if( mnOffset >= nBufSize )
 maUsedBuffers.push( maInUseBuffer );
 


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

2021-07-30 Thread Tünde Tóth (via logerrit)
 sc/inc/dbdata.hxx|8 ++--
 sc/qa/unit/uicalc/uicalc.cxx |   26 +
 sc/source/core/tool/dbdata.cxx   |   77 ++-
 sc/source/core/tool/refupdat.cxx |   10 -
 4 files changed, 74 insertions(+), 47 deletions(-)

New commits:
commit 0c0444c44107f1a18f23dd0833d462d8dbf56569
Author: Tünde Tóth 
AuthorDate: Wed Jul 21 16:04:37 2021 +0200
Commit: Eike Rathke 
CommitDate: Fri Jul 30 17:57:10 2021 +0200

tdf#126926 sc DBData: delete the database range

if some part of the reference became invalid.

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

diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx
index c1e714fc3e9f..8ecd2faf602f 100644
--- a/sc/inc/dbdata.hxx
+++ b/sc/inc/dbdata.hxx
@@ -208,10 +208,9 @@ public:
 voidSetModified(bool bMod)  { bModified = bMod; }
 
 voidUpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
-voidUpdateReference(const ScDocument* pDoc, UpdateRefMode 
eUpdateRefMode,
-SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
-SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
-SCCOL nDx, SCROW nDy, SCTAB nDz);
+boolUpdateReference(const ScDocument* pDoc, UpdateRefMode 
eUpdateRefMode, SCCOL nCol1,
+SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW 
nRow2, SCTAB nTab2,
+SCCOL nDx, SCROW nDy, SCTAB nDz);
 
 void ExtendDataArea(const ScDocument& rDoc);
 void CalcSaveFilteredCount(SCSIZE nNonFilteredRowCount);
@@ -296,6 +295,7 @@ public:
 void deleteOnTab(SCTAB nTab);
 ScDBData* getByRange(const ScRange& rRange);
 void insert(ScDBData* p);
+void erase(const iterator& itr);
 bool empty() const;
 bool has( const ScDBData* p ) const;
 bool operator== (const AnonDBs& r) const;
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index c0825914e3fc..5ddf2165a29b 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -1717,6 +1717,32 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, 
testTdf126540_GridToggleModifiesTheDocument)
 CPPUNIT_ASSERT(pDocSh->IsModified());
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126926)
+{
+mxComponent = loadFromDesktop("private:factory/scalc");
+ScModelObj* pModelObj = dynamic_cast(mxComponent.get());
+CPPUNIT_ASSERT(pModelObj);
+ScDocument* pDoc = pModelObj->GetDocument();
+CPPUNIT_ASSERT(pDoc);
+
+insertStringToCell(*pModelObj, "A1", "1");
+insertStringToCell(*pModelObj, "A2", "2");
+insertStringToCell(*pModelObj, "B1", "3");
+insertStringToCell(*pModelObj, "B2", "4");
+
+ScDBData* pDBData = new ScDBData("testDB", 0, 0, 0, 1, 1);
+bool bInserted
+= 
pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr(pDBData));
+CPPUNIT_ASSERT(bInserted);
+
+goToCell("A1:B1");
+
+dispatchCommand(mxComponent, ".uno:DeleteColumns", {});
+
+ScDBCollection* pDBs = pDoc->GetDBCollection();
+CPPUNIT_ASSERT(pDBs->empty());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index ba68d1aa0d8a..4e38b2aaa676 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -586,7 +586,7 @@ void ScDBData::UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos)
 
 }
 
-void ScDBData::UpdateReference(const ScDocument* pDoc, UpdateRefMode 
eUpdateRefMode,
+bool ScDBData::UpdateReference(const ScDocument* pDoc, UpdateRefMode 
eUpdateRefMode,
 SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
 SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
 SCCOL nDx, SCROW nDy, SCTAB nDz)
@@ -601,10 +601,13 @@ void ScDBData::UpdateReference(const ScDocument* pDoc, 
UpdateRefMode eUpdateRefM
 theTab2 = theTab1;
 SCCOL nOldCol1 = theCol1, nOldCol2 = theCol2;
 
-bool bDoUpdate = ScRefUpdate::Update( pDoc, eUpdateRefMode,
-nCol1,nRow1,nTab1, 
nCol2,nRow2,nTab2, nDx,nDy,nDz,
-theCol1,theRow1,theTab1, 
theCol2,theRow2,theTab2 ) != UR_NOTHING;
-if (bDoUpdate)
+ScRefUpdateRes eRet
+= ScRefUpdate::Update(pDoc, eUpdateRefMode, nCol1, nRow1, nTab1, 
nCol2, nRow2, nTab2, nDx,
+  nDy, nDz, theCol1, theRow1, theTab1, theCol2, 
theRow2, theTab2);
+
+bool bDoUpdate = eRet != UR_NOTHING;
+
+if (bDoUpdate && eRet != UR_INVALID)
 {
 // MoveTo() invalidates column names via SetArea(); adjust, remember 
and set new.
 AdjustTableColumnNames( eUpdateRefMode, nDx, nCol1, nOldCol1, 
nOldCol2, theCol1, theCol2);
@@ -639,6 +642,8 @@ void ScDBData::Upd

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

2021-07-30 Thread Jan-Marek Glogowski (via logerrit)
 vcl/inc/qt5/Qt5Frame.hxx  |7 +++
 vcl/inc/qt5/Qt5Widget.hxx |1 +
 vcl/qt5/Qt5Frame.cxx  |   10 ++
 vcl/qt5/Qt5Widget.cxx |   24 +---
 4 files changed, 31 insertions(+), 11 deletions(-)

New commits:
commit 9dcf5816c90e9819861332f11e014ef7b78e2fe7
Author: Jan-Marek Glogowski 
AuthorDate: Fri Jul 30 05:25:37 2021 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Fri Jul 30 20:24:39 2021 +0200

tdf#143580 Qt5 don't use Qt::Popup for FLOAT wins

Main problem is, that Qt::Popup grabs the focus and therefore
generates a focus-out event for the combobox, which then closes
the just shown popup window. The grab happens inside QWidget
private code and there is no way around it. But instead of
"faking" Qt::Tooltip, this uses Qt::Widget with additional flags.

Regression from commit 7e6fee830116823b9cd8e46d6962df4ea2bc1ea6
("Qt5 fix Qt::Popup window handling").

Change-Id: Ia1f8e33d98f7ec36cf1ebc350886121dfaadd658
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119691
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index ed82c2a7a8fb..01b93ad3b825 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -210,6 +210,7 @@ public:
 inline bool CallCallback(SalEvent nEvent, const void* pEvent) const;
 
 void setInputLanguage(LanguageType);
+inline bool isPopup() const;
 };
 
 inline bool Qt5Frame::CallCallback(SalEvent nEvent, const void* pEvent) const
@@ -218,4 +219,10 @@ inline bool Qt5Frame::CallCallback(SalEvent nEvent, const 
void* pEvent) const
 return SalFrame::CallCallback(nEvent, pEvent);
 }
 
+inline bool Qt5Frame::isPopup() const
+{
+return ((m_nStyle & SalFrameStyleFlags::FLOAT)
+&& !(m_nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx
index 7bf7ead6ae9a..60db1a306efd 100644
--- a/vcl/inc/qt5/Qt5Widget.hxx
+++ b/vcl/inc/qt5/Qt5Widget.hxx
@@ -75,6 +75,7 @@ class Qt5Widget : public QWidget
 
 void inputMethodEvent(QInputMethodEvent*) override;
 QVariant inputMethodQuery(Qt::InputMethodQuery) const override;
+static void closePopup();
 
 public:
 Qt5Widget(Qt5Frame& rFrame, Qt::WindowFlags f = Qt::WindowFlags());
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 02032d149d29..a4c78d1b71a7 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -146,9 +146,11 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags 
nStyle, bool bUseCairo)
 aWinFlags |= Qt::Tool | Qt::FramelessWindowHint;
 else if (nStyle & SalFrameStyleFlags::TOOLTIP)
 aWinFlags |= Qt::ToolTip;
-else if ((nStyle & SalFrameStyleFlags::FLOAT)
- && !(nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION))
-aWinFlags |= Qt::Popup;
+// Can't use Qt::Popup, because it grabs the input focus and generates
+// a focus-out event, reaking the compbo box. This used to map to
+// Qt::ToolTip, which doesn't feel that correct...
+else if (isPopup())
+aWinFlags = Qt::Widget | Qt::FramelessWindowHint | 
Qt::BypassWindowManagerHint;
 else if (nStyle & SalFrameStyleFlags::TOOLWINDOW)
 aWinFlags |= Qt::Tool;
 // top level windows can't be transient in Qt, so make them dialogs, 
if they have a parent. At least
@@ -426,7 +428,7 @@ void Qt5Frame::Show(bool bVisible, bool bNoActivate)
 pSalInst->RunInMainThread([this, bVisible, bNoActivate]() {
 asChild()->setVisible(bVisible);
 asChild()->raise();
-if (!bNoActivate)
+if (!bNoActivate && !isPopup())
 {
 asChild()->activateWindow();
 asChild()->setFocus();
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index ebb11cef51ff..864701340ad3 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -179,11 +180,10 @@ void Qt5Widget::handleMouseButtonEvent(const Qt5Frame& 
rFrame, const QMouseEvent
 
 void Qt5Widget::mousePressEvent(QMouseEvent* pEvent)
 {
-if ((windowFlags() & Qt::Popup)
-&& !geometry().translated(geometry().topLeft() * 
-1).contains(pEvent->pos()))
-close();
-else
-handleMousePressEvent(m_rFrame, pEvent);
+handleMousePressEvent(m_rFrame, pEvent);
+if (m_rFrame.isPopup()
+|| !geometry().translated(geometry().topLeft() * 
-1).contains(pEvent->pos()))
+closePopup();
 }
 
 void Qt5Widget::mouseReleaseEvent(QMouseEvent* pEvent)
@@ -593,10 +593,21 @@ void Qt5Widget::keyReleaseEvent(QKeyEvent* pEvent)
 
 void Qt5Widget::focusInEvent(QFocusEvent*) { 
m_rFrame.CallCallback(SalEvent::GetFocus, nullptr); }
 
+void Qt5Widget::closePopup()
+{
+VclPtr pFirstFloat = 

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

2021-07-30 Thread Noel Grandin (via logerrit)
 include/vcl/ctrl.hxx  |6 +-
 include/vcl/toolkit/controllayout.hxx |2 
 vcl/inc/controldata.hxx   |   38 --
 vcl/inc/pch/precompiled_vcl.hxx   |1 
 vcl/source/control/button.cxx |8 +-
 vcl/source/control/combobox.cxx   |4 -
 vcl/source/control/ctrl.cxx   |   91 --
 vcl/source/control/edit.cxx   |4 -
 vcl/source/control/fixed.cxx  |   12 ++--
 vcl/source/control/imp_listbox.cxx|   10 +--
 vcl/source/control/listbox.cxx|4 -
 vcl/source/control/spinfld.cxx|4 -
 vcl/source/control/tabctrl.cxx|   11 +---
 vcl/source/toolkit/group.cxx  |9 +--
 14 files changed, 80 insertions(+), 124 deletions(-)

New commits:
commit 942dcd6d8684ffdbc9bc67030c502e9db1965eb5
Author: Noel Grandin 
AuthorDate: Thu Jul 29 19:54:05 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 30 20:35:46 2021 +0200

flatten vcl::ImplControlData

the struct is already visible in the headers, so it's not a pimpl
pattern, and it's only two pointers, so no point in allocating
separately.

The tdf#91081 bug comment I removed is no longer relevant,
this general class of problem was solved with the introduction
of VclPtr.

Change-Id: Ie5d896baf0167273f8936930dd65891919c5bf7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119679
Tested-by: Noel Grandin 
Reviewed-by: Noel Grandin 

diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index 90fd8b7684b8..cde59c6f9e0f 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -26,14 +26,14 @@
 #include 
 
 // forward
-namespace vcl { struct ImplControlData; }
 class StyleSettings;
-
+namespace vcl { struct ControlLayoutData; }
 
 class VCL_DLLPUBLIC Control : public vcl::Window
 {
 protected:
-std::unique_ptr mpControlData;
+mutable std::unique_ptr  mpLayoutData;
+VclPtrmpReferenceDevice;
 
 private:
 boolmbHasControlFocus;
diff --git a/include/vcl/toolkit/controllayout.hxx 
b/include/vcl/toolkit/controllayout.hxx
index d47514460fe9..44b721c17dab 100644
--- a/include/vcl/toolkit/controllayout.hxx
+++ b/include/vcl/toolkit/controllayout.hxx
@@ -29,6 +29,8 @@
 #include 
 #include 
 
+class Control;
+
 namespace vcl
 {
 
diff --git a/vcl/inc/controldata.hxx b/vcl/inc/controldata.hxx
deleted file mode 100644
index ed6e3a368967..
--- a/vcl/inc/controldata.hxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_VCL_INC_CONTROLDATA_HXX
-#define INCLUDED_VCL_INC_CONTROLDATA_HXX
-
-#include 
-#include 
-
-namespace vcl
-{
-struct ImplControlData
-{
-mutable std::unique_ptr  mpLayoutData;
-VclPtrmpReferenceDevice;
-};
-
-} // namespace vcl
-
-#endif // INCLUDED_VCL_INC_CONTROLDATA_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx
index ea6ad604224d..a7ef0ce02759 100644
--- a/vcl/inc/pch/precompiled_vcl.hxx
+++ b/vcl/inc/pch/precompiled_vcl.hxx
@@ -254,7 +254,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index ac867a292533..68b368b56c0e 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -39,7 +40,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -1340,7 +1340,7 @@ void PushButton::KeyUp( const KeyEvent& rKEvt )
 
 void PushButton::FillLayoutData() const
 {
-mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+mpLayoutData.reset( new vcl::ControlLayoutData );
 const_cast(this)->Invalidate();
 }
 
@@ -2435,7 +2435,7 @@ void RadioButton::KeyUp( const KeyEvent& rKEvt )
 
 void RadioButton::FillLayoutData() const
 {
-mpControlData->mpLayoutData.reset( new vcl::ControlLayoutData );
+mpLayoutData.res

[Libreoffice-commits] core.git: dictionaries

2021-07-30 Thread Julien Nabet (via logerrit)
 dictionaries |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c694d9029b33cc574abd6b2cce8842d70d46cf5f
Author: Julien Nabet 
AuthorDate: Fri Jul 30 20:37:29 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Fri Jul 30 20:37:29 2021 +0200

Update git submodules

* Update dictionaries from branch 'master'
  to 8cd20580b995fc6d93fbb1cdabd329a26c6ec85c
  - tdf#139523: LightProof makes Python complain on FutureWarnings for pt-BR

Deal also with deprecated + fix some regexps

Change-Id: Ifd5bfed9a1f256bd357d29bac46ea51515b522f0
Reviewed-on: https://gerrit.libreoffice.org/c/dictionaries/+/119693
Tested-by: Olivier Hallot 
Reviewed-by: Olivier Hallot 
Reviewed-by: Julien Nabet 

diff --git a/dictionaries b/dictionaries
index 67fc52d45b9c..8cd20580b995 16
--- a/dictionaries
+++ b/dictionaries
@@ -1 +1 @@
-Subproject commit 67fc52d45b9c5e965f176eb917428c724c076ba0
+Subproject commit 8cd20580b995fc6d93fbb1cdabd329a26c6ec85c


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

2021-07-30 Thread Caolán McNamara (via logerrit)
 sc/source/ui/docshell/dbdocfun.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4677345e3695bac158bb04048b4d5c608ed764b4
Author: Caolán McNamara 
AuthorDate: Fri Jul 30 11:16:04 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jul 30 21:01:16 2021 +0200

cid#1489568 Dereference null return value

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

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 3cdee27ffb1d..6c374e1b09a3 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -602,7 +602,8 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& 
rSortParam,
 ScTabViewShell* pTabViewShell = 
dynamic_cast(pViewShell);
 if (pTabViewShell && pTabViewShell->GetDocId() == 
pSomeViewForThisDoc->GetDocId())
 {
-
pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)->invalidateByIndex(nStartRow);
+if (ScPositionHelper* pPosHelper = 
pTabViewShell->GetViewData().GetLOKHeightHelper(nTab))
+pPosHelper->invalidateByIndex(nStartRow);
 }
 pViewShell = SfxViewShell::GetNext(*pViewShell);
 }


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - vcl/inc vcl/qt5

2021-07-30 Thread Jan-Marek Glogowski (via logerrit)
 vcl/inc/qt5/Qt5Frame.hxx  |7 +++
 vcl/inc/qt5/Qt5Widget.hxx |1 +
 vcl/qt5/Qt5Frame.cxx  |   10 ++
 vcl/qt5/Qt5Widget.cxx |   24 +---
 4 files changed, 31 insertions(+), 11 deletions(-)

New commits:
commit ea2f19827db330a21c7962bdd13b1b838821bd4c
Author: Jan-Marek Glogowski 
AuthorDate: Fri Jul 30 05:25:37 2021 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jul 30 22:19:21 2021 +0200

tdf#143580 Qt5 don't use Qt::Popup for FLOAT wins

Main problem is, that Qt::Popup grabs the focus and therefore
generates a focus-out event for the combobox, which then closes
the just shown popup window. The grab happens inside QWidget
private code and there is no way around it. But instead of
"faking" Qt::Tooltip, this uses Qt::Widget with additional flags.

Regression from commit 7e6fee830116823b9cd8e46d6962df4ea2bc1ea6
("Qt5 fix Qt::Popup window handling").

Change-Id: Ia1f8e33d98f7ec36cf1ebc350886121dfaadd658
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119691
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 
(cherry picked from commit 9dcf5816c90e9819861332f11e014ef7b78e2fe7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119621
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index ed82c2a7a8fb..01b93ad3b825 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -210,6 +210,7 @@ public:
 inline bool CallCallback(SalEvent nEvent, const void* pEvent) const;
 
 void setInputLanguage(LanguageType);
+inline bool isPopup() const;
 };
 
 inline bool Qt5Frame::CallCallback(SalEvent nEvent, const void* pEvent) const
@@ -218,4 +219,10 @@ inline bool Qt5Frame::CallCallback(SalEvent nEvent, const 
void* pEvent) const
 return SalFrame::CallCallback(nEvent, pEvent);
 }
 
+inline bool Qt5Frame::isPopup() const
+{
+return ((m_nStyle & SalFrameStyleFlags::FLOAT)
+&& !(m_nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION));
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx
index 7bf7ead6ae9a..60db1a306efd 100644
--- a/vcl/inc/qt5/Qt5Widget.hxx
+++ b/vcl/inc/qt5/Qt5Widget.hxx
@@ -75,6 +75,7 @@ class Qt5Widget : public QWidget
 
 void inputMethodEvent(QInputMethodEvent*) override;
 QVariant inputMethodQuery(Qt::InputMethodQuery) const override;
+static void closePopup();
 
 public:
 Qt5Widget(Qt5Frame& rFrame, Qt::WindowFlags f = Qt::WindowFlags());
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 02032d149d29..a4c78d1b71a7 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -146,9 +146,11 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags 
nStyle, bool bUseCairo)
 aWinFlags |= Qt::Tool | Qt::FramelessWindowHint;
 else if (nStyle & SalFrameStyleFlags::TOOLTIP)
 aWinFlags |= Qt::ToolTip;
-else if ((nStyle & SalFrameStyleFlags::FLOAT)
- && !(nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION))
-aWinFlags |= Qt::Popup;
+// Can't use Qt::Popup, because it grabs the input focus and generates
+// a focus-out event, reaking the compbo box. This used to map to
+// Qt::ToolTip, which doesn't feel that correct...
+else if (isPopup())
+aWinFlags = Qt::Widget | Qt::FramelessWindowHint | 
Qt::BypassWindowManagerHint;
 else if (nStyle & SalFrameStyleFlags::TOOLWINDOW)
 aWinFlags |= Qt::Tool;
 // top level windows can't be transient in Qt, so make them dialogs, 
if they have a parent. At least
@@ -426,7 +428,7 @@ void Qt5Frame::Show(bool bVisible, bool bNoActivate)
 pSalInst->RunInMainThread([this, bVisible, bNoActivate]() {
 asChild()->setVisible(bVisible);
 asChild()->raise();
-if (!bNoActivate)
+if (!bNoActivate && !isPopup())
 {
 asChild()->activateWindow();
 asChild()->setFocus();
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index ebb11cef51ff..864701340ad3 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -46,6 +46,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -179,11 +180,10 @@ void Qt5Widget::handleMouseButtonEvent(const Qt5Frame& 
rFrame, const QMouseEvent
 
 void Qt5Widget::mousePressEvent(QMouseEvent* pEvent)
 {
-if ((windowFlags() & Qt::Popup)
-&& !geometry().translated(geometry().topLeft() * 
-1).contains(pEvent->pos()))
-close();
-else
-handleMousePressEvent(m_rFrame, pEvent);
+handleMousePressEvent(m_rFrame, pEvent);
+if (m_rFrame.isPopup()
+|| !geometry().translated(geometry().topLeft() * 
-1).contains(pEvent->pos()))
+closePopup();
 }
 
 void Qt5Widget::mouseReleaseEvent(QMouseEvent* pEvent)
@@ -593,10 +593,21 @@ void Qt5Widget::keyReleaseEvent(QKeyEvent* pEven

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore' - 7 commits - basegfx/Library_basegfx.mk basegfx/source drawinglayer/inc drawinglayer/Library_drawinglayercore.mk drawinglayer/Library

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit e854636eb8cefc2b9954b81311935541eee85dc0
Author: Tomaž Vajngerl 
AuthorDate: Fri Apr 2 16:11:50 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri Jul 30 23:27:41 2021 +0900

drawinglayer: ITextLayouter and use it as a VisitingParameter

Change-Id: I04aa42716c2bde4a2652d10892b6b2392a20fb3b

diff --git a/basegfx/Library_basegfx.mk b/basegfx/Library_basegfx.mk
index 8359969ae80c..957f1b45ac08 100644
--- a/basegfx/Library_basegfx.mk
+++ b/basegfx/Library_basegfx.mk
@@ -80,6 +80,7 @@ $(eval $(call gb_Library_add_exception_objects,basegfx,\
 basegfx/source/vector/b2dvector \
 basegfx/source/vector/b2ivector \
 basegfx/source/vector/b3dvector \
+basegfx/source/text/UnoTextLayouter \
 ))
 
 
diff --git a/basegfx/source/text/UnoTextLayouter.cxx 
b/basegfx/source/text/UnoTextLayouter.cxx
new file mode 100644
index ..e3f48264c624
--- /dev/null
+++ b/basegfx/source/text/UnoTextLayouter.cxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include 
+#include 
+
+using namespace css;
+
+namespace gfx
+{
+// css::lang::XUnoTunnel
+UNO3_GETIMPLEMENTATION_IMPL(UnoTextLayouter);
+
+std::shared_ptr
+getTextLayouterFromUno(uno::Reference const& 
xTextLayouter)
+{
+gfx::UnoTextLayouter* pUnoTextLayouter
+= 
comphelper::getUnoTunnelImplementation(xTextLayouter);
+if (pUnoTextLayouter)
+return pUnoTextLayouter->getTextLayouter();
+
+return std::shared_ptr();
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/attribute/fontattribute.cxx 
b/drawinglayer/source/attribute/fontattribute.cxx
index e423b8367f1c..b14397fe9d87 100644
--- a/drawinglayer/source/attribute/fontattribute.cxx
+++ b/drawinglayer/source/attribute/fontattribute.cxx
@@ -112,15 +112,31 @@ FontAttribute::FontAttribute()
 {
 }
 
-FontAttribute::FontAttribute(const FontAttribute&) = default;
+FontAttribute::FontAttribute(const FontAttribute& rOther)
+: mpFontAttribute(rOther.mpFontAttribute)
+{
+}
+
+FontAttribute::FontAttribute(FontAttribute&& rOther) noexcept
+: mpFontAttribute(std::move(rOther.mpFontAttribute))
+{
+}
 
-FontAttribute::FontAttribute(FontAttribute&&) = default;
+FontAttribute::~FontAttribute() {}
 
-FontAttribute::~FontAttribute() = default;
+FontAttribute& FontAttribute::operator=(const FontAttribute& rOther)
+{
+mpFontAttribute = rOther.mpFontAttribute;
 
-FontAttribute& FontAttribute::operator=(const FontAttribute&) = default;
+return *this;
+}
 
-FontAttribute& FontAttribute::operator=(FontAttribute&&) = default;
+FontAttribute& FontAttribute::operator=(FontAttribute&& rOther) noexcept
+{
+mpFontAttribute = std::move(rOther.mpFontAttribute);
+
+return *this;
+}
 
 bool FontAttribute::operator==(const FontAttribute& rCandidate) const
 {
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx 
b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index f0e677c0cedb..78e2ea02a0eb 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -118,7 +119,8 @@ namespace drawinglayer::unorenderer
 }
 
 const geometry::ViewInformation2D 
aViewInformation2D(aViewInformationSequence);
-primitive2d::VisitingParameters 
aVisitingParameters(aViewInformation2D);
+auto pTextLayouter = 
std::make_shared();
+primitive2d::VisitingParameters 
aVisitingParameters(aViewInformation2D, pTextLayouter);
 const sal_uInt32 
nDiscreteWidth(basegfx::fround(o3tl::convert(fWidth, eRangeUnit, 
o3tl::Length::in) * DPI_X));
 const sal_uInt32 
nDiscreteHeight(basegfx::fround(o3tl::convert(fHeight, eRangeUnit, 
o3tl::Length::in) * DPI_Y));
 
diff --git a/drawinglayer/source/primitive2d/baseprimitive2d.cxx 
b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
index 085ccc1b8c58..7ec09582886f 100644
--- a/drawinglayer/source/primitive2d/baseprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/baseprimitive2d.cxx
@@ -23,7 +23,10 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
+#include 
 
 using namespace css;
 
@@ -85,12 +88,39 @@ void 
BasePrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& /*rVis
 {
 }
 
+namespace
+{
+std::shared_ptr
+getTextLayouter(const uno::Sequence& rProperties)
+{
+std::shared_ptr pTextLayouter;
+
+if (!rProperties.hasElements())
+return pTextLayouter;
+
+for (const 

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - 3 commits - drawinglayer/source include/drawinglayer include/svx sc/source svx/source sw/source

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 41f181585835b6e697a7bccd9d0cb92b7f739298
Author: Tomaž Vajngerl 
AuthorDate: Fri Jul 23 16:31:02 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 10:16:49 2021 +0900

drawinglayer: extract Prop. Value conversion from ViewInformation2D

ViewInformation2D doesn't need to know anything about the Sequence
of PropertyValue that is used for parameters when constructing it
through UNO API. This can be done outside of ViewInfromation2D and
it doesn't need to be responsible for that internally inside the
ViewInformation2D. With this we get ViewInformation2D, which is much
simpler and isn't prone to YAGNI.

Change-Id: I3836237a1d26e38145b52136c3204931ae7c6b79

diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx 
b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 63b4ffd6986d..98ca81433f12 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -117,7 +117,7 @@ namespace drawinglayer::unorenderer
 MaximumQuadraticPixels = 50;
 }
 
-const geometry::ViewInformation2D 
aViewInformation2D(aViewInformationSequence);
+const auto aViewInformation2D = 
geometry::createViewInformation2D(aViewInformationSequence);
 const sal_uInt32 
nDiscreteWidth(basegfx::fround(o3tl::convert(fWidth, eRangeUnit, 
o3tl::Length::in) * DPI_X));
 const sal_uInt32 
nDiscreteHeight(basegfx::fround(o3tl::convert(fHeight, eRangeUnit, 
o3tl::Length::in) * DPI_Y));
 
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx 
b/drawinglayer/source/geometry/viewinformation2d.cxx
index 5b276cf52a59..6698f3b38b1f 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -84,162 +84,24 @@ protected:
 // Viewport, VisualizedPage or ViewTime
 uno::Sequence mxExtendedInformation;
 
-void impInterpretPropertyValues(const uno::Sequence& 
rViewParameters)
-{
-if (!rViewParameters.hasElements())
-return;
-
-const sal_Int32 nCount(rViewParameters.getLength());
-sal_Int32 nExtendedInsert(0);
-
-// prepare extended information for filtering. Maximum size is nCount
-mxExtendedInformation.realloc(nCount);
-
-for (sal_Int32 a(0); a < nCount; a++)
-{
-const beans::PropertyValue& rProp = rViewParameters[a];
-
-if (rProp.Name == g_PropertyName_ReducedDisplayQuality)
-{
-// extra information; add to filtered information
-mxExtendedInformation[nExtendedInsert++] = rProp;
-
-// for performance reasons, also cache content locally
-bool bSalBool(false);
-rProp.Value >>= bSalBool;
-mbReducedDisplayQuality = bSalBool;
-}
-else if (rProp.Name == g_PropertyName_ObjectTransformation)
-{
-css::geometry::AffineMatrix2D aAffineMatrix2D;
-rProp.Value >>= aAffineMatrix2D;
-
basegfx::unotools::homMatrixFromAffineMatrix(maObjectTransformation,
- aAffineMatrix2D);
-}
-else if (rProp.Name == g_PropertyName_ViewTransformation)
-{
-css::geometry::AffineMatrix2D aAffineMatrix2D;
-rProp.Value >>= aAffineMatrix2D;
-
basegfx::unotools::homMatrixFromAffineMatrix(maViewTransformation, 
aAffineMatrix2D);
-}
-else if (rProp.Name == g_PropertyName_Viewport)
-{
-css::geometry::RealRectangle2D aViewport;
-rProp.Value >>= aViewport;
-maViewport = 
basegfx::unotools::b2DRectangleFromRealRectangle2D(aViewport);
-}
-else if (rProp.Name == g_PropertyName_Time)
-{
-rProp.Value >>= mfViewTime;
-}
-else if (rProp.Name == g_PropertyName_VisualizedPage)
-{
-rProp.Value >>= mxVisualizedPage;
-}
-else
-{
-// extra information; add to filtered information
-mxExtendedInformation[nExtendedInsert++] = rProp;
-}
-}
-
-// extra information size is now known; realloc to final size
-mxExtendedInformation.realloc(nExtendedInsert);
-}
-
-void impFillViewInformationFromContent()
-{
-const bool 
bObjectTransformationUsed(!maObjectTransformation.isIdentity());
-const bool bViewTransformationUsed(!maViewTransformation.isIdentity());
-const bool bViewportUsed(!maViewport.isEmpty());
-const bool bTimeUsed(0.0 < mfViewTime);
-const b

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

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
 include/svx/svdograf.hxx |   13 ++---
 include/svx/svdpage.hxx  |2 +-
 include/svx/svdpagv.hxx  |   16 +---
 3 files changed, 8 insertions(+), 23 deletions(-)

New commits:
commit ea269c0a04ede8206ba15fd77d26bbd99ec44c75
Author: Tomaž Vajngerl 
AuthorDate: Tue Jul 20 21:39:02 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 04:10:49 2021 +0200

svx: cleanup some forward decls, unneeded pragma once, whitespace

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

diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index bf7e329d5442..69ce11533caa 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -29,17 +29,8 @@
 #include 
 #include 
 
-namespace sdr
-{
-namespace properties
-{
-class GraphicProperties;
-} // end of namespace properties
-namespace contact
-{
-class ViewObjectContactOfGraphic;
-} // end of namespace contact
-} // end of namespace sdr
+namespace sdr::properties { class GraphicProperties; }
+namespace sdr::contact { class ViewObjectContactOfGraphic; }
 
 /**
  * Options for GetTransformedGraphic()
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index d5552a7c72a4..fc6936a95282 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -64,7 +64,7 @@ private:
 SdrObjList(const SdrObjList& rSrcList) = delete;
 SdrObjList &operator=(const SdrObjList& rSrcList) = delete;
 
-::std::vector   maList;
+std::vector maList;
 
 tools::RectanglemaSdrObjListOutRect;
 tools::RectanglemaSdrObjListSnapRect;
diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx
index ab9bfa5625ae..3aceb48d1d4b 100644
--- a/include/svx/svdpagv.hxx
+++ b/include/svx/svdpagv.hxx
@@ -42,20 +42,16 @@ class SdrView;
 class SdrPageObj;
 class SdrPageView;
 
-namespace sdr
+namespace sdr::contact
 {
-namespace contact
-{
-class ViewObjectContactRedirector;
-class DisplayInfo;
-class ViewObjectContactRedirector;
-} // end of namespace contact
-} // end of namespace sdr
+class ViewObjectContactRedirector;
+class DisplayInfo;
+class ViewObjectContactRedirector;
+}
 
 // typedefs for a list of SdrPageWindow
 class SdrPageWindow;
 
-
 class SVXCORE_DLLPUBLIC SdrPageView
 {
 private:
@@ -255,6 +251,4 @@ public:
 const Color& GetApplicationDocumentColor() const { return maDocumentColor;}
 };
 
-#pragma once
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: drawinglayer/source include/drawinglayer sc/source svx/source sw/source

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/source/geometry/viewinformation2d.cxx   |   51 +--
 drawinglayer/source/processor2d/contourextractor2d.cxx   |3 
 drawinglayer/source/processor2d/hittestprocessor2d.cxx   |3 
 drawinglayer/source/processor2d/linegeometryextractor2d.cxx  |3 
 drawinglayer/source/processor2d/textaspolygonextractor2d.cxx |3 
 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx   |6 -
 drawinglayer/source/processor2d/vclprocessor2d.cxx   |6 -
 include/drawinglayer/geometry/viewinformation2d.hxx  |   13 --
 sc/source/ui/view/output.cxx |3 
 svx/source/dialog/pagectrl.cxx   |3 
 svx/source/dialog/weldeditview.cxx   |3 
 svx/source/sdr/contact/objectcontactofobjlistpainter.cxx |3 
 svx/source/sdr/contact/objectcontactofpageview.cxx   |3 
 svx/source/sdr/contact/viewobjectcontactofpageobj.cxx|3 
 svx/source/sdr/overlay/overlaymanager.cxx|3 
 sw/source/core/doc/notxtfrm.cxx  |3 
 sw/source/core/layout/paintfrm.cxx   |6 -
 17 files changed, 25 insertions(+), 93 deletions(-)

New commits:
commit 13efd364c046b8064f03cb23bb232f42a892d601
Author: Tomaž Vajngerl 
AuthorDate: Thu Jul 22 18:06:30 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 06:23:54 2021 +0200

drawinglayer: remove extendedInformation from ViewInformation2D

We actually never use extended information when normally using
the ViewInformation2D. The exception here is when we construct it
from property values, where the unknown property values are then
stored into the extended information sequence and then later
reconstructed when we convert it back to a sequence of property
values. Just for that case we don't neeed to expose the extended
information to the outside and create it, as that is then a
implementation detail for the UNO use case.

I am also not convinced we need it when creating ViewInformation2D
with the sequence of property values - it certantly not expected
that we need to preserve the property values at all, but that is
something that needs to be checked.

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

diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx 
b/drawinglayer/source/geometry/viewinformation2d.cxx
index 5067a33f2f75..5b276cf52a59 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -221,51 +221,25 @@ public:
 ImpViewInformation2D(const basegfx::B2DHomMatrix& rObjectTransformation,
  const basegfx::B2DHomMatrix& rViewTransformation,
  const basegfx::B2DRange& rViewport,
- const uno::Reference& rxDrawPage, 
double fViewTime,
- const uno::Sequence& 
rExtendedParameters)
+ const uno::Reference& rxDrawPage, 
double fViewTime)
 : maObjectTransformation(rObjectTransformation)
 , maViewTransformation(rViewTransformation)
-, maObjectToViewTransformation()
-, maInverseObjectToViewTransformation()
 , maViewport(rViewport)
-, maDiscreteViewport()
 , mxVisualizedPage(rxDrawPage)
 , mfViewTime(fViewTime)
 , mbReducedDisplayQuality(false)
-, mxViewInformation()
-, mxExtendedInformation()
 {
-impInterpretPropertyValues(rExtendedParameters);
 }
 
 explicit ImpViewInformation2D(const uno::Sequence& 
rViewParameters)
-: maObjectTransformation()
-, maViewTransformation()
-, maObjectToViewTransformation()
-, maInverseObjectToViewTransformation()
-, maViewport()
-, maDiscreteViewport()
-, mxVisualizedPage()
-, mfViewTime()
-, mbReducedDisplayQuality(false)
+: mbReducedDisplayQuality(false)
 , mxViewInformation(rViewParameters)
-, mxExtendedInformation()
 {
 impInterpretPropertyValues(rViewParameters);
 }
 
 ImpViewInformation2D()
-: maObjectTransformation()
-, maViewTransformation()
-, maObjectToViewTransformation()
-, maInverseObjectToViewTransformation()
-, maViewport()
-, maDiscreteViewport()
-, mxVisualizedPage()
-, mfViewTime()
-, mbReducedDisplayQuality(false)
-, mxViewInformation()
-, mxExtendedInformation()
+: mbReducedDisplayQuality(false)
 {
 }
 
@@ -330,19 +304,13 @@ public:
 return mxViewInformation;
 }
 
-const uno::Sequence& 
getExtendedInformationSequence() const
-{
-return mxExtendedInformation;
-}
-

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

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
 drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx |2 
 drawinglayer/source/geometry/viewinformation2d.cxx   |  284 ---
 drawinglayer/source/primitive2d/Tools.cxx|6 
 drawinglayer/source/primitive2d/baseprimitive2d.cxx  |4 
 drawinglayer/source/processor2d/baseprocessor2d.cxx  |4 
 include/drawinglayer/geometry/viewinformation2d.hxx  |   38 -
 svx/source/sdr/contact/objectcontact.cxx |2 
 svx/source/sdr/overlay/overlaymanager.cxx|2 
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |3 
 9 files changed, 141 insertions(+), 204 deletions(-)

New commits:
commit d5765ae2f9236c8ce32d61f05f46d9d76b991544
Author: Tomaž Vajngerl 
AuthorDate: Fri Jul 23 16:31:02 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 06:35:49 2021 +0200

drawinglayer: extract Prop. Value conversion from ViewInformation2D

ViewInformation2D doesn't need to know anything about the Sequence
of PropertyValue that is used for parameters when constructing it
through UNO API. This can be done outside of ViewInfromation2D and
it doesn't need to be responsible for that internally inside the
ViewInformation2D. With this we get ViewInformation2D, which is much
simpler and isn't prone to YAGNI.

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

diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx 
b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 63b4ffd6986d..98ca81433f12 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -117,7 +117,7 @@ namespace drawinglayer::unorenderer
 MaximumQuadraticPixels = 50;
 }
 
-const geometry::ViewInformation2D 
aViewInformation2D(aViewInformationSequence);
+const auto aViewInformation2D = 
geometry::createViewInformation2D(aViewInformationSequence);
 const sal_uInt32 
nDiscreteWidth(basegfx::fround(o3tl::convert(fWidth, eRangeUnit, 
o3tl::Length::in) * DPI_X));
 const sal_uInt32 
nDiscreteHeight(basegfx::fround(o3tl::convert(fHeight, eRangeUnit, 
o3tl::Length::in) * DPI_Y));
 
diff --git a/drawinglayer/source/geometry/viewinformation2d.cxx 
b/drawinglayer/source/geometry/viewinformation2d.cxx
index 5b276cf52a59..94def8eda93c 100644
--- a/drawinglayer/source/geometry/viewinformation2d.cxx
+++ b/drawinglayer/source/geometry/viewinformation2d.cxx
@@ -84,162 +84,24 @@ protected:
 // Viewport, VisualizedPage or ViewTime
 uno::Sequence mxExtendedInformation;
 
-void impInterpretPropertyValues(const uno::Sequence& 
rViewParameters)
-{
-if (!rViewParameters.hasElements())
-return;
-
-const sal_Int32 nCount(rViewParameters.getLength());
-sal_Int32 nExtendedInsert(0);
-
-// prepare extended information for filtering. Maximum size is nCount
-mxExtendedInformation.realloc(nCount);
-
-for (sal_Int32 a(0); a < nCount; a++)
-{
-const beans::PropertyValue& rProp = rViewParameters[a];
-
-if (rProp.Name == g_PropertyName_ReducedDisplayQuality)
-{
-// extra information; add to filtered information
-mxExtendedInformation[nExtendedInsert++] = rProp;
-
-// for performance reasons, also cache content locally
-bool bSalBool(false);
-rProp.Value >>= bSalBool;
-mbReducedDisplayQuality = bSalBool;
-}
-else if (rProp.Name == g_PropertyName_ObjectTransformation)
-{
-css::geometry::AffineMatrix2D aAffineMatrix2D;
-rProp.Value >>= aAffineMatrix2D;
-
basegfx::unotools::homMatrixFromAffineMatrix(maObjectTransformation,
- aAffineMatrix2D);
-}
-else if (rProp.Name == g_PropertyName_ViewTransformation)
-{
-css::geometry::AffineMatrix2D aAffineMatrix2D;
-rProp.Value >>= aAffineMatrix2D;
-
basegfx::unotools::homMatrixFromAffineMatrix(maViewTransformation, 
aAffineMatrix2D);
-}
-else if (rProp.Name == g_PropertyName_Viewport)
-{
-css::geometry::RealRectangle2D aViewport;
-rProp.Value >>= aViewport;
-maViewport = 
basegfx::unotools::b2DRectangleFromRealRectangle2D(aViewport);
-}
-else if (rProp.Name == g_PropertyName_Time)
-{
-rProp.Value >>= mfViewTime;
-}
-else if (rProp.

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - 3 commits - drawinglayer/CppunitTest_drawinglayer_border.mk drawinglayer/inc drawinglayer/Library_drawinglayercore.mk drawinglayer/

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
 Repository.mk |1 
 drawinglayer/CppunitTest_drawinglayer_border.mk   |1 
 drawinglayer/Library_drawinglayer.mk  |5 
 drawinglayer/Library_drawinglayercore.mk  |   49 
 drawinglayer/Module_drawinglayer.mk   |1 
 drawinglayer/inc/pch/precompiled_drawinglayer.hxx |7 
 drawinglayer/inc/pch/precompiled_drawinglayercore.cxx |   12 
 drawinglayer/inc/pch/precompiled_drawinglayercore.hxx |   46 
 drawinglayer/inc/primitive2d/cropprimitive2d.hxx  |2 
 drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx|   13 
 drawinglayer/inc/primitive2d/textlineprimitive2d.hxx  |2 
 drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx |4 
 drawinglayer/inc/primitive2d/wallpaperprimitive2d.hxx |4 
 drawinglayer/qa/unit/border.cxx   |   10 
 drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx  |3 
 drawinglayer/source/primitive2d/BufferedDecompositionPrimitive2D.cxx  |9 
 drawinglayer/source/primitive2d/PolyPolygonColorPrimitive2D.cxx   |4 
 drawinglayer/source/primitive2d/PolyPolygonGradientPrimitive2D.cxx|2 
 drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx |2 
 drawinglayer/source/primitive2d/PolyPolygonHairlinePrimitive2D.cxx|6 
 drawinglayer/source/primitive2d/PolyPolygonHatchPrimitive2D.cxx   |2 
 drawinglayer/source/primitive2d/PolyPolygonMarkerPrimitive2D.cxx  |6 
 drawinglayer/source/primitive2d/PolyPolygonSelectionPrimitive2D.cxx   |9 
 drawinglayer/source/primitive2d/PolyPolygonStrokePrimitive2D.cxx  |6 
 drawinglayer/source/primitive2d/Primitive2DContainer.cxx  |5 
 drawinglayer/source/primitive2d/Tools.cxx |7 
 drawinglayer/source/primitive2d/animatedprimitive2d.cxx   |   12 
 drawinglayer/source/primitive2d/backgroundcolorprimitive2d.cxx|   16 
 drawinglayer/source/primitive2d/baseprimitive2d.cxx   |   40 
 drawinglayer/source/primitive2d/bitmapprimitive2d.cxx |3 
 drawinglayer/source/primitive2d/borderlineprimitive2d.cxx |2 
 drawinglayer/source/primitive2d/controlprimitive2d.cxx|   16 
 drawinglayer/source/primitive2d/cropprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/discretebitmapprimitive2d.cxx |2 
 drawinglayer/source/primitive2d/discreteshadowprimitive2d.cxx |6 
 drawinglayer/source/primitive2d/embedded3dprimitive2d.cxx |8 
 drawinglayer/source/primitive2d/epsprimitive2d.cxx|4 
 drawinglayer/source/primitive2d/fillgradientprimitive2d.cxx   |4 
 drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx|4 
 drawinglayer/source/primitive2d/fillhatchprimitive2d.cxx  |   10 
 drawinglayer/source/primitive2d/glowprimitive2d.cxx   |5 
 drawinglayer/source/primitive2d/graphicprimitive2d.cxx|5 
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx  |6 
 drawinglayer/source/primitive2d/gridprimitive2d.cxx   |   16 
 drawinglayer/source/primitive2d/groupprimitive2d.cxx  |2 
 drawinglayer/source/primitive2d/helplineprimitive2d.cxx   |9 
 drawinglayer/source/primitive2d/hiddengeometryprimitive2d.cxx |7 
 drawinglayer/source/primitive2d/markerarrayprimitive2d.cxx|8 
 drawinglayer/source/primitive2d/maskprimitive2d.cxx   |2 
 drawinglayer/source/primitive2d/mediaprimitive2d.cxx  |8 
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx   |8 
 drawinglayer/source/primitive2d/pagepreviewprimitive2d.cxx|6 
 drawinglayer/source/primitive2d/patternfillprimitive2d.cxx|   22 
 drawinglayer/source/primitive2d/pointarrayprimitive2d.cxx |2 
 drawinglayer/source/primitive2d/polygonprimitive2d.cxx|   56 
 drawinglayer/source/primitive2d/primitivetools2d.cxx  |   26 
 drawinglayer/source/primitive2d/sceneprimitive2d.cxx  |   23 
 drawinglayer/source/primitive2d/shadowprimitive2d.cxx |6 
 drawinglayer/source/primitive2d/softedgeprimitive2d.cxx   |7 
 drawinglayer/source/primitive2d/svggradientprimitive2d.cxx|   12 
 drawinglayer/source/primitive2d/textdecoratedprimitive2d.cxx  |8 
 drawinglayer/source/primitive2d/texteffectprimitive2d.cxx |   26 
 drawinglayer/source/primitive2d/textlineprimitive2d.cxx   |2 
 drawinglayer/source/p

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - 19 commits - basctl/source bridges/source canvas/source cppcanvas/source cui/source desktop/source dictionaries drawinglayer/Cppuni

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 6422706f1513fcffcc1d8be4957db42c1f26abe8
Author: Tomaž Vajngerl 
AuthorDate: Tue Feb 23 13:23:32 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 13:38:34 2021 +0900

drawinglayer: make VisitingParameters constructor explicit

This discovers a bunch of cases where previously the
ViewInformation was implicitly converted into a VisitingParameter.

Change-Id: Ice233e9d3c9d12c5da284e190281a1d94059f49f

diff --git a/drawinglayer/qa/unit/border.cxx b/drawinglayer/qa/unit/border.cxx
index a3f7029b7350..801912f75825 100644
--- a/drawinglayer/qa/unit/border.cxx
+++ b/drawinglayer/qa/unit/border.cxx
@@ -66,9 +66,10 @@ CPPUNIT_TEST_FIXTURE(DrawinglayerBorderTest, 
testDoubleDecompositionSolid)
  
aStrokeAttribute));
 
 // Decompose it into polygons.
-drawinglayer::geometry::ViewInformation2D aView;
+const drawinglayer::geometry::ViewInformation2D aView;
+const drawinglayer::primitive2d::VisitingParameters 
aVisitingParameters(aView);
 drawinglayer::primitive2d::Primitive2DContainer aContainer;
-aBorder->get2DDecomposition(aContainer, aView);
+aBorder->get2DDecomposition(aContainer, aVisitingParameters);
 
 // Make sure it results in two borders as it's a double one.
 CPPUNIT_ASSERT_EQUAL(static_cast(2), aContainer.size());
@@ -91,8 +92,9 @@ CPPUNIT_TEST_FIXTURE(DrawinglayerBorderTest, 
testDoublePixelProcessing)
 // Create a pixel processor.
 ScopedVclPtrInstance pDev;
 drawinglayer::geometry::ViewInformation2D aView;
-std::unique_ptr pProcessor(
-
drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(*pDev, aView));
+const drawinglayer::primitive2d::VisitingParameters 
aVisitingParameters(aView);
+auto pProcessor = 
drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
+*pDev, aVisitingParameters);
 CPPUNIT_ASSERT(pProcessor);
 GDIMetaFile aMetaFile;
 // Start recording after the processor is created, so we can test the 
pixel processor.
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx 
b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 98ca81433f12..59c934b88d17 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -118,6 +118,7 @@ namespace drawinglayer::unorenderer
 }
 
 const auto aViewInformation2D = 
geometry::createViewInformation2D(aViewInformationSequence);
+primitive2d::VisitingParameters 
aVisitingParameters(aViewInformation2D);
 const sal_uInt32 
nDiscreteWidth(basegfx::fround(o3tl::convert(fWidth, eRangeUnit, 
o3tl::Length::in) * DPI_X));
 const sal_uInt32 
nDiscreteHeight(basegfx::fround(o3tl::convert(fHeight, eRangeUnit, 
o3tl::Length::in) * DPI_Y));
 
@@ -139,7 +140,7 @@ namespace drawinglayer::unorenderer
 BitmapEx aBitmapEx(
 convertToBitmapEx(
 xEmbedSeq,
-aViewInformation2D,
+aVisitingParameters,
 nDiscreteWidth,
 nDiscreteHeight,
 MaximumQuadraticPixels));
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx 
b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index 42559bfd4390..0cfa014bb13e 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -100,17 +100,19 @@ namespace drawinglayer::primitive2d
 // see if buffering is wanted. If so, create buffered content in 
given resolution
 if(0 != mnDiscreteWidth && 0 != mnDiscreteHeight)
 {
-const geometry::ViewInformation2D aViewInformation2D;
 const primitive2d::Primitive2DReference xEmbedRef(
 new primitive2d::TransformPrimitive2D(
 
basegfx::utils::createScaleB2DHomMatrix(mnDiscreteWidth, mnDiscreteHeight),
 getChildren()));
 const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef 
};
 
+const geometry::ViewInformation2D aViewInformation2D;
+primitive2d::VisitingParameters 
aVisitingParameters(aViewInformation2D);
+
 const BitmapEx aBitmapEx(
 convertToBitmapEx(
 xEmbedSeq,
-aViewInformation2D,
+aVisitingParameters,
 mnDiscreteWidth,
 mnDiscreteHeight,
 mnDiscreteWidth * mnDiscreteHeight));
diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx 
b/drawing

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - drawinglayer/qa drawinglayer/source include/drawinglayer sc/source sfx2/source svgio/source svx/source sw/source

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit acd7a57c335a0230c21d6c2bafaf69b3ee32a653
Author: Tomaž Vajngerl 
AuthorDate: Tue Feb 23 13:23:32 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 13:45:38 2021 +0900

drawinglayer: make VisitingParameters constructor explicit

This discovers a bunch of cases where previously the
ViewInformation was implicitly converted into a VisitingParameter.

Change-Id: Ice233e9d3c9d12c5da284e190281a1d94059f49f

diff --git a/drawinglayer/qa/unit/border.cxx b/drawinglayer/qa/unit/border.cxx
index a3f7029b7350..801912f75825 100644
--- a/drawinglayer/qa/unit/border.cxx
+++ b/drawinglayer/qa/unit/border.cxx
@@ -66,9 +66,10 @@ CPPUNIT_TEST_FIXTURE(DrawinglayerBorderTest, 
testDoubleDecompositionSolid)
  
aStrokeAttribute));
 
 // Decompose it into polygons.
-drawinglayer::geometry::ViewInformation2D aView;
+const drawinglayer::geometry::ViewInformation2D aView;
+const drawinglayer::primitive2d::VisitingParameters 
aVisitingParameters(aView);
 drawinglayer::primitive2d::Primitive2DContainer aContainer;
-aBorder->get2DDecomposition(aContainer, aView);
+aBorder->get2DDecomposition(aContainer, aVisitingParameters);
 
 // Make sure it results in two borders as it's a double one.
 CPPUNIT_ASSERT_EQUAL(static_cast(2), aContainer.size());
@@ -91,8 +92,9 @@ CPPUNIT_TEST_FIXTURE(DrawinglayerBorderTest, 
testDoublePixelProcessing)
 // Create a pixel processor.
 ScopedVclPtrInstance pDev;
 drawinglayer::geometry::ViewInformation2D aView;
-std::unique_ptr pProcessor(
-
drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(*pDev, aView));
+const drawinglayer::primitive2d::VisitingParameters 
aVisitingParameters(aView);
+auto pProcessor = 
drawinglayer::processor2d::createBaseProcessor2DFromOutputDevice(
+*pDev, aVisitingParameters);
 CPPUNIT_ASSERT(pProcessor);
 GDIMetaFile aMetaFile;
 // Start recording after the processor is created, so we can test the 
pixel processor.
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx 
b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index 98ca81433f12..59c934b88d17 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -118,6 +118,7 @@ namespace drawinglayer::unorenderer
 }
 
 const auto aViewInformation2D = 
geometry::createViewInformation2D(aViewInformationSequence);
+primitive2d::VisitingParameters 
aVisitingParameters(aViewInformation2D);
 const sal_uInt32 
nDiscreteWidth(basegfx::fround(o3tl::convert(fWidth, eRangeUnit, 
o3tl::Length::in) * DPI_X));
 const sal_uInt32 
nDiscreteHeight(basegfx::fround(o3tl::convert(fHeight, eRangeUnit, 
o3tl::Length::in) * DPI_Y));
 
@@ -139,7 +140,7 @@ namespace drawinglayer::unorenderer
 BitmapEx aBitmapEx(
 convertToBitmapEx(
 xEmbedSeq,
-aViewInformation2D,
+aVisitingParameters,
 nDiscreteWidth,
 nDiscreteHeight,
 MaximumQuadraticPixels));
diff --git a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx 
b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
index 42559bfd4390..0cfa014bb13e 100644
--- a/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/patternfillprimitive2d.cxx
@@ -100,17 +100,19 @@ namespace drawinglayer::primitive2d
 // see if buffering is wanted. If so, create buffered content in 
given resolution
 if(0 != mnDiscreteWidth && 0 != mnDiscreteHeight)
 {
-const geometry::ViewInformation2D aViewInformation2D;
 const primitive2d::Primitive2DReference xEmbedRef(
 new primitive2d::TransformPrimitive2D(
 
basegfx::utils::createScaleB2DHomMatrix(mnDiscreteWidth, mnDiscreteHeight),
 getChildren()));
 const primitive2d::Primitive2DContainer xEmbedSeq { xEmbedRef 
};
 
+const geometry::ViewInformation2D aViewInformation2D;
+primitive2d::VisitingParameters 
aVisitingParameters(aViewInformation2D);
+
 const BitmapEx aBitmapEx(
 convertToBitmapEx(
 xEmbedSeq,
-aViewInformation2D,
+aVisitingParameters,
 mnDiscreteWidth,
 mnDiscreteHeight,
 mnDiscreteWidth * mnDiscreteHeight));
diff --git a/drawinglayer/source/primitive2d/unifiedtransparenceprimitive2d.cxx 
b/drawing

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - drawinglayer/inc drawinglayer/qa drawinglayer/source include/drawinglayer include/svx sc/source sd/source sfx2/source svgio/source

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 7004f8c11020b692ffaa646409dbe1c514501a61
Author: Tomaž Vajngerl 
AuthorDate: Sat Jan 2 20:52:36 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 13:47:25 2021 +0900

make BasePrimitive2D easier extensible with VisitingParameters

BasePrimitive2D virtual methods get2DDecomposition and getB2DRange
are used in many subclasses of BasePrimitive2D. If we want to
extend the parameters that we want to pass to those classes (and
we will need to in the future changes) we need to change all the
subclasses too. So this commit intoduces VisitingParameters class,
which holds the parameters that we want to pass, which avoids the
need to extend the BasePrimitive2D API.

The only member of VisitingParameters is ViewInformation2D, which
was previously a parameter for both methods.

Change-Id: I39afc28707f1511aafce4e8a84dbc45b84fc8cd5

diff --git a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
index 86297687ad5f..b0135ffb25e7 100644
--- a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
@@ -82,7 +82,7 @@ namespace drawinglayer::primitive2d
 virtual bool operator==(const BasePrimitive2D& rPrimitive) const 
override;
 
 /// local decomposition
-virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, VisitingParameters const & rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
index ce62b3110199..59d0bb954d25 100644
--- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
@@ -57,9 +57,8 @@ private:
 basegfx::B2DHomMatrix maLastObjectToViewTransformation;
 
 /// create local decomposition
-virtual void
-create2DDecomposition(Primitive2DContainer& rContainer,
-  const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void create2DDecomposition(Primitive2DContainer& rContainer,
+   VisitingParameters const& rParameters) 
const override;
 
 public:
 /// constructor
@@ -80,16 +79,14 @@ public:
 by a fixed discrete unit, thus the contained geometry needs only once 
be asked for its
 own basegfx::B2DRange
  */
-virtual basegfx::B2DRange
-getB2DRange(const geometry::ViewInformation2D& rViewInformation) const 
override;
+virtual basegfx::B2DRange getB2DRange(VisitingParameters const& 
rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
 
 /// Override standard getDecomposition to be view-dependent here
-virtual void
-get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
-   const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
+VisitingParameters const& rParameters) 
const override;
 };
 
 } // end of namespace primitive2d::drawinglayer
diff --git a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
index 423be7995879..a8818fab6675 100644
--- a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
@@ -41,7 +41,7 @@ namespace drawinglayer::primitive2d
 basegfx::BColor maLineColor;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, VisitingParameters const & rParameters) const override;
 
 public:
 /// constructor
diff --git a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
index 9b93e28dbe0d..381e130f6d9d 100644
--- a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
@@ -68,7 +68,7 @@ namespace drawinglayer::primitive2d
 css::lang::Locale   maLocale;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DCo

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - drawinglayer/inc drawinglayer/qa drawinglayer/source include/drawinglayer include/svx sc/source sd/source sfx2/source svgio/source

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 60b0dd037659b59ddaecf88a117ef4e46fc659bb
Author: Tomaž Vajngerl 
AuthorDate: Sat Jan 2 20:52:36 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 14:05:08 2021 +0900

make BasePrimitive2D easier extensible with VisitingParameters

BasePrimitive2D virtual methods get2DDecomposition and getB2DRange
are used in many subclasses of BasePrimitive2D. If we want to
extend the parameters that we want to pass to those classes (and
we will need to in the future changes) we need to change all the
subclasses too. So this commit intoduces VisitingParameters class,
which holds the parameters that we want to pass, which avoids the
need to extend the BasePrimitive2D API.

The only member of VisitingParameters is ViewInformation2D, which
was previously a parameter for both methods.

Change-Id: I39afc28707f1511aafce4e8a84dbc45b84fc8cd5

diff --git a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
index 86297687ad5f..b0135ffb25e7 100644
--- a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
@@ -82,7 +82,7 @@ namespace drawinglayer::primitive2d
 virtual bool operator==(const BasePrimitive2D& rPrimitive) const 
override;
 
 /// local decomposition
-virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, VisitingParameters const & rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
index ce62b3110199..59d0bb954d25 100644
--- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
@@ -57,9 +57,8 @@ private:
 basegfx::B2DHomMatrix maLastObjectToViewTransformation;
 
 /// create local decomposition
-virtual void
-create2DDecomposition(Primitive2DContainer& rContainer,
-  const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void create2DDecomposition(Primitive2DContainer& rContainer,
+   VisitingParameters const& rParameters) 
const override;
 
 public:
 /// constructor
@@ -80,16 +79,14 @@ public:
 by a fixed discrete unit, thus the contained geometry needs only once 
be asked for its
 own basegfx::B2DRange
  */
-virtual basegfx::B2DRange
-getB2DRange(const geometry::ViewInformation2D& rViewInformation) const 
override;
+virtual basegfx::B2DRange getB2DRange(VisitingParameters const& 
rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
 
 /// Override standard getDecomposition to be view-dependent here
-virtual void
-get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
-   const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
+VisitingParameters const& rParameters) 
const override;
 };
 
 } // end of namespace primitive2d::drawinglayer
diff --git a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
index 423be7995879..a8818fab6675 100644
--- a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
@@ -41,7 +41,7 @@ namespace drawinglayer::primitive2d
 basegfx::BColor maLineColor;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, VisitingParameters const & rParameters) const override;
 
 public:
 /// constructor
diff --git a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
index 9b93e28dbe0d..381e130f6d9d 100644
--- a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
@@ -68,7 +68,7 @@ namespace drawinglayer::primitive2d
 css::lang::Locale   maLocale;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DCo

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - drawinglayer/inc drawinglayer/qa drawinglayer/source include/drawinglayer include/svx sc/source sd/source sfx2/source svgio/source

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit d5b7f03756a38dd39ad5e300f0db4eb84948598c
Author: Tomaž Vajngerl 
AuthorDate: Sat Jan 2 20:52:36 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 14:19:45 2021 +0900

make BasePrimitive2D easier extensible with VisitingParameters

BasePrimitive2D virtual methods get2DDecomposition and getB2DRange
are used in many subclasses of BasePrimitive2D. If we want to
extend the parameters that we want to pass to those classes (and
we will need to in the future changes) we need to change all the
subclasses too. So this commit intoduces VisitingParameters class,
which holds the parameters that we want to pass, which avoids the
need to extend the BasePrimitive2D API.

The only member of VisitingParameters is ViewInformation2D, which
was previously a parameter for both methods.

Change-Id: I39afc28707f1511aafce4e8a84dbc45b84fc8cd5

diff --git a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
index 86297687ad5f..b0135ffb25e7 100644
--- a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
@@ -82,7 +82,7 @@ namespace drawinglayer::primitive2d
 virtual bool operator==(const BasePrimitive2D& rPrimitive) const 
override;
 
 /// local decomposition
-virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, VisitingParameters const & rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
index ce62b3110199..59d0bb954d25 100644
--- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
@@ -57,9 +57,8 @@ private:
 basegfx::B2DHomMatrix maLastObjectToViewTransformation;
 
 /// create local decomposition
-virtual void
-create2DDecomposition(Primitive2DContainer& rContainer,
-  const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void create2DDecomposition(Primitive2DContainer& rContainer,
+   VisitingParameters const& rParameters) 
const override;
 
 public:
 /// constructor
@@ -80,16 +79,14 @@ public:
 by a fixed discrete unit, thus the contained geometry needs only once 
be asked for its
 own basegfx::B2DRange
  */
-virtual basegfx::B2DRange
-getB2DRange(const geometry::ViewInformation2D& rViewInformation) const 
override;
+virtual basegfx::B2DRange getB2DRange(VisitingParameters const& 
rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
 
 /// Override standard getDecomposition to be view-dependent here
-virtual void
-get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
-   const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
+VisitingParameters const& rParameters) 
const override;
 };
 
 } // end of namespace primitive2d::drawinglayer
diff --git a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
index 423be7995879..a8818fab6675 100644
--- a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
@@ -41,7 +41,7 @@ namespace drawinglayer::primitive2d
 basegfx::BColor maLineColor;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, VisitingParameters const & rParameters) const override;
 
 public:
 /// constructor
diff --git a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
index 9b93e28dbe0d..381e130f6d9d 100644
--- a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
@@ -68,7 +68,7 @@ namespace drawinglayer::primitive2d
 css::lang::Locale   maLocale;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DCo

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - drawinglayer/inc drawinglayer/qa drawinglayer/source include/drawinglayer include/svx sc/source sd/source sfx2/source svgio/source

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 4a256dd4c413cc3f4b97013f3f19aeae04ab0522
Author: Tomaž Vajngerl 
AuthorDate: Sat Jan 2 20:52:36 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 14:23:47 2021 +0900

make BasePrimitive2D easier extensible with VisitingParameters

BasePrimitive2D virtual methods get2DDecomposition and getB2DRange
are used in many subclasses of BasePrimitive2D. If we want to
extend the parameters that we want to pass to those classes (and
we will need to in the future changes) we need to change all the
subclasses too. So this commit intoduces VisitingParameters class,
which holds the parameters that we want to pass, which avoids the
need to extend the BasePrimitive2D API.

The only member of VisitingParameters is ViewInformation2D, which
was previously a parameter for both methods.

Change-Id: I39afc28707f1511aafce4e8a84dbc45b84fc8cd5

diff --git a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
index 86297687ad5f..b0135ffb25e7 100644
--- a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
@@ -82,7 +82,7 @@ namespace drawinglayer::primitive2d
 virtual bool operator==(const BasePrimitive2D& rPrimitive) const 
override;
 
 /// local decomposition
-virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, VisitingParameters const & rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
index ce62b3110199..59d0bb954d25 100644
--- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
@@ -57,9 +57,8 @@ private:
 basegfx::B2DHomMatrix maLastObjectToViewTransformation;
 
 /// create local decomposition
-virtual void
-create2DDecomposition(Primitive2DContainer& rContainer,
-  const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void create2DDecomposition(Primitive2DContainer& rContainer,
+   VisitingParameters const& rParameters) 
const override;
 
 public:
 /// constructor
@@ -80,16 +79,14 @@ public:
 by a fixed discrete unit, thus the contained geometry needs only once 
be asked for its
 own basegfx::B2DRange
  */
-virtual basegfx::B2DRange
-getB2DRange(const geometry::ViewInformation2D& rViewInformation) const 
override;
+virtual basegfx::B2DRange getB2DRange(VisitingParameters const& 
rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
 
 /// Override standard getDecomposition to be view-dependent here
-virtual void
-get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
-   const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
+VisitingParameters const& rParameters) 
const override;
 };
 
 } // end of namespace primitive2d::drawinglayer
diff --git a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
index 423be7995879..a8818fab6675 100644
--- a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
@@ -41,7 +41,7 @@ namespace drawinglayer::primitive2d
 basegfx::BColor maLineColor;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, VisitingParameters const & rParameters) const override;
 
 public:
 /// constructor
diff --git a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
index 9b93e28dbe0d..381e130f6d9d 100644
--- a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
@@ -68,7 +68,7 @@ namespace drawinglayer::primitive2d
 css::lang::Locale   maLocale;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DCo

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - drawinglayer/inc drawinglayer/qa drawinglayer/source include/drawinglayer include/svx sc/source sd/source sfx2/source svgio/source

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit 00d010d4a31683c419b71a15e228ae98042f6456
Author: Tomaž Vajngerl 
AuthorDate: Sat Jan 2 20:52:36 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 14:26:17 2021 +0900

make BasePrimitive2D easier extensible with VisitingParameters

BasePrimitive2D virtual methods get2DDecomposition and getB2DRange
are used in many subclasses of BasePrimitive2D. If we want to
extend the parameters that we want to pass to those classes (and
we will need to in the future changes) we need to change all the
subclasses too. So this commit intoduces VisitingParameters class,
which holds the parameters that we want to pass, which avoids the
need to extend the BasePrimitive2D API.

The only member of VisitingParameters is ViewInformation2D, which
was previously a parameter for both methods.

Change-Id: I39afc28707f1511aafce4e8a84dbc45b84fc8cd5

diff --git a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
index 86297687ad5f..b0135ffb25e7 100644
--- a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
@@ -82,7 +82,7 @@ namespace drawinglayer::primitive2d
 virtual bool operator==(const BasePrimitive2D& rPrimitive) const 
override;
 
 /// local decomposition
-virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, VisitingParameters const & rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
index ce62b3110199..59d0bb954d25 100644
--- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
@@ -57,9 +57,8 @@ private:
 basegfx::B2DHomMatrix maLastObjectToViewTransformation;
 
 /// create local decomposition
-virtual void
-create2DDecomposition(Primitive2DContainer& rContainer,
-  const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void create2DDecomposition(Primitive2DContainer& rContainer,
+   VisitingParameters const& rParameters) 
const override;
 
 public:
 /// constructor
@@ -80,16 +79,14 @@ public:
 by a fixed discrete unit, thus the contained geometry needs only once 
be asked for its
 own basegfx::B2DRange
  */
-virtual basegfx::B2DRange
-getB2DRange(const geometry::ViewInformation2D& rViewInformation) const 
override;
+virtual basegfx::B2DRange getB2DRange(VisitingParameters const& 
rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
 
 /// Override standard getDecomposition to be view-dependent here
-virtual void
-get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
-   const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
+VisitingParameters const& rParameters) 
const override;
 };
 
 } // end of namespace primitive2d::drawinglayer
diff --git a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
index 423be7995879..a8818fab6675 100644
--- a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
@@ -41,7 +41,7 @@ namespace drawinglayer::primitive2d
 basegfx::BColor maLineColor;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, VisitingParameters const & rParameters) const override;
 
 public:
 /// constructor
diff --git a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
index 9b93e28dbe0d..381e130f6d9d 100644
--- a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
@@ -68,7 +68,7 @@ namespace drawinglayer::primitive2d
 css::lang::Locale   maLocale;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DCo

[Libreoffice-commits] core.git: Branch 'feature/drawinglayercore2' - drawinglayer/inc drawinglayer/qa drawinglayer/source include/drawinglayer include/svx sc/source sd/source sfx2/source svgio/source

2021-07-30 Thread Tomaž Vajngerl (via logerrit)
Rebased ref, commits from common ancestor:
commit d6647423200494727b7a09c2c92c9d8ba504592b
Author: Tomaž Vajngerl 
AuthorDate: Sat Jan 2 20:52:36 2021 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 14:43:11 2021 +0900

make BasePrimitive2D easier extensible with VisitingParameters

BasePrimitive2D virtual methods get2DDecomposition and getB2DRange
are used in many subclasses of BasePrimitive2D. If we want to
extend the parameters that we want to pass to those classes (and
we will need to in the future changes) we need to change all the
subclasses too. So this commit intoduces VisitingParameters class,
which holds the parameters that we want to pass, which avoids the
need to extend the BasePrimitive2D API.

The only member of VisitingParameters is ViewInformation2D, which
was previously a parameter for both methods.

Change-Id: I39afc28707f1511aafce4e8a84dbc45b84fc8cd5

diff --git a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
index 86297687ad5f..b0135ffb25e7 100644
--- a/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/cropprimitive2d.hxx
@@ -82,7 +82,7 @@ namespace drawinglayer::primitive2d
 virtual bool operator==(const BasePrimitive2D& rPrimitive) const 
override;
 
 /// local decomposition
-virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, VisitingParameters const & rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
diff --git a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
index ce62b3110199..59d0bb954d25 100644
--- a/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/texteffectprimitive2d.hxx
@@ -57,9 +57,8 @@ private:
 basegfx::B2DHomMatrix maLastObjectToViewTransformation;
 
 /// create local decomposition
-virtual void
-create2DDecomposition(Primitive2DContainer& rContainer,
-  const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void create2DDecomposition(Primitive2DContainer& rContainer,
+   VisitingParameters const& rParameters) 
const override;
 
 public:
 /// constructor
@@ -80,16 +79,14 @@ public:
 by a fixed discrete unit, thus the contained geometry needs only once 
be asked for its
 own basegfx::B2DRange
  */
-virtual basegfx::B2DRange
-getB2DRange(const geometry::ViewInformation2D& rViewInformation) const 
override;
+virtual basegfx::B2DRange getB2DRange(VisitingParameters const& 
rParameters) const override;
 
 /// provide unique ID
 virtual sal_uInt32 getPrimitive2DID() const override;
 
 /// Override standard getDecomposition to be view-dependent here
-virtual void
-get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
-   const geometry::ViewInformation2D& rViewInformation) 
const override;
+virtual void get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor,
+VisitingParameters const& rParameters) 
const override;
 };
 
 } // end of namespace primitive2d::drawinglayer
diff --git a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
index 423be7995879..a8818fab6675 100644
--- a/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textlineprimitive2d.hxx
@@ -41,7 +41,7 @@ namespace drawinglayer::primitive2d
 basegfx::BColor maLineColor;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, VisitingParameters const & rParameters) const override;
 
 public:
 /// constructor
diff --git a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx 
b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
index 9b93e28dbe0d..381e130f6d9d 100644
--- a/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
+++ b/drawinglayer/inc/primitive2d/textstrikeoutprimitive2d.hxx
@@ -68,7 +68,7 @@ namespace drawinglayer::primitive2d
 css::lang::Locale   maLocale;
 
 /// local decomposition.
-virtual void create2DDecomposition(Primitive2DContainer& 
rContainer, const geometry::ViewInformation2D& rViewInformation) const override;
+virtual void create2DDecomposition(Primitive2DCo

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

2021-07-30 Thread panoskorovesis (via logerrit)
 include/vcl/filter/SvmWriter.hxx|   42 +
 vcl/Library_vcl.mk  |1 
 vcl/qa/cppunit/svm/svmtest.cxx  |4 +
 vcl/source/filter/svm/SvmWriter.cxx |   87 
 4 files changed, 133 insertions(+), 1 deletion(-)

New commits:
commit 5e020c43668c9e11188ba48bf57de4bd7e9cc501
Author: panoskorovesis 
AuthorDate: Tue Jul 27 10:40:58 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 08:45:09 2021 +0200

Create SvmWriter class

This class will separate Write functionality from metaact.hxx with
the use of handlers for each metaact subclass

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

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
new file mode 100644
index ..644cb55f9aff
--- /dev/null
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+
+class SvStream;
+
+class VCL_DLLPUBLIC SvmWriter
+{
+private:
+SvStream& mrStream;
+
+protected:
+void WriteColor(::Color aColor);
+
+public:
+SvmWriter(SvStream& rIStm);
+
+SvStream& Write(GDIMetaFile& rMetaFile);
+void MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData);
+void ActionHandler(MetaAction* pAction);
+};
\ No newline at end of file
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 8a150e0ad1ca..9fb2e352bdea 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -454,6 +454,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
 vcl/source/filter/jpeg/JpegWriter \
 vcl/source/filter/jpeg/JpegTransform \
 vcl/source/filter/svm/SvmReader \
+vcl/source/filter/svm/SvmWriter \
 vcl/source/filter/wmf/emfwr \
 vcl/source/filter/wmf/wmf \
 vcl/source/filter/wmf/wmfexternal \
diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx
index 5f9a4bced6a4..84978a6e9c67 100644
--- a/vcl/qa/cppunit/svm/svmtest.cxx
+++ b/vcl/qa/cppunit/svm/svmtest.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -325,7 +326,8 @@ GDIMetaFile SvmTest::writeAndReadStream(GDIMetaFile& 
rMetaFile, std::u16string_v
 writeToFile(rMetaFile, rName);
 
 SvMemoryStream aStream;
-rMetaFile.Write(aStream);
+SvmWriter aWriter(aStream);
+aWriter.Write(rMetaFile);
 aStream.Seek(STREAM_SEEK_TO_BEGIN);
 
 GDIMetaFile aResultMetafile;
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
new file mode 100644
index ..8c07bffe5d53
--- /dev/null
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include 
+#include 
+
+#include 
+
+SvmWriter::SvmWriter(SvStream& rIStm)
+: mrStream(rIStm)
+{
+}
+
+SvStream& SvmWriter::Write(GDIMetaFile& rMetaFile)
+{
+const SvStreamCompressFlags nStmCompressMode = mrStream.GetCompressMode();
+SvStreamEndian nOldFormat = mrStream.GetEndian();
+
+mrStream.SetEndian(SvStreamEndian::LITTLE);
+mrStream.WriteBytes

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

2021-07-30 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 858176c120b82f626aa8625fbb87dd23c4391c03
Author: panoskorovesis 
AuthorDate: Wed Jul 28 10:06:35 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 08:46:51 2021 +0200

Add Handler for Pixel Write

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

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

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 644cb55f9aff..c3502e3979c5 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -39,4 +39,5 @@ public:
 SvStream& Write(GDIMetaFile& rMetaFile);
 void MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData);
 void ActionHandler(MetaAction* pAction);
+void PixelHandler(MetaPixelAction* pAction);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index 8c07bffe5d53..37720b5d385e 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -27,6 +27,11 @@ SvmWriter::SvmWriter(SvStream& rIStm)
 {
 }
 
+void SvmWriter::WriteColor(::Color aColor)
+{
+mrStream.WriteUInt32(static_cast(aColor));
+}
+
 SvStream& SvmWriter::Write(GDIMetaFile& rMetaFile)
 {
 const SvStreamCompressFlags nStmCompressMode = mrStream.GetCompressMode();
@@ -73,6 +78,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::PIXEL:
+{
+auto* pMetaAction = static_cast(pAction);
+PixelHandler(pMetaAction);
+}
+break;
+
 /* default case prevents test failure and will be
 removed once all the handlers are completed */
 default:
@@ -84,4 +96,13 @@ void SvmWriter::ActionHandler(MetaAction* pAction)
 {
 mrStream.WriteUInt16(static_cast(pAction->GetType()));
 }
+
+void SvmWriter::PixelHandler(MetaPixelAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+TypeSerializer aSerializer(mrStream);
+aSerializer.writePoint(pAction->GetPoint());
+WriteColor(pAction->GetColor());
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-07-30 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 7c18bfa1709147562ad045729d8a0a1a9b1f67ab
Author: panoskorovesis 
AuthorDate: Wed Jul 28 11:31:16 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 08:47:37 2021 +0200

Add Handler for Point Write

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

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

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index c3502e3979c5..3273e12e7fe2 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -40,4 +40,5 @@ public:
 void MetaActionHandler(MetaAction* pAction, ImplMetaWriteData* pData);
 void ActionHandler(MetaAction* pAction);
 void PixelHandler(MetaPixelAction* pAction);
+void PointHandler(MetaPointAction* pAction);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index 37720b5d385e..c8abf09115f9 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -85,6 +85,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::POINT:
+{
+auto pMetaAction = static_cast(pAction);
+PointHandler(pMetaAction);
+}
+break;
+
 /* default case prevents test failure and will be
 removed once all the handlers are completed */
 default:
@@ -105,4 +112,12 @@ void SvmWriter::PixelHandler(MetaPixelAction* pAction)
 aSerializer.writePoint(pAction->GetPoint());
 WriteColor(pAction->GetColor());
 }
+
+void SvmWriter::PointHandler(MetaPointAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+VersionCompatWrite aCompat(mrStream, 1);
+TypeSerializer aSerializer(mrStream);
+aSerializer.writePoint(pAction->GetPoint());
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-07-30 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 dd8c7dc5083c83e5b3ad6fb19905c6187af14260
Author: panoskorovesis 
AuthorDate: Wed Jul 28 11:33:42 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 08:48:20 2021 +0200

Add Handler for Line Write

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

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

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 3273e12e7fe2..b767eee5c94d 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -41,4 +41,5 @@ public:
 void ActionHandler(MetaAction* pAction);
 void PixelHandler(MetaPixelAction* pAction);
 void PointHandler(MetaPointAction* pAction);
+void LineHandler(MetaLineAction* pAction);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index c8abf09115f9..c0eeb443877e 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -92,6 +92,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::LINE:
+{
+auto* pMetaAction = static_cast(pAction);
+LineHandler(pMetaAction);
+}
+break;
+
 /* default case prevents test failure and will be
 removed once all the handlers are completed */
 default:
@@ -120,4 +127,18 @@ void SvmWriter::PointHandler(MetaPointAction* pAction)
 TypeSerializer aSerializer(mrStream);
 aSerializer.writePoint(pAction->GetPoint());
 }
+
+void SvmWriter::LineHandler(MetaLineAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+
+VersionCompatWrite aCompat(mrStream, 2);
+
+// Version 1
+TypeSerializer aSerializer(mrStream);
+aSerializer.writePoint(pAction->GetStartPoint());
+aSerializer.writePoint(pAction->GetEndPoint());
+// Version 2
+WriteLineInfo(mrStream, pAction->GetLineInfo());
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2021-07-30 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 78b74ddc3da9dbc4d728b71f93626b0528870f31
Author: panoskorovesis 
AuthorDate: Wed Jul 28 11:35:38 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 08:48:50 2021 +0200

Add Handler for Rect Write

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

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

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index b767eee5c94d..3ffaf0bf5f94 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -42,4 +42,5 @@ public:
 void PixelHandler(MetaPixelAction* pAction);
 void PointHandler(MetaPointAction* pAction);
 void LineHandler(MetaLineAction* pAction);
+void RectHandler(MetaRectAction* pAction);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index c0eeb443877e..f2fb33c6cd4a 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -99,6 +99,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::RECT:
+{
+auto* pMetaAction = static_cast(pAction);
+RectHandler(pMetaAction);
+}
+break;
+
 /* default case prevents test failure and will be
 removed once all the handlers are completed */
 default:
@@ -141,4 +148,13 @@ void SvmWriter::LineHandler(MetaLineAction* pAction)
 // Version 2
 WriteLineInfo(mrStream, pAction->GetLineInfo());
 }
+
+void SvmWriter::RectHandler(MetaRectAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+
+VersionCompatWrite aCompat(mrStream, 1);
+TypeSerializer aSerializer(mrStream);
+aSerializer.writeRectangle(pAction->GetRect());
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

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

New commits:
commit 620f9649ae55e01700419876ce25ab4e45ed859f
Author: panoskorovesis 
AuthorDate: Wed Jul 28 11:38:45 2021 +0300
Commit: Tomaž Vajngerl 
CommitDate: Sat Jul 31 08:49:31 2021 +0200

Add Handler for RoundRect Write

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

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

diff --git a/include/vcl/filter/SvmWriter.hxx b/include/vcl/filter/SvmWriter.hxx
index 3ffaf0bf5f94..724051d2eee7 100644
--- a/include/vcl/filter/SvmWriter.hxx
+++ b/include/vcl/filter/SvmWriter.hxx
@@ -43,4 +43,5 @@ public:
 void PointHandler(MetaPointAction* pAction);
 void LineHandler(MetaLineAction* pAction);
 void RectHandler(MetaRectAction* pAction);
+void RoundRectHandler(MetaRoundRectAction* pAction);
 };
\ No newline at end of file
diff --git a/vcl/source/filter/svm/SvmWriter.cxx 
b/vcl/source/filter/svm/SvmWriter.cxx
index f2fb33c6cd4a..73e5734297d9 100644
--- a/vcl/source/filter/svm/SvmWriter.cxx
+++ b/vcl/source/filter/svm/SvmWriter.cxx
@@ -106,6 +106,13 @@ void SvmWriter::MetaActionHandler(MetaAction* pAction, 
ImplMetaWriteData* pData)
 }
 break;
 
+case MetaActionType::ROUNDRECT:
+{
+auto* pMetaAction = static_cast(pAction);
+RoundRectHandler(pMetaAction);
+}
+break;
+
 /* default case prevents test failure and will be
 removed once all the handlers are completed */
 default:
@@ -157,4 +164,14 @@ void SvmWriter::RectHandler(MetaRectAction* pAction)
 TypeSerializer aSerializer(mrStream);
 aSerializer.writeRectangle(pAction->GetRect());
 }
+
+void SvmWriter::RoundRectHandler(MetaRoundRectAction* pAction)
+{
+mrStream.WriteUInt16(static_cast(pAction->GetType()));
+
+VersionCompatWrite aCompat(mrStream, 1);
+TypeSerializer aSerializer(mrStream);
+aSerializer.writeRectangle(pAction->GetRect());
+
mrStream.WriteUInt32(pAction->GetHorzRound()).WriteUInt32(pAction->GetVertRound());
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: i18nlangtag/source oox/source package/source sal/rtl sal/textenc sc/source

2021-07-30 Thread Noel Grandin (via logerrit)
 i18nlangtag/source/languagetag/languagetag.cxx |   89 +++--
 oox/source/core/xmlfilterbase.cxx  |2 
 oox/source/drawingml/table/tableproperties.cxx |   11 +--
 package/source/xstor/owriteablestream.cxx  |6 -
 package/source/xstor/xstorage.cxx  |6 -
 package/source/zippackage/ZipPackageFolder.cxx |6 -
 package/source/zippackage/ZipPackageStream.cxx |6 -
 sal/rtl/bootstrap.cxx  |   10 +-
 sal/rtl/rtl_process.cxx|6 -
 sal/textenc/textenc.cxx|   10 +-
 sc/source/core/tool/formulaparserpool.cxx  |8 --
 11 files changed, 67 insertions(+), 93 deletions(-)

New commits:
commit a943936eeff04b60ebd0b2552bc18b42606f3321
Author: Noel Grandin 
AuthorDate: Fri Jul 30 20:54:50 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 31 08:55:29 2021 +0200

rtl::Static -> static local

in a handful cases, like a map or a vector, we don't need init on demand
at all, the default constructor can be laid out at compile time

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

diff --git a/i18nlangtag/source/languagetag/languagetag.cxx 
b/i18nlangtag/source/languagetag/languagetag.cxx
index 41f23973020f..07b9c6d0a666 100644
--- a/i18nlangtag/source/languagetag/languagetag.cxx
+++ b/i18nlangtag/source/languagetag/languagetag.cxx
@@ -49,24 +49,19 @@ struct myLtError
 ~myLtError() { if (p) lt_error_unref( p); }
 };
 
-// "static" to be returned as const reference to an empty locale.
-struct theEmptyLocale : public rtl::Static< lang::Locale, theEmptyLocale > {};
 }
 
 typedef std::unordered_set< OUString > KnownTagSet;
 namespace {
-struct theKnowns : public rtl::Static< KnownTagSet, theKnowns > {};
 struct theMutex : public rtl::Static< osl::Mutex, theMutex > {};
 }
 
 static const KnownTagSet & getKnowns()
 {
-KnownTagSet & rKnowns = theKnowns::get();
-if (rKnowns.empty())
-{
-osl::MutexGuard aGuard( theMutex::get());
-if (rKnowns.empty())
+static const KnownTagSet theKnowns =
+[]()
 {
+KnownTagSet knownSet;
 ::std::vector< MsLangId::LanguagetagMapping > aDefined( 
MsLangId::getDefinedLanguagetags());
 for (auto const& elemDefined : aDefined)
 {
@@ -76,12 +71,12 @@ static const KnownTagSet & getKnowns()
 ::std::vector< OUString > aFallbacks( LanguageTag( 
elemDefined.mnLang).getFallbackStrings( true));
 for (auto const& fallback : aFallbacks)
 {
-rKnowns.insert(fallback);
+knownSet.insert(fallback);
 }
 }
-}
-}
-return rKnowns;
+return knownSet;
+}();
+return theKnowns;
 }
 
 
@@ -95,10 +90,10 @@ struct compareIgnoreAsciiCaseLess
 };
 typedef ::std::map< OUString, LanguageTag::ImplPtr, compareIgnoreAsciiCaseLess 
> MapBcp47;
 typedef ::std::map< LanguageType, LanguageTag::ImplPtr > MapLangID;
-struct theMapBcp47 : public rtl::Static< MapBcp47, theMapBcp47 > {};
-struct theMapLangID : public rtl::Static< MapLangID, theMapLangID > {};
-struct theDontKnow : public rtl::Static< LanguageTag::ImplPtr, theDontKnow > 
{};
-struct theSystemLocale : public rtl::Static< LanguageTag::ImplPtr, 
theSystemLocale > {};
+MapBcp47 theMapBcp47;
+MapLangID theMapLangID;
+LanguageTag::ImplPtr theDontKnow;
+LanguageTag::ImplPtr theSystemLocale;
 }
 
 
@@ -598,10 +593,9 @@ LanguageTag::ImplPtr LanguageTagImpl::registerOnTheFly( 
LanguageType nRegisterID
 
 osl::MutexGuard aGuard( theMutex::get());
 
-MapBcp47& rMapBcp47 = theMapBcp47::get();
-MapBcp47::const_iterator it( rMapBcp47.find( maBcp47));
+MapBcp47::const_iterator it( theMapBcp47.find( maBcp47));
 bool bOtherImpl = false;
-if (it != rMapBcp47.end())
+if (it != theMapBcp47.end())
 {
 SAL_INFO( "i18nlangtag", "LanguageTag::registerOnTheFly: found impl 
for '" << maBcp47 << "'");
 pImpl = (*it).second;
@@ -621,7 +615,7 @@ LanguageTag::ImplPtr LanguageTagImpl::registerOnTheFly( 
LanguageType nRegisterID
 {
 SAL_INFO( "i18nlangtag", "LanguageTag::registerOnTheFly: new impl for 
'" << maBcp47 << "'");
 pImpl = std::make_shared( *this);
-rMapBcp47.insert( ::std::make_pair( maBcp47, pImpl));
+theMapBcp47.insert( ::std::make_pair( maBcp47, pImpl));
 }
 
 if (!bOtherImpl || !pImpl->mbInitializedLangID)
@@ -634,9 +628,8 @@ LanguageTag::ImplPtr LanguageTagImpl::registerOnTheFly( 
LanguageType nRegisterID
 // different, otherwise we would end up with ambiguous assignments
 // of different language tags, for example for the same primary
 // LangID with "no", "nb" and "nn".
-const MapLangID& rMapLangID = theMapLangID::get()

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

2021-07-30 Thread Noel Grandin (via logerrit)
 include/unotools/accessiblerelationsethelper.hxx  |4 ++--
 unotools/source/accessibility/accessiblerelationsethelper.cxx |   10 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 049732b2190ee24b11a71f9236d597a37b54ea77
Author: Noel Grandin 
AuthorDate: Fri Jul 30 14:53:24 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Jul 31 08:55:58 2021 +0200

osl::Mutex->std::mutex in AccessibleRelationSetHelper

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

diff --git a/include/unotools/accessiblerelationsethelper.hxx 
b/include/unotools/accessiblerelationsethelper.hxx
index b3ab5b0e4b27..35277ae5bd5f 100644
--- a/include/unotools/accessiblerelationsethelper.hxx
+++ b/include/unotools/accessiblerelationsethelper.hxx
@@ -23,8 +23,8 @@
 #include 
 
 #include 
-#include 
 #include 
+#include 
 #include 
 
 //= XAccessibleRelationSet helper classes
@@ -115,7 +115,7 @@ public:
 
 private:
 /// Mutex guarding this object.
-::osl::Mutex maMutex;
+std::mutex maMutex;
 /// The implementation of this helper interface.
 std::vector maRelations;
 };
diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx 
b/unotools/source/accessibility/accessiblerelationsethelper.cxx
index 02b3ad572e34..e7bf704a300b 100644
--- a/unotools/source/accessibility/accessiblerelationsethelper.cxx
+++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx
@@ -66,7 +66,7 @@ AccessibleRelationSetHelper::~AccessibleRelationSetHelper()
 sal_Int32 SAL_CALL
 AccessibleRelationSetHelper::getRelationCount(  )
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 return maRelations.size();
 }
@@ -87,7 +87,7 @@ sal_Int32 SAL_CALL
  AccessibleRelation SAL_CALL
 AccessibleRelationSetHelper::getRelation( sal_Int32 nIndex )
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 if ((nIndex < 0) || (o3tl::make_unsigned(nIndex) >= maRelations.size()))
 throw lang::IndexOutOfBoundsException();
@@ -110,7 +110,7 @@ sal_Int32 SAL_CALL
 sal_Bool SAL_CALL
 AccessibleRelationSetHelper::containsRelation( sal_Int16 aRelationType )
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 AccessibleRelation defaultRelation; // default is INVALID
 AccessibleRelation relationByType = lcl_getRelationByType(maRelations, 
aRelationType);
@@ -131,14 +131,14 @@ sal_Bool SAL_CALL
 AccessibleRelation SAL_CALL
 AccessibleRelationSetHelper::getRelationByType( sal_Int16 
aRelationType )
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 return lcl_getRelationByType(maRelations, aRelationType);
 }
 
 void AccessibleRelationSetHelper::AddRelation(const AccessibleRelation& 
rRelation)
 {
-osl::MutexGuard aGuard (maMutex);
+std::lock_guard aGuard (maMutex);
 
 for (auto& aRelation: maRelations)
 {