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

2023-12-04 Thread Miklos Vajna (via logerrit)
 include/svx/svdpage.hxx   |8 
 svx/source/svdraw/svdpage.cxx |2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit beb0b57a638a2577d89ab5bdee6351008c5127ca
Author: Miklos Vajna 
AuthorDate: Mon Dec 4 08:19:31 2023 +0100
Commit: Miklos Vajna 
CommitDate: Mon Dec 4 10:43:26 2023 +0100

svx: prefix members of SdrPageGridFrameList

See tdf#94879 for motivation.

Change-Id: Ieb5630a9aaa1d5ae51915e0fe6892e43e9c2e629
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160292
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 7dd18e743184..c70a2f1f4a2d 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -302,18 +302,18 @@ public:
 
 class SVXCORE_DLLPUBLIC SdrPageGridFrameList final
 {
-std::vector aList;
+std::vector m_aList;
 
 SdrPageGridFrameList(const SdrPageGridFrameList& rSrcList) = delete;
 void   operator=(const SdrPageGridFrameList& rSrcList) = delete;
-SdrPageGridFrame* GetObject(sal_uInt16 i) const { return aList[i]; }
+SdrPageGridFrame* GetObject(sal_uInt16 i) const { return m_aList[i]; }
 
 public:
 SdrPageGridFrameList(){}
 ~SdrPageGridFrameList(){ 
Clear(); }
 void   Clear();
-sal_uInt16 GetCount() const{ 
return sal_uInt16(aList.size()); }
-void   Insert(const SdrPageGridFrame& rGF) { aList.push_back(new 
SdrPageGridFrame(rGF)); }
+sal_uInt16 GetCount() const{ 
return sal_uInt16(m_aList.size()); }
+void   Insert(const SdrPageGridFrame& rGF) { m_aList.push_back(new 
SdrPageGridFrame(rGF)); }
 SdrPageGridFrame&   operator[](sal_uInt16 nPos){ 
return *GetObject(nPos); }
 const SdrPageGridFrame& operator[](sal_uInt16 nPos) const  { 
return *GetObject(nPos); }
 };
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 9b5965a5843a..adc8555bf13d 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1099,7 +1099,7 @@ void SdrPageGridFrameList::Clear()
 for (sal_uInt16 i=0; i

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

2023-11-22 Thread AmosAidoo (via logerrit)
 include/svx/charmap.hxx |3 
 include/svx/searchcharmap.hxx   |2 
 svx/source/dialog/charmap.cxx   |   13 ++-
 svx/source/dialog/searchcharmap.cxx |  152 +---
 4 files changed, 20 insertions(+), 150 deletions(-)

New commits:
commit 94d2d9a59450fa4bccd0a3a450d8b273271d2ff2
Author: AmosAidoo 
AuthorDate: Tue Nov 21 03:17:12 2023 +0100
Commit: Andreas Heinisch 
CommitDate: Wed Nov 22 21:49:57 2023 +0100

tdf#154088 Merge code snippets for character retrieval and string 
construction

The DrawChars_Impl method has been unified since the duplicates were 
identical
and only differed in how they retrieved characters from a separate source. 
Each
class now has its own implentation of GetCharFromIndex as a solution.

Change-Id: Ic2d10a46a91ea8dee2c94b620e6745bf77ae9eab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159773
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index 8057eae3c1bd..1c440b6ee2c1 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -66,6 +66,7 @@ public:
 
 voidSelectCharacter( sal_UCS4 cNew );
 virtual sal_UCS4GetSelectCharacter() const;
+virtual sal_UCS4GetCharFromIndex(int index) const;
 voidcreateContextMenu(const Point& rPosition);
 
 voidSetDoubleClickHdl( const Link& rLink 
) { aDoubleClkHdl = rLink; }
@@ -148,7 +149,7 @@ protected:
 
 protected:
 virtual bool KeyInput(const KeyEvent&) override;
-virtual voidDrawChars_Impl(vcl::RenderContext& rRenderContext, 
int n1, int n2);
+voidDrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, 
int n2);
 voidInitSettings(vcl::RenderContext& rRenderContext);
 // abstraction layers are: Unicode<->MapIndex<->Pixel
 Point   MapIndexToPixel( int) const;
diff --git a/include/svx/searchcharmap.hxx b/include/svx/searchcharmap.hxx
index d05f3ea82728..b07d58a4c8ad 100644
--- a/include/svx/searchcharmap.hxx
+++ b/include/svx/searchcharmap.hxx
@@ -44,6 +44,7 @@ public:
 
 voidSelectCharacter( const Subset* sub);
 virtual sal_UCS4GetSelectCharacter() const override;
+virtual sal_UCS4GetCharFromIndex(int index) const 
override;
 
 virtual svx::SvxShowCharSetItem*ImplGetItem( int _nPos ) override;
 virtual int LastInView() const override;
@@ -59,7 +60,6 @@ private:
 //to uniquely identify each appended element
 std::unordered_map m_aItemList;
 private:
-virtual void DrawChars_Impl(vcl::RenderContext& rRenderContext, int n1, 
int n2) override;
 virtual void Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& rRect) override;
 virtual bool KeyInput(const KeyEvent& rKEvt) override;
 };
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index be2d991977b5..dcb1205584d7 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -534,12 +534,17 @@ void SvxShowCharSet::DrawChars_Impl(vcl::RenderContext& 
rRenderContext, int n1,
 tools::Rectangle aBoundRect;
 for (i = n1; i <= n2; ++i)
 {
+sal_UCS4 charValue = GetCharFromIndex(i);
+
+if (charValue == 0)
+continue;
+
+OUString aCharStr(, 1);
+
 Point pix = MapIndexToPixel(i);
 int x = pix.X();
 int y = pix.Y();
 
-sal_UCS4 nChar = mxFontCharMap->GetCharFromIndex(i);
-OUString aCharStr(, 1);
 int nTextWidth = rRenderContext.GetTextWidth(aCharStr);
 int tx = x + (nX - nTextWidth + 1) / 2;
 int ty = y + (nY - nTextHeight + 1) / 2;
@@ -672,6 +677,10 @@ sal_UCS4 SvxShowCharSet::GetSelectCharacter() const
 return getSelectedChar();
 }
 
+sal_UCS4 SvxShowCharSet::GetCharFromIndex(int index) const
+{
+return mxFontCharMap->GetCharFromIndex(index);
+}
 
 void SvxShowCharSet::RecalculateFont(vcl::RenderContext& rRenderContext)
 {
diff --git a/svx/source/dialog/searchcharmap.cxx 
b/svx/source/dialog/searchcharmap.cxx
index dc3ef7bcecab..2a770eac57de 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -140,6 +140,12 @@ void SvxSearchCharSet::SelectCharacter( const Subset* sub )
 Invalidate();
 }
 
+sal_UCS4 SvxSearchCharSet::GetCharFromIndex(int index) const
+{
+std::unordered_map::const_iterator got = 
m_aItemList.find(index);
+return (got != m_aItemList.end()) ? got->second : 0;
+}
+
 void SvxSearchCharSet::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle&)
 {
 InitSettings(rRenderContext);
@@ -147,152 +153,6 @@ void SvxSearchCharSet::Paint(vcl::RenderContext& 
rRenderContext, const tools::Re
 DrawChars_Impl(rRenderContext, FirstInView(), LastInView());
 }
 
-void 

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

2023-11-22 Thread Noel Grandin (via logerrit)
 include/svx/framelink.hxx|1 
 svx/source/dialog/framelink.cxx  |   17 ++
 svx/source/dialog/framelinkarray.cxx |  255 ---
 3 files changed, 166 insertions(+), 107 deletions(-)

New commits:
commit d9c726beb64968e84d2150824c81dcf0a8b66ec2
Author: Noel Grandin 
AuthorDate: Wed Nov 22 08:41:26 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Nov 22 16:59:37 2023 +0100

optimise framelinkarray lookup

We can use hashing to do an O(1) lookup instead of O(n)
linear scanning, this class is sometimes a bottleneck
in laying out large spreadsheets.

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

diff --git a/include/svx/framelink.hxx b/include/svx/framelink.hxx
index ceb0abe5e390..5c98c3a1a3c6 100644
--- a/include/svx/framelink.hxx
+++ b/include/svx/framelink.hxx
@@ -163,6 +163,7 @@ public:
 
 bool operator==( const Style& rOther) const;
 bool operator<( const Style& rOther) const;
+size_t hashCode() const;
 };
 
 inline bool operator>( const Style& rL, const Style& rR ) { return 
rR.operator<(rL); }
diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx
index fbc5ee1d5533..887fc445dc0c 100644
--- a/svx/source/dialog/framelink.cxx
+++ b/svx/source/dialog/framelink.cxx
@@ -23,6 +23,7 @@
 #include 
 
 #include 
+#include 
 
 
 using namespace ::com::sun::star;
@@ -193,6 +194,22 @@ bool Style::operator==( const Style& rOther) const
 && Type() == rOther.Type());
 }
 
+size_t Style::hashCode() const
+{
+std::size_t seed = 0;
+o3tl::hash_combine(seed, Prim());
+o3tl::hash_combine(seed, Dist());
+o3tl::hash_combine(seed, Secn());
+o3tl::hash_combine(seed, static_cast(GetColorPrim()));
+o3tl::hash_combine(seed, static_cast(GetColorSecn()));
+o3tl::hash_combine(seed, static_cast(GetColorGap()));
+o3tl::hash_combine(seed, GetRefMode());
+o3tl::hash_combine(seed, UseGapColor());
+o3tl::hash_combine(seed, Type());
+return seed;
+}
+
+
 namespace
 {
 /**
diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index 65e8c8342dfe..3431c861fcfd 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -71,6 +72,7 @@ public:
 explicit Cell(const Cell&) = default;
 
 bool operator==( const Cell& ) const;
+size_t hashCode() const;
 
 void SetStyleLeft(const Style& rStyle) { maLeft = rStyle; }
 void SetStyleRight(const Style& rStyle) { maRight = rStyle; }
@@ -226,11 +228,29 @@ bool Cell::operator==(const Cell& rOther) const
 && mnAddTop == rOther.mnAddTop
 && mnAddBottom == rOther.mnAddBottom
 && meRotMode == rOther.meRotMode
-&& mfOrientation == rOther.mfOrientation
 && mbOverlapX == rOther.mbOverlapX
 && mbOverlapY == rOther.mbOverlapY;
 }
 
+size_t Cell::hashCode() const
+{
+std::size_t seed = 0;
+o3tl::hash_combine(seed, maLeft.hashCode());
+o3tl::hash_combine(seed, maRight.hashCode());
+o3tl::hash_combine(seed, maTop.hashCode());
+o3tl::hash_combine(seed, maBottom.hashCode());
+o3tl::hash_combine(seed, maTLBR.hashCode());
+o3tl::hash_combine(seed, maBLTR.hashCode());
+o3tl::hash_combine(seed, mnAddLeft);
+o3tl::hash_combine(seed, mnAddRight);
+o3tl::hash_combine(seed, mnAddTop);
+o3tl::hash_combine(seed, mnAddBottom);
+o3tl::hash_combine(seed, meRotMode);
+o3tl::hash_combine(seed, mbOverlapX);
+o3tl::hash_combine(seed, mbOverlapY);
+return seed;
+}
+
 void Cell::MirrorSelfX()
 {
 std::swap( maLeft, maRight );
@@ -255,9 +275,29 @@ static void lclRecalcCoordVec( std::vector& 
rCoords, const std::vecto
 const Style OBJ_STYLE_NONE;
 const Cell OBJ_CELL_NONE;
 
+/** use hashing to speed up finding duplicates */
+namespace
+{
+struct RegisteredCellHash
+{
+size_t operator()(Cell* const pCell) const
+{
+return pCell->hashCode();
+}
+};
+
+struct RegisteredCellEquals
+{
+bool operator()(Cell* const pCell1, Cell* const pCell2) const
+{
+return *pCell1 == *pCell2;
+}
+};
+}
+
 struct ArrayImpl
 {
-std::unordered_set maRegisteredCells;
+std::unordered_set 
maRegisteredCells;
 CellVec maCells;
 std::vector   maWidths;
 std::vector   maHeights;
@@ -281,7 +321,7 @@ struct ArrayImpl
 sal_Int32   GetIndex( sal_Int32 nCol, sal_Int32 nRow ) const
 { return nRow * mnWidth + nCol; }
 
-const Cell* GetCell( sal_Int32 nCol, sal_Int32 nRow ) const;
+const Cell& GetCell( sal_Int32 nCol, sal_Int32 nRow ) const;
 voidPutCell( sal_Int32 nCol, sal_Int32 nRow, const Cell& );
 
 sal_Int32  

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

2023-11-21 Thread Balazs Varga (via logerrit)
 include/svx/optgrid.hxx   |2 +
 svx/source/dialog/optgrid.cxx |   48 +-
 2 files changed, 36 insertions(+), 14 deletions(-)

New commits:
commit b4350fd9c3f1873ead892c6baeb7f7c0fc1c7d80
Author: Balazs Varga 
AuthorDate: Tue Nov 21 15:32:11 2023 +0100
Commit: Balazs Varga 
CommitDate: Tue Nov 21 21:03:41 2023 +0100

tdf#158143 - UI: Part 35 - Unify lockdown behavior of Options dialog

for Writer/Web - Grid Page.

Change-Id: I8b3cc4f75e613691840edc6456fb8ea2c4314282
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159784
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/include/svx/optgrid.hxx b/include/svx/optgrid.hxx
index f27a4bf78d29..c033d001871c 100644
--- a/include/svx/optgrid.hxx
+++ b/include/svx/optgrid.hxx
@@ -20,6 +20,7 @@
 #define INCLUDED_SVX_OPTGRID_HXX
 
 #include 
+#include 
 #include 
 
 namespace weld { class CheckButton; }
@@ -104,6 +105,7 @@ public:
 
 private:
 boolbAttrModified;
+boolm_bHTMLMode;
 
 std::unique_ptr m_xCbxUseGridsnap;
 std::unique_ptr m_xCbxUseGridsnapImg;
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index cd73ae223961..a5607755fd3f 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -91,6 +92,7 @@ bool  SvxGridItem::GetPresentation
 SvxGridTabPage::SvxGridTabPage(weld::Container* pPage, weld::DialogController* 
pController, const SfxItemSet& rCoreSet)
 : SfxTabPage(pPage, pController, "svx/ui/optgridpage.ui", "OptGridPage", 
)
 , bAttrModified(false)
+, m_bHTMLMode(false)
 , m_xCbxUseGridsnap(m_xBuilder->weld_check_button("usegridsnap"))
 , m_xCbxUseGridsnapImg(m_xBuilder->weld_widget("lockusegridsnap"))
 , m_xCbxGridVisible(m_xBuilder->weld_check_button("gridvisible"))
@@ -132,6 +134,10 @@ SvxGridTabPage::SvxGridTabPage(weld::Container* pPage, 
weld::DialogController* p
 SetFieldUnit( *m_xMtrFldDrawY, eFUnit, true );
 lcl_SetMinMax(*m_xMtrFldDrawY, nMin, nMax);
 
+if (const SfxUInt16Item* pItem = rCoreSet.GetItemIfSet(SID_HTML_MODE, 
false))
+{
+m_bHTMLMode = 0 != (pItem->GetValue() & HTMLMODE_ON);
+}
 
 m_xCbxRotate->connect_toggled(LINK(this, SvxGridTabPage, 
ClickRotateHdl_Impl));
 Link aLink = LINK(this, SvxGridTabPage, 
ChangeGridsnapHdl_Impl);
@@ -213,36 +219,50 @@ void SvxGridTabPage::Reset( const SfxItemSet* rSet )
 
 if( (pGridAttr = rSet->GetItemIfSet( SID_ATTR_GRID_OPTIONS , false )) )
 {
+bool bReadOnly = !m_bHTMLMode ? 
officecfg::Office::Writer::Grid::Option::SnapToGrid::isReadOnly() :
+
officecfg::Office::WriterWeb::Grid::Option::SnapToGrid::isReadOnly();
 m_xCbxUseGridsnap->set_active(pGridAttr->bUseGridsnap);
-
m_xCbxUseGridsnap->set_sensitive(!officecfg::Office::Writer::Grid::Option::SnapToGrid::isReadOnly());
-
m_xCbxUseGridsnapImg->set_visible(officecfg::Office::Writer::Grid::Option::SnapToGrid::isReadOnly());
+m_xCbxUseGridsnap->set_sensitive(!bReadOnly);
+m_xCbxUseGridsnapImg->set_visible(bReadOnly);
 
+bReadOnly = !m_bHTMLMode ? 
officecfg::Office::Writer::Grid::Option::Synchronize::isReadOnly() :
+
officecfg::Office::WriterWeb::Grid::Option::Synchronize::isReadOnly();
 m_xCbxSynchronize->set_active(pGridAttr->bSynchronize);
-
m_xCbxSynchronize->set_sensitive(!officecfg::Office::Writer::Grid::Option::Synchronize::isReadOnly());
-
m_xCbxSynchronizeImg->set_visible(officecfg::Office::Writer::Grid::Option::Synchronize::isReadOnly());
+m_xCbxSynchronize->set_sensitive(!bReadOnly);
+m_xCbxSynchronizeImg->set_visible(bReadOnly);
 
+bReadOnly = !m_bHTMLMode ? 
officecfg::Office::Writer::Grid::Option::VisibleGrid::isReadOnly() :
+
officecfg::Office::WriterWeb::Grid::Option::VisibleGrid::isReadOnly();
 m_xCbxGridVisible->set_active(pGridAttr->bGridVisible);
-
m_xCbxGridVisible->set_sensitive(!officecfg::Office::Writer::Grid::Option::VisibleGrid::isReadOnly());
-
m_xCbxGridVisibleImg->set_visible(officecfg::Office::Writer::Grid::Option::VisibleGrid::isReadOnly());
+m_xCbxGridVisible->set_sensitive(!bReadOnly);
+m_xCbxGridVisibleImg->set_visible(bReadOnly);
 
 MapUnit eUnit = rSet->GetPool()->GetMetric( SID_ATTR_GRID_OPTIONS );
 SetMetricValue( *m_xMtrFldDrawX , pGridAttr->nFldDrawX, eUnit );
 SetMetricValue( *m_xMtrFldDrawY , pGridAttr->nFldDrawY, eUnit );
 
-
m_xMtrFldDrawX->set_sensitive(!officecfg::Office::Writer::Grid::Resolution::XAxis::isReadOnly());
-
m_xMtrFldDrawXImg->set_visible(officecfg::Office::Writer::Grid::Resolution::XAxis::isReadOnly());
+bReadOnly = !m_bHTMLMode ? 
officecfg::Office::Writer::Grid::Resolution::XAxis::isReadOnly() :
+

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

2023-11-13 Thread Miklos Vajna (via logerrit)
 include/svx/svdpage.hxx   |2 +-
 svx/source/svdraw/svdpage.cxx |   10 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 9f09ce383eef0750240a61d90341d56bffbce824
Author: Miklos Vajna 
AuthorDate: Mon Nov 13 08:11:07 2023 +0100
Commit: Miklos Vajna 
CommitDate: Mon Nov 13 09:05:27 2023 +0100

svx: prefix members of SdrPage

See tdf#94879 for motivation.

Change-Id: I9b3b1116bca80a5c587931e4c8da9ac31e1faa5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159353
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index b197e4d2eb77..2a03e10cb2b1 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -444,7 +444,7 @@ protected:
 // new MasterPageDescriptorVector
 std::unique_ptr mpMasterPageDescriptor;
 
-sal_uInt16  nPageNum;
+sal_uInt16  m_nPageNum;
 
 boolmbMaster : 1;   // flag if this is a 
MasterPage
 boolmbInserted : 1;
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index bbe169e08b66..9b5965a5843a 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -1304,7 +1304,7 @@ SdrPage::SdrPage(SdrModel& rModel, bool bMasterPage)
 mnBorderRight(0),
 mnBorderLower(0),
 mpLayerAdmin(new SdrLayerAdmin(())),
-nPageNum(0),
+m_nPageNum(0),
 mbMaster(bMasterPage),
 mbInserted(false),
 mbObjectsNotPersistent(false),
@@ -1366,7 +1366,7 @@ void SdrPage::lateInit(const SdrPage& rSrcPage)
 mnBorderRight = rSrcPage.mnBorderRight;
 mnBorderLower = rSrcPage.mnBorderLower;
 mbBackgroundFullSize = rSrcPage.mbBackgroundFullSize;
-nPageNum = rSrcPage.nPageNum;
+m_nPageNum = rSrcPage.m_nPageNum;
 
 if(rSrcPage.TRG_HasMasterPage())
 {
@@ -1570,10 +1570,10 @@ bool SdrPage::IsBackgroundFullSize() const
 // #i68775# React on PageNum changes (from Model in most cases)
 void SdrPage::SetPageNum(sal_uInt16 nNew)
 {
-if(nNew != nPageNum)
+if(nNew != m_nPageNum)
 {
 // change
-nPageNum = nNew;
+m_nPageNum = nNew;
 
 // notify visualisations, also notifies e.g. buffered MasterPages
 ActionChanged();
@@ -1592,7 +1592,7 @@ sal_uInt16 SdrPage::GetPageNum() const
 if (getSdrModelFromSdrPage().IsPagNumsDirty())
 getSdrModelFromSdrPage().RecalcPageNums(false);
 }
-return nPageNum;
+return m_nPageNum;
 }
 
 void SdrPage::SetChanged()


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

2023-11-06 Thread Miklos Vajna (via logerrit)
 include/svx/svdoashp.hxx   |4 +-
 svx/source/svdraw/svdoashp.cxx |   72 -
 2 files changed, 38 insertions(+), 38 deletions(-)

New commits:
commit da99d57e03765e275a9640c82fe502ff244d547f
Author: Miklos Vajna 
AuthorDate: Mon Nov 6 08:04:25 2023 +0100
Commit: Miklos Vajna 
CommitDate: Mon Nov 6 10:56:49 2023 +0100

svx: prefix members of SdrObjCustomShape

See tdf#94879 for motivation.

Change-Id: I589bba671fc7ad4282d18c35666ace80fff9ed77
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158969
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx
index ef84beeb50e2..e36cb28d4948 100644
--- a/include/svx/svdoashp.hxx
+++ b/include/svx/svdoashp.hxx
@@ -75,7 +75,7 @@ class SVXCORE_DLLPUBLIC SdrObjCustomShape : public SdrTextObj
 {
 private:
 // fObjectRotation is containing the object rotation in degrees.
-double fObjectRotation;
+double m_fObjectRotation;
 bool mbAdjustingTextFrameWidthAndHeight;
 
 protected:
@@ -138,7 +138,7 @@ public:
 void SetMirroredX( const bool bMirroredX );
 void SetMirroredY( const bool bMirroredY );
 
-double GetObjectRotation() const { return fObjectRotation;}
+double GetObjectRotation() const { return m_fObjectRotation;}
 double GetExtraTextRotation( const bool bPreRotation = false ) const;
 
 SdrObjCustomShape(SdrModel& rSdrModel);
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index b455e3063d65..21998ff4e339 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -810,7 +810,7 @@ std::unique_ptr 
SdrObjCustomShape::CreateObject
 
 SdrObjCustomShape::SdrObjCustomShape(SdrModel& rSdrModel)
 :   SdrTextObj(rSdrModel)
-, fObjectRotation(0.0)
+, m_fObjectRotation(0.0)
 , mbAdjustingTextFrameWidthAndHeight(false)
 {
 m_bClosedObj = true; // custom shapes may be filled
@@ -819,13 +819,13 @@ SdrObjCustomShape::SdrObjCustomShape(SdrModel& rSdrModel)
 
 SdrObjCustomShape::SdrObjCustomShape(SdrModel& rSdrModel, SdrObjCustomShape 
const & rSource)
 :   SdrTextObj(rSdrModel, rSource)
-, fObjectRotation(0.0)
+, m_fObjectRotation(0.0)
 , mbAdjustingTextFrameWidthAndHeight(false)
 {
 m_bClosedObj = true; // custom shapes may be filled
 mbTextFrame = true;
 
-fObjectRotation = rSource.fObjectRotation;
+m_fObjectRotation = rSource.m_fObjectRotation;
 mbAdjustingTextFrameWidthAndHeight = 
rSource.mbAdjustingTextFrameWidthAndHeight;
 assert(!mbAdjustingTextFrameWidthAndHeight);
 InvalidateRenderGeometry();
@@ -1329,7 +1329,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const 
DefaultType eDefaultType ) cons
 
 void SdrObjCustomShape::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const
 {
-rInfo.bResizeFreeAllowed=fObjectRotation == 0.0;
+rInfo.bResizeFreeAllowed=m_fObjectRotation == 0.0;
 rInfo.bResizePropAllowed=true;
 rInfo.bRotateFreeAllowed=true;
 rInfo.bRotate90Allowed  =true;
@@ -1572,21 +1572,21 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, 
const Fraction& rxFact, co
 if (IsMirroredX())
 {
 if (IsMirroredY())
-fObjectRotation = fAngle - 180.0;
+m_fObjectRotation = fAngle - 180.0;
 else
-fObjectRotation = -fAngle;
+m_fObjectRotation = -fAngle;
 }
 else
 {
 if (IsMirroredY())
-fObjectRotation = 180.0 - fAngle;
+m_fObjectRotation = 180.0 - fAngle;
 else
-fObjectRotation = fAngle;
+m_fObjectRotation = fAngle;
 }
-while (fObjectRotation < 0)
-fObjectRotation += 360.0;
-while (fObjectRotation >= 360.0)
-fObjectRotation -= 360.0;
+while (m_fObjectRotation < 0)
+m_fObjectRotation += 360.0;
+while (m_fObjectRotation >= 360.0)
+m_fObjectRotation -= 360.0;
 
 InvalidateRenderGeometry();
 }
@@ -1596,9 +1596,9 @@ void SdrObjCustomShape::NbcRotate( const Point& rRef, 
Degree100 nAngle, double s
 bool bMirroredX = IsMirroredX();
 bool bMirroredY = IsMirroredY();
 
-fObjectRotation = fmod( fObjectRotation, 360.0 );
-if ( fObjectRotation < 0 )
-fObjectRotation = 360 + fObjectRotation;
+m_fObjectRotation = fmod( m_fObjectRotation, 360.0 );
+if ( m_fObjectRotation < 0 )
+m_fObjectRotation = 360 + m_fObjectRotation;
 
 // the rotation angle for ashapes is stored in fObjectRotation, this 
rotation
 // has to be applied to the text object (which is internally using 
maGeo.nAngle).
@@ -1608,7 +1608,7 @@ void SdrObjCustomShape::NbcRotate( const Point& rRef, 
Degree100 nAngle, double s
 maGeo.m_nRotationAngle = 0_deg100; 
// resetting aGeo data
 maGeo.RecalcSinCos();
 
-Degree100 nW(static_cast( fObjectRotation * 100 )); 
 // applying our object rotation
+

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

2023-10-31 Thread Noel Grandin (via logerrit)
 include/svx/sdr/properties/defaultproperties.hxx|4 +--
 svx/source/sdr/properties/attributeproperties.cxx   |   20 +++
 svx/source/sdr/properties/captionproperties.cxx |6 ++--
 svx/source/sdr/properties/circleproperties.cxx  |6 ++--
 svx/source/sdr/properties/customshapeproperties.cxx |4 +--
 svx/source/sdr/properties/defaultproperties.cxx |   26 ++--
 svx/source/sdr/properties/e3dcompoundproperties.cxx |6 ++--
 svx/source/sdr/properties/e3dsceneproperties.cxx|   20 +++
 svx/source/sdr/properties/graphicproperties.cxx |   20 +++
 svx/source/sdr/properties/measureproperties.cxx |   12 -
 svx/source/sdr/properties/textproperties.cxx|   18 ++---
 svx/source/table/cell.cxx   |2 -
 12 files changed, 72 insertions(+), 72 deletions(-)

New commits:
commit 525a4732c74baf0c8638353d32bf4220bbb77623
Author: Noel Grandin 
AuthorDate: Tue Oct 31 12:36:17 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Oct 31 18:10:13 2023 +0100

rename mxItemSet->moItemSet in DefaultProperties

because it reduces the noise in an upcoming patch

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

diff --git a/include/svx/sdr/properties/defaultproperties.hxx 
b/include/svx/sdr/properties/defaultproperties.hxx
index bec1fbe27320..410fa593ac92 100644
--- a/include/svx/sdr/properties/defaultproperties.hxx
+++ b/include/svx/sdr/properties/defaultproperties.hxx
@@ -38,7 +38,7 @@ namespace sdr::properties
 {
 protected:
 // the to be used ItemSet
-mutable std::optional mxItemSet;
+mutable std::optional moItemSet;
 
 // create a new object specific itemset with object specific 
ranges.
 virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) 
override;
@@ -60,7 +60,7 @@ namespace sdr::properties
 virtual void ItemSetChanged(std::span< const SfxPoolItem* const > 
aChangedItems, sal_uInt16 nDeletedWhich);
 
 // check if SfxItemSet exists
-bool HasSfxItemSet() const { return bool(mxItemSet); }
+bool HasSfxItemSet() const { return bool(moItemSet); }
 
 public:
 // basic constructor
diff --git a/svx/source/sdr/properties/attributeproperties.cxx 
b/svx/source/sdr/properties/attributeproperties.cxx
index 37bdc9cfa05a..3fc050f825f9 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -55,7 +55,7 @@ namespace sdr::properties
 {
 if(SfxItemState::SET == aIter.GetItemState())
 {
-mxItemSet->ClearItem(nWhich);
+moItemSet->ClearItem(nWhich);
 }
 
 nWhich = aIter.NextWhich();
@@ -63,7 +63,7 @@ namespace sdr::properties
 }
 
 // set new stylesheet as parent
-mxItemSet->SetParent(>GetItemSet());
+moItemSet->SetParent(>GetItemSet());
 }
 else
 {
@@ -110,7 +110,7 @@ namespace sdr::properties
 // reset parent of ItemSet
 if(HasSfxItemSet())
 {
-mxItemSet->SetParent(nullptr);
+moItemSet->SetParent(nullptr);
 }
 
 SdrObject& rObj = GetSdrObject();
@@ -272,7 +272,7 @@ namespace sdr::properties
 }
 }
 
-return *mxItemSet;
+return *moItemSet;
 }
 
 void AttributeProperties::ItemSetChanged(std::span< const SfxPoolItem* 
const > /*aChangedItems*/, sal_uInt16 /*nDeletedWhich*/)
@@ -339,11 +339,11 @@ namespace sdr::properties
 if(pResultItem)
 {
 // force ItemSet
-mxItemSet->Put(std::move(pResultItem));
+moItemSet->Put(std::move(pResultItem));
 }
 else
 {
-mxItemSet->Put(*pNewItem);
+moItemSet->Put(*pNewItem);
 }
 }
 else
@@ -351,7 +351,7 @@ namespace sdr::properties
 // clear item if ItemSet exists
 if(HasSfxItemSet())
 {
-mxItemSet->ClearItem(nWhich);
+moItemSet->ClearItem(nWhich);
 }
 }
 }
@@ -384,7 +384,7 @@ namespace sdr::properties
 GetObjectItemSet();
 
 // prepare copied, new itemset, but WITHOUT parent
-SfxItemSet aDestItemSet(*mxItemSet);
+SfxItemSet aDestItemSet(*moItemSet);
 

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

2023-10-31 Thread Noel Grandin (via logerrit)
 include/svx/svdoattr.hxx   |4 +---
 include/svx/svdobj.hxx |2 +-
 include/svx/svdovirt.hxx   |3 +++
 svx/source/svdraw/svdoattr.cxx |5 -
 svx/source/svdraw/svdobj.cxx   |   10 +-
 svx/source/svdraw/svdovirt.cxx |6 ++
 6 files changed, 16 insertions(+), 14 deletions(-)

New commits:
commit 5d0748b0c44649c422980a2b2f5554846c47ac9c
Author: Noel Grandin 
AuthorDate: Tue Oct 31 12:09:56 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue Oct 31 18:09:53 2023 +0100

SdrAttrObj and SdrObject are abstract

so push the CreateObjectSpecificProperties implementation down to the
concrete subclasses.

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

diff --git a/include/svx/svdoattr.hxx b/include/svx/svdoattr.hxx
index 3933caa3f3f5..26990a193b46 100644
--- a/include/svx/svdoattr.hxx
+++ b/include/svx/svdoattr.hxx
@@ -29,15 +29,13 @@ class SdrOutliner;
 class SfxItemSet;
 class SfxItemPool;
 
-//   SdrAttrObj
+//   SdrAttrObj. This is an abstract class, we only instantiate its subclasses.
 class SVXCORE_DLLPUBLIC SdrAttrObj : public SdrObject
 {
 private:
 friend classSdrOutliner;
 
 protected:
-virtual std::unique_ptr 
CreateObjectSpecificProperties() override;
-
 tools::Rectangle   maSnapRect;
 
 protected:
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 631a5973bb7b..892beb56668c 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -917,7 +917,7 @@ protected:
 
 virtual ~SdrObject() override;
 
-virtual std::unique_ptr 
CreateObjectSpecificProperties();
+virtual std::unique_ptr 
CreateObjectSpecificProperties() = 0;
 
 virtual std::unique_ptr 
CreateObjectSpecificViewContact();
 
diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx
index 8ccddce4d263..17c869313067 100644
--- a/include/svx/svdovirt.hxx
+++ b/include/svx/svdovirt.hxx
@@ -34,6 +34,9 @@ public:
 virtual sdr::properties::BaseProperties& GetProperties() const override;
 
 protected:
+virtual std::unique_ptr
+CreateObjectSpecificProperties() override;
+
 virtual std::unique_ptr 
CreateObjectSpecificViewContact() override;
 
 rtl::Reference mxRefObj; // Referenced drawing object
diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx
index 2c1b208d314d..ae4f59baa5cf 100644
--- a/svx/source/svdraw/svdoattr.cxx
+++ b/svx/source/svdraw/svdoattr.cxx
@@ -29,11 +29,6 @@
 
 using namespace com::sun::star;
 
-std::unique_ptr 
SdrAttrObj::CreateObjectSpecificProperties()
-{
-return std::make_unique(*this);
-}
-
 SdrAttrObj::SdrAttrObj(SdrModel& rSdrModel)
 : SdrObject(rSdrModel)
 {
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index c5741f5007c1..f4d13219db0d 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -211,11 +211,6 @@ const std::shared_ptr< svx::diagram::IDiagramHelper >& 
SdrObject::getDiagramHelp
 
 // BaseProperties section
 
-std::unique_ptr 
SdrObject::CreateObjectSpecificProperties()
-{
-return std::make_unique(*this);
-}
-
 sdr::properties::BaseProperties& SdrObject::GetProperties() const
 {
 if(!mpProperties)
@@ -3245,6 +3240,11 @@ public:
 return new EmptyObject(rTargetModel, *this);
 }
 
+virtual std::unique_ptr 
CreateObjectSpecificProperties() override
+{
+return std::make_unique(*this);
+}
+
 SdrInventor GetObjInventor() const override
 {
 return OBJECT_INVENTOR;
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index 25a38804a78b..b1fe6f5cb9bb 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -18,6 +18,7 @@
  */
 
 
+#include 
 #include 
 #include 
 #include 
@@ -31,6 +32,11 @@ sdr::properties::BaseProperties& SdrVirtObj::GetProperties() 
const
 }
 
 
+std::unique_ptr 
SdrVirtObj::CreateObjectSpecificProperties()
+{
+return std::make_unique(*this);
+}
+
 // #i27224#
 std::unique_ptr 
SdrVirtObj::CreateObjectSpecificViewContact()
 {


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

2023-10-28 Thread Heiko Tietze (via logerrit)
 include/svx/labelitemwindow.hxx  |   11 
 include/svx/srchdlg.hxx  |2 
 svx/source/dialog/srchdlg.cxx|   40 +++--
 svx/source/form/labelitemwindow.cxx  |   24 +-
 svx/uiconfig/ui/findreplacedialog.ui |   80 +--
 svx/uiconfig/ui/labelbox.ui  |   29 ++--
 6 files changed, 135 insertions(+), 51 deletions(-)

New commits:
commit 97d3d4f371f82704dba907975e6cfdaac456fe4d
Author: Heiko Tietze 
AuthorDate: Fri Sep 15 14:23:50 2023 +0200
Commit: Heiko Tietze 
CommitDate: Sat Oct 28 11:23:12 2023 +0200

Resolves tdf#156227 - More appealing feedback for find/quickfind

ErrorMessageType removed in favor of an infobar-like label
Accessibility notification added for the quickfind bar

Change-Id: Iec2498d04152392b3e181146005bdb0c9db8ec50
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156943
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/include/svx/labelitemwindow.hxx b/include/svx/labelitemwindow.hxx
index 5271482b11ad..d9aeccbb7bfd 100644
--- a/include/svx/labelitemwindow.hxx
+++ b/include/svx/labelitemwindow.hxx
@@ -12,14 +12,23 @@
 #include 
 #include 
 
+enum class LabelItemWindowType
+{
+Text,
+Info,
+};
+
 class SVXCORE_DLLPUBLIC LabelItemWindow final : public InterimItemWindow
 {
 private:
+std::unique_ptr m_xBox;
 std::unique_ptr m_xLabel;
+std::unique_ptr m_xImage;
 
 public:
 LabelItemWindow(vcl::Window* pParent, const OUString& rLabel);
-void set_label(const OUString& rLabel);
+void set_label(const OUString& rLabel,
+   const LabelItemWindowType eType = 
LabelItemWindowType::Text);
 OUString get_label() const;
 
 void SetOptimalSize();
diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index f069af48c539..7223a51cd324 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -177,6 +177,8 @@ private:
 std::unique_ptr m_xSearchTmplLB;
 std::unique_ptr m_xSearchAttrText;
 std::unique_ptr m_xSearchLabel;
+std::unique_ptr m_xSearchIcon;
+std::unique_ptr m_xSearchBox;
 
 std::unique_ptr m_xReplaceFrame;
 std::unique_ptr m_xReplaceLB;
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index a17711bc46fb..b5cf7bcf34fd 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -285,6 +285,8 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, 
SfxChildWindow* pChildWi
 , m_xSearchTmplLB(m_xBuilder->weld_combo_box("searchlist"))
 , m_xSearchAttrText(m_xBuilder->weld_label("searchdesc"))
 , m_xSearchLabel(m_xBuilder->weld_label("searchlabel"))
+, m_xSearchIcon(m_xBuilder->weld_image("searchicon"))
+, m_xSearchBox(m_xBuilder->weld_box("searchbox"))
 , m_xReplaceFrame(m_xBuilder->weld_frame("replaceframe"))
 , m_xReplaceLB(m_xBuilder->weld_combo_box("replaceterm"))
 , m_xReplaceTmplLB(m_xBuilder->weld_combo_box("replacelist"))
@@ -340,6 +342,9 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, 
SfxChildWindow* pChildWi
 m_xSearchTmplLB->make_sorted();
 m_xSearchAttrText->hide();
 
+m_xSearchLabel->set_font_color(Color(0x00, 0x47, 0x85));
+this->SetSearchLabel(""); // hide the message but keep the box height
+
 m_xReplaceTmplLB->make_sorted();
 m_xReplaceAttrText->hide();
 
@@ -581,14 +586,18 @@ void SvxSearchDialog::SetSearchLabel(const OUString& rStr)
 m_xSearchLabel->set_label(rStr);
 if (!rStr.isEmpty())
 {
-// hide/show to fire SHOWING state change event so search label text
-// is announced by screen reader
-m_xSearchLabel->hide();
 m_xSearchLabel->show();
+m_xSearchIcon->show();
+m_xSearchBox->set_background(Color(0xBD, 0xE5, 0xF8)); // same as 
InfobarType::INFO
+}
+else
+{
+const Size aSize = m_xSearchBox->get_preferred_size();
+m_xSearchLabel->hide();
+m_xSearchIcon->hide();
+m_xSearchBox->set_size_request(-1, aSize.Height());
+m_xSearchBox->set_background(COL_TRANSPARENT);
 }
-
-if (rStr == SvxResId(RID_SVXSTR_SEARCH_NOT_FOUND))
-m_xSearchLB->set_entry_message_type(weld::EntryMessageType::Error);
 }
 
 void SvxSearchDialog::ApplyTransliterationFlags_Impl( TransliterationFlags 
nSettings )
@@ -2360,8 +2369,6 @@ SfxChildWinInfo SvxSearchDialogWrapper::GetInfo() const
 
 static void lcl_SetSearchLabelWindow(const OUString& rStr, SfxViewFrame& 
rViewFrame)
 {
-bool bNotFound = rStr == SvxResId(RID_SVXSTR_SEARCH_NOT_FOUND);
-
 css::uno::Reference< css::beans::XPropertySet > xPropSet(
 rViewFrame.GetFrame().GetFrameInterface(), 
css::uno::UNO_QUERY_THROW);
 css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
@@ -2380,21 +2387,8 @@ static void lcl_SetSearchLabelWindow(const OUString& 
rStr, SfxViewFrame& rViewFr
 {
 

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

2023-10-24 Thread Miklos Vajna (via logerrit)
 include/svx/svdsob.hxx |   16 
 svx/source/svdraw/svdlayer.cxx |8 
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit ed7d1c49c0a898772e7f81416b3414da8cc35f2e
Author: Miklos Vajna 
AuthorDate: Tue Oct 24 08:20:06 2023 +0200
Commit: Miklos Vajna 
CommitDate: Tue Oct 24 09:43:10 2023 +0200

svx: prefix members of SdrLayerIDSet

See tdf#94879 for motivation.

Change-Id: Ibac67e7f8535b231f63a01b7e572595f5b91a996
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158368
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdsob.hxx b/include/svx/svdsob.hxx
index 7e2b8578e01d..9d19a673641f 100644
--- a/include/svx/svdsob.hxx
+++ b/include/svx/svdsob.hxx
@@ -31,31 +31,31 @@
 class SVXCORE_DLLPUBLIC SdrLayerIDSet final
 {
 // For now, have up to 256 layers
-sal_uInt8 aData[32];
+sal_uInt8 m_aData[32];
 
 public:
 explicit SdrLayerIDSet(bool bInitVal = false)
 {
-memset(aData, bInitVal ? 0xFF : 0x00, sizeof(aData));
+memset(m_aData, bInitVal ? 0xFF : 0x00, sizeof(m_aData));
 }
 
 bool operator!=(const SdrLayerIDSet& rCmpSet) const
 {
-return (memcmp(aData, rCmpSet.aData, sizeof(aData))!=0);
+return (memcmp(m_aData, rCmpSet.m_aData, sizeof(m_aData))!=0);
 }
 
 void Set(SdrLayerID a)
 {
 const sal_Int16 nId = a.get();
 if (nId >= 0 && nId < 256)
-aData[nId / 8] |= 1 << (nId % 8);
+m_aData[nId / 8] |= 1 << (nId % 8);
 }
 
 void Clear(SdrLayerID a)
 {
 const sal_Int16 nId = a.get();
 if (nId >= 0 && nId < 256)
-aData[nId / 8] &= ~(1 << (nId % 8));
+m_aData[nId / 8] &= ~(1 << (nId % 8));
 }
 
 void Set(SdrLayerID a, bool b)
@@ -69,17 +69,17 @@ public:
 bool IsSet(SdrLayerID a) const
 {
 const sal_Int16 nId = a.get();
-return nId >= 0 && nId < 256 && (aData[nId / 8] & 1 << nId % 8) != 0;
+return nId >= 0 && nId < 256 && (m_aData[nId / 8] & 1 << nId % 8) != 0;
 }
 
 void SetAll()
 {
-memset(aData, 0xFF, sizeof(aData));
+memset(m_aData, 0xFF, sizeof(m_aData));
 }
 
 void ClearAll()
 {
-memset(aData, 0x00, sizeof(aData));
+memset(m_aData, 0x00, sizeof(m_aData));
 }
 
 bool IsEmpty() const;
diff --git a/svx/source/svdraw/svdlayer.cxx b/svx/source/svdraw/svdlayer.cxx
index cb482b9fc2a9..74d5222f92b1 100644
--- a/svx/source/svdraw/svdlayer.cxx
+++ b/svx/source/svdraw/svdlayer.cxx
@@ -27,7 +27,7 @@
 
 bool SdrLayerIDSet::IsEmpty() const
 {
-for(sal_uInt8 i : aData)
+for(sal_uInt8 i : m_aData)
 {
 if(i != 0)
 return false;
@@ -40,7 +40,7 @@ void SdrLayerIDSet::operator&=(const SdrLayerIDSet& r2ndSet)
 {
 for(sal_uInt16 i(0); i < 32; i++)
 {
-aData[i] &= r2ndSet.aData[i];
+m_aData[i] &= r2ndSet.m_aData[i];
 }
 }
 
@@ -59,12 +59,12 @@ void SdrLayerIDSet::PutValue( const css::uno::Any & rAny )
 sal_Int16 nIndex;
 for( nIndex = 0; nIndex < nCount; nIndex++ )
 {
-aData[nIndex] = static_cast(aSeq[nIndex]);
+m_aData[nIndex] = static_cast(aSeq[nIndex]);
 }
 
 for( ; nIndex < 32; nIndex++ )
 {
-aData[nIndex] = 0;
+m_aData[nIndex] = 0;
 }
 }
 


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

2023-10-18 Thread Noel Grandin (via logerrit)
 include/svx/svdpage.hxx   |7 ++-
 svx/source/svdraw/svdogrp.cxx |8 
 2 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 0280a9ef0d93bb2c8ec713b6dc36b77962b57e99
Author: Noel Grandin 
AuthorDate: Wed Oct 18 09:45:56 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 18 12:11:14 2023 +0200

tdf#155410 shave 1% cost off SdrGroup::GetLayer

by avoiding repeated indexed lookup into the std::deque inside
SdrObjList

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

diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 97142d661296..7ab37532c046 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -225,10 +225,15 @@ public:
 
 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
 
+typedef std::deque> SdrObjectDeque;
+
+SdrObjectDeque::const_iterator begin() const { return maList.begin(); }
+SdrObjectDeque::const_iterator end() const { return maList.end(); }
+
 private:
 tools::RectanglemaSdrObjListOutRect;
 tools::RectanglemaSdrObjListSnapRect;
-std::deque> maList;
+SdrObjectDeque maList;
 /// This list, if it exists, defines the navigation order. If it does
 /// not exist then maList defines the navigation order.
 std::optional>> 
mxNavigationOrder;
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index 6c63e258a963..8a518554827a 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -174,11 +174,11 @@ SdrObjKind SdrObjGroup::GetObjIdentifier() const
 
 SdrLayerID SdrObjGroup::GetLayer() const
 {
-bool b1st = true;
 SdrLayerID nLay = SdrObject::GetLayer();
-const size_t nObjCount(GetObjCount());
-for (size_t i=0; iGetLayer());
+bool b1st = true;
+for (const rtl::Reference& pObject : *this)
+{
+SdrLayerID nLay1(pObject->GetLayer());
 if (b1st) { nLay=nLay1; b1st = false; }
 else if (nLay1!=nLay) return SdrLayerID(0);
 }


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

2023-10-17 Thread Miklos Vajna (via logerrit)
 include/svx/svdhdl.hxx   |   20 ++--
 svx/source/svdraw/svdhdl.cxx |   26 +-
 2 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit a55e2ad714ff941a2aa2c725ffbc1057fbd9baf5
Author: Miklos Vajna 
AuthorDate: Mon Oct 16 20:06:02 2023 +0200
Commit: Miklos Vajna 
CommitDate: Tue Oct 17 08:12:01 2023 +0200

svx: prefix members of SdrHdlList

See tdf#94879 for motivation.

Change-Id: I9e529ef12c05e333e2eeb535d2ae72e5d4c84a72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158062
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx
index 0bcff5f2e318..4cece6895236 100644
--- a/include/svx/svdhdl.hxx
+++ b/include/svx/svdhdl.hxx
@@ -428,13 +428,13 @@ public:
 class SVXCORE_DLLPUBLIC SdrHdlList
 {
 size_t  mnFocusIndex;
-SdrMarkView*pView;
+SdrMarkView*m_pView;
 std::deque> maList;
-sal_uInt16  nHdlSize;
+sal_uInt16  m_nHdlSize;
 
-boolbRotateShear : 1;
-boolbDistortShear : 1;
-boolbMoveOutside : 1;  // move handles 
outwards (for TextEdit)
+boolm_bRotateShear : 1;
+boolm_bDistortShear : 1;
+boolm_bMoveOutside : 1;  // move handles 
outwards (for TextEdit)
 
 SVX_DLLPRIVATE SdrHdlList(const SdrHdlList&) = delete;
 SVX_DLLPRIVATE void operator=(const SdrHdlList&) = delete;
@@ -450,7 +450,7 @@ public:
 void ResetFocusHdl();
 
 // Access to View
-SdrMarkView* GetView() const { return pView;}
+SdrMarkView* GetView() const { return m_pView;}
 
 // Sorting: 1.Level first reference point handle, then normal handles, 
next Glue, then User then Plushandles
 //  2.Level PageView (Pointer)
@@ -460,13 +460,13 @@ public:
 SdrHdl*  GetHdl(size_t nNum) const { return nNum < maList.size() ? 
maList[nNum].get() : nullptr; }
 size_t   GetHdlNum(const SdrHdl* pHdl) const;
 void SetHdlSize(sal_uInt16 nSiz);
-sal_uInt16   GetHdlSize() const{ return nHdlSize; }
+sal_uInt16   GetHdlSize() const{ return 
m_nHdlSize; }
 void SetMoveOutside(bool bOn);
-bool IsMoveOutside() const { return bMoveOutside; }
+bool IsMoveOutside() const { return m_bMoveOutside; }
 void SetRotateShear(bool bOn);
-bool IsRotateShear() const { return bRotateShear; }
+bool IsRotateShear() const { return m_bRotateShear; }
 void SetDistortShear(bool bOn);
-bool IsDistortShear() const{ return bDistortShear; }
+bool IsDistortShear() const{ return m_bDistortShear; }
 
 // AddHdl takes ownership of the handle. It should be on the Heap
 // as Clear() deletes it.
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 867534e9a08f..90903acb29f8 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -2174,12 +2174,12 @@ void SdrHdlList::ResetFocusHdl()
 
 SdrHdlList::SdrHdlList(SdrMarkView* pV)
 :   mnFocusIndex(SAL_MAX_SIZE),
-pView(pV)
+m_pView(pV)
 {
-nHdlSize = 3;
-bRotateShear = false;
-bMoveOutside = false;
-bDistortShear = false;
+m_nHdlSize = 3;
+m_bRotateShear = false;
+m_bMoveOutside = false;
+m_bDistortShear = false;
 }
 
 SdrHdlList::~SdrHdlList()
@@ -2189,10 +2189,10 @@ SdrHdlList::~SdrHdlList()
 
 void SdrHdlList::SetHdlSize(sal_uInt16 nSiz)
 {
-if(nHdlSize != nSiz)
+if(m_nHdlSize != nSiz)
 {
 // remember new value
-nHdlSize = nSiz;
+m_nHdlSize = nSiz;
 
 // propagate change to IAOs
 for(size_t i=0; i SdrHdlList::RemoveHdl(size_t nNum)
@@ -2248,8 +2248,8 @@ void SdrHdlList::Clear()
 {
 maList.clear();
 
-bRotateShear=false;
-bDistortShear=false;
+m_bRotateShear=false;
+m_bDistortShear=false;
 }
 
 void SdrHdlList::Sort()


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

2023-10-10 Thread Pedro Pinto Silva (via logerrit)
 include/svx/srchdlg.hxx   |1 +
 svx/source/dialog/srchdlg.cxx |7 +++
 2 files changed, 8 insertions(+)

New commits:
commit 564af6b066b71aa48cca9bb843668a2fb47d999c
Author: Pedro Pinto Silva 
AuthorDate: Wed Mar 22 10:07:43 2023 +0100
Commit: Caolán McNamara 
CommitDate: Tue Oct 10 17:31:25 2023 +0200

jsdialog: hide help and close buttons for searchreplace dialog

Signed-off-by: Pedro Pinto Silva 
Change-Id: I0f3bc2cd6839c74dff40431f8659d7f90b285d12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149293
(cherry picked from commit c65142fd9fd9a43e1f27cb11f5b4048600b5a4c4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157720
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx
index 9a75199ad818..f069af48c539 100644
--- a/include/svx/srchdlg.hxx
+++ b/include/svx/srchdlg.hxx
@@ -198,6 +198,7 @@ private:
 std::unique_ptr m_xWordBtn;
 
 std::unique_ptr m_xCloseBtn;
+std::unique_ptr m_xHelpBtn;
 std::unique_ptr m_xIncludeDiacritics;
 std::unique_ptr m_xIncludeKashida;
 std::unique_ptr m_xOtherOptionsExpander;
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index dcb467b5475f..a17711bc46fb 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -301,6 +301,7 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, 
SfxChildWindow* pChildWi
 , m_xSearchFormattedCB(m_xBuilder->weld_check_button("searchformatted"))
 , m_xWordBtn(m_xBuilder->weld_check_button("wholewords"))
 , m_xCloseBtn(m_xBuilder->weld_button("close"))
+, m_xHelpBtn(m_xBuilder->weld_button("help"))
 , m_xIncludeDiacritics(m_xBuilder->weld_check_button("includediacritics"))
 , m_xIncludeKashida(m_xBuilder->weld_check_button("includekashida"))
 , m_xOtherOptionsExpander(m_xBuilder->weld_expander("OptionsExpander"))
@@ -327,6 +328,12 @@ SvxSearchDialog::SvxSearchDialog(weld::Window* pParent, 
SfxChildWindow* pChildWi
 , m_xAllSheetsCB(m_xBuilder->weld_check_button("allsheets"))
 , m_xCalcStrFT(m_xBuilder->weld_label("entirecells"))
 {
+if (comphelper::LibreOfficeKit::isActive())
+{
+m_xCloseBtn->hide();
+m_xHelpBtn->hide();
+}
+
 m_aPresentIdle.SetTimeout(50);
 m_aPresentIdle.SetInvokeHandler(LINK(this, SvxSearchDialog, 
PresentTimeoutHdl_Impl));
 


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

2023-10-09 Thread Miklos Vajna (via logerrit)
 include/svx/svdhdl.hxx   |6 +++---
 svx/source/svdraw/svdhdl.cxx |6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3e3dd080fe32811b4a74088d3e819f593cbebd3e
Author: Miklos Vajna 
AuthorDate: Mon Oct 9 08:05:35 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Oct 9 09:47:18 2023 +0200

svx: prefix members of SdrHdlLine

See tdf#94879 for motivation.

Change-Id: I08a0368a6e262982419b3866defd6a181675af0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157690
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx
index 115bf9c77896..0bcff5f2e318 100644
--- a/include/svx/svdhdl.hxx
+++ b/include/svx/svdhdl.hxx
@@ -342,11 +342,11 @@ class SdrHdlLine final : public SdrHdl
 // create marker for this kind
 virtual void CreateB2dIAObject() override;
 
-SdrHdl* pHdl1;
-SdrHdl* pHdl2;
+SdrHdl* m_pHdl1;
+SdrHdl* m_pHdl2;
 
 public:
-SdrHdlLine(SdrHdl& rHdl1, SdrHdl& rHdl2, SdrHdlKind eNewKind) { 
m_eKind=eNewKind; pHdl1= pHdl2= }
+SdrHdlLine(SdrHdl& rHdl1, SdrHdl& rHdl2, SdrHdlKind eNewKind) { 
m_eKind=eNewKind; m_pHdl1= m_pHdl2= }
 virtual ~SdrHdlLine() override;
 
 virtual PointerStyle GetPointer() const override;
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index cecefc0d7810..deb8da05d9d5 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1447,7 +1447,7 @@ void SdrHdlLine::CreateB2dIAObject()
 
 SdrMarkView* pView = m_pHdlList->GetView();
 
-if(!(pView && !pView->areMarkHandlesHidden() && pHdl1 && pHdl2))
+if(!(pView && !pView->areMarkHandlesHidden() && m_pHdl1 && m_pHdl2))
 return;
 
 SdrPageView* pPageView = pView->GetSdrPageView();
@@ -1464,8 +1464,8 @@ void SdrHdlLine::CreateB2dIAObject()
 const rtl::Reference< sdr::overlay::OverlayManager >& xManager = 
rPageWindow.GetOverlayManager();
 if (xManager.is())
 {
-basegfx::B2DPoint aPosition1(pHdl1->GetPos().X(), 
pHdl1->GetPos().Y());
-basegfx::B2DPoint aPosition2(pHdl2->GetPos().X(), 
pHdl2->GetPos().Y());
+basegfx::B2DPoint aPosition1(m_pHdl1->GetPos().X(), 
m_pHdl1->GetPos().Y());
+basegfx::B2DPoint aPosition2(m_pHdl2->GetPos().X(), 
m_pHdl2->GetPos().Y());
 
 std::unique_ptr 
pNewOverlayObject(new
 sdr::overlay::OverlayLineStriped(


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

2023-10-02 Thread Miklos Vajna (via logerrit)
 include/svx/svdhdl.hxx   |   30 +++---
 svx/source/svdraw/svdhdl.cxx |   42 +-
 2 files changed, 36 insertions(+), 36 deletions(-)

New commits:
commit 819fabd11f9b78bf7ecef1d2afeae1a9d8382afa
Author: Miklos Vajna 
AuthorDate: Mon Oct 2 08:25:44 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Oct 2 10:40:23 2023 +0200

svx: prefix members of SdrHdlGradient

See tdf#94879 for motivation.

Change-Id: I1da02ee14cb3cbc0cd51ccc4f612947b789ca46a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157478
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx
index abd5a060f5aa..115bf9c77896 100644
--- a/include/svx/svdhdl.hxx
+++ b/include/svx/svdhdl.hxx
@@ -292,18 +292,18 @@ class SdrHdlGradient final : public SdrHdl
 {
 private:
 // pointer to used color handles
-SdrHdlColor*pColHdl1;
-SdrHdlColor*pColHdl2;
+SdrHdlColor*m_pColHdl1;
+SdrHdlColor*m_pColHdl2;
 
 // 2nd position
-Point   a2ndPos;
+Point   m_a2ndPos;
 
 // is this a gradient or a transparence
-boolbGradient : 1;
+boolm_bGradient : 1;
 
 // select which handle to move
-boolbMoveSingleHandle : 1;
-boolbMoveFirstHandle : 1;
+boolm_bMoveSingleHandle : 1;
+boolm_bMoveFirstHandle : 1;
 
 // create marker for this kind
 virtual void CreateB2dIAObject() override;
@@ -312,14 +312,14 @@ public:
 SdrHdlGradient(const Point& rRef1, const Point& rRef2, bool bGrad);
 virtual ~SdrHdlGradient() override;
 
-bool IsGradient() const { return bGradient; }
+bool IsGradient() const { return m_bGradient; }
 
 // set the associated color handles
-void SetColorHandles(SdrHdlColor* pL1, SdrHdlColor* pL2) { pColHdl1 = pL1; 
pColHdl2 = pL2; }
-SdrHdlColor* GetColorHdl1() const { return pColHdl1; }
-SdrHdlColor* GetColorHdl2() const { return pColHdl2; }
+void SetColorHandles(SdrHdlColor* pL1, SdrHdlColor* pL2) { m_pColHdl1 = 
pL1; m_pColHdl2 = pL2; }
+SdrHdlColor* GetColorHdl1() const { return m_pColHdl1; }
+SdrHdlColor* GetColorHdl2() const { return m_pColHdl2; }
 
-const Point& Get2ndPos() const { return a2ndPos; }
+const Point& Get2ndPos() const { return m_a2ndPos; }
 void Set2ndPos(const Point& rPnt);
 
 // the link called by the color handles
@@ -329,10 +329,10 @@ public:
 void FromIAOToItem(SdrObject* pObj, bool bSetItemOnObject, bool bUndo);
 
 // selection flags for interaction
-bool IsMoveSingleHandle() const { return bMoveSingleHandle; }
-void SetMoveSingleHandle(bool bNew) { bMoveSingleHandle = bNew; }
-bool IsMoveFirstHandle() const { return bMoveFirstHandle; }
-void SetMoveFirstHandle(bool bNew) { bMoveFirstHandle = bNew; }
+bool IsMoveSingleHandle() const { return m_bMoveSingleHandle; }
+void SetMoveSingleHandle(bool bNew) { m_bMoveSingleHandle = bNew; }
+bool IsMoveFirstHandle() const { return m_bMoveFirstHandle; }
+void SetMoveFirstHandle(bool bNew) { m_bMoveFirstHandle = bNew; }
 };
 
 
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 77904d411a9f..407e82eedb4e 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1253,12 +1253,12 @@ void SdrHdlColor::SetSize(const Size& rNew)
 
 SdrHdlGradient::SdrHdlGradient(const Point& rRef1, const Point& rRef2, bool 
bGrad)
 : SdrHdl(rRef1, bGrad ? SdrHdlKind::Gradient : SdrHdlKind::Transparence)
-, pColHdl1(nullptr)
-, pColHdl2(nullptr)
-, a2ndPos(rRef2)
-, bGradient(bGrad)
-, bMoveSingleHandle(false)
-, bMoveFirstHandle(false)
+, m_pColHdl1(nullptr)
+, m_pColHdl2(nullptr)
+, m_a2ndPos(rRef2)
+, m_bGradient(bGrad)
+, m_bMoveSingleHandle(false)
+, m_bMoveFirstHandle(false)
 {
 }
 
@@ -1268,10 +1268,10 @@ SdrHdlGradient::~SdrHdlGradient()
 
 void SdrHdlGradient::Set2ndPos(const Point& rPnt)
 {
-if(a2ndPos != rPnt)
+if(m_a2ndPos != rPnt)
 {
 // remember new position
-a2ndPos = rPnt;
+m_a2ndPos = rPnt;
 
 // create new display
 Touch();
@@ -1306,7 +1306,7 @@ void SdrHdlGradient::CreateB2dIAObject()
 if (xManager.is())
 {
 // striped line in between
-basegfx::B2DVector aVec(a2ndPos.X() - m_aPos.X(), a2ndPos.Y() 
- m_aPos.Y());
+basegfx::B2DVector aVec(m_a2ndPos.X() - m_aPos.X(), 
m_a2ndPos.Y() - m_aPos.Y());
 double fVecLen = aVec.getLength();
 double fLongPercentArrow = (1.0 - 0.05) * fVecLen;
 double fHalfArrowWidth = (0.05 * 0.5) * fVecLen;
@@ -1340,7 +1340,7 @@ void 

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

2023-09-25 Thread Miklos Vajna (via logerrit)
 include/svx/svdhdl.hxx   |   14 +++---
 svx/source/svdraw/svdhdl.cxx |   26 +-
 2 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit d6a1324380cc8362d509a1f29dcd2ca4ad4bee9d
Author: Miklos Vajna 
AuthorDate: Mon Sep 25 08:09:02 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 25 09:16:40 2023 +0200

svx: prefix members of SdrHdlColor

See tdf#94879 for motivation.

Change-Id: Ic987e38bb2f1a23504e27a32062df75215de6b3d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157232
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx
index 8824a65b4986..abd5a060f5aa 100644
--- a/include/svx/svdhdl.hxx
+++ b/include/svx/svdhdl.hxx
@@ -255,16 +255,16 @@ public:
 class SVXCORE_DLLPUBLIC SdrHdlColor final : public SdrHdl
 {
 // size of colr markers
-SizeaMarkerSize;
+Sizem_aMarkerSize;
 
 // color
-Color   aMarkerColor;
+Color   m_aMarkerColor;
 
 // callback link when value changed
-Link aColorChangeHdl;
+Link m_aColorChangeHdl;
 
 // use luminance values only
-boolbUseLuminance : 1;
+boolm_bUseLuminance : 1;
 
 // create marker for this kind
 SVX_DLLPRIVATE virtual void CreateB2dIAObject() override;
@@ -277,14 +277,14 @@ public:
 explicit SdrHdlColor(const Point& rRef, Color aCol, const Size& rSize, 
bool bLuminance);
 virtual ~SdrHdlColor() override;
 
-bool IsUseLuminance() const { return bUseLuminance; }
+bool IsUseLuminance() const { return m_bUseLuminance; }
 
-const Color& GetColor() const { return aMarkerColor; }
+const Color& GetColor() const { return m_aMarkerColor; }
 void SetColor(Color aNew, bool bCallLink = false);
 
 void SetSize(const Size& rNew);
 
-void SetColorChangeHdl(const Link& rLink) { 
aColorChangeHdl = rLink; }
+void SetColorChangeHdl(const Link& rLink) { 
m_aColorChangeHdl = rLink; }
 };
 
 
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 27b94f83d67a..77904d411a9f 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1112,14 +1112,14 @@ void SdrHdl::insertNewlyCreatedOverlayObjectForSdrHdl(
 
 SdrHdlColor::SdrHdlColor(const Point& rRef, Color aCol, const Size& rSize, 
bool bLum)
 :   SdrHdl(rRef, SdrHdlKind::Color),
-aMarkerSize(rSize),
-bUseLuminance(bLum)
+m_aMarkerSize(rSize),
+m_bUseLuminance(bLum)
 {
 if(IsUseLuminance())
 aCol = GetLuminance(aCol);
 
 // remember color
-aMarkerColor = aCol;
+m_aMarkerColor = aCol;
 }
 
 SdrHdlColor::~SdrHdlColor()
@@ -1153,7 +1153,7 @@ void SdrHdlColor::CreateB2dIAObject()
 const rtl::Reference< sdr::overlay::OverlayManager >& xManager = 
rPageWindow.GetOverlayManager();
 if (xManager.is())
 {
-BitmapEx aBmpCol(CreateColorDropper(aMarkerColor));
+BitmapEx aBmpCol(CreateColorDropper(m_aMarkerColor));
 basegfx::B2DPoint aPosition(m_aPos.X(), m_aPos.Y());
 std::unique_ptr 
pNewOverlayObject(new
 sdr::overlay::OverlayBitmapEx(
@@ -1177,13 +1177,13 @@ BitmapEx SdrHdlColor::CreateColorDropper(Color aCol)
 {
 // get the Bitmap
 VclPtr pWrite(VclPtr::Create());
-pWrite->SetOutputSizePixel(aMarkerSize);
+pWrite->SetOutputSizePixel(m_aMarkerSize);
 pWrite->SetBackground(aCol);
 pWrite->Erase();
 
 // draw outer border
-sal_Int32 nWidth = aMarkerSize.Width();
-sal_Int32 nHeight = aMarkerSize.Height();
+sal_Int32 nWidth = m_aMarkerSize.Width();
+sal_Int32 nHeight = m_aMarkerSize.Height();
 
 pWrite->SetLineColor(COL_LIGHTGRAY);
 pWrite->DrawLine(Point(0, 0), Point(0, nHeight - 1));
@@ -1210,7 +1210,7 @@ BitmapEx SdrHdlColor::CreateColorDropper(Color aCol)
 pWrite->DrawLine(Point(2, nHeight - 2), Point(nWidth - 2, nHeight - 2));
 pWrite->DrawLine(Point(nWidth - 2, 2), Point(nWidth - 2, nHeight - 3));
 
-return pWrite->GetBitmapEx(Point(0,0), aMarkerSize);
+return pWrite->GetBitmapEx(Point(0,0), m_aMarkerSize);
 }
 
 Color SdrHdlColor::GetLuminance(const Color& rCol)
@@ -1225,26 +1225,26 @@ void SdrHdlColor::SetColor(Color aNew, bool bCallLink)
 if(IsUseLuminance())
 aNew = GetLuminance(aNew);
 
-if(aMarkerColor != aNew)
+if(m_aMarkerColor != aNew)
 {
 // remember new color
-aMarkerColor = aNew;
+m_aMarkerColor = aNew;
 
 // create new display
 Touch();
 
 // tell about change
 if(bCallLink)
-aColorChangeHdl.Call(this);
+m_aColorChangeHdl.Call(this);
 }
 }
 
 void SdrHdlColor::SetSize(const Size& rNew)
 {
-if(rNew != aMarkerSize)
+if(rNew != m_aMarkerSize)
 {
 // 

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

2023-09-18 Thread Miklos Vajna (via logerrit)
 include/svx/svdhdl.hxx   |4 ++--
 svx/source/svdraw/svdhdl.cxx |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit fec20d4bba32b06fa3641290deaa4e4fec98ae42
Author: Miklos Vajna 
AuthorDate: Mon Sep 18 08:11:51 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 18 10:59:34 2023 +0200

svx: prefix members of SdrHdlBezWgt

See tdf#94879 for motivation.

Change-Id: I1bacd92ad30fe3765d2eb5054018f6fd64a3835d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157005
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx
index 78bb95e25ab2..8824a65b4986 100644
--- a/include/svx/svdhdl.hxx
+++ b/include/svx/svdhdl.hxx
@@ -359,14 +359,14 @@ class SdrHdlBezWgt final : public SdrHdl
 {
 public:
 // this is not a Copy-Ctor!!!
-SdrHdlBezWgt(const SdrHdl* pRefHdl1, SdrHdlKind 
eNewKind=SdrHdlKind::BezierWeight) { m_eKind=eNewKind; pHdl1=pRefHdl1; }
+SdrHdlBezWgt(const SdrHdl* pRefHdl1, SdrHdlKind 
eNewKind=SdrHdlKind::BezierWeight) { m_eKind=eNewKind; m_pHdl1=pRefHdl1; }
 virtual ~SdrHdlBezWgt() override;
 
 private:
 // create marker for this kind
 virtual void CreateB2dIAObject() override;
 
-const SdrHdl* pHdl1;
+const SdrHdl* m_pHdl1;
 };
 
 
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index d9b6514e466a..27b94f83d67a 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1522,7 +1522,7 @@ void SdrHdlBezWgt::CreateB2dIAObject()
 const rtl::Reference< sdr::overlay::OverlayManager >& xManager = 
rPageWindow.GetOverlayManager();
 if (xManager.is())
 {
-basegfx::B2DPoint aPosition1(pHdl1->GetPos().X(), 
pHdl1->GetPos().Y());
+basegfx::B2DPoint aPosition1(m_pHdl1->GetPos().X(), 
m_pHdl1->GetPos().Y());
 basegfx::B2DPoint aPosition2(m_aPos.X(), m_aPos.Y());
 
 if(!aPosition1.equal(aPosition2))


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

2023-09-12 Thread Julien Nabet (via logerrit)
 include/svx/svdoedge.hxx   |   12 ++--
 svx/source/svdraw/svdoedge.cxx |   38 +++---
 2 files changed, 25 insertions(+), 25 deletions(-)

New commits:
commit 93c5885dad3343f3d1a55e33bf83fecd1fed8cab
Author: Julien Nabet 
AuthorDate: Tue Sep 12 22:48:12 2023 +0200
Commit: Julien Nabet 
CommitDate: Wed Sep 13 07:14:19 2023 +0200

svx: prefix members of SaveGeoData

See tdf#94879 for motivation.

Change-Id: I9ba78fdbb7f2390f43e3315c8cdf86c56f96f478
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156863
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index 4da2219b3645..94bb89a00a3e 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -112,12 +112,12 @@ public:
 class SdrEdgeObjGeoData final : public SdrTextObjGeoData
 {
 public:
-SdrObjConnectionaCon1;  // connection status of the beginning 
of the line
-SdrObjConnectionaCon2;  // connection status of the end of the 
line
-std::optional pEdgeTrack;
-boolbEdgeTrackDirty; // true -> connector track 
needs to be recalculated
-boolbEdgeTrackUserDefined;
-SdrEdgeInfoRec  aEdgeInfo;
+SdrObjConnectionm_aCon1;  // connection status of the 
beginning of the line
+SdrObjConnectionm_aCon2;  // connection status of the end of 
the line
+std::optional m_pEdgeTrack;
+boolm_bEdgeTrackDirty; // true -> connector track 
needs to be recalculated
+boolm_bEdgeTrackUserDefined;
+SdrEdgeInfoRec  m_aEdgeInfo;
 
 public:
 SdrEdgeObjGeoData();
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 4eee430ced24..f70e1f924f6b 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -2478,9 +2478,9 @@ void SdrEdgeObj::NbcSetPoint(const Point& rPnt, 
sal_uInt32 i)
 }
 
 SdrEdgeObjGeoData::SdrEdgeObjGeoData()
-: pEdgeTrack(std::in_place)
-, bEdgeTrackDirty(false)
-, bEdgeTrackUserDefined(false)
+: m_pEdgeTrack(std::in_place)
+, m_bEdgeTrackDirty(false)
+, m_bEdgeTrackUserDefined(false)
 {
 }
 
@@ -2497,38 +2497,38 @@ void SdrEdgeObj::SaveGeoData(SdrObjGeoData& rGeo) const
 {
 SdrTextObj::SaveGeoData(rGeo);
 SdrEdgeObjGeoData& rEGeo=static_cast(rGeo);
-rEGeo.aCon1  =m_aCon1;
-rEGeo.aCon2  =m_aCon2;
-*rEGeo.pEdgeTrack=*m_pEdgeTrack;
-rEGeo.bEdgeTrackDirty=m_bEdgeTrackDirty;
-rEGeo.bEdgeTrackUserDefined=m_bEdgeTrackUserDefined;
-rEGeo.aEdgeInfo  =m_aEdgeInfo;
+rEGeo.m_aCon1  =m_aCon1;
+rEGeo.m_aCon2  =m_aCon2;
+*rEGeo.m_pEdgeTrack=*m_pEdgeTrack;
+rEGeo.m_bEdgeTrackDirty=m_bEdgeTrackDirty;
+rEGeo.m_bEdgeTrackUserDefined=m_bEdgeTrackUserDefined;
+rEGeo.m_aEdgeInfo  =m_aEdgeInfo;
 }
 
 void SdrEdgeObj::RestoreGeoData(const SdrObjGeoData& rGeo)
 {
 SdrTextObj::RestoreGeoData(rGeo);
 const SdrEdgeObjGeoData& rEGeo=static_cast(rGeo);
-if (m_aCon1.m_pSdrObj!=rEGeo.aCon1.m_pSdrObj) {
+if (m_aCon1.m_pSdrObj!=rEGeo.m_aCon1.m_pSdrObj) {
 if (m_aCon1.m_pSdrObj!=nullptr) 
m_aCon1.m_pSdrObj->RemoveListener(*this);
-m_aCon1=rEGeo.aCon1;
+m_aCon1=rEGeo.m_aCon1;
 if (m_aCon1.m_pSdrObj!=nullptr) m_aCon1.m_pSdrObj->AddListener(*this);
 }
 else
-m_aCon1=rEGeo.aCon1;
+m_aCon1=rEGeo.m_aCon1;
 
-if (m_aCon2.m_pSdrObj!=rEGeo.aCon2.m_pSdrObj) {
+if (m_aCon2.m_pSdrObj!=rEGeo.m_aCon2.m_pSdrObj) {
 if (m_aCon2.m_pSdrObj!=nullptr) 
m_aCon2.m_pSdrObj->RemoveListener(*this);
-m_aCon2=rEGeo.aCon2;
+m_aCon2=rEGeo.m_aCon2;
 if (m_aCon2.m_pSdrObj!=nullptr) m_aCon2.m_pSdrObj->AddListener(*this);
 }
 else
-m_aCon2=rEGeo.aCon2;
+m_aCon2=rEGeo.m_aCon2;
 
-*m_pEdgeTrack=*rEGeo.pEdgeTrack;
-m_bEdgeTrackDirty=rEGeo.bEdgeTrackDirty;
-m_bEdgeTrackUserDefined=rEGeo.bEdgeTrackUserDefined;
-m_aEdgeInfo  =rEGeo.aEdgeInfo;
+*m_pEdgeTrack=*rEGeo.m_pEdgeTrack;
+m_bEdgeTrackDirty=rEGeo.m_bEdgeTrackDirty;
+m_bEdgeTrackUserDefined=rEGeo.m_bEdgeTrackUserDefined;
+m_aEdgeInfo  =rEGeo.m_aEdgeInfo;
 }
 
 Point SdrEdgeObj::GetTailPoint( bool bTail ) const


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

2023-09-04 Thread Miklos Vajna (via logerrit)
 include/svx/svdglue.hxx   |   10 +-
 svx/source/svdraw/svdglue.cxx |   22 +++---
 2 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 9bb4fa71c230a34a07ea9b7c4e4f13f4d3f7b5fe
Author: Miklos Vajna 
AuthorDate: Mon Sep 4 08:29:26 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Sep 4 16:27:30 2023 +0200

svx: prefix members of SdrGluePointList

See tdf#94879 for motivation.

Change-Id: Ia58a0c5319d51c463db23bae250e6c0c5e7a9741
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156505
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdglue.hxx b/include/svx/svdglue.hxx
index acdebd0bf4ea..234ecf08cdd0 100644
--- a/include/svx/svdglue.hxx
+++ b/include/svx/svdglue.hxx
@@ -182,7 +182,7 @@ public:
 
 class SVXCORE_DLLPUBLIC SdrGluePointList
 {
-std::vector aList;
+std::vector m_aList;
 public:
 SdrGluePointList() {};
 SdrGluePointList(const SdrGluePointList& rSrcList)
@@ -193,22 +193,22 @@ public:
 SdrGluePointList& operator=(const SdrGluePointList& rSrcList);
 sal_uInt16 GetCount() const
 {
-return sal_uInt16(aList.size());
+return sal_uInt16(m_aList.size());
 }
 // At insert, the object (GluePoint) automatically gets an ID assigned.
 // Return value is the index of the new GluePoint in the list.
 sal_uInt16 Insert(const SdrGluePoint& rGP);
 void Delete(sal_uInt16 nPos)
 {
-aList.erase(aList.begin() + nPos);
+m_aList.erase(m_aList.begin() + nPos);
 }
 SdrGluePoint& operator[](sal_uInt16 nPos)
 {
-return aList[nPos];
+return m_aList[nPos];
 }
 const SdrGluePoint& operator[](sal_uInt16 nPos) const
 {
-return aList[nPos];
+return m_aList[nPos];
 }
 sal_uInt16 FindGluePoint(sal_uInt16 nId) const;
 sal_uInt16 HitTest(const Point& rPnt, const OutputDevice& rOut, const 
SdrObject* pObj) const;
diff --git a/svx/source/svdraw/svdglue.cxx b/svx/source/svdraw/svdglue.cxx
index 471089f3763c..c27fc2e2bde9 100644
--- a/svx/source/svdraw/svdglue.cxx
+++ b/svx/source/svdraw/svdglue.cxx
@@ -282,7 +282,7 @@ bool SdrGluePoint::IsHit(const Point& rPnt, const 
OutputDevice& rOut, const SdrO
 
 SdrGluePointList& SdrGluePointList::operator=(const SdrGluePointList& rSrcList)
 {
-if (GetCount()!=0) aList.clear();
+if (GetCount()!=0) m_aList.clear();
 sal_uInt16 nCount=rSrcList.GetCount();
 for (sal_uInt16 i=0; i=nCount,"SdrGluePointList::Insert(): nLastIdnCount;
 if (nId<=nLastId) {
@@ -307,7 +307,7 @@ sal_uInt16 SdrGluePointList::Insert(const SdrGluePoint& rGP)
 } else {
 bool bBrk = false;
 for (sal_uInt16 nNum=0; nNum0) && nRet==SDRGLUEPOINT_NOTFOUND) {
 nNum--;
-const auto& pGP = aList[nNum];
+const auto& pGP = m_aList[nNum];
 if (pGP.IsHit(rPnt,rOut,pObj))
 nRet = nNum;
 }
@@ -362,13 +362,13 @@ sal_uInt16 SdrGluePointList::HitTest(const Point& rPnt, 
const OutputDevice& rOut
 
 void SdrGluePointList::SetReallyAbsolute(bool bOn, const SdrObject& rObj)
 {
-for (auto& xGP : aList)
+for (auto& xGP : m_aList)
 xGP.SetReallyAbsolute(bOn,rObj);
 }
 
 void SdrGluePointList::Rotate(const Point& rRef, Degree100 nAngle, double sn, 
double cs, const SdrObject* pObj)
 {
-for (auto& xGP : aList)
+for (auto& xGP : m_aList)
 xGP.Rotate(rRef,nAngle,sn,cs,pObj);
 }
 
@@ -381,13 +381,13 @@ void SdrGluePointList::Mirror(const Point& rRef1, const 
Point& rRef2, const SdrO
 
 void SdrGluePointList::Mirror(const Point& rRef1, const Point& rRef2, 
Degree100 nAngle, const SdrObject* pObj)
 {
-for (auto& xGP : aList)
+for (auto& xGP : m_aList)
 xGP.Mirror(rRef1,rRef2,nAngle,pObj);
 }
 
 void SdrGluePointList::Shear(const Point& rRef, double tn, bool bVShear, const 
SdrObject* pObj)
 {
-for (auto& xGP : aList)
+for (auto& xGP : m_aList)
 xGP.Shear(rRef,tn,bVShear,pObj);
 }
 


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

2023-09-01 Thread Henry Castro (via logerrit)
 include/svx/ParseContext.hxx |   11 +--
 svx/source/form/ParseContext.cxx |   16 
 2 files changed, 25 insertions(+), 2 deletions(-)

New commits:
commit 47d77c822fb58f9617379969b078c8a6230767d6
Author: Henry Castro 
AuthorDate: Wed Aug 30 10:16:37 2023 -0400
Commit: Henry Castro 
CommitDate: Fri Sep 1 19:09:28 2023 +0200

svx: add class "ONeutralParseContext"

If Base SQL query:

SELECT COUNT("test"."id") FROM Test

Then changed to Spanish interface, it is required
to have a neutral keyword localized, the "COUNT"
will fail to detect column type, because the keyword
in Spanish is "RECUENTO"

Signed-off-by: Henry Castro 
Change-Id: I191b9591ad796d0dd9509c0fb10b11c16f72e1ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156296
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156423
Tested-by: Jenkins

diff --git a/include/svx/ParseContext.hxx b/include/svx/ParseContext.hxx
index 4b8f451a8014..b5b8b7c84ea6 100644
--- a/include/svx/ParseContext.hxx
+++ b/include/svx/ParseContext.hxx
@@ -31,11 +31,12 @@ namespace svxform
 
 //= OSystemParseContext
 
-class SAL_DLLPUBLIC_RTTI OSystemParseContext final : public 
::connectivity::IParseContext
+class SAL_DLLPUBLIC_RTTI OSystemParseContext : public 
::connectivity::IParseContext
 {
-private:
+protected:
 
 ::std::vector< OUString > m_aLocalizedKeywords;
+OSystemParseContext(bool bInit);
 
 public:
 SVXCORE_DLLPUBLIC OSystemParseContext();
@@ -57,6 +58,12 @@ namespace svxform
 
 };
 
+class SAL_DLLPUBLIC_RTTI ONeutralParseContext final : public 
OSystemParseContext
+{
+public:
+SVXCORE_DLLPUBLIC ONeutralParseContext();
+SVXCORE_DLLPUBLIC virtual ~ONeutralParseContext();
+};
 
 //= OParseContextClient
 
diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx
index 63634179142e..d231bfb3cd52 100644
--- a/svx/source/form/ParseContext.cxx
+++ b/svx/source/form/ParseContext.cxx
@@ -41,6 +41,11 @@ OSystemParseContext::OSystemParseContext()
 m_aLocalizedKeywords.push_back(SvxResId(RID_RSC_SQL_INTERNATIONAL[i]));
 }
 
+OSystemParseContext::OSystemParseContext(bool /*bInit*/)
+: IParseContext()
+{
+}
+
 OSystemParseContext::~OSystemParseContext()
 {
 }
@@ -140,6 +145,17 @@ IParseContext::InternationalKeyCode 
OSystemParseContext::getIntlKeyCode(const OS
 return InternationalKeyCode::None;
 }
 
+ONeutralParseContext::ONeutralParseContext()
+: OSystemParseContext(false)
+{
+std::locale aLocale = Translate::Create("svx", LanguageTag("en-US"));
+for (size_t i = 0; i < SAL_N_ELEMENTS(RID_RSC_SQL_INTERNATIONAL); ++i)
+
m_aLocalizedKeywords.push_back(Translate::get(RID_RSC_SQL_INTERNATIONAL[i], 
aLocale));
+}
+
+ONeutralParseContext::~ONeutralParseContext()
+{
+}
 
 namespace
 {


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

2023-08-30 Thread Miklos Vajna (via logerrit)
 include/svx/svdglue.hxx   |   72 +-
 svx/source/svdraw/svdglue.cxx |   70 
 2 files changed, 71 insertions(+), 71 deletions(-)

New commits:
commit 9e53afb9cad0e6ed66904ac38b61d1450e12f01d
Author: Miklos Vajna 
AuthorDate: Wed Aug 30 08:29:58 2023 +0200
Commit: Miklos Vajna 
CommitDate: Wed Aug 30 09:16:48 2023 +0200

svx: prefix members of SdrGluePoint

See tdf#94879 for motivation.

Change-Id: I1f1abdf5c522306a5d897250afdb99221e5609f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156274
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdglue.hxx b/include/svx/svdglue.hxx
index 3c70ebeac3c4..acdebd0bf4ea 100644
--- a/include/svx/svdglue.hxx
+++ b/include/svx/svdglue.hxx
@@ -68,62 +68,62 @@ class SVXCORE_DLLPUBLIC SdrGluePoint {
 // Reference Point is SdrObject::GetSnapRect().Center()
 // bNoPercent=false: position is -5000..5000 (1/100)% or 0..1 
(depending on align)
 // bNoPercent=true : position is in log unit, relative to the reference 
point
-PointaPos;
-SdrEscapeDirection nEscDir;
-sal_uInt16   nId;
-SdrAlign nAlign;
-bool bNoPercent:1;
-bool bReallyAbsolute:1; // temp for transformations on the reference object
-bool bUserDefined:1; // #i38892#
+Pointm_aPos;
+SdrEscapeDirection m_nEscDir;
+sal_uInt16   m_nId;
+SdrAlign m_nAlign;
+bool m_bNoPercent:1;
+bool m_bReallyAbsolute:1; // temp for transformations on the reference 
object
+bool m_bUserDefined:1; // #i38892#
 public:
 SdrGluePoint()
-: nEscDir(SdrEscapeDirection::SMART)
-, nId(0)
-, nAlign(SdrAlign::NONE)
-, bNoPercent(false)
-, bReallyAbsolute(false)
-, bUserDefined(true)
+: m_nEscDir(SdrEscapeDirection::SMART)
+, m_nId(0)
+, m_nAlign(SdrAlign::NONE)
+, m_bNoPercent(false)
+, m_bReallyAbsolute(false)
+, m_bUserDefined(true)
 {}
 SdrGluePoint(const Point& rNewPos)
-: aPos(rNewPos)
-, nEscDir(SdrEscapeDirection::SMART)
-, nId(0)
-, nAlign(SdrAlign::NONE)
-, bNoPercent(false)
-, bReallyAbsolute(false)
-, bUserDefined(true)
+: m_aPos(rNewPos)
+, m_nEscDir(SdrEscapeDirection::SMART)
+, m_nId(0)
+, m_nAlign(SdrAlign::NONE)
+, m_bNoPercent(false)
+, m_bReallyAbsolute(false)
+, m_bUserDefined(true)
 {}
 const Point& GetPos() const
 {
-return aPos;
+return m_aPos;
 }
 void SetPos(const Point& rNewPos)
 {
-aPos = rNewPos;
+m_aPos = rNewPos;
 }
 SdrEscapeDirection GetEscDir() const
 {
-return nEscDir;
+return m_nEscDir;
 }
 void SetEscDir(SdrEscapeDirection nNewEsc)
 {
-nEscDir = nNewEsc;
+m_nEscDir = nNewEsc;
 }
 sal_uInt16   GetId() const
 {
-return nId;
+return m_nId;
 }
 void SetId(sal_uInt16 nNewId)
 {
-nId = nNewId;
+m_nId = nNewId;
 }
 bool IsPercent() const
 {
-return !bNoPercent;
+return !m_bNoPercent;
 }
 void SetPercent(bool bOn)
 {
-bNoPercent  = !bOn;
+m_bNoPercent  = !bOn;
 }
 // temp for transformations on the reference object
 void SetReallyAbsolute(bool bOn, const SdrObject& rObj);
@@ -131,38 +131,38 @@ public:
 // #i38892#
 bool IsUserDefined() const
 {
-return bUserDefined;
+return m_bUserDefined;
 }
 void SetUserDefined(bool bNew)
 {
-bUserDefined = bNew;
+m_bUserDefined = bNew;
 }
 
 SdrAlign GetAlign() const
 {
-return nAlign;
+return m_nAlign;
 }
 void SetAlign(SdrAlign nAlg)
 {
-nAlign = nAlg;
+m_nAlign = nAlg;
 }
 SdrAlign GetHorzAlign() const
 {
-return nAlign & static_cast(0x00FF);
+return m_nAlign & static_cast(0x00FF);
 }
 void SetHorzAlign(SdrAlign nAlg)
 {
 assert((nAlg & static_cast(0xFF00)) == SdrAlign::NONE);
-nAlign = SdrAlign(nAlign & static_cast(0xFF00)) | (nAlg & 
static_cast(0x00FF));
+m_nAlign = SdrAlign(m_nAlign & static_cast(0xFF00)) | (nAlg 
& static_cast(0x00FF));
 }
 SdrAlign GetVertAlign() const
 {
-return nAlign & static_cast(0xFF00);
+return m_nAlign & static_cast(0xFF00);
 }
 void SetVertAlign(SdrAlign nAlg)
 {
 assert((nAlg & static_cast(0x00FF)) == SdrAlign::NONE);
-nAlign = SdrAlign(nAlign & static_cast(0x00FF)) | (nAlg & 
static_cast(0xFF00));
+m_nAlign = SdrAlign(m_nAlign & static_cast(0x00FF)) | (nAlg 
& static_cast(0xFF00));
 }
 
 bool IsHit(const Point& rPnt, const OutputDevice& rOut, const SdrObject* 
pObj) const;
diff --git a/svx/source/svdraw/svdglue.cxx 

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

2023-08-28 Thread Szymon Kłos (via logerrit)
 include/svx/dialog/ThemeDialog.hxx |3 ++-
 svx/source/dialog/ThemeDialog.cxx  |   19 ++-
 2 files changed, 12 insertions(+), 10 deletions(-)

New commits:
commit 5733cdba90b099637805648b193510268def74be
Author: Szymon Kłos 
AuthorDate: Tue Aug 15 12:31:22 2023 +0200
Commit: Szymon Kłos 
CommitDate: Mon Aug 28 08:47:55 2023 +0200

Theme dialog: fix crash when closing parent first

When we have 'Add' subdialog opened and we close parent
by clicking 'cancel' - subdialog wasn't closed and we had
a crash on next interaction with 'Add' subdialog

Change-Id: I5865a725e93d7c11aa933b7566a7c584018740ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155715
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Gülşah Köse 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156157
Tested-by: Jenkins

diff --git a/include/svx/dialog/ThemeDialog.hxx 
b/include/svx/dialog/ThemeDialog.hxx
index 7003fdebf168..9536bdb38d84 100644
--- a/include/svx/dialog/ThemeDialog.hxx
+++ b/include/svx/dialog/ThemeDialog.hxx
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -30,7 +31,7 @@ class SVX_DLLPUBLIC ThemeDialog final : public 
weld::GenericDialogController
 private:
 weld::Window* mpWindow;
 model::Theme* mpTheme;
-bool mxSubDialog;
+std::shared_ptr mxSubDialog;
 std::vector maColorSets;
 
 std::unique_ptr mxValueSetThemeColors;
diff --git a/svx/source/dialog/ThemeDialog.cxx 
b/svx/source/dialog/ThemeDialog.cxx
index 99e7c3ad466e..e3a206be6cab 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -8,7 +8,6 @@
  */
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -22,7 +21,6 @@ ThemeDialog::ThemeDialog(weld::Window* pParent, model::Theme* 
pTheme)
 : GenericDialogController(pParent, "svx/ui/themedialog.ui", "ThemeDialog")
 , mpWindow(pParent)
 , mpTheme(pTheme)
-, mxSubDialog(false)
 , mxValueSetThemeColors(new svx::ThemeColorValueSet)
 , mxValueSetThemeColorsWindow(
   new weld::CustomWeld(*m_xBuilder, "valueset_theme_colors", 
*mxValueSetThemeColors))
@@ -45,7 +43,11 @@ ThemeDialog::ThemeDialog(weld::Window* pParent, 
model::Theme* pTheme)
 }
 }
 
-ThemeDialog::~ThemeDialog() = default;
+ThemeDialog::~ThemeDialog()
+{
+if (mxSubDialog)
+mxSubDialog->response(RET_CANCEL);
+}
 
 void ThemeDialog::initColorSets()
 {
@@ -89,17 +91,16 @@ void ThemeDialog::runThemeColorEditDialog()
 if (mxSubDialog)
 return;
 
-auto pDialog = std::make_shared(mpWindow, 
*mpCurrentColorSet);
-std::shared_ptr xKeepAlive(shared_from_this());
+mxSubDialog = std::make_shared(mpWindow, 
*mpCurrentColorSet);
 
-mxSubDialog = weld::DialogController::runAsync(pDialog, [this, 
pDialog](sal_uInt32 nResult) {
+weld::DialogController::runAsync(mxSubDialog, [this](sal_uInt32 nResult) {
 if (nResult != RET_OK)
 {
 mxAdd->set_sensitive(true);
-mxSubDialog = false;
+mxSubDialog = nullptr;
 return;
 }
-auto aColorSet = pDialog->getColorSet();
+auto aColorSet = mxSubDialog->getColorSet();
 if (!aColorSet.getName().isEmpty())
 {
 ColorSets::get().insert(aColorSet, 
ColorSets::IdenticalNameAction::AutoRename);
@@ -113,7 +114,7 @@ void ThemeDialog::runThemeColorEditDialog()
 = 
std::make_shared(maColorSets[maColorSets.size() - 1]);
 }
 mxAdd->set_sensitive(true);
-mxSubDialog = false;
+mxSubDialog = nullptr;
 });
 }
 


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

2023-08-21 Thread Miklos Vajna (via logerrit)
 include/svx/svdoedge.hxx   |   20 -
 svx/source/svdraw/svdhdl.cxx   |4 
 svx/source/svdraw/svdoedge.cxx |  444 -
 3 files changed, 234 insertions(+), 234 deletions(-)

New commits:
commit 5bf9c2a5da15e1b91b42aca679288d8a37d47984
Author: Miklos Vajna 
AuthorDate: Mon Aug 21 08:05:25 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Aug 21 11:32:00 2023 +0200

svx: prefix members of SdrEdgeObj

See tdf#94879 for motivation.

Change-Id: I5236f1d6d2294172640ec671424fbcd78a866d22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155883
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index 2d522c9f077c..faa8c67b1e65 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -138,15 +138,15 @@ private:
 virtual std::unique_ptr 
CreateObjectSpecificViewContact() override;
 virtual std::unique_ptr 
CreateObjectSpecificProperties() override;
 
-SdrObjConnectionaCon1;  // Connection status of the beginning 
of the line
-SdrObjConnectionaCon2;  // Connection status of the end of the 
line
+SdrObjConnectionm_aCon1;  // Connection status of the 
beginning of the line
+SdrObjConnectionm_aCon2;  // Connection status of the end of 
the line
 
-std::optional pEdgeTrack;
-sal_uInt16  nNotifyingCount; // Locking
-SdrEdgeInfoRec  aEdgeInfo;
+std::optional m_pEdgeTrack;
+sal_uInt16  m_nNotifyingCount; // Locking
+SdrEdgeInfoRec  m_aEdgeInfo;
 
-boolbEdgeTrackDirty : 1; // true -> Connection 
track needs to be recalculated
-boolbEdgeTrackUserDefined : 1;
+boolm_bEdgeTrackDirty : 1; // true -> Connection 
track needs to be recalculated
+boolm_bEdgeTrackUserDefined : 1;
 
 // Bool to allow suppression of default connects at object
 // inside test (HitTest) and object center test (see ImpFindConnector())
@@ -196,7 +196,7 @@ public:
 // react on model/page change
 virtual void handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage) 
override;
 
-SdrObjConnection& GetConnection(bool bTail1) { return *(bTail1 ?  : 
); }
+SdrObjConnection& GetConnection(bool bTail1) { return *(bTail1 ? _aCon1 
: _aCon2); }
 virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
 virtual SdrObjKind GetObjIdentifier() const override;
 virtual const tools::Rectangle& GetCurrentBoundRect() const override;
@@ -209,11 +209,11 @@ public:
 // * for all of the below: bTail1=true: beginning of the line,
 //   otherwise end of the line
 // * pObj=NULL: disconnect connector
-void SetEdgeTrackDirty() { bEdgeTrackDirty=true; }
+void SetEdgeTrackDirty() { m_bEdgeTrackDirty=true; }
 void ConnectToNode(bool bTail1, SdrObject* pObj) override;
 void DisconnectFromNode(bool bTail1) override;
 SdrObject* GetConnectedNode(bool bTail1) const override;
-const SdrObjConnection& GetConnection(bool bTail1) const { return *(bTail1 
?  : ); }
+const SdrObjConnection& GetConnection(bool bTail1) const { return *(bTail1 
? _aCon1 : _aCon2); }
 bool CheckNodeConnection(bool bTail1) const;
 
 virtual void RecalcSnapRect() override;
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index e5820f945ace..9d522a4ed66b 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1702,10 +1702,10 @@ bool ImpEdgeHdl::IsHorzDrag() const
 
 SdrEdgeKind eEdgeKind = pEdge->GetObjectItem(SDRATTR_EDGEKIND).GetValue();
 
-const SdrEdgeInfoRec& rInfo=pEdge->aEdgeInfo;
+const SdrEdgeInfoRec& rInfo=pEdge->m_aEdgeInfo;
 if (eEdgeKind==SdrEdgeKind::OrthoLines || eEdgeKind==SdrEdgeKind::Bezier)
 {
-return !rInfo.ImpIsHorzLine(m_eLineCode,*pEdge->pEdgeTrack);
+return !rInfo.ImpIsHorzLine(m_eLineCode,*pEdge->m_pEdgeTrack);
 }
 else if (eEdgeKind==SdrEdgeKind::ThreeLines)
 {
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 5b5b03e046e6..d72d8469f0b6 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -156,9 +156,9 @@ std::unique_ptr 
SdrEdgeObj::CreateObjectSpecificViewC
 
 SdrEdgeObj::SdrEdgeObj(SdrModel& rSdrModel)
 :   SdrTextObj(rSdrModel),
-nNotifyingCount(0),
-bEdgeTrackDirty(false),
-bEdgeTrackUserDefined(false),
+m_nNotifyingCount(0),
+m_bEdgeTrackDirty(false),
+m_bEdgeTrackUserDefined(false),
 // Default is to allow default connects
 mbSuppressDefaultConnect(false),
 mbBoundRectCalculationRunning(false),
@@ -166,14 +166,14 @@ SdrEdgeObj::SdrEdgeObj(SdrModel& rSdrModel)
 {
 m_bClosedObj=false;
 m_bIsEdge=true;
-pEdgeTrack = XPolygon();
+m_pEdgeTrack = XPolygon();
 }

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

2023-08-07 Thread Miklos Vajna (via logerrit)
 include/svx/svdoedge.hxx   |   30 +++---
 svx/source/svdraw/svdhdl.cxx   |2 
 svx/source/svdraw/svdoedge.cxx |  200 -
 3 files changed, 116 insertions(+), 116 deletions(-)

New commits:
commit 16ee4471db74b9e3417106048172eb98ae553f3f
Author: Miklos Vajna 
AuthorDate: Mon Aug 7 08:23:58 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Aug 7 09:17:25 2023 +0200

svx: prefix members of SdrEdgeInfoRec

See tdf#94879 for motivation.

Change-Id: Ia1f0f7016217f17d45e863484bdb176e7d47a594
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155389
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index 1c578fda09c0..2d522c9f077c 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -78,26 +78,26 @@ public:
 // The 5 distances are set on dragging or via SetAttr and are
 // evaluated by ImpCalcEdgeTrack. Only 0-3 longs are transported
 // via Get/SetAttr/Get/SetStyleSh though.
-Point   aObj1Line2;
-Point   aObj1Line3;
-Point   aObj2Line2;
-Point   aObj2Line3;
-Point   aMiddleLine;
+Point   m_aObj1Line2;
+Point   m_aObj1Line3;
+Point   m_aObj2Line2;
+Point   m_aObj2Line3;
+Point   m_aMiddleLine;
 
 // Following values are set by ImpCalcEdgeTrack
-tools::LongnAngle1;   // exit angle at Obj1
-tools::LongnAngle2;   // exit angle at Obj2
-sal_uInt16  nObj1Lines;// 1..3
-sal_uInt16  nObj2Lines;// 1..3
-sal_uInt16  nMiddleLine;   // 0x=none, otherwise 
point number of the beginning of the line
+tools::Longm_nAngle1;   // exit angle at 
Obj1
+tools::Longm_nAngle2;   // exit angle at 
Obj2
+sal_uInt16  m_nObj1Lines;// 1..3
+sal_uInt16  m_nObj2Lines;// 1..3
+sal_uInt16  m_nMiddleLine;   // 0x=none, otherwise 
point number of the beginning of the line
 
 public:
 SdrEdgeInfoRec()
-:   nAngle1(0),
-nAngle2(0),
-nObj1Lines(0),
-nObj2Lines(0),
-nMiddleLine(0x)
+:   m_nAngle1(0),
+m_nAngle2(0),
+m_nObj1Lines(0),
+m_nObj2Lines(0),
+m_nMiddleLine(0x)
 {}
 
 Point& ImpGetLineOffsetPoint(SdrEdgeLineCode eLineCode);
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index de6ffcd8175f..e5820f945ace 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1709,7 +1709,7 @@ bool ImpEdgeHdl::IsHorzDrag() const
 }
 else if (eEdgeKind==SdrEdgeKind::ThreeLines)
 {
-tools::Long nAngle=nObjHdlNum==2 ? rInfo.nAngle1 : rInfo.nAngle2;
+tools::Long nAngle=nObjHdlNum==2 ? rInfo.m_nAngle1 : rInfo.m_nAngle2;
 return nAngle==0 || nAngle==18000;
 }
 return false;
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index be203714bddd..5b5b03e046e6 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -88,13 +88,13 @@ bool SdrObjConnection::TakeGluePoint(SdrGluePoint& rGP) 
const
 Point& SdrEdgeInfoRec::ImpGetLineOffsetPoint(SdrEdgeLineCode eLineCode)
 {
 switch (eLineCode) {
-case SdrEdgeLineCode::Obj1Line2 : return aObj1Line2;
-case SdrEdgeLineCode::Obj1Line3 : return aObj1Line3;
-case SdrEdgeLineCode::Obj2Line2 : return aObj2Line2;
-case SdrEdgeLineCode::Obj2Line3 : return aObj2Line3;
-case SdrEdgeLineCode::MiddleLine: return aMiddleLine;
+case SdrEdgeLineCode::Obj1Line2 : return m_aObj1Line2;
+case SdrEdgeLineCode::Obj1Line3 : return m_aObj1Line3;
+case SdrEdgeLineCode::Obj2Line2 : return m_aObj2Line2;
+case SdrEdgeLineCode::Obj2Line3 : return m_aObj2Line3;
+case SdrEdgeLineCode::MiddleLine: return m_aMiddleLine;
 } // switch
-return aMiddleLine;
+return m_aMiddleLine;
 }
 
 sal_uInt16 SdrEdgeInfoRec::ImpGetPolyIdx(SdrEdgeLineCode eLineCode, const 
XPolygon& rXP) const
@@ -104,7 +104,7 @@ sal_uInt16 SdrEdgeInfoRec::ImpGetPolyIdx(SdrEdgeLineCode 
eLineCode, const XPolyg
 case SdrEdgeLineCode::Obj1Line3 : return 2;
 case SdrEdgeLineCode::Obj2Line2 : return rXP.GetPointCount()-3;
 case SdrEdgeLineCode::Obj2Line3 : return rXP.GetPointCount()-4;
-case SdrEdgeLineCode::MiddleLine: return nMiddleLine;
+case SdrEdgeLineCode::MiddleLine: return m_nMiddleLine;
 } // switch
 return 0;
 }
@@ -112,10 +112,10 @@ sal_uInt16 

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

2023-08-03 Thread Caolán McNamara (via logerrit)
 include/svx/sdr/contact/viewcontact.hxx  |5 +
 svx/source/sdr/contact/viewcontact.cxx   |9 -
 svx/source/sdr/contact/viewobjectcontact.cxx |9 +++--
 3 files changed, 16 insertions(+), 7 deletions(-)

New commits:
commit a53c693564f95acdbf6686e00b86671c0e068c48
Author: Caolán McNamara 
AuthorDate: Wed Aug 2 17:09:19 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu Aug 3 09:52:36 2023 +0200

Related: cool#6911 refactor for an optimization

no change intended here

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

diff --git a/include/svx/sdr/contact/viewcontact.hxx 
b/include/svx/sdr/contact/viewcontact.hxx
index ffdc6d055008..1491d0a1401d 100644
--- a/include/svx/sdr/contact/viewcontact.hxx
+++ b/include/svx/sdr/contact/viewcontact.hxx
@@ -30,6 +30,7 @@ class SdrObject;
 
 namespace sdr::contact
 {
+class DisplayInfo;
 class ObjectContact;
 class ViewObjectContact;
 
@@ -146,6 +147,10 @@ public:
 // delete all existing VOCs by purpose, but can also be used for other 
purposes.
 // It is always possible to delete the VOCs, these are re-created on demand
 void flushViewObjectContacts(bool bWithHierarchy = true);
+
+void getPrimitive2DSequenceHierarchyOfIndex(
+sal_uInt32 a, DisplayInfo& rDisplayInfo, ObjectContact& rObjectContact,
+drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor);
 };
 }
 
diff --git a/svx/source/sdr/contact/viewcontact.cxx 
b/svx/source/sdr/contact/viewcontact.cxx
index 2a5d73e509c3..3529f98cf385 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -290,6 +290,13 @@ void ViewContact::flushViewObjectContacts(bool 
bWithHierarchy)
 // delete local VOCs
 deleteAllVOCs();
 }
-}
 
+void ViewContact::getPrimitive2DSequenceHierarchyOfIndex(
+sal_uInt32 a, DisplayInfo& rDisplayInfo, ObjectContact& rObjectContact,
+drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor)
+{
+const ViewObjectContact& 
rCandidate(GetViewContact(a).GetViewObjectContact(rObjectContact));
+rCandidate.getPrimitive2DSequenceHierarchy(rDisplayInfo, rVisitor);
+}
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 3f2ce8dc34fa..91ee66dff1ae 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -564,14 +564,11 @@ void 
ViewObjectContact::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInf
 
 void ViewObjectContact::getPrimitive2DSequenceSubHierarchy(DisplayInfo& 
rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& 
rVisitor) const
 {
-const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
+ViewContact& rViewContact = GetViewContact();
+const sal_uInt32 nSubHierarchyCount(rViewContact.GetObjectCount());
 
 for(sal_uInt32 a(0); a < nSubHierarchyCount; a++)
-{
-const ViewObjectContact& 
rCandidate(GetViewContact().GetViewContact(a).GetViewObjectContact(GetObjectContact()));
-
-rCandidate.getPrimitive2DSequenceHierarchy(rDisplayInfo, rVisitor);
-}
+rViewContact.getPrimitive2DSequenceHierarchyOfIndex(a, rDisplayInfo, 
GetObjectContact(), rVisitor);
 }
 
 // Support getting a GridOffset per object and view for non-linear ViewToDevice


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

2023-08-02 Thread Gülşah Köse (via logerrit)
 include/svx/dialog/ThemeDialog.hxx |1 +
 svx/source/dialog/ThemeDialog.cxx  |   11 +--
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 5a683f2d7c59bbb9ad93172f8dcf43e9efa56053
Author: Gülşah Köse 
AuthorDate: Mon Jul 31 11:04:35 2023 +0300
Commit: Gülşah Köse 
CommitDate: Wed Aug 2 11:46:51 2023 +0200

Prevent to open multiple Theme Color Edit dialog

When we do super fast clicks to Add button prevent to open multiple
dialog. Follow-up commit e73b2bc4e6fdaba3098fa2c701342e1df112514c

Signed-off-by: Gülşah Köse 
Change-Id: If40c4982b873d41984bea298284eae062742b057
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155083
Tested-by: Jenkins

diff --git a/include/svx/dialog/ThemeDialog.hxx 
b/include/svx/dialog/ThemeDialog.hxx
index 020240c97ca3..7003fdebf168 100644
--- a/include/svx/dialog/ThemeDialog.hxx
+++ b/include/svx/dialog/ThemeDialog.hxx
@@ -30,6 +30,7 @@ class SVX_DLLPUBLIC ThemeDialog final : public 
weld::GenericDialogController
 private:
 weld::Window* mpWindow;
 model::Theme* mpTheme;
+bool mxSubDialog;
 std::vector maColorSets;
 
 std::unique_ptr mxValueSetThemeColors;
diff --git a/svx/source/dialog/ThemeDialog.cxx 
b/svx/source/dialog/ThemeDialog.cxx
index ab743b0df4bd..99e7c3ad466e 100644
--- a/svx/source/dialog/ThemeDialog.cxx
+++ b/svx/source/dialog/ThemeDialog.cxx
@@ -22,6 +22,7 @@ ThemeDialog::ThemeDialog(weld::Window* pParent, model::Theme* 
pTheme)
 : GenericDialogController(pParent, "svx/ui/themedialog.ui", "ThemeDialog")
 , mpWindow(pParent)
 , mpTheme(pTheme)
+, mxSubDialog(false)
 , mxValueSetThemeColors(new svx::ThemeColorValueSet)
 , mxValueSetThemeColorsWindow(
   new weld::CustomWeld(*m_xBuilder, "valueset_theme_colors", 
*mxValueSetThemeColors))
@@ -85,12 +86,17 @@ IMPL_LINK_NOARG(ThemeDialog, SelectItem, ValueSet*, void)
 
 void ThemeDialog::runThemeColorEditDialog()
 {
+if (mxSubDialog)
+return;
+
 auto pDialog = std::make_shared(mpWindow, 
*mpCurrentColorSet);
 std::shared_ptr xKeepAlive(shared_from_this());
-weld::DialogController::runAsync(pDialog, [this, xKeepAlive, 
pDialog](sal_uInt32 nResult) {
+
+mxSubDialog = weld::DialogController::runAsync(pDialog, [this, 
pDialog](sal_uInt32 nResult) {
 if (nResult != RET_OK)
 {
 mxAdd->set_sensitive(true);
+mxSubDialog = false;
 return;
 }
 auto aColorSet = pDialog->getColorSet();
@@ -107,15 +113,16 @@ void ThemeDialog::runThemeColorEditDialog()
 = 
std::make_shared(maColorSets[maColorSets.size() - 1]);
 }
 mxAdd->set_sensitive(true);
+mxSubDialog = false;
 });
 }
 
 IMPL_LINK(ThemeDialog, ButtonClicked, weld::Button&, rButton, void)
 {
+mxAdd->set_sensitive(false);
 if (mpCurrentColorSet && mxAdd.get() == )
 {
 runThemeColorEditDialog();
-mxAdd->set_sensitive(false);
 }
 }
 


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

2023-07-31 Thread Miklos Vajna (via logerrit)
 include/svx/svdhdl.hxx   |8 
 include/svx/svdobj.hxx   |8 
 include/svx/xit.hxx  |   10 +-
 svx/source/svdraw/svdhdl.cxx |   12 ++--
 svx/source/svdraw/svdobj.cxx |8 
 svx/source/xoutdev/xattr.cxx |   10 +-
 6 files changed, 28 insertions(+), 28 deletions(-)

New commits:
commit bf570139782418b0276ffd81669c8e1cdd3acbd5
Author: Miklos Vajna 
AuthorDate: Mon Jul 31 08:04:02 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Jul 31 19:36:15 2023 +0200

svx: prefix members of E3dVolumeMarker, ImpEdgeHdl, NameOrIndex and ...

... SdrObjUserData

See tdf#94879 for motivation.

Change-Id: I4d330b0f8e08a3bdfc2c256c2ee86ac584947fc0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155080
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/svdhdl.hxx b/include/svx/svdhdl.hxx
index 606dd8d5afa7..61c0100ad144 100644
--- a/include/svx/svdhdl.hxx
+++ b/include/svx/svdhdl.hxx
@@ -372,7 +372,7 @@ private:
 
 class E3dVolumeMarker final : public SdrHdl
 {
-basegfx::B2DPolyPolygon aWireframePoly;
+basegfx::B2DPolyPolygon m_aWireframePoly;
 
 // create marker for this kind
 virtual void CreateB2dIAObject() override;
@@ -384,17 +384,17 @@ public:
 
 class ImpEdgeHdl final : public SdrHdl
 {
-SdrEdgeLineCode eLineCode;
+SdrEdgeLineCode m_eLineCode;
 
 // create marker for this kind
 virtual void CreateB2dIAObject() override;
 
 public:
-ImpEdgeHdl(const Point& rPnt, SdrHdlKind eNewKind): 
SdrHdl(rPnt,eNewKind),eLineCode(SdrEdgeLineCode::MiddleLine) {}
+ImpEdgeHdl(const Point& rPnt, SdrHdlKind eNewKind): 
SdrHdl(rPnt,eNewKind),m_eLineCode(SdrEdgeLineCode::MiddleLine) {}
 virtual ~ImpEdgeHdl() override;
 
 void SetLineCode(SdrEdgeLineCode eCode);
-SdrEdgeLineCode GetLineCode() const { return eLineCode; }
+SdrEdgeLineCode GetLineCode() const { return m_eLineCode; }
 bool IsHorzDrag() const;
 virtual PointerStyle GetPointer() const override;
 };
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index ed62c1db983f..35f6a47bd6e2 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -150,8 +150,8 @@ public:
  */
 class SVXCORE_DLLPUBLIC SdrObjUserData
 {
-SdrInventor  nInventor;
-sal_uInt16   nIdentifier;
+SdrInventor  m_nInventor;
+sal_uInt16   m_nIdentifier;
 
 void operator=(const SdrObjUserData& rData) = delete;
 bool operator==(const SdrObjUserData& rData) const = delete;
@@ -163,8 +163,8 @@ public:
 virtual ~SdrObjUserData();
 
 virtual std::unique_ptr Clone(SdrObject* pObj1) const = 0; 
// #i71039# NULL -> 0
-SdrInventor GetInventor() const { return nInventor;}
-sal_uInt16 GetId() const { return nIdentifier;}
+SdrInventor GetInventor() const { return m_nInventor;}
+sal_uInt16 GetId() const { return m_nIdentifier;}
 };
 
 /**
diff --git a/include/svx/xit.hxx b/include/svx/xit.hxx
index f6b19595a9f8..b51af17a4d4d 100644
--- a/include/svx/xit.hxx
+++ b/include/svx/xit.hxx
@@ -36,13 +36,13 @@ typedef bool (*SvxCompareValueFunc)( const NameOrIndex* p1, 
const NameOrIndex* p
 
 class SVXCORE_DLLPUBLIC NameOrIndex : public SfxStringItem
 {
-sal_Int32nPalIndex;
+sal_Int32m_nPalIndex;
 
 protected:
-voidDetach(){ nPalIndex = -1; }
+voidDetach(){ m_nPalIndex = -1; }
 
 public:
-NameOrIndex() { nPalIndex = -1; }
+NameOrIndex() { m_nPalIndex = -1; }
 NameOrIndex(TypedWhichId nWhich, sal_Int32 nIndex);
 NameOrIndex(TypedWhichId nWhich, const OUString& 
rName);
 NameOrIndex(const NameOrIndex& rNameOrIndex);
@@ -52,8 +52,8 @@ public:
 
 OUString const & GetName() const  { return GetValue(); 
  }
 void SetName(const OUString& rName) { SetValue(rName); 
}
-bool IsIndex() const  { return (nPalIndex >= 0); }
-sal_Int32GetPalIndex() const { return nPalIndex; }
+bool IsIndex() const  { return (m_nPalIndex >= 0); 
}
+sal_Int32GetPalIndex() const { return m_nPalIndex; }
 
 /** this static checks if the given NameOrIndex item has a unique name for 
its value.
 The returned String is a unique name for an item with this value in 
both given pools.
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 379b3ed3f73e..de6ffcd8175f 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -1553,7 +1553,7 @@ void SdrHdlBezWgt::CreateB2dIAObject()
 
 E3dVolumeMarker::E3dVolumeMarker(const basegfx::B2DPolyPolygon& rWireframePoly)
 {
-aWireframePoly = rWireframePoly;
+m_aWireframePoly = rWireframePoly;
 }
 
 void E3dVolumeMarker::CreateB2dIAObject()
@@ -1579,11 +1579,11 @@ 

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

2023-07-26 Thread Caolán McNamara (via logerrit)
 include/svx/compressgraphicdialog.hxx   |8 
 svx/source/dialog/compressgraphicdialog.cxx |   16 
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 6a51ab527b56ddc2bf6ec6ccbfbf2bc608244355
Author: Caolán McNamara 
AuthorDate: Tue Jul 25 21:28:54 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jul 26 11:26:20 2023 +0200

Resolves: tdf#156411 listen to "value-changed" not "changed"

we were listening to "changed" and querying the "value", but the value
isn't guaranteed to have changed while the contents are being edited,
only when "value-changed" arrives.

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

diff --git a/include/svx/compressgraphicdialog.hxx 
b/include/svx/compressgraphicdialog.hxx
index 3319a41a431c..088d0b6fd45e 100644
--- a/include/svx/compressgraphicdialog.hxx
+++ b/include/svx/compressgraphicdialog.hxx
@@ -67,10 +67,10 @@ private:
 
 DECL_DLLPRIVATE_LINK( SlideHdl, weld::Scale&, void );
 DECL_DLLPRIVATE_LINK( NewInterpolationModifiedHdl, weld::ComboBox&, void );
-DECL_DLLPRIVATE_LINK( NewQualityModifiedHdl, weld::Entry&, void );
-DECL_DLLPRIVATE_LINK( NewCompressionModifiedHdl, weld::Entry&, void );
-DECL_DLLPRIVATE_LINK( NewWidthModifiedHdl, weld::Entry&, void );
-DECL_DLLPRIVATE_LINK( NewHeightModifiedHdl, weld::Entry&, void );
+DECL_DLLPRIVATE_LINK( NewQualityModifiedHdl, weld::SpinButton&, void );
+DECL_DLLPRIVATE_LINK( NewCompressionModifiedHdl, weld::SpinButton&, void );
+DECL_DLLPRIVATE_LINK( NewWidthModifiedHdl, weld::SpinButton&, void );
+DECL_DLLPRIVATE_LINK( NewHeightModifiedHdl, weld::SpinButton&, void );
 DECL_DLLPRIVATE_LINK( ResolutionModifiedHdl, weld::ComboBox&, void );
 DECL_DLLPRIVATE_LINK( ToggleCompressionRB, weld::Toggleable&, void );
 DECL_DLLPRIVATE_LINK( ToggleReduceResolutionRB, weld::Toggleable&, void );
diff --git a/svx/source/dialog/compressgraphicdialog.cxx 
b/svx/source/dialog/compressgraphicdialog.cxx
index a8be5ed6c5e8..8fcf479d889d 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -135,8 +135,8 @@ void CompressGraphicsDialog::Initialize()
 
 m_xInterpolationCombo->connect_changed(LINK(this, CompressGraphicsDialog, 
NewInterpolationModifiedHdl));
 
-m_xMFNewWidth->connect_changed( LINK( this, CompressGraphicsDialog, 
NewWidthModifiedHdl ));
-m_xMFNewHeight->connect_changed( LINK( this, CompressGraphicsDialog, 
NewHeightModifiedHdl ));
+m_xMFNewWidth->connect_value_changed( LINK( this, CompressGraphicsDialog, 
NewWidthModifiedHdl ));
+m_xMFNewHeight->connect_value_changed( LINK( this, CompressGraphicsDialog, 
NewHeightModifiedHdl ));
 
 m_xResolutionLB->connect_changed( LINK( this, CompressGraphicsDialog, 
ResolutionModifiedHdl ));
 m_xBtnCalculate->connect_clicked(  LINK( this, CompressGraphicsDialog, 
CalculateClickHdl ) );
@@ -148,8 +148,8 @@ void CompressGraphicsDialog::Initialize()
 
 m_xQualitySlider->connect_value_changed( LINK( this, 
CompressGraphicsDialog, SlideHdl ));
 m_xCompressionSlider->connect_value_changed( LINK( this, 
CompressGraphicsDialog, SlideHdl ));
-m_xQualityMF->connect_changed( LINK( this, CompressGraphicsDialog, 
NewQualityModifiedHdl ));
-m_xCompressionMF->connect_changed( LINK( this, CompressGraphicsDialog, 
NewCompressionModifiedHdl ));
+m_xQualityMF->connect_value_changed( LINK( this, CompressGraphicsDialog, 
NewQualityModifiedHdl ));
+m_xCompressionMF->connect_value_changed( LINK( this, 
CompressGraphicsDialog, NewCompressionModifiedHdl ));
 
 m_xJpegCompRB->set_active(true);
 m_xReduceResolutionCB->set_active(true);
@@ -288,7 +288,7 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, OkayClickHdl, 
weld::Button&, void )
 CompressGraphicsDialog::response(RET_OK);
 }
 
-IMPL_LINK_NOARG( CompressGraphicsDialog, NewWidthModifiedHdl, weld::Entry&, 
void )
+IMPL_LINK_NOARG( CompressGraphicsDialog, NewWidthModifiedHdl, 
weld::SpinButton&, void )
 {
 m_dResolution =  m_xMFNewWidth->get_value() / GetViewWidthInch();
 
@@ -311,19 +311,19 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, 
NewInterpolationModifiedHdl, weld::Comb
 Update();
 }
 
-IMPL_LINK_NOARG( CompressGraphicsDialog, NewQualityModifiedHdl, weld::Entry&, 
void )
+IMPL_LINK_NOARG( CompressGraphicsDialog, NewQualityModifiedHdl, 
weld::SpinButton&, void )
 {
 m_xQualitySlider->set_value(m_xQualityMF->get_value());
 Update();
 }
 
-IMPL_LINK_NOARG( CompressGraphicsDialog, NewCompressionModifiedHdl, 
weld::Entry&, void )
+IMPL_LINK_NOARG( CompressGraphicsDialog, NewCompressionModifiedHdl, 
weld::SpinButton&, void )
 {
 m_xCompressionSlider->set_value(m_xCompressionMF->get_value());
 Update();
 }
 
-IMPL_LINK_NOARG( CompressGraphicsDialog, NewHeightModifiedHdl, weld::Entry&, 

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

2023-07-17 Thread Justin Luth (via logerrit)
 include/svx/sidebar/ValueSetWithTextControl.hxx  |1 +
 svx/source/sidebar/tools/ValueSetWithTextControl.cxx |9 +
 sw/source/uibase/sidebar/PageSizeControl.cxx |1 +
 3 files changed, 11 insertions(+)

New commits:
commit 1876feb8a8805b2f80537e2828c152ccbdf67fe2
Author: Justin Luth 
AuthorDate: Mon Jul 10 15:27:29 2023 -0400
Commit: Justin Luth 
CommitDate: Tue Jul 18 01:22:41 2023 +0200

tdf#136905 NBB: let ValueSetWithTextControl set optimal height

There was no way to specify a "good font size" to use
for .uno:AttributePageSize in the notebookbar.
The font "resized to match to size of the box"
which is hard-coded to aSize(250, 300).

(Even if ValueSet::SetOptimalSize worked, it would set an
inadequate height.)

So it seems like the best thing to do is simply add a function
that allows the box height to be modified.

Using the fontsize from GetDefaultFont is not correct.
Use the OS-defined label font size instead, which seems to be
the most common choice - GetPushButtonFont would has also worked.

I verified that the label font size is controled by
the OS' font preference.

The ability to define the box's optimal height
is still (somewhat) necessary. It isn't good enough
to just "use the system font size".
I tested with an OS font size of 48 (instead of 11),
and in that case the box height was too small
(but with the font only using 4/9's of a 12pt space,
even a 24pt font looked OK without adjusting optimal height).

Change-Id: I0a0774dea9c2a6c21a8e84439318a94f39783413
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154286
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/include/svx/sidebar/ValueSetWithTextControl.hxx 
b/include/svx/sidebar/ValueSetWithTextControl.hxx
index ac397f9fdab6..407e9606757f 100644
--- a/include/svx/sidebar/ValueSetWithTextControl.hxx
+++ b/include/svx/sidebar/ValueSetWithTextControl.hxx
@@ -40,6 +40,7 @@ public:
 
 SVX_DLLPRIVATE virtual void SetDrawingArea(weld::DrawingArea* 
pDrawingArea) override;
 
+void SetOptimalDrawingAreaHeight();
 void AddItem(const OUString& rItemText, const OUString& rItemText2);
 
 SVX_DLLPRIVATE virtual void UserDraw(const UserDrawEvent& rUDEvt) override;
diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx 
b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
index 1b6ca2d42979..77b260272264 100644
--- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
+++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
@@ -43,6 +43,15 @@ void 
ValueSetWithTextControl::SetDrawingArea(weld::DrawingArea* pDrawingArea)
 SetColCount();
 }
 
+void ValueSetWithTextControl::SetOptimalDrawingAreaHeight()
+{
+const vcl::Font 
aFont(Application::GetSettings().GetStyleSettings().GetLabelFont());
+const sal_Int32 nRowHeight = aFont.GetFontSize().Height() * 9 / 4; // see 
UserDraw()
+const Size aSize(GetOutputSizePixel().Width(), nRowHeight * 
maItems.size());
+GetDrawingArea()->set_size_request(aSize.Width(), aSize.Height());
+SetOutputSizePixel(aSize);
+}
+
 void ValueSetWithTextControl::AddItem(
 const OUString& rItemText,
 const OUString& rItemText2 )
diff --git a/sw/source/uibase/sidebar/PageSizeControl.cxx 
b/sw/source/uibase/sidebar/PageSizeControl.cxx
index 211ebece9e5e..a85848ad753d 100644
--- a/sw/source/uibase/sidebar/PageSizeControl.cxx
+++ b/sw/source/uibase/sidebar/PageSizeControl.cxx
@@ -165,6 +165,7 @@ PageSizeControl::PageSizeControl(PageSizePopup* pControl, 
weld::Widget* pParent)
 }
 mxSizeValueSet->SetNoSelection();
 mxSizeValueSet->SetSelectHdl( LINK(this, PageSizeControl, ImplSizeHdl ) );
+mxSizeValueSet->SetOptimalDrawingAreaHeight();
 mxSizeValueSet->Show();
 mxSizeValueSet->Resize();
 


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

2023-07-17 Thread Miklos Vajna (via logerrit)
 include/svx/sdasitm.hxx  |   10 +-
 include/svx/svdtrans.hxx |   24 +++---
 svx/source/items/customshapeitem.cxx |  128 +--
 svx/source/svdraw/svdtrans.cxx   |   24 +++---
 4 files changed, 93 insertions(+), 93 deletions(-)

New commits:
commit 107ab712725e92fc527b54e91f317f932b78146a
Author: Miklos Vajna 
AuthorDate: Mon Jul 17 08:09:53 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Jul 17 11:20:22 2023 +0200

svx: prefix members of SdrCustomShapeGeometryItem and SdrFormatter

See tdf#94879 for motivation.

Change-Id: If7ca1e0117943f82c9ea46d6a6eb9ba9f67b1b09
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154507
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/sdasitm.hxx b/include/svx/sdasitm.hxx
index ee1c05ebc634..e53e9c3604a2 100644
--- a/include/svx/sdasitm.hxx
+++ b/include/svx/sdasitm.hxx
@@ -43,16 +43,16 @@ private:
 typedef std::unordered_map  
PropertyPairHashMap;
 typedef std::unordered_map PropertyHashMap;
 
-PropertyHashMap aPropHashMap;
-PropertyPairHashMap aPropPairHashMap;
+PropertyHashMap m_aPropHashMap;
+PropertyPairHashMap m_aPropPairHashMap;
 
-css::uno::Sequence< css::beans::PropertyValue > aPropSeq;
+css::uno::Sequence< css::beans::PropertyValue > m_aPropSeq;
 
 // For fast comparisons keep a hash of the content, computed on demand
 // (unusable state is if anyToHash() returns no hash).
 enum HashState { Unknown, Valid, Unusable };
-mutable HashState aHashState = HashState::Unknown;
-mutable size_t aHash = 0xdeadbeef;
+mutable HashState m_aHashState = HashState::Unknown;
+mutable size_t m_aHash = 0xdeadbeef;
 
 void SetPropSeq( const css::uno::Sequence< css::beans::PropertyValue >& 
rPropSeq );
 inline void UpdateHash() const;
diff --git a/include/svx/svdtrans.hxx b/include/svx/svdtrans.hxx
index aa8992a34bd3..ae225426afd6 100644
--- a/include/svx/svdtrans.hxx
+++ b/include/svx/svdtrans.hxx
@@ -264,22 +264,22 @@ inline bool IsInch(FieldUnit eU) {
 }
 
 class SVXCORE_DLLPUBLIC SdrFormatter {
-tools::Long  nMul_;
-tools::Long  nDiv_;
-short nComma_;
-bool  bDirty;
-MapUnit   eSrcMU;
-MapUnit   eDstMU;
+tools::Long  m_nMul;
+tools::Long  m_nDiv;
+short m_nComma;
+bool  m_bDirty;
+MapUnit   m_eSrcMU;
+MapUnit   m_eDstMU;
 private:
 SVX_DLLPRIVATE void Undirty();
 public:
 SdrFormatter(MapUnit eSrc, MapUnit eDst)
-: nMul_(0)
-, nDiv_(0)
-, nComma_(0)
-, bDirty(true)
-, eSrcMU(eSrc)
-, eDstMU(eDst)
+: m_nMul(0)
+, m_nDiv(0)
+, m_nComma(0)
+, m_bDirty(true)
+, m_eSrcMU(eSrc)
+, m_eDstMU(eDst)
 {
 }
 OUString GetStr(tools::Long nVal) const;
diff --git a/svx/source/items/customshapeitem.cxx 
b/svx/source/items/customshapeitem.cxx
index 5f2ef96a251b..1aaa0e7ff02b 100644
--- a/svx/source/items/customshapeitem.cxx
+++ b/svx/source/items/customshapeitem.cxx
@@ -42,18 +42,18 @@ SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem( 
const uno::Sequence< bea
 css::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const 
OUString& rPropName )
 {
 css::uno::Any* pRet = nullptr;
-PropertyHashMap::iterator aHashIter( aPropHashMap.find( rPropName ) );
-if ( aHashIter != aPropHashMap.end() )
-pRet = ()[ (*aHashIter).second ].Value;
+PropertyHashMap::iterator aHashIter( m_aPropHashMap.find( rPropName ) );
+if ( aHashIter != m_aPropHashMap.end() )
+pRet = _aPropSeq.getArray()[ (*aHashIter).second ].Value;
 return pRet;
 }
 
 const css::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const 
OUString& rPropName ) const
 {
 const css::uno::Any* pRet = nullptr;
-PropertyHashMap::const_iterator aHashIter( aPropHashMap.find( rPropName ) 
);
-if ( aHashIter != aPropHashMap.end() )
-pRet = [ (*aHashIter).second ].Value;
+PropertyHashMap::const_iterator aHashIter( m_aPropHashMap.find( rPropName 
) );
+if ( aHashIter != m_aPropHashMap.end() )
+pRet = _aPropSeq[ (*aHashIter).second ].Value;
 return pRet;
 }
 
@@ -65,8 +65,8 @@ css::uno::Any* 
SdrCustomShapeGeometryItem::GetPropertyValueByName( const OUStrin
 {
 if ( auto rSecSequence = 
o3tl::tryAccess>(*pSeqAny) )
 {
-PropertyPairHashMap::iterator aHashIter( aPropPairHashMap.find( 
PropertyPair( rSequenceName, rPropName ) ) );
-if ( aHashIter != aPropPairHashMap.end() )
+PropertyPairHashMap::iterator aHashIter( m_aPropPairHashMap.find( 
PropertyPair( rSequenceName, rPropName ) ) );
+if ( aHashIter != m_aPropPairHashMap.end() )
 {
 pRet = 
_cast 
&>(*rSecSequence).getArray()[ (*aHashIter).second ].Value;
 }
@@ -83,8 +83,8 @@ const css::uno::Any* 

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

2023-06-19 Thread Miklos Vajna (via logerrit)
 include/svx/EnhancedCustomShape2d.hxx |   70 +--
 svx/source/customshapes/EnhancedCustomShape2d.cxx |  456 +++---
 2 files changed, 263 insertions(+), 263 deletions(-)

New commits:
commit 4034578cc6cd927b0074106a6f823bec765e4805
Author: Miklos Vajna 
AuthorDate: Mon Jun 19 08:37:32 2023 +0200
Commit: Miklos Vajna 
CommitDate: Mon Jun 19 09:44:39 2023 +0200

svx: prefix members of EnhancedCustomShape2d

See tdf#94879 for motivation.

Change-Id: I88eaa11f4eaca381a9cb95aa2f24b5a43c7ca80d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153246
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/EnhancedCustomShape2d.hxx 
b/include/svx/EnhancedCustomShape2d.hxx
index 7855daacbeae..bed4fa9d75f8 100644
--- a/include/svx/EnhancedCustomShape2d.hxx
+++ b/include/svx/EnhancedCustomShape2d.hxx
@@ -79,26 +79,26 @@ namespace o3tl
 class SVXCORE_DLLPUBLIC EnhancedCustomShape2d final : public SfxItemSet
 {
 SdrObjCustomShape&  mrSdrObjCustomShape;
-MSO_SPT eSpType;
+MSO_SPT m_eSpType;
 
-sal_Int32   nCoordLeft;
-sal_Int32   nCoordTop;
-sal_Int32   nCoordWidthG;
-sal_Int32   nCoordHeightG;
-sal_Int32   nCoordWidth;
-sal_Int32   nCoordHeight;
-tools::Rectangle   aLogicRect;
+sal_Int32   m_nCoordLeft;
+sal_Int32   m_nCoordTop;
+sal_Int32   m_nCoordWidthG;
+sal_Int32   m_nCoordHeightG;
+sal_Int32   m_nCoordWidth;
+sal_Int32   m_nCoordHeight;
+tools::Rectangle   m_aLogicRect;
 
-double  fXScale;
-double  fYScale;
-double  fXRatio;
-double  fYRatio;
+double  m_fXScale;
+double  m_fYScale;
+double  m_fXRatio;
+double  m_fYRatio;
 
-boolbOOXMLShape;
+boolm_bOOXMLShape;
 
-sal_Int32   nXRef;
-sal_Int32   nYRef;
-sal_uInt32  nColorData;
+sal_Int32   m_nXRef;
+sal_Int32   m_nYRef;
+sal_uInt32  m_nColorData;
 
 /*
 
@@ -107,24 +107,24 @@ class SVXCORE_DLLPUBLIC EnhancedCustomShape2d final : 
public SfxItemSet
 bool bReady;
 double fValue;
 };
-css::uno::Sequence< OUString > 
  seqEquations;
-std::vector< std::shared_ptr< EnhancedCustomShape::ExpressionNode > >  
 vNodesSharedPtr;
-std::vector< EquationResult >  
 vEquationResults;
+css::uno::Sequence< OUString > 
  m_seqEquations;
+std::vector< std::shared_ptr< EnhancedCustomShape::ExpressionNode > >  
 m_vNodesSharedPtr;
+std::vector< EquationResult >  
 m_vEquationResults;
 
-css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > 
   seqSegments;
-css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair>
   seqCoordinates;
-css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame >   
   seqTextFrames;
-css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair>
   seqGluePoints;
-css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > 
   seqAdjustmentValues;
-css::uno::Sequence< css::beans::PropertyValues >   
   seqHandles;
-css::uno::Sequence< css::awt::Size >   
   seqSubViewSize;
+css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > 
   m_seqSegments;
+css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair>
   m_seqCoordinates;
+css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame >   
   m_seqTextFrames;
+css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair>
   m_seqGluePoints;
+css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > 
   m_seqAdjustmentValues;
+css::uno::Sequence< css::beans::PropertyValues >   
   m_seqHandles;
+css::uno::Sequence< css::awt::Size >   
   m_seqSubViewSize;
 
-boolbFilled 

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

2023-06-05 Thread Mike Kaganski (via logerrit)
 include/svx/langbox.hxx   |1 -
 svx/source/dialog/langbox.cxx |   16 +---
 2 files changed, 5 insertions(+), 12 deletions(-)

New commits:
commit ee2d846031e9921c61ff1ff8399ed1fe9106c5fc
Author: Mike Kaganski 
AuthorDate: Mon Jun 5 14:25:52 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Jun 5 20:26:27 2023 +0200

Drop unneeded indirection

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

diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index 3cc724f52c7d..08893e8e1ce4 100644
--- a/include/svx/langbox.hxx
+++ b/include/svx/langbox.hxx
@@ -70,7 +70,6 @@ private:
 SVX_DLLPRIVATE weld::ComboBoxEntry BuildEntry(const LanguageType 
nLangType, sal_Int16 nType = css::i18n::ScriptType::WEAK);
 SVX_DLLPRIVATE void AddLanguages(const std::vector< LanguageType >& 
rLanguageTypes, SvxLanguageListFlags nLangList,
  std::vector& 
rEntries);
-SVX_DLLPRIVATE void InsertLanguage(const LanguageType nLangType, sal_Int16 
nType);
 
 DECL_DLLPRIVATE_LINK(ChangeHdl, weld::ComboBox&, void);
 public:
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index 4135964daa29..459e7db31033 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -305,20 +305,14 @@ void SvxLanguageBox::SetLanguageList(SvxLanguageListFlags 
nLangList, bool bHasLa
 m_xControl->insert_vector(aEntries, true);
 }
 
-void SvxLanguageBox::InsertLanguage(const LanguageType nLangType, sal_Int16 
nType)
+void SvxLanguageBox::InsertLanguage(const LanguageType nLangType)
 {
-weld::ComboBoxEntry aEntry = BuildEntry(nLangType, nType);
+if (find_id(nLangType) != -1)
+return;
+weld::ComboBoxEntry aEntry = BuildEntry(nLangType);
 if (aEntry.sString.isEmpty())
 return;
-if (aEntry.sImage.isEmpty())
-m_xControl->append(aEntry.sId, aEntry.sString);
-else
-m_xControl->append(aEntry.sId, aEntry.sString, aEntry.sImage);
-}
-
-void SvxLanguageBox::InsertLanguage(const LanguageType nLangType)
-{
-InsertLanguage(nLangType, css::i18n::ScriptType::WEAK);
+m_xControl->append(aEntry);
 }
 
 weld::ComboBoxEntry SvxLanguageBox::BuildEntry(const LanguageType nLangType, 
sal_Int16 nType)


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

2023-06-05 Thread Mike Kaganski (via logerrit)
 include/svx/langbox.hxx   |1 -
 svx/source/dialog/langbox.cxx |   17 ++---
 2 files changed, 6 insertions(+), 12 deletions(-)

New commits:
commit 496bd45f1e2f4c3dc90448d1adc81c5c29349f58
Author: Mike Kaganski 
AuthorDate: Mon Jun 5 14:21:06 2023 +0300
Commit: Mike Kaganski 
CommitDate: Mon Jun 5 20:26:09 2023 +0200

Drop duplicating function

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

diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx
index 7a03c522d98b..3cc724f52c7d 100644
--- a/include/svx/langbox.hxx
+++ b/include/svx/langbox.hxx
@@ -72,7 +72,6 @@ private:
  std::vector& 
rEntries);
 SVX_DLLPRIVATE void InsertLanguage(const LanguageType nLangType, sal_Int16 
nType);
 
-SVX_DLLPRIVATE int ImplTypeToPos(LanguageType eType) const;
 DECL_DLLPRIVATE_LINK(ChangeHdl, weld::ComboBox&, void);
 public:
 SvxLanguageBox(std::unique_ptr pControl);
diff --git a/svx/source/dialog/langbox.cxx b/svx/source/dialog/langbox.cxx
index b7623d6f8c0d..4135964daa29 100644
--- a/svx/source/dialog/langbox.cxx
+++ b/svx/source/dialog/langbox.cxx
@@ -154,12 +154,12 @@ void SvxLanguageBox::set_active_id(const LanguageType 
eLangType)
 // a language that is replaced, we need to select the replacement instead.
 LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( 
eLangType);
 
-sal_Int32 nAt = ImplTypeToPos( nLang );
+sal_Int32 nAt = find_id( nLang );
 
 if (nAt == -1)
 {
 InsertLanguage( nLang );  // on-the-fly-ID
-nAt = ImplTypeToPos( nLang );
+nAt = find_id( nLang );
 }
 
 if (nAt != -1)
@@ -176,7 +176,7 @@ void SvxLanguageBox::AddLanguages(const std::vector< 
LanguageType >& rLanguageTy
 LanguageType nLang = MsLangId::getReplacementForObsoleteLanguage( 
nLangType );
 if (lcl_isScriptTypeRequested( nLang, nLangList))
 {
-int nAt = ImplTypeToPos(nLang);
+int nAt = find_id(nLang);
 if (nAt != -1)
 continue;
 weld::ComboBoxEntry aNewEntry(BuildEntry(nLang));
@@ -305,11 +305,6 @@ void SvxLanguageBox::SetLanguageList(SvxLanguageListFlags 
nLangList, bool bHasLa
 m_xControl->insert_vector(aEntries, true);
 }
 
-int SvxLanguageBox::ImplTypeToPos(LanguageType eType) const
-{
-return 
m_xControl->find_id(OUString::number(static_cast(eType)));
-}
-
 void SvxLanguageBox::InsertLanguage(const LanguageType nLangType, sal_Int16 
nType)
 {
 weld::ComboBoxEntry aEntry = BuildEntry(nLangType, nType);
@@ -334,7 +329,7 @@ weld::ComboBoxEntry SvxLanguageBox::BuildEntry(const 
LanguageType nLangType, sal
 // string as would be returned by SvtLanguageTable::GetString().
 if (nLang != nLangType)
 {
-int nAt = ImplTypeToPos( nLang );
+int nAt = find_id( nLang );
 if (nAt != -1)
 return weld::ComboBoxEntry("");
 }
@@ -478,7 +473,7 @@ SvxLanguageBox* 
SvxLanguageBox::SaveEditedAsEntry(SvxLanguageBox* ppBoxes[3])
 if (!pBox)
 continue;
 
-const int nPos = pBox->ImplTypeToPos( nLang);
+const int nPos = pBox->find_id( nLang);
 if (nPos != -1)
 {
 // Already present but with a different string or in another list.
@@ -521,7 +516,7 @@ SvxLanguageBox* 
SvxLanguageBox::SaveEditedAsEntry(SvxLanguageBox* ppBoxes[3])
 pBox->InsertLanguage(nLang);
 
 // Select it.
-const int nPos = pBox->ImplTypeToPos(nLang);
+const int nPos = pBox->find_id(nLang);
 if (nPos != -1)
 pBox->m_xControl->set_active(nPos);
 


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

2023-06-05 Thread Samuel Mehrbrodt (via logerrit)
 include/svx/svdpage.hxx  |1 +
 svx/source/svdraw/svdpage.cxx|   11 +++
 sw/source/core/access/AccessibilityIssue.cxx |   20 +++-
 3 files changed, 31 insertions(+), 1 deletion(-)

New commits:
commit 1f09bab0d033953542d17987e1de56cebfa3497b
Author: Samuel Mehrbrodt 
AuthorDate: Thu Jun 1 14:54:07 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Jun 5 08:18:51 2023 +0200

tdf#155504 Add "Fix" function to shapes

Change-Id: I9494207b0bcdf121034f79d936aeadd95cecdf23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152494
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 7443c408814d..778e8c2ee327 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -141,6 +141,7 @@ public:
 
 size_t GetObjCount() const;
 SdrObject* GetObj(size_t nNum) const;
+SdrObject* GetObjByName(std::u16string_view sName) const;
 
 /// linked page or linked group object
 virtual bool IsReadOnly() const;
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 175f58b2ad7a..f7df7c12a730 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -789,6 +789,17 @@ SdrObject* SdrObjList::GetObj(size_t nNum) const
 return nullptr;
 }
 
+SdrObject* SdrObjList::GetObjByName(std::u16string_view sName) const
+{
+for (size_t i = 0; i < GetObjCount(); ++i)
+{
+SdrObject* pObj = GetObj(i);
+if (pObj->GetName() == sName)
+return pObj;
+}
+return nullptr;
+}
+
 
 bool SdrObjList::IsReadOnly() const
 {
diff --git a/sw/source/core/access/AccessibilityIssue.cxx 
b/sw/source/core/access/AccessibilityIssue.cxx
index e11531ecd474..81072800d42d 100644
--- a/sw/source/core/access/AccessibilityIssue.cxx
+++ b/sw/source/core/access/AccessibilityIssue.cxx
@@ -10,13 +10,16 @@
 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 namespace sw
 {
@@ -100,7 +103,8 @@ void AccessibilityIssue::gotoIssue() const
 
 bool AccessibilityIssue::canQuickFixIssue() const
 {
-return m_eIssueObject == IssueObject::GRAPHIC || m_eIssueObject == 
IssueObject::OLE;
+return m_eIssueObject == IssueObject::GRAPHIC || m_eIssueObject == 
IssueObject::OLE
+   || m_eIssueObject == IssueObject::SHAPE;
 }
 
 void AccessibilityIssue::quickFixIssue() const
@@ -124,6 +128,20 @@ void AccessibilityIssue::quickFixIssue() const
 }
 }
 break;
+case IssueObject::SHAPE:
+{
+OUString aDesc = SwResId(STR_ENTER_ALT);
+SvxNameDialog aNameDialog(m_pParent, "", aDesc);
+if (aNameDialog.run() == RET_OK)
+{
+SwWrtShell* pWrtShell = m_pDoc->GetDocShell()->GetWrtShell();
+auto pPage = 
pWrtShell->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+SdrObject* pObj = pPage->GetObjByName(m_sObjectID);
+if (pObj)
+pObj->SetTitle(aNameDialog.GetName());
+}
+}
+break;
 default:
 break;
 }


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

2023-05-31 Thread Luigi Iucci (via logerrit)
 include/svx/tbcontrl.hxx |   55 +++
 svx/source/tbxctrls/tbcontrl.cxx |1 
 2 files changed, 51 insertions(+), 5 deletions(-)

New commits:
commit 1bc6d8f811e0941d1a8046c9ba725d0f38223143
Author: Luigi Iucci 
AuthorDate: Thu May 18 18:10:06 2023 +0200
Commit: Miklos Vajna 
CommitDate: Wed May 31 15:30:57 2023 +0200

Added doxygen to calc currency combo

Change-Id: If6a70f38007c385c28f9136e48635e91b9ec93e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151968
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx
index 34e65d99492a..a8022bec29f8 100644
--- a/include/svx/tbcontrl.hxx
+++ b/include/svx/tbcontrl.hxx
@@ -247,60 +247,105 @@ public:
 void EnsurePaletteManager();
 };
 
+/** Poup controller for currency combo widget **/
 class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SvxCurrencyToolBoxControl final : 
public svt::PopupWindowController
 {
 public:
-// struct containing currency data
+/**
+* Struct containing currency data
+* an instance corresponds to a line in the combo
+**/
 struct SvxCurrencyData {
+/** position of the currency in 
SvxCurrencyToolBoxControl::CurrencySymbols vector **/
 sal_uInt16 m_currencyIdx;
+
+/**
+* False if the instance corresponds to a line of the combo that shows 
only the ISO code
+* True otherwise
+**/
 bool m_onlyIsoCode;
 OUString m_label;
 
+/** Constant for invalid currency **/
 static const sal_uInt16 InvalidCurrency;
 
+/**
+* Constructor
+*
+* @param currencyIdx Position of the currency in 
SvxCurrencyToolBoxControl::CurrencySymbols vector
+* @param onlyIsoCode False if the instance corresponds to a line of 
the combo that shows
+* only the ISO code True otherwise
+**/
 SvxCurrencyData(
 sal_uInt16 currencyIdx = InvalidCurrency,
 bool onlyIsoCode = false
 );
 
+/** Needed by std::find **/
 bool operator == (const SvxCurrencyData& other) const;
 };
 
+/** vector of combo box currencies **/
 typedef std::vector SvxCurrencyVect_t;
 
 private:
 OUString m_aFormatString;
 LanguageType m_eLanguage;
 sal_uInt32   m_nFormatKey;
+
+/** Currencies in the combo **/
 SvxCurrencyVect_t  m_currencies;
+
+
+/** Most recently used currencies **/
 SvxCurrencyVect_t  m_mru_currencies;
 
+/** Adds a currency to the the most recently used list **/
 void addMruCurrency(sal_Int16 currencyPosition);
 
-// inner static method for backward compatibility
+/**
+* Inner static method that polialtes the currency list and the most 
recently used
+* currency list.
+* The method is static for backward compatibility: it is used by the two
+* homonymous public methods, one of which is static while the other is 
instance
+*
+* @param bFlag used by SvxNumberFormatShell::GetCurrencySymbols
+* @param p_mru_currencies output: most recently used currencies
+* @param pCurrencies output: most recently used currencies
+* @see SvxNumberFormatShell::GetCurrencySymbols
+**/
 static void inner_GetCurrencySymbols( bool bFlag, SvxCurrencyVect_t 
_mru_currencies,
 SvxCurrencyVect_t );
 
 public:
+/**
+* Static method used by SvxNumberFormatShell::GetCurrencySymbols
+*
+* @param rList output: labels in the combo box
+* @param bFlag input: true means that we add the default currency in the 
combox
+* @param rCurrencyList output: list of the currency positions in 
SvxCurrencyToolBoxControl::CurrencySymbols vector
+* @see SvxNumberFormatShell::GetCurrencySymbols
+**/
 static void GetCurrencySymbols( std::vector& rList, bool bFlag,
 std::vector& rCurrencyList );
 
+/** Instance method used by SvxCurrencyList_Impl constructor **/
 const SvxCurrencyVect_t& GetCurrencySymbols();
 
 explicit SvxCurrencyToolBoxControl( const 
css::uno::Reference& rContext );
 virtual ~SvxCurrencyToolBoxControl() override;
 
-// XToolbarController
+/** XToolbarController **/
 virtual void SAL_CALL execute( sal_Int16 nSelectModifier ) override;
 
 virtual VclPtr createVclPopupWindow( vcl::Window* pParent ) 
override;
 virtual std::unique_ptr weldPopupWindow() override;
 
-// XServiceInfo
+/** XServiceInfo **/
 virtual OUString SAL_CALL getImplementationName() override;
 virtual css::uno::Sequence SAL_CALL getSupportedServiceNames() 
override;
 
-// XInitialization
+/** XInitialization **/
 virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any 
>& rArguments ) override;
 };
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 96ee682fa460..c27216cdedd5 100644
--- 

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

2023-05-23 Thread Noel Grandin (via logerrit)
 include/svx/svdobj.hxx  |3 +--
 svx/source/sdr/contact/viewobjectcontactofgroup.cxx |5 +
 svx/source/svdraw/svdobj.cxx|   18 ++
 svx/source/svdraw/svdviter.cxx  |   12 +++-
 4 files changed, 15 insertions(+), 23 deletions(-)

New commits:
commit 8de6e211b760761f1f80b2a7371a5f6b640ab14e
Author: Noel Grandin 
AuthorDate: Mon May 22 18:47:36 2023 +0200
Commit: Noel Grandin 
CommitDate: Tue May 23 14:36:47 2023 +0200

tdf#155410 move some layer/object visibility computation inside SdrObject

which has the nice effect of
(a) removing some duplicated code
(b) being more efficient with deeply nested complex objects

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

diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index ab5066d699a2..54376b1f0397 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -364,8 +364,7 @@ public:
 virtual SdrLayerID GetLayer() const;
 virtual void NbcSetLayer(SdrLayerID nLayer);
 virtual void SetLayer(SdrLayerID nLayer);
-// renaming GetSdrLayerIDSet -> getMergedHierarchySdrLayerIDSet to make 
clear what happens here. rSet needs to be empty.
-void getMergedHierarchySdrLayerIDSet(SdrLayerIDSet& rSet) const;
+bool isVisibleOnAnyOfTheseLayers(const SdrLayerIDSet& rSet) const;
 
 void SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle& 
rBoundRect) const;
 
diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx 
b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
index 8469a00c1e45..90a74cfabc8a 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
@@ -76,10 +76,7 @@ namespace sdr::contact
 
 bool ViewObjectContactOfGroup::isPrimitiveVisibleOnAnyLayer(const 
SdrLayerIDSet& aLayers) const
 {
-SdrLayerIDSet aObjectLayers;
-getSdrObject().getMergedHierarchySdrLayerIDSet(aObjectLayers);
-aObjectLayers &= aLayers;
-return !aObjectLayers.IsEmpty();
+return getSdrObject().isVisibleOnAnyOfTheseLayers(aLayers);
 }
 
 } // end of namespace
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index ab9aa7a9dcf1..03f9f0f95739 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -647,16 +647,18 @@ SdrLayerID SdrObject::GetLayer() const
 return mnLayerID;
 }
 
-void SdrObject::getMergedHierarchySdrLayerIDSet(SdrLayerIDSet& rSet) const
+bool SdrObject::isVisibleOnAnyOfTheseLayers(const SdrLayerIDSet& rSet) const
 {
-rSet.Set(GetLayer());
+if (rSet.IsSet(GetLayer()))
+return true;
 SdrObjList* pOL=GetSubList();
-if (pOL!=nullptr) {
-const size_t nObjCount = pOL->GetObjCount();
-for (size_t nObjNum = 0; nObjNumGetObj(nObjNum)->getMergedHierarchySdrLayerIDSet(rSet);
-}
-}
+if (!pOL)
+return false;
+const size_t nObjCount = pOL->GetObjCount();
+for (size_t nObjNum = 0; nObjNumGetObj(nObjNum)->isVisibleOnAnyOfTheseLayers(rSet))
+return true;
+return false;
 }
 
 void SdrObject::NbcSetLayer(SdrLayerID nLayer)
diff --git a/svx/source/svdraw/svdviter.cxx b/svx/source/svdraw/svdviter.cxx
index 3ad7cb40f86e..baa13909b6c7 100644
--- a/svx/source/svdraw/svdviter.cxx
+++ b/svx/source/svdraw/svdviter.cxx
@@ -68,10 +68,7 @@ bool SdrViewIter::ImpCheckPageView(SdrPageView const* pPV) 
const
 {
 // Looking for an object? First, determine if it visible in
 // this PageView.
-SdrLayerIDSet aObjLay;
-mpObject->getMergedHierarchySdrLayerIDSet(aObjLay);
-aObjLay &= pPV->GetVisibleLayers();
-return !aObjLay.IsEmpty();
+return 
mpObject->isVisibleOnAnyOfTheseLayers(pPV->GetVisibleLayers());
 }
 else
 {
@@ -91,12 +88,9 @@ bool SdrViewIter::ImpCheckPageView(SdrPageView const* pPV) 
const
 {
 // Looking for an object? First, determine if it visible in
 // this PageView.
-SdrLayerIDSet aObjLay;
-mpObject->getMergedHierarchySdrLayerIDSet(aObjLay);
-aObjLay &= pPV->GetVisibleLayers();
+SdrLayerIDSet aObjLay = pPV->GetVisibleLayers();
 aObjLay &= pPg->TRG_GetMasterPageVisibleLayers();
-
-if (!aObjLay.IsEmpty())
+if (mpObject->isVisibleOnAnyOfTheseLayers(aObjLay))
 {
 return true;
 } // else, look at the next master page of this page...


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

2023-05-10 Thread Sarper Akdemir (via logerrit)
 include/svx/svddef.hxx|4 ++--
 svx/source/svdraw/svdattr.cxx |2 +-
 svx/source/table/cell.cxx |6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit eafc57233e90cafeee6f3c9e9ad655df5f1c3185
Author: Sarper Akdemir 
AuthorDate: Fri Apr 21 00:37:37 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Wed May 10 22:16:20 2023 +0200

rename SDRATTR_TABLE_GRABBAG to SDRATTR_TABLE_CELL_GRABBAG

Since SDRATTR_TABLE_GRABBAG was only used in the cell context, rename
it to SDRATTR_TABLE_CELL_GRABBAG to reflect that.

As per Miklos' suggestion in:

https://gerrit.libreoffice.org/c/core/+/150521/3/svx/source/table/cell.cxx#99

Change-Id: Id18e1ab077072d0d8ba45774ef6a3443bbea52e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150736
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx
index e5b1c884acfd..fa57a8aa0bfc 100644
--- a/include/svx/svddef.hxx
+++ b/include/svx/svddef.hxx
@@ -419,8 +419,8 @@ constexpr TypedWhichId
SDRATTR_TABLE_BORDER_INNER  (SDRATTR_T
 constexpr TypedWhichId   SDRATTR_TABLE_BORDER_TLBR   
(SDRATTR_TABLE_FIRST+2);  // 1238
 constexpr TypedWhichId   SDRATTR_TABLE_BORDER_BLTR   
(SDRATTR_TABLE_FIRST+3);  // 1239
 constexpr TypedWhichId SDRATTR_TABLE_TEXT_ROTATION 
(SDRATTR_TABLE_FIRST+4);  // 1240
-constexpr TypedWhichIdSDRATTR_TABLE_GRABBAG   
(SDRATTR_TABLE_FIRST+5);  // 1241
-constexpr sal_uInt16  SDRATTR_TABLE_LAST  
(SDRATTR_TABLE_GRABBAG);  // 1241
+constexpr TypedWhichIdSDRATTR_TABLE_CELL_GRABBAG  
(SDRATTR_TABLE_FIRST+5);  // 1241
+constexpr sal_uInt16  SDRATTR_TABLE_LAST  
(SDRATTR_TABLE_CELL_GRABBAG); // 1241
 
 constexpr sal_uInt16  SDRATTR_GLOW_FIRST 
(SDRATTR_TABLE_LAST+1);// 1242
 constexpr TypedWhichId 
SDRATTR_GLOW_RADIUS(SDRATTR_GLOW_FIRST+0);// 1242
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 4cc184246159..9ed199d34586 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -333,7 +333,7 @@ SdrItemPool::SdrItemPool(
 rPoolDefaults[ SDRATTR_TABLE_BORDER_TLBR - SDRATTR_START ] = new 
SvxLineItem( SDRATTR_TABLE_BORDER_TLBR );
 rPoolDefaults[ SDRATTR_TABLE_BORDER_BLTR - SDRATTR_START ] = new 
SvxLineItem( SDRATTR_TABLE_BORDER_BLTR );
 rPoolDefaults[ SDRATTR_TABLE_TEXT_ROTATION - SDRATTR_START ] = new 
SvxTextRotateItem(0_deg10, SDRATTR_TABLE_TEXT_ROTATION);
-rPoolDefaults[ SDRATTR_TABLE_GRABBAG - SDRATTR_START ] = new 
SfxGrabBagItem(SDRATTR_TABLE_GRABBAG);
+rPoolDefaults[ SDRATTR_TABLE_CELL_GRABBAG - SDRATTR_START ] = new 
SfxGrabBagItem(SDRATTR_TABLE_CELL_GRABBAG);
 
 rPoolDefaults[ SDRATTR_GLOW_RADIUS - SDRATTR_START ] = new 
SdrMetricItem(SDRATTR_GLOW_RADIUS, 0);
 rPoolDefaults[ SDRATTR_GLOW_COLOR - SDRATTR_START ] = new 
XColorItem(SDRATTR_GLOW_COLOR, aNullCol);
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 432084a40b83..88381056e572 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -98,7 +98,7 @@ static const SvxItemPropertySet* ImplGetSvxCellPropertySet()
 { u"LeftBorder",   SDRATTR_TABLE_BORDER,   
cppu::UnoType::get(), 0, LEFT_BORDER },
 { u"RightBorder",  SDRATTR_TABLE_BORDER,   
cppu::UnoType::get(), 0, RIGHT_BORDER },
 { u"RotateAngle",  SDRATTR_TABLE_TEXT_ROTATION,
cppu::UnoType::get(), 0, 0 },
-{ u"CellInteropGrabBag",   SDRATTR_TABLE_GRABBAG,  
cppu::UnoType>::get(), 0, 0},
+{ u"CellInteropGrabBag",   SDRATTR_TABLE_CELL_GRABBAG, 
cppu::UnoType>::get(), 0, 0 },
 
 SVX_UNOEDIT_OUTLINER_PROPERTIES,
 SVX_UNOEDIT_CHAR_PROPERTIES,
@@ -1056,7 +1056,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& 
rPropertyName, const Any&
 
mpProperties->SetObjectItem(SvxTextRotateItem(Degree10(nRotVal/10), 
SDRATTR_TABLE_TEXT_ROTATION));
 return;
 }
-case SDRATTR_TABLE_GRABBAG:
+case SDRATTR_TABLE_CELL_GRABBAG:
 {
 if (mpGrabBagItem == nullptr)
 mpGrabBagItem.reset(new SfxGrabBagItem);
@@ -1184,7 +1184,7 @@ Any SAL_CALL Cell::getPropertyValue( const OUString& 
PropertyName )
 const SvxTextRotateItem& rTextRotate = 
mpProperties->GetItem(SDRATTR_TABLE_TEXT_ROTATION);
 return Any(sal_Int32(to(rTextRotate.GetValue(;
 }
-case SDRATTR_TABLE_GRABBAG:
+case SDRATTR_TABLE_CELL_GRABBAG:
 {
 if (mpGrabBagItem != nullptr)
 {


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

2023-05-04 Thread Caolán McNamara (via logerrit)
 include/svx/svdedtv.hxx   |2 +-
 svx/source/svdraw/svdedtv.cxx |   15 ++-
 2 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 1efb16454f813dce9dffc124b43a31e46a1b9e3f
Author: Caolán McNamara 
AuthorDate: Wed May 3 16:59:51 2023 +0100
Commit: Caolán McNamara 
CommitDate: Thu May 4 09:50:36 2023 +0200

tdf#108889 ref count goes negative with 0 undo levels configured

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

diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index 2ff56e71b17b..1cf9be6fdb9a 100644
--- a/include/svx/svdedtv.hxx
+++ b/include/svx/svdedtv.hxx
@@ -154,7 +154,7 @@ protected:
 // Removes all objects of the MarkList from their ObjLists including Undo.
 // The entries in rMark remain.
 // @return a list of objects that must be deleted after the outermost 
EndUndo
-std::vector DeleteMarkedList(SdrMarkList const& rMark); // 
DeleteMarked -> DeleteMarkedList
+std::vector> DeleteMarkedList(SdrMarkList const& 
rMark); // DeleteMarked -> DeleteMarkedList
 
 // Check possibilities of all marked objects
 virtual void CheckPossibilities();
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 96e61779e04b..27015e410e9d 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -712,9 +712,9 @@ void SdrEditView::ForceMarkedObjToAnotherPage()
 }
 }
 
-std::vector SdrEditView::DeleteMarkedList(SdrMarkList const& rMark)
+std::vector> 
SdrEditView::DeleteMarkedList(SdrMarkList const& rMark)
 {
-std::vector ret;
+std::vector> ret;
 if (rMark.GetMarkCount()!=0)
 {
 rMark.ForceSort();
@@ -761,13 +761,13 @@ std::vector 
SdrEditView::DeleteMarkedList(SdrMarkList const& rMark)
 aUpdaters.push_back(new 
E3DModifySceneSnapRectUpdater(pObj));
 }
 
-pOL->RemoveObject(nOrdNum);
-
 if( !bUndo )
 {
-// tdf#108863 don't delete objects before EndUndo()
+// tdf#108863 and tdf#108889 don't delete objects before 
EndUndo()
 ret.push_back(pObj);
 }
+
+pOL->RemoveObject(nOrdNum);
 }
 
 // fire scene updaters
@@ -865,10 +865,7 @@ void SdrEditView::DeleteMarkedObj()
 // original stuff: remove selected objects. Handle clear will
 // do something only once
 auto temp(DeleteMarkedList(GetMarkedObjectList()));
-for (auto p : temp)
-{
-lazyDeleteObjects.push_back(p);
-}
+lazyDeleteObjects.insert(lazyDeleteObjects.end(), temp.begin(), 
temp.end());
 GetMarkedObjectListWriteAccess().Clear();
 maHdlList.Clear();
 


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

2023-05-02 Thread Vert D (via logerrit)
 include/svx/charmap.hxx   |2 -
 svx/source/dialog/charmap.cxx |   79 ++
 2 files changed, 28 insertions(+), 53 deletions(-)

New commits:
commit 332b620732d4f78625c6547a988fa9860ab0d7bd
Author: Vert D 
AuthorDate: Fri Apr 28 08:13:56 2023 -0500
Commit: Mike Kaganski 
CommitDate: Tue May 2 14:22:55 2023 +0200

tdf#154884 fix isFavChar, updateFavCharacterList deletes the correct pair

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

diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index 71999368fd4a..8057eae3c1bd 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -78,7 +78,7 @@ public:
 voidSetFont( const vcl::Font& rFont );
 vcl::Font const & GetFont() const { return maFont; }
 FontCharMapRef const & GetFontCharMap();
-boolisFavChar(const OUString& sTitle, const OUString& rFont);
+boolisFavChar(std::u16string_view sTitle, std::u16string_view 
rFont);
 voidgetFavCharacterList(); //gets both Fav char and Fav char 
font list
 voidupdateFavCharacterList(const OUString& rChar, const 
OUString& rFont);
 
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 924838273d05..6d7933fe95cb 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -228,18 +228,15 @@ void SvxShowCharSet::getFavCharacterList()
 comphelper::sequenceToContainer(maFavCharFontList, rFavCharFontList);
 }
 
-bool SvxShowCharSet::isFavChar(const OUString& sTitle, const OUString& rFont)
+bool SvxShowCharSet::isFavChar(std::u16string_view sTitle, std::u16string_view 
rFont)
 {
-auto isFavCharTitleExists = std::any_of(maFavCharList.begin(),
- maFavCharList.end(),
- [sTitle] (const OUString & a) { return a == sTitle; });
-
-auto isFavCharFontExists = std::any_of(maFavCharFontList.begin(),
- maFavCharFontList.end(),
- [rFont] (const OUString & a) { return a == rFont; });
-
-// if Fav char to be added is already in list, return true
-return isFavCharTitleExists && isFavCharFontExists;
+assert(maFavCharList.size() == maFavCharFontList.size());
+for (size_t i = 0; i < maFavCharList.size(); i++)
+{
+if (maFavCharList[i] == sTitle && maFavCharFontList[i] == rFont)
+return true;
+}
+return false;
 }
 
 void SvxShowCharSet::createContextMenu(const Point& rPosition)
@@ -300,55 +297,33 @@ void SvxShowCharSet::CopyToClipboard(const OUString& 
rOUStr)
 
 void SvxShowCharSet::updateFavCharacterList(const OUString& sTitle, const 
OUString& rFont)
 {
-if(isFavChar(sTitle, rFont))
+if (isFavChar(sTitle, rFont))
 {
-auto itChar = std::find(maFavCharList.begin(), maFavCharList.end(), 
sTitle);
-auto itChar2 = std::find(maFavCharFontList.begin(), 
maFavCharFontList.end(), rFont);
-
-// if Fav char to be added is already in list, remove it
-if( itChar != maFavCharList.end() &&  itChar2 != 
maFavCharFontList.end() )
+assert(maFavCharList.size() == maFavCharFontList.size());
+auto fontIt = maFavCharFontList.begin();
+for (auto charIt = maFavCharList.begin(); charIt != 
maFavCharList.end(); charIt++)
 {
-maFavCharList.erase( itChar );
-maFavCharFontList.erase( itChar2);
-}
-
-css::uno::Sequence< OUString > aFavCharList(maFavCharList.size());
-auto aFavCharListRange = asNonConstRange(aFavCharList);
-css::uno::Sequence< OUString > 
aFavCharFontList(maFavCharFontList.size());
-auto aFavCharFontListRange = asNonConstRange(aFavCharFontList);
-
-for (size_t i = 0; i < maFavCharList.size(); ++i)
-{
-aFavCharListRange[i] = maFavCharList[i];
-aFavCharFontListRange[i] = maFavCharFontList[i];
+if (*charIt == sTitle && *fontIt == rFont)
+{
+maFavCharList.erase(charIt);
+maFavCharFontList.erase(fontIt);
+break;
+}
+fontIt++;
 }
-
-std::shared_ptr 
batch(comphelper::ConfigurationChanges::create());
-
officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::set(aFavCharList,
 batch);
-
officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::set(aFavCharFontList,
 batch);
-batch->commit();
-return;
 }
-
-auto itChar = std::find(maFavCharList.begin(), maFavCharList.end(), 
sTitle);
-auto itChar2 = std::find(maFavCharFontList.begin(), 
maFavCharFontList.end(), rFont);
-
-// if Fav char to be added is already in list, remove it
-if( itChar != maFavCharList.end() &&  itChar2 != maFavCharFontList.end() )
+else
 {
-maFavCharList.erase( itChar );
-

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

2023-04-29 Thread Tomaž Vajngerl (via logerrit)
 include/svx/svdotext.hxx   |2 
 svx/source/svdraw/svdotext.cxx |   85 ++---
 2 files changed, 14 insertions(+), 73 deletions(-)

New commits:
commit dd15364793401e41bae45cdeb410808c9f94fa93
Author: Tomaž Vajngerl 
AuthorDate: Sat Apr 29 21:33:09 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 30 03:19:26 2023 +0200

adapt the new auto-fitting alg. to work for vertical text

And remove the old auto-fitting algorithm now.

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

diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index bf82e4db7c54..d9c0908e505b 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -275,7 +275,7 @@ private:
Fraction&aFitXCorrection ) 
const;
 void ImpAutoFitText( SdrOutliner& rOutliner ) const;
 void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool 
bIsVerticalWriting ) const;
-void autoFitTextForCompatibility(SdrOutliner& rOutliner, const Size& 
rShapeSize) const;
+void autoFitTextForCompatibility(SdrOutliner& rOutliner, const Size& 
rShapeSize, bool bIsVerticalWriting) const;
 
 SVX_DLLPRIVATE rtl::Reference 
ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
 SVX_DLLPRIVATE void ImpRegisterLink();
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 4eab532af59b..f2951787b551 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1272,78 +1272,10 @@ void SdrTextObj::ImpAutoFitText( SdrOutliner& rOutliner 
) const
 void SdrTextObj::ImpAutoFitText(SdrOutliner& rOutliner, const Size& rTextSize,
 bool bIsVerticalWriting) const
 {
-if (!bIsVerticalWriting)
-{
-autoFitTextForCompatibility(rOutliner, rTextSize);
-return;
-}
-
-// EditEngine formatting is unstable enough for
-// line-breaking text that we need some more samples
-
-// loop early-exits if we detect an already attained value
-double nMinStretchX = 0.0;
-double nMinStretchY = 0.0;
-std::array aOldStretchXVals = {0,0,0,0,0,0,0,0,0,0};
-rOutliner.setRoundFontSizeToPt(false);
-for (size_t i = 0; i < aOldStretchXVals.size(); ++i)
-{
-const Size aCurrTextSize = rOutliner.CalcTextSizeNTP();
-double fFactor = 1.0;
-if (aCurrTextSize.Width() != 0)
-fFactor = double(rTextSize.Width())/aCurrTextSize.Width();
-
-// fFactor scales in both x and y directions
-// - this is fine for bulleted words
-// - but it scales too much for a long paragraph
-// - taking sqrt scales long paragraphs the best
-// - bulleted words will have to go through more iterations
-fFactor = std::sqrt(fFactor);
-
-double nCurrStretchX, nCurrStretchY;
-rOutliner.getGlobalScale(nCurrStretchX, nCurrStretchY, 
o3tl::temporary(double()), o3tl::temporary(double()));
-
-if (fFactor >= 0.98)
-{
-// resulting text area fits into available shape rect -
-// err on the larger stretching, to optimally fill area
-nMinStretchX = std::max(nMinStretchX, nCurrStretchX);
-nMinStretchY = std::max(nMinStretchY, nCurrStretchY);
-}
-
-aOldStretchXVals[i] = basegfx::fround(nCurrStretchX * 10.0);
-if (std::find(aOldStretchXVals.begin(), aOldStretchXVals.begin() + i, 
basegfx::fround(nCurrStretchX * 10.0)) != aOldStretchXVals.begin() + i)
-break; // same value already attained once; algo is looping, exit
-
-if (fFactor < 1.0 || nCurrStretchX != 100)
-{
-nCurrStretchX = double(basegfx::fround(nCurrStretchX * fFactor * 
100.0)) / 100.00;
-nCurrStretchY = double(basegfx::fround(nCurrStretchY * fFactor * 
100.0)) / 100.00;
-
-double nStretchX = std::min(100.0, nCurrStretchX);
-double nStretchY = std::min(100.0, nCurrStretchY);
-
-rOutliner.setGlobalScale(nStretchX, nStretchY, nStretchX, 
nStretchY);
-SAL_INFO("svx", "zoom is " << nCurrStretchX);
-}
-}
-
-const SdrTextFitToSizeTypeItem& rItem = 
GetObjectItem(SDRATTR_TEXT_FITTOSIZE);
-if (rItem.GetMaxScale() > 0.0)
-{
-nMinStretchX = std::min(rItem.GetMaxScale(), nMinStretchX);
-nMinStretchY = std::min(rItem.GetMaxScale(), nMinStretchY);
-}
-
-SAL_INFO("svx", "final zoom is " << nMinStretchX);
-
-nMinStretchX = std::min(100.0, nMinStretchX);
-nMinStretchY = std::min(100.0, nMinStretchY);
-
-rOutliner.setGlobalScale(nMinStretchX, nMinStretchY, nMinStretchX, 
nMinStretchY);
+autoFitTextForCompatibility(rOutliner, rTextSize, bIsVerticalWriting);
 }
 
-void SdrTextObj::autoFitTextForCompatibility(SdrOutliner& rOutliner, 

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

2023-04-21 Thread Caolán McNamara (via logerrit)
 include/svx/xmlexchg.hxx |7 +++---
 svx/source/fmcomp/xmlexchg.cxx   |   10 -
 svx/source/form/datanavi.cxx |   36 ++-
 sw/source/uibase/dochdl/swdtflvr.cxx |4 +--
 4 files changed, 34 insertions(+), 23 deletions(-)

New commits:
commit 1d0fadfd218b872ee5d4b07b88320c8f37667218
Author: Caolán McNamara 
AuthorDate: Fri Apr 21 16:16:02 2023 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 21 21:18:00 2023 +0200

Resolves: tdf#154535 create the OXFormsDescriptor on-demand

so we don't cause an unwanted Binding to be created unless we are forced
to.

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

diff --git a/include/svx/xmlexchg.hxx b/include/svx/xmlexchg.hxx
index e03bdb4cfe31..73137c97c52b 100644
--- a/include/svx/xmlexchg.hxx
+++ b/include/svx/xmlexchg.hxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace com::sun::star::beans {
 class SAL_NO_VTABLE XPropertySet;
@@ -61,17 +62,17 @@ namespace svx
 virtual voidAddSupportedFormats() override;
 virtual bool GetData( const css::datatransfer::DataFlavor& 
rFlavor, const OUString& rDestDoc ) override;
 
-OXFormsDescriptor m_aDescriptor;
+std::function m_getDescriptorFunc;
 
 public:
 
 /** construct the transferable
 */
-OXFormsTransferable( const OXFormsDescriptor  );
+OXFormsTransferable(const std::function& 
getDescriptorFunc);
 
 /** extracts an xform descriptor from the transferable given
 */
-static const OXFormsDescriptor ( const 
TransferableDataHelper& _rData );
+static OXFormsDescriptor extractDescriptor( const 
TransferableDataHelper& _rData );
 };
 
 
diff --git a/svx/source/fmcomp/xmlexchg.cxx b/svx/source/fmcomp/xmlexchg.cxx
index 1f8d44ee7d3a..86bc1bbf46b9 100644
--- a/svx/source/fmcomp/xmlexchg.cxx
+++ b/svx/source/fmcomp/xmlexchg.cxx
@@ -27,8 +27,8 @@ namespace svx
 
 using namespace ::com::sun::star::datatransfer;
 
-OXFormsTransferable::OXFormsTransferable( const OXFormsDescriptor  ) :
-m_aDescriptor(rhs)
+OXFormsTransferable::OXFormsTransferable(const 
std::function& getDescriptorFunc) :
+m_getDescriptorFunc(getDescriptorFunc)
 {
 }
 
@@ -47,13 +47,13 @@ namespace svx
 return false;
 }
 
-const OXFormsDescriptor ::extractDescriptor( const 
TransferableDataHelper &_rData ) {
-
+OXFormsDescriptor OXFormsTransferable::extractDescriptor( const 
TransferableDataHelper &_rData )
+{
 using namespace ::com::sun::star::uno;
 Reference  = 
const_cast &>(_rData.GetTransferable());
 XTransferable *pInterface = transfer.get();
 OXFormsTransferable& rThis = 
dynamic_cast(*pInterface);
-return rThis.m_aDescriptor;
+return rThis.m_getDescriptorFunc();
 }
 
 }
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index cfacfa948fbe..a00747cd2633 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -300,19 +300,29 @@ namespace svxform
 return;
 }
 
-OXFormsDescriptor desc;
-desc.szName = m_xItemList->get_text(*m_xScratchIter);
-if(pItemNode->m_xNode.is()) {
-// a valid node interface tells us that we need to create a 
control from a binding
-desc.szServiceName = GetServiceNameForNode(pItemNode->m_xNode);
-desc.xPropSet = GetBindingForNode(pItemNode->m_xNode);
-DBG_ASSERT( desc.xPropSet.is(), "DataTreeListBox::StartDrag(): 
invalid node binding" );
-}
-else {
-desc.szServiceName = FM_COMPONENT_COMMANDBUTTON;
-desc.xPropSet = pItemNode->m_xPropSet;
-}
-xTransferable = rtl::Reference(new 
OXFormsTransferable(desc));
+OUString szName = m_xItemList->get_text(*m_xScratchIter);
+Reference xNode(pItemNode->m_xNode);
+Reference xPropSet(pItemNode->m_xPropSet);
+
+// tdf#154535 create the OXFormsDescriptor on-demand so we don't cause 
an unwanted
+// Binding to be created unless we are forced to.
+auto fnCreateFormsDescriptor = [this, szName, xNode, xPropSet](){
+OXFormsDescriptor desc;
+desc.szName = szName;
+if (xNode) {
+// a valid node interface tells us that we need to create a 
control from a binding
+desc.szServiceName = GetServiceNameForNode(xNode);
+desc.xPropSet = GetBindingForNode(xNode);
+DBG_ASSERT( desc.xPropSet.is(), "DataTreeListBox::StartDrag(): 
invalid node binding" );
+}
+else {
+desc.szServiceName = FM_COMPONENT_COMMANDBUTTON;
+  

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

2023-04-20 Thread Baole Fang (via logerrit)
 include/svx/strings.hrc  |1 +
 include/svx/zoomctrl.hxx |1 +
 svx/source/stbctrls/zoomctrl.cxx |   21 +
 3 files changed, 23 insertions(+)

New commits:
commit 91148ed5d5ef3428a39676bec672ccb5918ff19a
Author: Baole Fang 
AuthorDate: Wed Apr 19 14:14:10 2023 -0400
Commit: Mike Kaganski 
CommitDate: Thu Apr 20 17:40:39 2023 +0200

tdf#154732: Fix zoom bar in Draw

Oringally, the zoom bar in both Draw and Impress show
"Fit slide to current window."
Now, the zoom bar in Draw is modified into
"Fit page to current window.", while Impress still uses "slide".

Change-Id: Iba25215d437b128f581bc5a8e6767f6b1f382be4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150650
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index b5b64bfd6304..7799a69bca11 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1324,6 +1324,7 @@
 #define RID_SVXSTR_DOC_MODIFIED_NO  
NC_("RID_SVXSTR_DOC_MODIFIED_NO", "The document has not been modified since the 
last save.")
 #define RID_SVXSTR_DOC_LOAD 
NC_("RID_SVXSTR_DOC_LOAD", "Loading document...")
 #define RID_SVXSTR_FIT_SLIDE
NC_("RID_SVXSTR_FIT_SLIDE", "Fit slide to current window.")
+#define RID_SVXSTR_FIT_PAGE 
NC_("RID_SVXSTR_FIT_PAGE", "Fit page to current window.")
 #define RID_SVXSTR_WARN_MISSING_SMARTART
NC_("RID_SVXSTR_WARN_MISSING_SMARTART", "Could not load all SmartArt objects. 
Saving in Microsoft Office 2010 or later would avoid this issue.")
 #define RID_SVXSTR_TABLECELL_HINT   
NC_("RID_SVXSTR_TABLECELL_HINT", "Table cell address. Click to open Table 
Properties dialog.")
 #define RID_SVXSTR_SECTION_HINT 
NC_("RID_SVXSTR_SECTION_HINT", "Section name. Click to open Edit Sections 
dialog.")
diff --git a/include/svx/zoomctrl.hxx b/include/svx/zoomctrl.hxx
index 0c64db1e5efa..15ccb03f5747 100644
--- a/include/svx/zoomctrl.hxx
+++ b/include/svx/zoomctrl.hxx
@@ -52,6 +52,7 @@ private:
 public:
 virtual void Paint(const UserDrawEvent& rEvt) override;
 virtual bool MouseButtonDown(const MouseEvent& rEvt) override;
+virtual void SAL_CALL initialize(const css::uno::Sequence& 
aArguments) override;
 
 SFX_DECL_STATUSBAR_CONTROL();
 
diff --git a/svx/source/stbctrls/zoomctrl.cxx b/svx/source/stbctrls/zoomctrl.cxx
index 001ba0ec1e3b..3faaa17073f2 100644
--- a/svx/source/stbctrls/zoomctrl.cxx
+++ b/svx/source/stbctrls/zoomctrl.cxx
@@ -39,6 +39,7 @@
 #include 
 
 #include 
+#include 
 
 SFX_IMPL_STATUSBAR_CONTROL(SvxZoomStatusBarControl,SvxZoomItem);
 
@@ -203,6 +204,26 @@ 
SvxZoomPageStatusBarControl::SvxZoomPageStatusBarControl(sal_uInt16 _nSlotId,
 GetStatusBar().SetQuickHelpText(GetId(), SvxResId(RID_SVXSTR_FIT_SLIDE));
 }
 
+void SAL_CALL SvxZoomPageStatusBarControl::initialize( const 
css::uno::Sequence< css::uno::Any >& aArguments )
+{
+// Call inherited initialize
+StatusbarController::initialize(aArguments);
+
+// Get document type
+css::uno::Reference< css::frame::XModuleManager2 > xModuleManager = 
css::frame::ModuleManager::create( m_xContext );
+OUString aModuleIdentifier = xModuleManager->identify( 
css::uno::Reference( m_xFrame, 
css::uno::UnoReference_Query::UNO_QUERY ) );
+
+// Decide what to show in zoom bar
+if ( aModuleIdentifier == "com.sun.star.drawing.DrawingDocument" )
+{
+GetStatusBar().SetQuickHelpText(GetId(), 
SvxResId(RID_SVXSTR_FIT_PAGE));
+}
+else if ( aModuleIdentifier == 
"com.sun.star.presentation.PresentationDocument" )
+{
+GetStatusBar().SetQuickHelpText(GetId(), 
SvxResId(RID_SVXSTR_FIT_SLIDE));
+}
+}
+
 void SvxZoomPageStatusBarControl::Paint(const UserDrawEvent& rUsrEvt)
 {
 vcl::RenderContext* pDev = rUsrEvt.GetRenderContext();


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

2023-04-03 Thread Michael Weghorn (via logerrit)
 include/svx/charmap.hxx   |1 +
 svx/source/dialog/charmap.cxx |   41 -
 2 files changed, 33 insertions(+), 9 deletions(-)

New commits:
commit 1f437264084fd173116965fa4d856aeafdfe7a98
Author: Michael Weghorn 
AuthorDate: Sun Apr 2 00:36:44 2023 +0300
Commit: Michael Weghorn 
CommitDate: Mon Apr 3 17:01:56 2023 +0200

tdf#153806 a11y: Allow opening context menu in special char dlg using 
keyboard

Open the context menu for the `CommandEventId::ContextMenu`
command for the character table that is used in the special
characters dialog, so opening the context menu is not only
possible by right mouse click, but also using the keyboard
(by pressing the context menu button or Shift+F10).

Move the handling for the case where the context menu is activated
using the mouse from `SvxShowCharSet::MouseButtonDown`
to `SvxShowCharSet::Command`.

When the context menu is activated using the keyboard,
use the centre of the currently selected item for the
context menu position.

Adding support for opening the context menu for the
recently used and favorite characters further down
in the special characters dialog is independent of this
and would have to be added separately.

Change-Id: I55ef43708b95f5a90b06777a8aeb32a64609160d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149927
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index 972659ff9f87..71999368fd4a 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -111,6 +111,7 @@ private:
 virtual bool MouseButtonUp(const MouseEvent& rMEvt) override;
 virtual void GetFocus() override;
 virtual void LoseFocus() override;
+virtual bool Command(const CommandEvent& rCEvt) override;
 
 virtual css::uno::Reference 
CreateAccessible() override;
 virtual FactoryFunction GetUITestFactory() const override;
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 27fa8ccb2687..924838273d05 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -135,18 +136,11 @@ bool SvxShowCharSet::MouseButtonDown(const MouseEvent& 
rMEvt)
 
 if ( !(rMEvt.GetClicks() % 2) )
 aDoubleClkHdl.Call( this );
-}
 
-if (rMEvt.IsRight())
-{
-Point aPosition (rMEvt.GetPosPixel());
-int nIndex = PixelToMapIndex( rMEvt.GetPosPixel() );
-// Fire the focus event
-SelectIndex( nIndex, true);
-createContextMenu(aPosition);
+return true;
 }
 
-return true;
+return CustomWidgetController::MouseButtonDown(rMEvt);
 }
 
 bool SvxShowCharSet::MouseButtonUp(const MouseEvent& rMEvt)
@@ -187,6 +181,35 @@ bool SvxShowCharSet::MouseMove(const MouseEvent& rMEvt)
 return true;
 }
 
+bool SvxShowCharSet::Command(const CommandEvent& rCEvt)
+{
+if (rCEvt.GetCommand() == CommandEventId::ContextMenu)
+{
+Point aPosition;
+if (rCEvt.IsMouseEvent())
+{
+aPosition = rCEvt.GetMousePosPixel();
+int nIndex = PixelToMapIndex(aPosition);
+// Fire the focus event
+SelectIndex(nIndex, true);
+}
+else
+{
+svx::SvxShowCharSetItem* pItem = ImplGetItem(nSelectedIndex);
+if (!pItem)
+return true;
+
+// position context menu at centre of currently selected item
+aPosition = MapIndexToPixel(nSelectedIndex);
+aPosition.AdjustX(pItem->maRect.GetWidth() / 2);
+aPosition.AdjustY(pItem->maRect.GetHeight() / 2);
+}
+createContextMenu(aPosition);
+return true;
+}
+return weld::CustomWidgetController::Command(rCEvt);
+}
+
 sal_uInt16 SvxShowCharSet::GetRowPos(sal_uInt16 _nPos)
 {
 return _nPos / COLUMN_COUNT ;


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

2023-04-03 Thread Michael Weghorn (via logerrit)
 include/svx/charmap.hxx   |3 +--
 svx/source/dialog/charmap.cxx |8 +++-
 2 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit bb4aaa4cfd6cf3fe0f43baae2622df1098047123
Author: Michael Weghorn 
AuthorDate: Sun Apr 2 00:01:10 2023 +0300
Commit: Michael Weghorn 
CommitDate: Mon Apr 3 17:01:31 2023 +0200

Pass special char dlg context menu pos as param, drop member

The `maPosition` member was only used for the position
of the context menu. It was set before calling
`SvxShowCharSet::createContextMenu` and then only used
in there.

Pass the position directly as a parameter instead and
drop the extra member.

Change-Id: I7ba9ec60ffb993ca1269d86efeddbe0950ed7fbe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149926
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index 5f0bfe6ffdee..972659ff9f87 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -66,7 +66,7 @@ public:
 
 voidSelectCharacter( sal_UCS4 cNew );
 virtual sal_UCS4GetSelectCharacter() const;
-voidcreateContextMenu();
+voidcreateContextMenu(const Point& rPosition);
 
 voidSetDoubleClickHdl( const Link& rLink 
) { aDoubleClkHdl = rLink; }
 voidSetReturnKeyPressHdl( const Link& 
rLink ) { m_aReturnKeypressHdl = rLink; }
@@ -139,7 +139,6 @@ protected:
 
 FontCharMapRef  mxFontCharMap;
 SizemaFontSize;
-Point   maPosition;
 
 bool mbRecalculateFont  : 1;
 bool mbUpdateForeground : 1;
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 90bb03081af9..27fa8ccb2687 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -68,7 +68,6 @@ 
SvxShowCharSet::SvxShowCharSet(std::unique_ptr pScrolledWi
 , nX(0)
 , nY(0)
 , maFontSize(0, 0)
-, maPosition(0,0)
 , mbRecalculateFont(true)
 , mbUpdateForeground(true)
 , mbUpdateBackground(true)
@@ -141,11 +140,10 @@ bool SvxShowCharSet::MouseButtonDown(const MouseEvent& 
rMEvt)
 if (rMEvt.IsRight())
 {
 Point aPosition (rMEvt.GetPosPixel());
-maPosition = aPosition;
 int nIndex = PixelToMapIndex( rMEvt.GetPosPixel() );
 // Fire the focus event
 SelectIndex( nIndex, true);
-createContextMenu();
+createContextMenu(aPosition);
 }
 
 return true;
@@ -221,7 +219,7 @@ bool SvxShowCharSet::isFavChar(const OUString& sTitle, 
const OUString& rFont)
 return isFavCharTitleExists && isFavCharFontExists;
 }
 
-void SvxShowCharSet::createContextMenu()
+void SvxShowCharSet::createContextMenu(const Point& rPosition)
 {
 std::unique_ptr 
xBuilder(Application::CreateBuilder(GetDrawingArea(), "svx/ui/charsetmenu.ui"));
 std::unique_ptr xItemMenu(xBuilder->weld_menu("charsetmenu"));
@@ -233,7 +231,7 @@ void SvxShowCharSet::createContextMenu()
 else
 xItemMenu->set_visible("remove", false);
 
-ContextMenuSelect(xItemMenu->popup_at_rect(GetDrawingArea(), 
tools::Rectangle(maPosition, Size(1,1;
+ContextMenuSelect(xItemMenu->popup_at_rect(GetDrawingArea(), 
tools::Rectangle(rPosition, Size(1,1;
 GrabFocus();
 Invalidate();
 }


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

2023-04-02 Thread Tomaž Vajngerl (via logerrit)
 include/svx/svdobjkind.hxx   |3 ++-
 svx/source/svdraw/svdcrtv.cxx|   12 ++--
 svx/source/svdraw/svdobj.cxx |   17 -
 sw/source/core/frmedt/feshview.cxx   |2 +-
 sw/source/uibase/docvw/edtwin.cxx|2 +-
 sw/source/uibase/ribbar/drawbase.cxx |6 +++---
 6 files changed, 25 insertions(+), 17 deletions(-)

New commits:
commit 24a374ebc9da56cc6721e8feaa1e15ba850bf41d
Author: Tomaž Vajngerl 
AuthorDate: Sun Apr 2 06:28:01 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Apr 2 11:42:42 2023 +0200

tdf#154040 use a SdrObjKind::NewFrame for frame creation in writer

Instead of (ab)using SdrObjKind::NONE for the temporary, empty
SdrObject instance in writer when creating a new frame, use a new
SdrObjKind::NewFrame kind for the object and use a empty SdrObject
instance EmptyObject - minimal implementation of SdrObject).

Change-Id: I0277a8f0cf7bfd428e106258ae8710b77e62c41b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149924
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/svx/svdobjkind.hxx b/include/svx/svdobjkind.hxx
index e6063bc10ce5..d25eba0a0027 100644
--- a/include/svx/svdobjkind.hxx
+++ b/include/svx/svdobjkind.hxx
@@ -141,7 +141,8 @@ enum class SdrObjKind : sal_uInt16
 ReportDesignSubReport = 506,
 
 // writer, arbitrarily place at 600
-SwFlyDrawObjIdentifier = 601
+SwFlyDrawObjIdentifier = 601,
+NewFrame = 602
 };
 
 inline constexpr bool IsInventorE3D(SdrObjKind e)
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index 8c3c0750377f..3a27e56694c7 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -414,7 +414,7 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, 
SdrObjKind nIdent, cons
 // object should not be created. Since it is possible to use 
it as a helper
 // object (e.g. in letting the user define an area with the 
interactive
 // construction) at least no items should be set at that 
object.
-if(nInvent != SdrInventor::Default || nIdent != 
SdrObjKind::NONE)
+if(nInvent != SdrInventor::Default || nIdent != 
SdrObjKind::NewFrame)
 {
 mpCurrentCreate->SetMergedItemSet(maDefaultAttr);
 }
@@ -734,11 +734,11 @@ void SdrCreateView::ShowCreateObj(/*OutputDevice* pOut, 
sal_Bool bFull*/)
 // overlay objects instead.
 bool bUseSolidDragging(IsSolidDragging());
 
-// #i101648# check if dragged object is a naked SdrObject (not
-// a derivation). This is e.g. used in SW Frame construction
-// as placeholder. Do not use SolidDragging for naked SdrObjects,
-// they cannot have a valid optical representation
-if(bUseSolidDragging && SdrObjKind::NONE == 
mpCurrentCreate->GetObjIdentifier())
+// #i101648# check if dragged object is a SdrObjKind::NewFrame.
+// This is e.g. used in SW Frame construction as placeholder.
+// Do not use SolidDragging for SdrObjKind::NewFrame kind of objects,
+// they cannot have a valid optical representation.
+if (bUseSolidDragging && SdrObjKind::NewFrame == 
mpCurrentCreate->GetObjIdentifier())
 {
 bUseSolidDragging = false;
 }
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 8f3d2e7eb12a..ab9aa7a9dcf1 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -3197,6 +3197,9 @@ rtl::Reference 
SdrObjFactory::CreateObjectFromFactory(SdrModel& rSdrM
 namespace
 {
 
+// SdrObject subclass, which represents an empty object of a
+// certain type (kind).
+template 
 class EmptyObject final : public SdrObject
 {
 private:
@@ -3221,17 +3224,17 @@ public:
 
 SdrInventor GetObjInventor() const override
 {
-return SdrInventor::Default;
+return OBJECT_INVENTOR;
 }
 
 SdrObjKind GetObjIdentifier() const override
 {
-return SdrObjKind::NONE;
+return OBJECT_KIND;
 }
 
 void NbcRotate(const Point& /*rRef*/, Degree100 /*nAngle*/, double 
/*sinAngle*/, double /*cosAngle*/) override
 {
-assert(false);
+assert(false); // should not be called for this kind of objects
 }
 };
 
@@ -3329,7 +3332,7 @@ rtl::Reference SdrObjFactory::MakeNewObject(
 }
 }
 break;
-case SdrObjKind::NONE: pObj = new EmptyObject(rSdrModel); break;
+case SdrObjKind::NONE: pObj = nullptr; break;
 case SdrObjKind::Group   : pObj=new SdrObjGroup(rSdrModel);
 break;
 case SdrObjKind::Polygon   : pObj=new SdrPathObj(rSdrModel, 
SdrObjKind::Polygon   ); break;
 case SdrObjKind::PolyLine   : pObj=new SdrPathObj(rSdrModel, 
SdrObjKind::PolyLine   ); break;
@@ 

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

2023-03-30 Thread Arvind K (via logerrit)
 include/svx/strings.hrc  |3 +--
 svx/source/tbxctrls/bulletsnumbering.cxx |   11 +--
 2 files changed, 2 insertions(+), 12 deletions(-)

New commits:
commit 2ca71b5c6e0374254e7c75c75e54fa6a8caebfde
Author: Arvind K 
AuthorDate: Fri Mar 3 01:05:54 2023 +0530
Commit: Heiko Tietze 
CommitDate: Thu Mar 30 08:10:34 2023 +

tdf#146748 Change 'More Numbering/Bullets' options to 'Customize'

Change-Id: Ia9ae20b8c73ddd762424c99eedbaf145fed81935
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148142
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index c54d99529ee3..b5b64bfd6304 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1107,8 +1107,7 @@
 #define RID_SVXSTR_DEFAULT  
NC_("RID_SVXSTR_DEFAULT", "Default")
 #define RID_SVXSTR_FRAME
NC_("RID_SVXSTR_FRAME", "Borders")
 #define RID_SVXSTR_FRAME_STYLE  
NC_("RID_SVXSTR_FRAME_STYLE", "Border Style")
-#define RID_SVXSTR_MORENUMBERING
NC_("RID_SVXSTR_MORENUMBERING", "More Numbering...")
-#define RID_SVXSTR_MOREBULLETS  
NC_("RID_SVXSTR_MOREBULLETS", "More Bullets...")
+#define RID_SVXSTR_CUSTOMIZE
NC_("RID_SVXSTR_CUSTOMIZE", "Customize...")
 #define RID_SVXSTR_BY_AUTHOR
NC_("RID_SVXSTR_BY_AUTHOR", "By author")
 #define RID_SVXSTR_PAGES
NC_("RID_SVXSTR_PAGES", "Pages")
 #define RID_SVXSTR_CLEARFORM
NC_("RID_SVXSTR_CLEARFORM", "Clear formatting")
diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx 
b/svx/source/tbxctrls/bulletsnumbering.cxx
index a9195cd5a695..1a8636380921 100644
--- a/svx/source/tbxctrls/bulletsnumbering.cxx
+++ b/svx/source/tbxctrls/bulletsnumbering.cxx
@@ -107,22 +107,13 @@ NumberingPopup::NumberingPopup(NumberingToolBoxControl& 
rController,
 mxValueSet->SetOutputSizePixel(aSize);
 
mxValueSet->SetColor(Application::GetSettings().GetStyleSettings().GetFieldColor());
 
-OUString aMoreItemText;
+OUString aMoreItemText = SvxResId( RID_SVXSTR_CUSTOMIZE );
 if ( mePageType == NumberingPageType::BULLET )
-{
-aMoreItemText = SvxResId( RID_SVXSTR_MOREBULLETS );
 AddStatusListener( ".uno:CurrentBulletListType" );
-}
 else if ( mePageType == NumberingPageType::SINGLENUM )
-{
-aMoreItemText = SvxResId( RID_SVXSTR_MORENUMBERING );
 AddStatusListener( ".uno:CurrentNumListType" );
-}
 else
-{
-aMoreItemText = SvxResId( RID_SVXSTR_MORE );
 AddStatusListener( ".uno:CurrentOutlineType" );
-}
 
 auto xImage = 
vcl::CommandInfoProvider::GetXGraphicForCommand(".uno:OutlineBullet", 
mrController.getFrameInterface());
 mxMoreButton->set_image(xImage);


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

2023-03-30 Thread Mike Kaganski (via logerrit)
 include/svx/xoutbmp.hxx|3 -
 svx/source/xoutdev/_xoutbmp.cxx|   12 -
 sw/qa/extras/htmlexport/data/reqif-transparent-tif-img.odt |binary
 sw/qa/extras/htmlexport/htmlexport.cxx |   23 +
 sw/source/filter/html/htmlflywriter.cxx|   31 +++--
 5 files changed, 55 insertions(+), 14 deletions(-)

New commits:
commit 8e97ef854fb225dac37185c1911894b7d206fa8d
Author: Mike Kaganski 
AuthorDate: Thu Mar 30 09:24:26 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Mar 30 07:53:15 2023 +

sw reqif-xhtml export: fix export of transparent TIF

Since commit 22b50f1937de67e4ad9e692d6964aa5b8d33af7a (use libtiff for
tiff import, 2022-05-21), transparent TIFs are imported correctly.
As the result, reqif export started to output the transparent TIF
images as GIFs, because XOutFlags::UseGifIfSensible handles case of
transparency, and XOutFlags::UseNativeIfPossible didn't handle TIF.
Additionally, the resulting mediatype was reported incorrectly:

  

1. Handle TIFs in XOutBitmap::WriteGraphic when 
XOutFlags::UseNativeIfPossible
   is specified.
2. Return the corrected mediatype from XOutBitmap::WriteGraphic,
   to inform the caller about the possible change.
3. Remove the XOutFlags::UseGifIfSensible flag when doing the
   reqif export, to avoid the format change at all.

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

diff --git a/include/svx/xoutbmp.hxx b/include/svx/xoutbmp.hxx
index 43a666d06277..d2137f670c8a 100644
--- a/include/svx/xoutbmp.hxx
+++ b/include/svx/xoutbmp.hxx
@@ -59,7 +59,8 @@ public:
 static ErrCode  WriteGraphic( const Graphic& rGraphic, OUString& 
rFileName,
   const OUString& rFilterName, const 
XOutFlags nFlags,
   const Size* pMtfSize_100TH_MM = nullptr,
-  const css::uno::Sequence< 
css::beans::PropertyValue >* pFilterData = nullptr);
+  const css::uno::Sequence< 
css::beans::PropertyValue >* pFilterData = nullptr,
+  OUString* pMediaType = nullptr );
 static bool GraphicToBase64(const Graphic& rGraphic, OUString& rOUString,
 bool bAddPrefix = true,
 ConvertDataFormat aTargetFormat = 
ConvertDataFormat::Unknown);
diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx
index 7241fedfe043..d392426defb5 100644
--- a/svx/source/xoutdev/_xoutbmp.cxx
+++ b/svx/source/xoutdev/_xoutbmp.cxx
@@ -30,10 +30,13 @@
 #include 
 #include 
 
+#include 
+
 constexpr OUStringLiteral FORMAT_BMP = u"bmp";
 constexpr OUStringLiteral FORMAT_GIF = u"gif";
 constexpr OUStringLiteral FORMAT_JPG = u"jpg";
 constexpr OUStringLiteral FORMAT_PNG = u"png";
+constexpr OUStringLiteral FORMAT_TIF = u"tif";
 constexpr OUStringLiteral FORMAT_WEBP = u"webp";
 
 using namespace com::sun::star;
@@ -104,7 +107,8 @@ Graphic XOutBitmap::MirrorGraphic( const Graphic& rGraphic, 
const BmpMirrorFlags
 ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName,
  const OUString& rFilterName, const XOutFlags 
nFlags,
  const Size* pMtfSize_100TH_MM,
- const css::uno::Sequence< 
css::beans::PropertyValue >* pFilterData )
+ const css::uno::Sequence< 
css::beans::PropertyValue >* pFilterData,
+ OUString* pMediaType )
 {
 if( rGraphic.GetType() == GraphicType::NONE )
 return ERRCODE_NONE;
@@ -183,6 +187,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, 
OUString& rFileName,
 
 case GfxLinkType::NativeJpg: aExt = FORMAT_JPG; break;
 case GfxLinkType::NativePng: aExt = FORMAT_PNG; break;
+case GfxLinkType::NativeTif: aExt = FORMAT_TIF; break;
 case GfxLinkType::NativeWebp: aExt = FORMAT_WEBP; break;
 
 default:
@@ -197,6 +202,9 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, 
OUString& rFileName,
 if( !(nFlags & XOutFlags::DontAddExtension) )
 aURL.setExtension( aExt );
 rFileName = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE 
);
+if (pMediaType)
+if (auto xGraphic = 
rGraphic.GetXGraphic().query())
+xGraphic->getPropertyValue("MimeType") >>= *pMediaType;
 
 SfxMedium   
aMedium(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), 
StreamMode::WRITE | StreamMode::SHARE_DENYNONE | StreamMode::TRUNC);
 SvStream*   pOStm = aMedium.GetOutStream();

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

2023-03-17 Thread DrGigioSan (via logerrit)
 include/svx/tbcontrl.hxx |   29 ++
 svx/source/tbxctrls/tbcontrl.cxx |  168 +--
 2 files changed, 155 insertions(+), 42 deletions(-)

New commits:
commit dc6b93011cc5435f367666e43e354c6ab97bbc90
Author: DrGigioSan 
AuthorDate: Tue Mar 14 21:19:08 2023 +0100
Commit: Miklos Vajna 
CommitDate: Fri Mar 17 12:58:37 2023 +

store last five most recently used currencies in the currency toolbar 
drop-down

Refactory
 Cause
   Currency must be added in the MRU list in  
SvxCurrencyToolBoxControl::execute
   method.
   Unfortunately in this point the only information available is the number 
format.
   It is not possibile to infer currency from number format  (e.g: both  
USD and
   AUD use symbol $).
 Encapsulating currency data
   In order to solve the problem currency data is enacpsulated in a 
SvxCurrencyData
   struct. Added a vector of SvxCurrencyData to SvxCurrencyToolBoxControl.
 Static and non static call
   Former static SvxCurrencyToolBoxControl::GetCurrencySymbols has been
   preserved, as it is called by SvxNumberFormatShell.
   A new GetCurrencySymbols is used by the control.
   To avoid code duplication, both functions call a static private function
   inner_GetCurrencySymbols.
MRU Currencies
   MRU currencies are stored in another member vector m_mru_curencies:
   During currencies vector population (inner_GetCurrencySymbols) a space 
is reserved
   on top of vector for mru currencies.
   A new method addMruCurrency updates m_currencies. This method is called 
in
   SvxCurrencyToolBoxControl::execute

Change-Id: I6f86179efd1839e31b089e0086b6ddbdda358f31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148896
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx
index 72acf5845a4a..e40c06f3eb44 100644
--- a/include/svx/tbcontrl.hxx
+++ b/include/svx/tbcontrl.hxx
@@ -249,15 +249,44 @@ public:
 
 class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SvxCurrencyToolBoxControl final : 
public svt::PopupWindowController
 {
+public:
+// struct containing currency data
+struct SvxCurrencyData {
+sal_uInt16 m_currencyIdx;
+bool m_onlyIsoCode;
+OUString m_label;
+
+static const sal_uInt16 InvalidCurrency;
+
+SvxCurrencyData(
+sal_uInt16 currencyIdx = InvalidCurrency,
+bool onlyIsoCode = false
+);
+
+bool operator == (const SvxCurrencyData& other) const;
+};
+
+typedef std::vector SvxCurrencyVect_t;
+
 private:
 OUString m_aFormatString;
 LanguageType m_eLanguage;
 sal_uInt32   m_nFormatKey;
+SvxCurrencyVect_t  m_currencies;
+SvxCurrencyVect_t  m_mru_currencies;
+
+void addMruCurrency(sal_Int16 currencyPosition);
+
+// inner static method for backward compatibility
+static void inner_GetCurrencySymbols( bool bFlag, SvxCurrencyVect_t 
_mru_currencies,
+SvxCurrencyVect_t );
 
 public:
 static void GetCurrencySymbols( std::vector& rList, bool bFlag,
 std::vector& rCurrencyList );
 
+const SvxCurrencyVect_t& GetCurrencySymbols();
+
 explicit SvxCurrencyToolBoxControl( const 
css::uno::Reference& rContext );
 virtual ~SvxCurrencyToolBoxControl() override;
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 6303bbcd7d4c..b3a5229e6c10 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -110,6 +110,10 @@
 
 #define COMBO_WIDTH_IN_CHARS18
 
+#define MAX_MRU_CURRENCIES  5
+
+#define INVALID_CURRENCYsal_uInt16(-2)
+
 // namespaces
 using namespace ::editeng;
 using namespace ::com::sun::star;
@@ -3894,15 +3898,13 @@ namespace
 , m_rSelectedFormat(rSelectedFormat)
 , m_eSelectedLanguage(eSelectedLanguage)
 {
-std::vector< OUString > aList;
-std::vector< sal_uInt16 > aCurrencyList;
 const NfCurrencyTable& rCurrencyTable = 
SvNumberFormatter::GetTheCurrencyTable();
 sal_uInt16 nLen = rCurrencyTable.size();
 
 SvNumberFormatter aFormatter( m_xControl->getContext(), 
LANGUAGE_SYSTEM );
 m_eFormatLanguage = aFormatter.GetLanguage();
 
-SvxCurrencyToolBoxControl::GetCurrencySymbols( aList, true, 
aCurrencyList );
+const SvxCurrencyToolBoxControl::SvxCurrencyVect_t  = 
pControl->GetCurrencySymbols( );
 
 sal_uInt16 nPos = 0, nCount = 0;
 sal_Int32 nSelectedPos = -1;
@@ -3912,9 +3914,11 @@ namespace
 OUString sLongestString;
 
 m_xCurrencyLb->freeze();
-for( const auto& rItem : aList )
+for( const SvxCurrencyToolBoxControl::SvxCurrencyData& curr : 
rCurrencies )
 {
-

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

2023-03-10 Thread Noel Grandin (via logerrit)
 include/svx/unopool.hxx  |6 +++-
 include/svx/unoprov.hxx  |   13 ++---
 svx/source/unodraw/unopool.cxx   |   16 +--
 svx/source/unodraw/unoprov.cxx   |   47 +++
 sw/source/uibase/uno/unodefaults.cxx |2 -
 5 files changed, 43 insertions(+), 41 deletions(-)

New commits:
commit 13a9d32cd1d6f8f95efbea5f6a85d50159d3baaa
Author: Noel Grandin 
AuthorDate: Thu Mar 9 14:29:51 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Mar 10 08:31:15 2023 +

simplify initialisation of some pool defaults

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

diff --git a/include/svx/unopool.hxx b/include/svx/unopool.hxx
index 1647375209b1..1f9431f8755d 100644
--- a/include/svx/unopool.hxx
+++ b/include/svx/unopool.hxx
@@ -30,6 +30,10 @@
 class SdrModel;
 class SfxItemPool;
 
+enum class SvxUnoDrawPoolDefaults {
+Drawing, Writer
+};
+
 /** This class implements the service com.sun.star.drawing.Defaults.
 It works on the SfxItemPool from the given model and the global
 draw object item pool.
@@ -42,7 +46,7 @@ class SVX_DLLPUBLIC SvxUnoDrawPool :public 
::cppu::OWeakAggObject,
 public comphelper::PropertySetHelper
 {
 public:
-SvxUnoDrawPool(SdrModel* pModel, sal_Int32 nServiceId);
+SvxUnoDrawPool(SdrModel* pModel, SvxUnoDrawPoolDefaults nServiceId);
 
 /** deprecated */
 SvxUnoDrawPool(SdrModel* pModel);
diff --git a/include/svx/unoprov.hxx b/include/svx/unoprov.hxx
index 204b737edd97..fe03bb286dbc 100644
--- a/include/svx/unoprov.hxx
+++ b/include/svx/unoprov.hxx
@@ -95,19 +95,12 @@ public:
  * class SvxPropertySetInfoPool
  */
 
-const sal_Int32 SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS = 0;
-const sal_Int32 SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER = 1;
-const sal_Int32 SVXUNO_SERVICEID_LASTID = 1;
-
 namespace comphelper { class PropertySetInfo; }
 
-class SvxPropertySetInfoPool
+namespace SvxPropertySetInfoPool
 {
-public:
-UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) static 
rtl::Reference const & getOrCreate( sal_Int32 
nServiceId ) noexcept;
-
-private:
-static rtl::Reference 
mxInfos[SVXUNO_SERVICEID_LASTID+1];
+UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) 
rtl::Reference const & getDrawingDefaults() 
noexcept;
+UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) 
rtl::Reference const & getWriterDrawingDefaults() 
noexcept;
 };
 
 #endif
diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx
index 59c19c70262d..b6172876152a 100644
--- a/svx/source/unodraw/unopool.cxx
+++ b/svx/source/unodraw/unopool.cxx
@@ -39,15 +39,25 @@
 using namespace ::com::sun::star;
 using namespace ::cppu;
 
-SvxUnoDrawPool::SvxUnoDrawPool(SdrModel* pModel, sal_Int32 nServiceId)
-: PropertySetHelper( SvxPropertySetInfoPool::getOrCreate( nServiceId ) ), 
mpModel( pModel )
+static rtl::Reference const & 
getDefaults(SvxUnoDrawPoolDefaults nServiceId)
+{
+switch (nServiceId)
+{
+case SvxUnoDrawPoolDefaults::Drawing: return 
SvxPropertySetInfoPool::getDrawingDefaults();
+case SvxUnoDrawPoolDefaults::Writer: return 
SvxPropertySetInfoPool::getWriterDrawingDefaults();
+default: std::abort();
+}
+}
+
+SvxUnoDrawPool::SvxUnoDrawPool(SdrModel* pModel, SvxUnoDrawPoolDefaults 
nServiceId)
+: PropertySetHelper( getDefaults(nServiceId) ), mpModel( pModel )
 {
 init();
 }
 
 /* deprecated */
 SvxUnoDrawPool::SvxUnoDrawPool(SdrModel* pModel)
-: PropertySetHelper( SvxPropertySetInfoPool::getOrCreate( 
SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS ) ), mpModel( pModel )
+: PropertySetHelper( SvxPropertySetInfoPool::getDrawingDefaults() ), mpModel( 
pModel )
 {
 init();
 }
diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx
index 139e9d3ac48e..aeb16d9800d9 100644
--- a/svx/source/unodraw/unoprov.cxx
+++ b/svx/source/unodraw/unoprov.cxx
@@ -2045,36 +2045,31 @@ OUString SvxUnogetInternalNameForItem(const sal_uInt16 
nWhich, const OUString& r
 }
 
 
-rtl::Reference const & 
SvxPropertySetInfoPool::getOrCreate( sal_Int32 nServiceId ) noexcept
+rtl::Reference const & 
SvxPropertySetInfoPool::getDrawingDefaults() noexcept
 {
-SolarMutexGuard aGuard;
-
-assert( nServiceId <= SVXUNO_SERVICEID_LASTID );
-
-if( !mxInfos[ nServiceId ].is() )
+static rtl::Reference xDrawingDefaults = []()
 {
-mxInfos[nServiceId] = new comphelper::PropertySetInfo();
-
-switch( nServiceId )
-{
-case SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS:
-mxInfos[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS]->add( 
ImplGetSvxDrawingDefaultsPropertyMap() );
-break;
-case SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER:
-
mxInfos[SVXUNO_SERVICEID_COM_SUN_STAR_DRAWING_DEFAULTS_WRITER]->add( 
ImplGetSvxDrawingDefaultsPropertyMap() 

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

2023-03-06 Thread Caolán McNamara (via logerrit)
 include/svx/AccessibilityCheckDialog.hxx   |1 +
 svx/source/dialog/AccessibilityCheckDialog.cxx |   12 +++-
 svx/uiconfig/ui/accessibilitycheckdialog.ui|4 +++-
 svx/uiconfig/ui/accessibilitycheckentry.ui |   16 +---
 4 files changed, 24 insertions(+), 9 deletions(-)

New commits:
commit 4a88c5840e022ca896ce26ce1dfde2db7fb7df29
Author: Caolán McNamara 
AuthorDate: Thu Mar 2 17:15:06 2023 +0100
Commit: Caolán McNamara 
CommitDate: Mon Mar 6 16:54:48 2023 +

tdf#148776 for scrolling set step size as height of a row

similar to FontFeaturesDialog.

FWIW gtk's viewport implementation automatically overwrites the step
size to be 10% of the visible height (and page size of 90% of the
visible height)

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

diff --git a/include/svx/AccessibilityCheckDialog.hxx 
b/include/svx/AccessibilityCheckDialog.hxx
index f2e3c567351b..65b100064f87 100644
--- a/include/svx/AccessibilityCheckDialog.hxx
+++ b/include/svx/AccessibilityCheckDialog.hxx
@@ -45,6 +45,7 @@ private:
 std::vector> 
m_aAccessibilityCheckEntries;
 
 // Controls
+std::unique_ptr m_xScrolledWindow;
 std::unique_ptr m_xAccessibilityCheckBox;
 std::unique_ptr m_xRescanBtn;
 
diff --git a/svx/source/dialog/AccessibilityCheckDialog.cxx 
b/svx/source/dialog/AccessibilityCheckDialog.cxx
index ac34f7306da4..010f3af0bb81 100644
--- a/svx/source/dialog/AccessibilityCheckDialog.cxx
+++ b/svx/source/dialog/AccessibilityCheckDialog.cxx
@@ -25,9 +25,10 @@ AccessibilityCheckEntry::AccessibilityCheckEntry(
 , m_pAccessibilityIssue(rAccessibilityIssue)
 {
 m_xLabel->set_label(m_pAccessibilityIssue->m_aIssueText);
+// lock in the height as including the button so all rows are the same 
height
+m_xContainer->set_size_request(-1, 
m_xContainer->get_preferred_size().Height());
 m_xGotoButton->set_visible(m_pAccessibilityIssue->canGotoIssue());
 m_xGotoButton->connect_clicked(LINK(this, AccessibilityCheckEntry, 
GotoButtonClicked));
-m_xContainer->show();
 }
 
 IMPL_LINK_NOARG(AccessibilityCheckEntry, GotoButtonClicked, weld::Button&, 
void)
@@ -42,6 +43,7 @@ AccessibilityCheckDialog::AccessibilityCheckDialog(
   "AccessibilityCheckDialog")
 , m_aIssueCollection(std::move(aIssueCollection))
 , m_getIssueCollection(getIssueCollection)
+, m_xScrolledWindow(m_xBuilder->weld_scrolled_window("scrolledwindow"))
 , m_xAccessibilityCheckBox(m_xBuilder->weld_box("accessibilityCheckBox"))
 , m_xRescanBtn(m_xBuilder->weld_button("rescan"))
 {
@@ -62,6 +64,14 @@ void AccessibilityCheckDialog::populateIssues()
 m_xAccessibilityCheckBox->reorder_child(xEntry->get_widget(), i++);
 m_aAccessibilityCheckEntries.push_back(std::move(xEntry));
 }
+
+if (!m_aAccessibilityCheckEntries.empty())
+{
+auto nRowHeight
+= 
m_aAccessibilityCheckEntries.back()->get_widget()->get_preferred_size().Height();
+// 6 is the spacing set in the .ui
+m_xScrolledWindow->vadjustment_set_step_increment(nRowHeight + 6);
+}
 }
 
 IMPL_LINK_NOARG(AccessibilityCheckDialog, RescanButtonClicked, weld::Button&, 
void)
diff --git a/svx/uiconfig/ui/accessibilitycheckdialog.ui 
b/svx/uiconfig/ui/accessibilitycheckdialog.ui
index fecab2fbb31f..b19a1e35e738 100644
--- a/svx/uiconfig/ui/accessibilitycheckdialog.ui
+++ b/svx/uiconfig/ui/accessibilitycheckdialog.ui
@@ -97,7 +97,7 @@
 True
 vertical
 
-  
+  
 True
 True
 True
@@ -114,6 +114,8 @@
 True
 False
 vertical
+6
+True
 
   
 
diff --git a/svx/uiconfig/ui/accessibilitycheckentry.ui 
b/svx/uiconfig/ui/accessibilitycheckentry.ui
index 0fe33322b11f..3d60179f16b5 100644
--- a/svx/uiconfig/ui/accessibilitycheckentry.ui
+++ b/svx/uiconfig/ui/accessibilitycheckentry.ui
@@ -1,20 +1,22 @@
 
-
+
 
   
   
 True
-False
-3
+False
+3
+3
+6
 
   
 True
-False
+False
 True
 True
 0
 
-  
+  
 static
   
 
@@ -29,8 +31,8 @@
   
 Go to 
Issue
 True
-True
-True
+True
+True
   
   
 False


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

2023-03-04 Thread Tomaž Vajngerl (via logerrit)
 include/svx/svdobj.hxx  |2 +-
 include/svx/svdopage.hxx|2 ++
 svx/source/svdraw/svdobj.cxx|   38 --
 svx/source/svdraw/svdopage.cxx  |5 +
 sw/source/core/draw/dflyobj.cxx |5 +
 sw/source/core/inc/dflyobj.hxx  |3 +++
 6 files changed, 16 insertions(+), 39 deletions(-)

New commits:
commit b33468fa2b5da7ce27afd40979aafff61285
Author: Tomaž Vajngerl 
AuthorDate: Sat Feb 11 22:02:11 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Mar 5 05:27:04 2023 +

make NbcRotate abstract as it's implementation is noop

During testing the NbcRotate function on SdrObject it turned out
the the function is essentially a noop, because it uses normal
equality to test the values of a double, which are a product of
sin and cos functions (to determine the 90 degree angles). So
because of this the input rectangle was never modified - noop.

Because of this we can just remove the impl. of the function and
declare it abstract, so that the actual implementations define
a valid function to rotate.

There were some subclasses that didn't override the NbcRotate so
they used the one implementation in SdrObject. These subclasses
now override the function and in the implementation we call
assert(false), which is never called during a test run. It seems
we never rotate those objects.

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

diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 52923dc5b92e..ab5066d699a2 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -542,7 +542,7 @@ public:
 virtual void NbcMove  (const Size& rSiz);
 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const 
Fraction& yFact);
 virtual void NbcCrop  (const basegfx::B2DPoint& rRef, double fxFact, 
double fyFact);
-virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, 
double cs);
+virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, 
double cs) = 0;
 // Utility for call sites that don't have sin and cos handy
 void NbcRotate(const Point& rRef, Degree100 nAngle);
 virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
diff --git a/include/svx/svdopage.hxx b/include/svx/svdopage.hxx
index abb35d8239cd..279c75c758a6 100644
--- a/include/svx/svdopage.hxx
+++ b/include/svx/svdopage.hxx
@@ -64,6 +64,8 @@ public:
 
 virtual OUString TakeObjNameSingul() const override;
 virtual OUString TakeObjNamePlural() const override;
+
+void NbcRotate(const Point& rRef, Degree100 nAngle, double sinAngle, 
double cosAngle) override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index af9cac05631c..c4628f4cd2f2 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1441,33 +1441,6 @@ void SdrObject::NbcRotate(const Point& rRef, Degree100 
nAngle)
 
 namespace
 {
-
-tools::Rectangle lclRotateRectangle(tools::Rectangle const& rRectangle, Point 
const& rRef, double sn, double cs)
-{
-tools::Rectangle aRectangle(rRectangle);
-aRectangle.Move(-rRef.X(),-rRef.Y());
-tools::Rectangle R(aRectangle);
-if (sn==1.0 && cs==0.0) { // 90deg
-aRectangle.SetLeft(-R.Bottom() );
-aRectangle.SetRight(-R.Top() );
-aRectangle.SetTop(R.Left() );
-aRectangle.SetBottom(R.Right() );
-} else if (sn==0.0 && cs==-1.0) { // 180deg
-aRectangle.SetLeft(-R.Right() );
-aRectangle.SetRight(-R.Left() );
-aRectangle.SetTop(-R.Bottom() );
-aRectangle.SetBottom(-R.Top() );
-} else if (sn==-1.0 && cs==0.0) { // 270deg
-aRectangle.SetLeft(R.Top() );
-aRectangle.SetRight(R.Bottom() );
-aRectangle.SetTop(-R.Right() );
-aRectangle.SetBottom(-R.Left() );
-}
-aRectangle.Move(rRef.X(),rRef.Y());
-aRectangle.Normalize(); // just in case
-return aRectangle;
-}
-
 tools::Rectangle lclMirrorRectangle(tools::Rectangle const& rRectangle, Point 
const& rRef1, Point const& rRef2)
 {
 tools::Rectangle aRectangle(rRectangle);
@@ -1499,17 +1472,6 @@ tools::Rectangle lclMirrorRectangle(tools::Rectangle 
const& rRectangle, Point co
 
 } // end anonymous namespace
 
-void SdrObject::NbcRotate(const Point& rRef,  Degree100 nAngle, double sn, 
double cs)
-{
-SetGlueReallyAbsolute(true);
-tools::Rectangle aRectangle = getOutRectangle();
-aRectangle = lclRotateRectangle(aRectangle, rRef, sn, cs);
-setOutRectangle(aRectangle);
-SetBoundAndSnapRectsDirty();
-NbcRotateGluePoints(rRef, nAngle, sn, cs);
-SetGlueReallyAbsolute(false);
-}
-
 void SdrObject::NbcMirror(const Point& rRef1, const Point& rRef2)
 {
 SetGlueReallyAbsolute(true);
diff 

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

2023-03-04 Thread Tomaž Vajngerl (via logerrit)
 include/svx/svdobj.hxx  |2 +-
 svx/source/svdraw/svdobj.cxx|7 +--
 sw/source/core/draw/dflyobj.cxx |   11 +++
 sw/source/core/inc/dflyobj.hxx  |5 -
 4 files changed, 17 insertions(+), 8 deletions(-)

New commits:
commit b53b01a050bbb43cd571c428e86fc23a2fa5773c
Author: Tomaž Vajngerl 
AuthorDate: Sat Feb 11 17:08:54 2023 +0900
Commit: Tomaž Vajngerl 
CommitDate: Sun Mar 5 01:41:21 2023 +

svx: make SdrObject abstract by making CloneSdrObject pure virtual

This change makes SdrObject an abstract class that can't be as
we don't want it to be instantiated. With this the ClonseSdrObject
became a pure virtual function.

With this change also the SwFlyDrawObj needs a implementation of
the CloneSdrFunction, which was previously provided by SdrObject.

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

diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 08ef71a168a8..52923dc5b92e 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -442,7 +442,7 @@ public:
 virtual bool HasLimitedRotation() const;
 
 // Returns a copy of the object. Every inherited class must reimplement 
this.
-virtual rtl::Reference CloneSdrObject(SdrModel& rTargetModel) 
const;
+virtual rtl::Reference CloneSdrObject(SdrModel& rTargetModel) 
const = 0;
 // helper, since Clone always return the type of the current subclass
 template
 static rtl::Reference Clone(T const & rObj, SdrModel& rTargetModel)
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index e733c2d83871..af9cac05631c 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1048,11 +1048,6 @@ bool SdrObject::HasLimitedRotation() const
 return false;
 }
 
-rtl::Reference SdrObject::CloneSdrObject(SdrModel& rTargetModel) 
const
-{
-return new SdrObject(rTargetModel, *this);
-}
-
 OUString SdrObject::TakeObjNameSingul() const
 {
 OUString sName(SvxResId(STR_ObjNameSingulNONE));
@@ -3329,7 +3324,7 @@ rtl::Reference SdrObjFactory::MakeNewObject(
 }
 }
 break;
-case SdrObjKind::NONE   : pObj=new SdrObject(rSdrModel);   
break;
+case SdrObjKind::NONE   : pObj = nullptr; break;
 case SdrObjKind::Group   : pObj=new SdrObjGroup(rSdrModel);
 break;
 case SdrObjKind::Polygon   : pObj=new SdrPathObj(rSdrModel, 
SdrObjKind::Polygon   ); break;
 case SdrObjKind::PolyLine   : pObj=new SdrPathObj(rSdrModel, 
SdrObjKind::PolyLine   ); break;
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 3095d5a2a6f4..45068cf1fd89 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -130,6 +130,12 @@ SwFlyDrawObj::SwFlyDrawObj(SdrModel& rSdrModel)
 {
 }
 
+SwFlyDrawObj::SwFlyDrawObj(SdrModel& rSdrModel, SwFlyDrawObj const& rSource)
+: SdrObject(rSdrModel, rSource)
+, mbIsTextBox(false)
+{
+}
+
 SwFlyDrawObj::~SwFlyDrawObj()
 {
 }
@@ -145,6 +151,11 @@ SdrObjKind SwFlyDrawObj::GetObjIdentifier() const
 return SdrObjKind::SwFlyDrawObjIdentifier;
 }
 
+rtl::Reference SwFlyDrawObj::CloneSdrObject(SdrModel& rTargetModel) 
const
+{
+return new SwFlyDrawObj(rTargetModel);
+}
+
 // TODO: Need own primitive to get the FlyFrame paint working
 namespace drawinglayer::primitive2d
 {
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index db853d2262b2..7e62bdaddefa 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -44,8 +44,11 @@ private:
 
 public:
 SwFlyDrawObj(SdrModel& rSdrModel);
+SwFlyDrawObj(SdrModel& rSdrModel, SwFlyDrawObj const& rSource);
+
+// for instantiation of this class while loading (via factory
+virtual rtl::Reference CloneSdrObject(SdrModel& rTargetModel) 
const override;
 
-// for instantiation of this class while loading (via factory)
 virtual SdrInventor GetObjInventor() const override;
 virtual SdrObjKind GetObjIdentifier()   const override;
 virtual bool IsTextBox() const override { return mbIsTextBox; }


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

2023-02-21 Thread Caolán McNamara (via logerrit)
 include/svx/fillctrl.hxx |1 +
 svx/source/tbxctrls/fillctrl.cxx |9 +
 2 files changed, 10 insertions(+)

New commits:
commit b05104facac18f40f34043be304f616530fc3a22
Author: Caolán McNamara 
AuthorDate: Tue Feb 21 16:34:07 2023 +
Commit: Caolán McNamara 
CommitDate: Tue Feb 21 19:56:41 2023 +

Resolves: tdf#148047 don't move focus if dropdown is active

a bit of a corner case, for the popover gtk sets the focus in two
steps, one to null, then to the final widget, not in just one step.
On seeing the interim null case we assume that focus was lost and
set it to the parent, which causes the popover to be dismissed
while it's still appearing. Workaround this by ignoring the grab
to parent while the popover is active.

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

diff --git a/include/svx/fillctrl.hxx b/include/svx/fillctrl.hxx
index 978f63e359e8..1a781713dbaa 100644
--- a/include/svx/fillctrl.hxx
+++ b/include/svx/fillctrl.hxx
@@ -95,6 +95,7 @@ private:
 void SetOptimalSize();
 
 virtual void DataChanged(const DataChangedEvent& rDCEvt) override;
+virtual void GetFocus() override;
 
 static void ReleaseFocus_Impl();
 
diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx
index cfb7583be12c..ced69cbdf2c7 100644
--- a/svx/source/tbxctrls/fillctrl.cxx
+++ b/svx/source/tbxctrls/fillctrl.cxx
@@ -1084,4 +1084,13 @@ void FillControl::DataChanged(const DataChangedEvent& 
rDCEvt)
 InterimItemWindow::DataChanged(rDCEvt);
 }
 
+void FillControl::GetFocus()
+{
+// tdf#148047 if the dropdown is active then leave the focus
+// there and don't grab back to a different widget
+if (mxToolBoxColor->get_menu_item_active(".uno:FillColor"))
+return;
+InterimItemWindow::GetFocus();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2023-02-15 Thread Julien Nabet (via logerrit)
 include/svx/strings.hrc  |1 +
 svx/source/dialog/SafeModeDialog.cxx |2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit a16c64ad808c3ef79fb9b8954c4f33e9e0ff855a
Author: Julien Nabet 
AuthorDate: Sun Feb 12 09:28:47 2023 +0100
Commit: Julien Nabet 
CommitDate: Wed Feb 15 10:28:01 2023 +

tdf#153559: Untranslatable string in safemodedialog.cxx

Change-Id: I35bccb70bef74b6438c2744f693aff6d1842e894
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146830
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index 76153cc0722d..c54d99529ee3 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1395,6 +1395,7 @@
 #define RID_SVXSTR_OUTLINENUM_DESCRIPTION_7 
NC_("RID_SVXSTR_OUTLINENUM_DESCRIPTION_7", "Right pointing bullet, right 
pointing arrow bullet, solid diamond bullet, solid small circular bullet")
 
 #define RID_SVXSTR_SAFEMODE_ZIP_FAILURE 
NC_("RID_SVXSTR_SAFEMODE_ZIP_FAILURE", "The zip file could not be created.")
+#define RID_SVXSTR_SAFEMODE_USER_PROFILE_EXPORTED   
NC_("RID_SVXSTR_SAFEMODE_USER_PROFILE_EXPORTED", "Your user profile has been 
exported as 'libreoffice-profile.zip'.")
 
 #define RID_SVXSTR_STYLEFAMILY_TABLEDESIGN  
NC_("RID_SVXSTR_STYLEFAMILY_TABLEDESIGN", "Table Design Styles")
 
diff --git a/svx/source/dialog/SafeModeDialog.cxx 
b/svx/source/dialog/SafeModeDialog.cxx
index 9da7fddfd25b..b499ae3d5911 100644
--- a/svx/source/dialog/SafeModeDialog.cxx
+++ b/svx/source/dialog/SafeModeDialog.cxx
@@ -283,7 +283,7 @@ IMPL_LINK(SafeModeDialog, CreateZipBtnHdl, weld::Button&, 
/*rBtn*/, void)
 return;
 }
 
-FileExportedDialog aDialog(m_xDialog.get(),"Your user profile has been 
exported as 'libreoffice-profile.zip'.");
+FileExportedDialog aDialog(m_xDialog.get(), 
SvxResId(RID_SVXSTR_SAFEMODE_USER_PROFILE_EXPORTED));
 aDialog.run();
 }
 


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

2023-02-14 Thread Noel Grandin (via logerrit)
 include/svx/shapepropertynotifier.hxx|   14 -
 include/svx/svdobj.hxx   |   14 ++---
 include/svx/unoshape.hxx |5 ++-
 svx/source/svdraw/svdobj.cxx |   16 --
 svx/source/unodraw/shapepropertynotifier.cxx |   25 
 svx/source/unodraw/unoshape.cxx  |   40 +++
 sw/source/core/unocore/unodraw.cxx   |2 -
 7 files changed, 56 insertions(+), 60 deletions(-)

New commits:
commit 95f69903640f8b6d3c0c5798b74339d0ae62bd05
Author: Noel Grandin 
AuthorDate: Tue Feb 14 19:05:18 2023 +0200
Commit: Noel Grandin 
CommitDate: Wed Feb 15 07:25:55 2023 +

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

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

diff --git a/include/svx/shapepropertynotifier.hxx 
b/include/svx/shapepropertynotifier.hxx
index bcc6c357f05a..c34f536408f2 100644
--- a/include/svx/shapepropertynotifier.hxx
+++ b/include/svx/shapepropertynotifier.hxx
@@ -21,7 +21,7 @@
 #define INCLUDED_SVX_SHAPEPROPERTYNOTIFIER_HXX
 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -102,12 +102,12 @@ namespace svx
 the owner instance of the notifier. Will be used as 
css.lang.EventObject.Source when
 notifying events.
 */
-PropertyChangeNotifier( ::cppu::OWeakObject& _rOwner, ::osl::Mutex& 
_rMutex );
+PropertyChangeNotifier( ::cppu::OWeakObject& _rOwner );
 ~PropertyChangeNotifier();
 
 // listener maintenance
-void addPropertyChangeListener( const OUString& _rPropertyName, const 
css::uno::Reference< css::beans::XPropertyChangeListener >& _rxListener );
-void removePropertyChangeListener( const OUString& _rPropertyName, 
const css::uno::Reference< css::beans::XPropertyChangeListener >& _rxListener );
+void addPropertyChangeListener( std::unique_lock& rGuard, 
const OUString& _rPropertyName, const css::uno::Reference< 
css::beans::XPropertyChangeListener >& _rxListener );
+void removePropertyChangeListener( std::unique_lock& 
rGuard, const OUString& _rPropertyName, const css::uno::Reference< 
css::beans::XPropertyChangeListener >& _rxListener );
 
 /** registers an PropertyValueProvider
 */
@@ -118,11 +118,11 @@ namespace svx
 If no property value provider for the given property ID is 
registered, this is worth an assertion in a
 non-product build, and otherwise ignored.
 */
-voidnotifyPropertyChange( const ShapePropertyProviderId _eProperty 
) const;
+voidnotifyPropertyChange( std::unique_lock& rGuard, 
const ShapePropertyProviderId _eProperty ) const;
 
 /** is called to dispose the instance
 */
-voiddisposing();
+voiddisposing(std::unique_lock& rGuard);
 
 private:
 PropertyChangeNotifier(const PropertyChangeNotifier&) = delete;
@@ -130,7 +130,7 @@ namespace svx
 
 ::cppu::OWeakObject&m_rContext;
 o3tl::enumarray>  m_aProviders;
-
comphelper::OMultiTypeInterfaceContainerHelperVar3 m_aPropertyChangeListeners;
+comphelper::OMultiTypeInterfaceContainerHelperVar4 m_aPropertyChangeListeners;
 };
 
 
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 6b779775bc3d..08ef71a168a8 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -79,7 +79,7 @@ enum class PointerStyle;
 class Graphic;
 class SvxShape;
 namespace svx { enum class ShapePropertyProviderId; }
-
+namespace svx { class PropertyValueProvider; }
 namespace basegfx
 {
 class B2DPoint;
@@ -91,7 +91,6 @@ namespace sdr { class ObjectUser; }
 namespace sdr::properties { class BaseProperties; }
 namespace sdr::contact { class ViewContact; }
 
-namespace svx { class PropertyChangeNotifier; }
 namespace com::sun::star::drawing { class XShape; }
 namespace svx::diagram { class IDiagramHelper; }
 
@@ -782,15 +781,6 @@ public:
 
 static SdrObject* getSdrObjectFromXShape( const css::uno::Reference< 
css::uno::XInterface >& xInt );
 
-// retrieves the instance responsible for notifying changes in the 
properties of the shape associated with
-// the SdrObject
-//
-// @precond
-// There already exists an SvxShape instance associated with the 
SdrObject
-// @throws css::uno::RuntimeException
-// if there does nt yet exists an SvxShape instance associated with 
the SdrObject.
-svx::PropertyChangeNotifier& getShapePropertyChangeNotifier();
-
 // notifies a change in the given property, to all applicable listeners 
registered at the associated SvxShape
 //
 // This method is equivalent to calling 
getShapePropertyChangeNotifier().notifyPropertyChange( _eProperty ),
@@ -798,6 +788,8 @@ public:
 // case the method will silently return 

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

2023-01-30 Thread Noel Grandin (via logerrit)
 include/svx/sdr/primitive2d/sdrframeborderprimitive2d.hxx |6 +-
 svx/source/dialog/framelinkarray.cxx  |   25 -
 svx/source/sdr/primitive2d/sdrframeborderprimitive2d.cxx  |   14 ++---
 sw/source/core/layout/paintfrm.cxx|   38 ++
 4 files changed, 39 insertions(+), 44 deletions(-)

New commits:
commit e2c811e6f9c0b2de47153a70a783f4d808eab3ab
Author: Noel Grandin 
AuthorDate: Mon Jan 30 10:11:09 2023 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 30 10:00:33 2023 +

tdf#150534 reduce allocation in SdrFrameBorderPrimitive2D

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

diff --git a/include/svx/sdr/primitive2d/sdrframeborderprimitive2d.hxx 
b/include/svx/sdr/primitive2d/sdrframeborderprimitive2d.hxx
index 40638aa9d05b..93ebdcfde7f2 100644
--- a/include/svx/sdr/primitive2d/sdrframeborderprimitive2d.hxx
+++ b/include/svx/sdr/primitive2d/sdrframeborderprimitive2d.hxx
@@ -90,7 +90,7 @@ namespace drawinglayer::primitive2d
 class SVXCORE_DLLPUBLIC SdrFrameBorderPrimitive2D final : public 
BufferedDecompositionPrimitive2D
 {
 private:
-std::shared_ptr   maFrameBorders;
+SdrFrameBorderDataVectormaFrameBorders;
 double  
mfMinimalNonZeroBorderWidth;
 double  
mfMinimalNonZeroBorderWidthUsedForDecompose;
 bool
mbForceToSingleDiscreteUnit;
@@ -102,7 +102,7 @@ namespace drawinglayer::primitive2d
 
 public:
 SdrFrameBorderPrimitive2D(
-std::shared_ptr& rFrameBorders,
+SdrFrameBorderDataVector&& rFrameBorders,
 bool bForceToSingleDiscreteUnit);
 
 // compare operator
@@ -114,7 +114,7 @@ namespace drawinglayer::primitive2d
 const geometry::ViewInformation2D& rViewInformation) const 
override;
 
 // data access
-const std::shared_ptr& getFrameBorders() 
const { return maFrameBorders; }
+const SdrFrameBorderDataVector& getFrameBorders() const { return 
maFrameBorders; }
 bool doForceToSingleDiscreteUnit() const { return 
mbForceToSingleDiscreteUnit; }
 
 // provide unique ID
diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index a14279f329f1..322e2225d5e6 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -1275,8 +1275,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
Array::CreateB2DPrimitiveRange(
 const sal_Int32 nEndCol(nLastCol < GetColCount() - 1 ? nLastCol + 1 : 
nLastCol);
 
 // prepare SdrFrameBorderDataVector
-std::shared_ptr aData(
-
std::make_shared());
+drawinglayer::primitive2d::SdrFrameBorderDataVector aData;
 
 // remember for which merged cells crossed lines were already created. To
 // do so, hold the sal_Int32 cell index in a set for fast check
@@ -1328,7 +1327,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
Array::CreateB2DPrimitiveRange(
 
 if(rTop.IsUsed())
 {
-HelperCreateHorizontalEntry(*this, rTop, nCol, nRow, 
aOrigin, aX, aY, *aData, true, pForceColor);
+HelperCreateHorizontalEntry(*this, rTop, nCol, nRow, 
aOrigin, aX, aY, aData, true, pForceColor);
 }
 }
 
@@ -1340,7 +1339,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
Array::CreateB2DPrimitiveRange(
 
 if(rBottom.IsUsed())
 {
-HelperCreateHorizontalEntry(*this, rBottom, nCol, nRow 
+ 1, aOrigin, aX, aY, *aData, false, pForceColor);
+HelperCreateHorizontalEntry(*this, rBottom, nCol, nRow 
+ 1, aOrigin, aX, aY, aData, false, pForceColor);
 }
 }
 
@@ -1353,7 +1352,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
Array::CreateB2DPrimitiveRange(
 
 if(rLeft.IsUsed())
 {
-HelperCreateVerticalEntry(*this, rLeft, nCol, nRow, 
aOrigin, aX, aY, *aData, true, pForceColor);
+HelperCreateVerticalEntry(*this, rLeft, nCol, nRow, 
aOrigin, aX, aY, aData, true, pForceColor);
 }
 }
 
@@ -1365,7 +1364,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
Array::CreateB2DPrimitiveRange(
 
 if(rRight.IsUsed())
 {
-HelperCreateVerticalEntry(*this, rRight, nCol + 1, 
nRow, aOrigin, aX, aY, *aData, false, pForceColor);
+HelperCreateVerticalEntry(*this, rRight, nCol + 1, 
nRow, aOrigin, aX, aY, aData, 

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

2023-01-11 Thread Justin Luth (via logerrit)
 include/svx/nbdtmg.hxx|8 
 svx/source/sidebar/nbdtmg.cxx |8 
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 613baf1573757f8af594eda2460076b4eaad7c64
Author: Justin Luth 
AuthorDate: Sat Jan 7 07:24:30 2023 -0500
Commit: Justin Luth 
CommitDate: Wed Jan 11 23:57:01 2023 +

svx typo: RelplaceNumRule -> ReplaceNumRule

Change-Id: Ic11fcf35a7b1a6fb15a4046300639622095ed823
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145241
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/include/svx/nbdtmg.hxx b/include/svx/nbdtmg.hxx
index 5bbb310a9d74..81ef80223496 100644
--- a/include/svx/nbdtmg.hxx
+++ b/include/svx/nbdtmg.hxx
@@ -128,7 +128,7 @@ class SVX_DLLPUBLIC NBOTypeMgrBase
 virtual ~NBOTypeMgrBase() {}
 virtual void Init()=0;
 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 
mLevel,sal_uInt16 nFromIndex=0) = 0;
-virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) = 0;
+virtual void ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) = 0;
 virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) = 0;
 virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault)=0;
 virtual bool IsCustomized(sal_uInt16 nIndex)=0;
@@ -160,7 +160,7 @@ class BulletsTypeMgr final : public NBOTypeMgrBase
 BulletsTypeMgr();
 virtual void Init() override;
 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 
mLevel,sal_uInt16 nFromIndex=0) override;
-virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
+virtual void ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
 virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override;
 virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) 
override;
 virtual bool IsCustomized(sal_uInt16 nIndex) override;
@@ -176,7 +176,7 @@ class NumberingTypeMgr final : public NBOTypeMgrBase
 virtual ~NumberingTypeMgr() override;
 virtual void Init() override;
 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 
mLevel,sal_uInt16 nFromIndex=0) override;
-virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
+virtual void ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
 virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override;
 virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) 
override;
 virtual bool IsCustomized(sal_uInt16 nIndex) override;
@@ -193,7 +193,7 @@ class OutlineTypeMgr final : public NBOTypeMgrBase
 OutlineTypeMgr();
 virtual void Init() override;
 virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 
mLevel,sal_uInt16 nFromIndex=0) override;
-virtual void RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
+virtual void ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel) override;
 virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override;
 virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) 
override;
 virtual bool IsCustomized(sal_uInt16 nIndex) override;
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 3643976d2866..2519ece7e60c 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -206,7 +206,7 @@ void NBOTypeMgrBase::ImplLoad(std::u16string_view filename)
 aNum.SetLevel(i, aFmt);
 }
 }
-RelplaceNumRule(aNum,nNumIndex,0x1/*nLevel*/);
+ReplaceNumRule(aNum,nNumIndex,0x1/*nLevel*/);
 xIStm->ReadInt32( nNumIndex );
 }
 }
@@ -298,7 +298,7 @@ sal_uInt16 
BulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLe
 return sal_uInt16(0x);
 }
 
-void BulletsTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel)
+void BulletsTypeMgr::ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel)
 {
 if ( mLevel == sal_uInt16(0x) || mLevel == 0)
 return;
@@ -468,7 +468,7 @@ sal_uInt16 
NumberingTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 m
 return sal_uInt16(0x);
 }
 
-void NumberingTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, 
sal_uInt16 mLevel)
+void 

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

2023-01-04 Thread Tomaž Vajngerl (via logerrit)
 include/svx/ColorSets.hxx   |2 ++
 svx/source/styles/ColorSets.cxx |5 +
 sw/source/uibase/sidebar/ThemePanel.cxx |   15 +++
 3 files changed, 22 insertions(+)

New commits:
commit 7c10e3b120ba75a2db75342fdc68040a179404b8
Author: Tomaž Vajngerl 
AuthorDate: Mon Dec 12 22:26:41 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Thu Jan 5 05:55:51 2023 +

sw: add the ColorSet from SdrPage into ColorSets in ThemePanel

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

diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index 718b79b3e66c..3d345b20c1b3 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -99,6 +99,8 @@ public:
 }
 
 const ColorSet& getColorSet(std::u16string_view rName);
+
+void insert(ColorSet const& rColorSet);
 };
 
 struct SVXCORE_DLLPUBLIC ThemeSupplementalFont
diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx
index bb8009fdc5be..5511253f3d03 100644
--- a/svx/source/styles/ColorSets.cxx
+++ b/svx/source/styles/ColorSets.cxx
@@ -238,6 +238,11 @@ const ColorSet& ColorSets::getColorSet(std::u16string_view 
rName)
 return maColorSets[0];
 }
 
+void ColorSets::insert(ColorSet const& rColorSet)
+{
+maColorSets.push_back(rColorSet);
+}
+
 Theme::Theme(OUString const& rName)
 : maName(rName)
 {
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx 
b/sw/source/uibase/sidebar/ThemePanel.cxx
index 14a58b236d91..ad0d74e2b678 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -30,6 +30,11 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+
 
 namespace
 {
@@ -442,6 +447,16 @@ ThemePanel::ThemePanel(weld::Widget* pParent)
 
 maColorSets.init();
 
+SwDocShell* pDocSh = static_cast(SfxObjectShell::Current());
+SwDoc* pDocument = pDocSh->GetDoc();
+if (pDocument)
+{
+SdrPage* pPage = 
pDocument->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+svx::Theme* pTheme = pPage->getSdrPageProperties().GetTheme();
+if (pTheme)
+maColorSets.insert(*pTheme->GetColorSet());
+}
+
 const std::vector& aColorSets = maColorSets.getColorSets();
 for (size_t i = 0; i < aColorSets.size(); ++i)
 {


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

2022-12-01 Thread Michael Stahl (via logerrit)
 include/svx/svdotable.hxx  |7 ---
 svx/source/table/viewcontactoftableobj.cxx |   59 +++--
 svx/source/table/viewcontactoftableobj.hxx |1 
 3 files changed, 58 insertions(+), 9 deletions(-)

New commits:
commit 4bfa3edaeea444d46f9470d415667fb8df54c32d
Author: Michael Stahl 
AuthorDate: Thu Dec 1 13:35:32 2022 +0100
Commit: Michael Stahl 
CommitDate: Thu Dec 1 17:02:00 2022 +0100

tdf#135192 svx: PDF/UA export: table tag primitives only if necessary

Introduce a ViewObjectContactOfTableObj which is able to check that a
tagged PDF export is in progress.

For the non-PDF case, for performance, fall back to calling
ViewContact::createViewIndependentPrimitive2DSequence().

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

diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx
index 9eea4930aff5..3e0da9a72708 100644
--- a/include/svx/svdotable.hxx
+++ b/include/svx/svdotable.hxx
@@ -262,6 +262,8 @@ public:
 
 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 
+const TableLayouter& getTableLayouter() const;
+
 private:
 void init( sal_Int32 nColumns, sal_Int32 nRows );
 
@@ -274,11 +276,6 @@ private:
 
 SdrOutliner* GetCellTextEditOutliner( const sdr::table::Cell& rCell ) 
const;
 
-// For the ViewContactOfTableObj to build the primitive representation, it 
is necessary to access the
-// TableLayouter for position and attribute information
-friend class sdr::contact::ViewContactOfTableObj;
-const TableLayouter& getTableLayouter() const;
-
 tools::Rectangle   maLogicRect;
 rtl::Reference mpImpl;
 };
diff --git a/svx/source/table/viewcontactoftableobj.cxx 
b/svx/source/table/viewcontactoftableobj.cxx
index da11d1741789..3f17c5ccae21 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -36,6 +36,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -153,6 +155,21 @@ namespace drawinglayer::primitive2d
 
 namespace sdr::contact
 {
+
+namespace {
+class ViewObjectContactOfTableObj : public ViewObjectContactOfSdrObj
+{
+public:
+ViewObjectContactOfTableObj(ObjectContact& rObjectContact, 
ViewContact& rViewContact)
+: ViewObjectContactOfSdrObj(rObjectContact, rViewContact)
+{
+}
+
+protected:
+virtual void createPrimitive2DSequence(DisplayInfo const& 
rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& 
rVisitor) const override;
+};
+} // namespace
+
 static svx::frame::Style impGetLineStyle(
 const sdr::table::TableLayouter& rLayouter,
 sal_Int32 nX,
@@ -204,9 +221,11 @@ namespace sdr::contact
 return svx::frame::Style();
 }
 
-void 
ViewContactOfTableObj::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor&
 rVisitor) const
+static void createPrimitive2DSequenceImpl(
+sdr::table::SdrTableObj const& rTableObj,
+bool const isTaggedPDF,
+drawinglayer::primitive2d::Primitive2DDecompositionVisitor& 
rVisitor)
 {
-const sdr::table::SdrTableObj& rTableObj = static_cast(GetSdrObject());
 const uno::Reference< css::table::XTable > xTable = 
rTableObj.getTable();
 
 if(xTable.is())
@@ -352,7 +371,7 @@ namespace sdr::contact
 aRetvalForShadow.append(xCellReference);
 }
 }
-if (pPage)
+if (isTaggedPDF && pPage)
 {
 // heuristic: if there's a special formatting 
on
 // first row, assume that it's a header row
@@ -370,7 +389,7 @@ namespace sdr::contact
 row.append(cell);
 }
 
-if (pPage)
+if (isTaggedPDF && pPage)
 {
 row = 
drawinglayer::primitive2d::Primitive2DContainer {
 new 
drawinglayer::primitive2d::StructureTagPrimitive2D(
@@ -484,6 +503,38 @@ namespace sdr::contact
 }
 }
 
+void ViewObjectContactOfTableObj::createPrimitive2DSequence(
+DisplayInfo const& rDisplayInfo,
+drawinglayer::primitive2d::Primitive2DDecompositionVisitor& 
rVisitor) const
+{
+bool const isTaggedPDF(GetObjectContact().isExportTaggedPDF());
+if (isTaggedPDF)
+{
+// this will be 

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

2022-11-29 Thread Michael Stahl (via logerrit)
 include/svx/svdobj.hxx   |   12 +-
 include/svx/svdovirt.hxx |6 +
 svx/source/sdr/contact/viewobjectcontact.cxx |4 +++
 svx/source/svdraw/svdovirt.cxx   |   30 +++
 4 files changed, 46 insertions(+), 6 deletions(-)

New commits:
commit ae132145ff42a95dc24fb124847c04af4b8c8dab
Author: Michael Stahl 
AuthorDate: Tue Nov 29 13:11:25 2022 +0100
Commit: Michael Stahl 
CommitDate: Tue Nov 29 16:11:44 2022 +0100

tdf#141386 svx,sw: fix setting name/title/description on SwVirtFlyDrawObj

The problem is that setting the title via the dialog in Writer calls
SwFlyFrameFormat::SetObjTitle() which sets SwFrameFormat::msTitle and
SdrObject::m_pPlusData::aObjTitle on the master SwFlyDrawObj.

Now ViewContactOfSdrObj::embedToObjectSpecificInformation() is called
for the SwVirtFlyDrawObj, not the SwFlyDrawObj, because that one is not
on the SdrPage.

However, SwFlyFrameFormat::GetObjTitle() will return
SwFrameFormat::msTitle as a fallback.

So what's missing here is SwVirtFlyDrawObj must forward calls that
get/set model properties to its associated SwFlyDrawObj - implement that
in base class SdrVirtObj.

But note that this does not fix the reported PDF export bug - that was
already fixed by commit 122b4264d23df8b11419839ba700b88c4f936a6c in sw
and this fix is for other users of ObjectInfoPrimitive2D.

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

diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 3cc030c0b293..2404060e5936 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -374,14 +374,14 @@ public:
 // An object may have a user-set Name (Get/SetName()), e.g SdrGrafObj, 
SdrObjGroup
 // or SdrOle2Obj.
 // It may also have a Title and a Description for accessibility purposes.
-void SetName(const OUString& rStr, const bool bSetChanged = true);
-const OUString & GetName() const;
+virtual void SetName(const OUString& rStr, const bool bSetChanged = true);
+virtual const OUString & GetName() const;
 void MakeNameUnique();
 void MakeNameUnique(std::unordered_set& rNameSet);
-void SetTitle(const OUString& rStr);
-OUString GetTitle() const;
-void SetDescription(const OUString& rStr);
-OUString GetDescription() const;
+virtual void SetTitle(const OUString& rStr);
+virtual OUString GetTitle() const;
+virtual void SetDescription(const OUString& rStr);
+virtual OUString GetDescription() const;
 
 // for group objects
 bool IsGroupObject() const;
diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx
index 9f327d639bb1..fc8ce86247ed 100644
--- a/include/svx/svdovirt.hxx
+++ b/include/svx/svdovirt.hxx
@@ -62,6 +62,12 @@ public:
 virtual SdrInventor GetObjInventor() const override;
 virtual SdrObjKind GetObjIdentifier() const override;
 virtual SdrObjList* GetSubList() const override;
+virtual void SetName(const OUString& rStr, const bool bSetChanged = true) 
override;
+virtual const OUString& GetName() const override;
+virtual void SetTitle(const OUString& rStr) override;
+virtual OUString GetTitle() const override;
+virtual void SetDescription(const OUString& rStr) override;
+virtual OUString GetDescription() const override;
 
 virtual const tools::Rectangle& GetCurrentBoundRect() const override;
 virtual const tools::Rectangle& GetLastBoundRect() const override;
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 9831cf3bfd59..8580603850ea 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -392,6 +392,10 @@ drawinglayer::primitive2d::Primitive2DContainer const & 
ViewObjectContact::getPr
 const SdrObjKind nIdentifier(pSdrObj->GetObjIdentifier());
 const bool bIsTextObj(nullptr != DynCastSdrTextObj(pSdrObj));
 
+// Note: SwFlyDrawObj/SwVirtFlyDrawObj have SdrInventor::Swg - these
+// are *not* handled here because not all of them are painted
+// completely with primitives, so a tag here does not encapsulate them.
+// The tag must be created by SwTaggedPDFHelper until this is fixed.
 if ( nInventor == SdrInventor::Default )
 {
 if ( nIdentifier == SdrObjKind::Group )
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index 23193d6e4aa4..ab95fd633b16 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -111,6 +111,36 @@ SdrObjList* SdrVirtObj::GetSubList() const
 return mxRefObj->GetSubList();
 }
 
+void SdrVirtObj::SetName(const OUString& rStr, const bool bSetChanged)
+{
+return mxRefObj->SetName(rStr, 

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

2022-11-18 Thread Mike Kaganski (via logerrit)
 include/svx/sdrpaintwindow.hxx   |1 -
 svx/source/svdraw/sdrpaintwindow.cxx |   15 +++
 2 files changed, 3 insertions(+), 13 deletions(-)

New commits:
commit 085c179b9e146ef27d98aed72d5b681c585cabfc
Author: Mike Kaganski 
AuthorDate: Fri Nov 18 15:31:56 2022 +0300
Commit: Mike Kaganski 
CommitDate: Fri Nov 18 15:22:29 2022 +0100

Simplify a bit

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

diff --git a/include/svx/sdrpaintwindow.hxx b/include/svx/sdrpaintwindow.hxx
index d6dee79a9389..109851aacd80 100644
--- a/include/svx/sdrpaintwindow.hxx
+++ b/include/svx/sdrpaintwindow.hxx
@@ -123,7 +123,6 @@ public:
 
 // prepare PreRendering (evtl.)
 void PreparePreRenderDevice();
-void DestroyPreRenderDevice();
 void OutputPreRenderDevice(const vcl::Region& rExpandedRegion);
 SdrPreRenderDevice* GetPreRenderDevice() const { return 
mpPreRenderDevice.get(); }
 
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx 
b/svx/source/svdraw/sdrpaintwindow.cxx
index 6c3b328ba5ea..ebed55326a57 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -252,7 +252,7 @@ SdrPaintWindow::~SdrPaintWindow()
 {
 mxOverlayManager.clear();
 
-DestroyPreRenderDevice();
+mpPreRenderDevice.reset();
 }
 
 rtl::Reference< sdr::overlay::OverlayManager > const & 
SdrPaintWindow::GetOverlayManager() const
@@ -292,21 +292,12 @@ void SdrPaintWindow::PreparePreRenderDevice()
 {
 mpPreRenderDevice.reset(new SdrPreRenderDevice(*mpOutputDevice));
 }
+mpPreRenderDevice->PreparePreRenderDevice();
 }
 else
 {
-DestroyPreRenderDevice();
+mpPreRenderDevice.reset();
 }
-
-if(mpPreRenderDevice)
-{
-mpPreRenderDevice->PreparePreRenderDevice();
-}
-}
-
-void SdrPaintWindow::DestroyPreRenderDevice()
-{
-mpPreRenderDevice.reset();
 }
 
 void SdrPaintWindow::OutputPreRenderDevice(const vcl::Region& rExpandedRegion)


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

2022-10-13 Thread Caolán McNamara (via logerrit)
 include/svx/sdr/overlay/overlayobject.hxx   |8 
 svx/source/sdr/overlay/overlaymanager.cxx   |   19 +++
 svx/source/sdr/overlay/overlayobject.cxx|3 ++-
 svx/source/sdr/overlay/overlayrectangle.cxx |2 ++
 svx/source/svdraw/svdedxv.cxx   |2 ++
 5 files changed, 33 insertions(+), 1 deletion(-)

New commits:
commit 046bc5029681444cb5d707b33a8aa3cc67732c22
Author: Caolán McNamara 
AuthorDate: Wed Oct 12 15:53:21 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 13 10:04:53 2022 +0200

tdf#150622 allow use of selection color for frame in HighContrast mode

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

diff --git a/include/svx/sdr/overlay/overlayobject.hxx 
b/include/svx/sdr/overlay/overlayobject.hxx
index d4ef56646171..294ceb3447f8 100644
--- a/include/svx/sdr/overlay/overlayobject.hxx
+++ b/include/svx/sdr/overlay/overlayobject.hxx
@@ -109,6 +109,11 @@ namespace sdr::overlay
 // it is switched to false
 boolmbAllowsAntiAliase 
: 1;
 
+// Flag to control if this OverlayObject is allowed to ignore the
+// DrawMode settings which force use of colors to High Contrast 
fg/bg
+// Default is false.
+bool
mbOverruleDrawModeSettings : 1;
+
 // set changed flag. Call after change, since the old range is 
invalidated
 // and then the new one is calculated and invalidated, too. This 
will only
 // work after the change.
@@ -142,6 +147,9 @@ namespace sdr::overlay
 // read access to AntiAliase flag
 bool allowsAntiAliase() const { return mbAllowsAntiAliase; }
 
+// read access to DrawModeSettings flag
+bool overrulesDrawModeSettings() const { return 
mbOverruleDrawModeSettings; }
+
 // read access to baseRange. This may trigger createBaseRange() if
 // object is changed.
 const basegfx::B2DRange& getBaseRange() const;
diff --git a/svx/source/sdr/overlay/overlaymanager.cxx 
b/svx/source/sdr/overlay/overlaymanager.cxx
index 3cbd821fb3bd..3d501b814da5 100644
--- a/svx/source/sdr/overlay/overlaymanager.cxx
+++ b/svx/source/sdr/overlay/overlaymanager.cxx
@@ -47,6 +47,12 @@ namespace sdr::overlay
 
 const AntialiasingFlags 
nOriginalAA(rDestinationDevice.GetAntialiasing());
 const bool 
bIsAntiAliasing(SvtOptionsDrawinglayer::IsAntiAliasing());
+// tdf#150622 for High Contrast we typically force colors to a 
single pair Fore/Back,
+// but it seems reasonable to allow overlays to use the selection 
color
+// taken from the system High Contrast settings
+const DrawModeFlags 
nOriginalDrawMode(rDestinationDevice.GetDrawMode());
+const DrawModeFlags nForceSettings = DrawModeFlags::SettingsLine | 
DrawModeFlags::SettingsFill |
+ DrawModeFlags::SettingsText | 
DrawModeFlags::SettingsGradient;
 
 // create processor
 std::unique_ptr 
pProcessor(drawinglayer::processor2d::createProcessor2DFromOutputDevice(
@@ -75,7 +81,20 @@ namespace sdr::overlay
 rDestinationDevice.SetAntialiasing(nOriginalAA 
& ~AntialiasingFlags::Enable);
 }
 
+const bool bOverrulesDrawModeSettings = 
rCandidate.overrulesDrawModeSettings();
+if (bOverrulesDrawModeSettings)
+{
+// overrule DrawMode settings
+
rDestinationDevice.SetDrawMode(nOriginalDrawMode & ~nForceSettings);
+}
+
 pProcessor->process(rSequence);
+
+if (bOverrulesDrawModeSettings)
+{
+// restore DrawMode settings
+
rDestinationDevice.SetDrawMode(nOriginalDrawMode);
+}
 }
 }
 }
diff --git a/svx/source/sdr/overlay/overlayobject.cxx 
b/svx/source/sdr/overlay/overlayobject.cxx
index 4fd227977dbb..6aab4f88068c 100644
--- a/svx/source/sdr/overlay/overlayobject.cxx
+++ b/svx/source/sdr/overlay/overlayobject.cxx
@@ -90,7 +90,8 @@ namespace sdr::overlay
 mbIsVisible(true),
 mbIsHittable(true),
 mbAllowsAnimation(false),
-mbAllowsAntiAliase(true)
+mbAllowsAntiAliase(true),
+mbOverruleDrawModeSettings(false)
 {
 }
 
diff --git a/svx/source/sdr/overlay/overlayrectangle.cxx 
b/svx/source/sdr/overlay/overlayrectangle.cxx
index 

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

2022-09-13 Thread Noel Grandin (via logerrit)
 include/svx/unoshape.hxx   |3 
 svx/source/unodraw/unoshap2.cxx|   20 ++--
 sw/inc/unodraw.hxx |   30 +-
 sw/inc/unotxdoc.hxx|4 
 sw/source/core/unocore/unodraw.cxx |  174 +++--
 sw/source/uibase/uno/unotxdoc.cxx  |   11 +-
 6 files changed, 85 insertions(+), 157 deletions(-)

New commits:
commit eae7a05b94fcfdf0ae48adab2006fe0b82c95921
Author: Noel Grandin 
AuthorDate: Tue Sep 13 09:56:15 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 13 13:53:24 2022 +0200

ofz#50767 docxfuzzer: Indirect-leak in rtl_allocateMemory

Two fixes required here

(1) the unnecessary use of aggregation in SwXDrawPage, which leads to a
very confusing cycle that I don't fully follow. No indication why this
is necessary in the git history, has been this way since initial commit

(2) a ref-counting cycle through SvxShapeGroup and SvxDrawPage, use a
weak reference here to break the ref-counting cycle.

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

diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index 0eb3ef33101c..862cbb1a0766 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -428,7 +428,8 @@ class SVXCORE_DLLPUBLIC SvxShapeGroup final : public 
SvxShapeGroupAnyD,
   public css::drawing::XShapes2
 {
 private:
-rtl::Reference< SvxDrawPage> mxPage;
+/// using a weak reference to prevent leaks via ref-counting cycles
+unotools::WeakReference< SvxDrawPage> mxWeakPage;
 
 void addUnoShape( const css::uno::Reference< css::drawing::XShape >& 
xShape, size_t nPos );
 void addShape(SvxShape& rShape, size_t nPos);
diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index cf72530e6c7d..0315d2a5c74e 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -80,7 +80,7 @@ using namespace ::com::sun::star::container;
 
 SvxShapeGroup::SvxShapeGroup(SdrObject* pObj, SvxDrawPage* pDrawPage)
 : SvxShapeGroupAnyD(pObj, getSvxMapProvider().GetMap(SVXMAP_GROUP), 
getSvxMapProvider().GetPropertySet(SVXMAP_GROUP, 
SdrObject::GetGlobalDrawObjectItemPool()))
-, mxPage(pDrawPage)
+, mxWeakPage(pDrawPage)
 {
 }
 
@@ -91,7 +91,7 @@ SvxShapeGroup::~SvxShapeGroup() noexcept
 void SvxShapeGroup::Create( SdrObject* pNewObj, SvxDrawPage* pNewPage )
 {
 SvxShape::Create( pNewObj, pNewPage );
-mxPage = pNewPage;
+mxWeakPage = pNewPage;
 }
 
 
@@ -185,7 +185,13 @@ void SvxShapeGroup::addShape( SvxShape& rShape )
 
 void SvxShapeGroup::addShape( SvxShape& rShape, size_t nPos )
 {
-if (!HasSdrObject() || !mxPage.is())
+SdrObject* pSdrObject = GetSdrObject();
+if (!pSdrObject)
+{
+return;
+}
+rtl::Reference xPage = mxWeakPage.get();
+if (!xPage)
 {
 OSL_FAIL("could not add XShape to group shape!");
 return;
@@ -193,12 +199,12 @@ void SvxShapeGroup::addShape( SvxShape& rShape, size_t 
nPos )
 
 rtl::Reference pSdrShape = rShape.GetSdrObject();
 if( pSdrShape == nullptr )
-pSdrShape = mxPage->CreateSdrObject_(  );
+pSdrShape = xPage->CreateSdrObject_(  );
 
 if( pSdrShape->IsInserted() )
 pSdrShape->getParentSdrObjListFromSdrObject()->RemoveObject( 
pSdrShape->GetOrdNum() );
 
-GetSdrObject()->GetSubList()->InsertObject(pSdrShape.get(), nPos);
+pSdrObject->GetSubList()->InsertObject(pSdrShape.get(), nPos);
 //  Was created using mpModel in CreateSdrObject_ above
 //  may be good to add an assertion here for the future
 // pSdrShape->SetModel(GetSdrObject()->GetModel());
@@ -214,9 +220,9 @@ void SvxShapeGroup::addShape( SvxShape& rShape, size_t nPos 
)
 // Establish connection between new SdrObject and its wrapper before
 // inserting the new shape into the group.  There a new wrapper
 // would be created when this connection would not already exist.
-rShape.Create( pSdrShape.get(), mxPage.get() );
+rShape.Create( pSdrShape.get(), xPage.get() );
 
-GetSdrObject()->getSdrModelFromSdrObject().SetChanged();
+pSdrObject->getSdrModelFromSdrObject().SetChanged();
 }
 
 // XShapes
diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx
index e252499f0453..d7a768317bbf 100644
--- a/sw/inc/unodraw.hxx
+++ b/sw/inc/unodraw.hxx
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -40,12 +39,18 @@ class SdrView;
 class SwDoc;
 class SwXShape;
 
-class SwFmDrawPage final : public SvxFmDrawPage
+typedef cppu::ImplInheritanceHelper
+<
+SvxFmDrawPage,
+css::container::XEnumerationAccess
+> SwFmDrawPage_Base;
+class SwFmDrawPage final : public SwFmDrawPage_Base
 {
+SwDoc*  m_pDoc;
 SdrPageView*m_pPageView;
 std::vector> m_vShapes;
 public:
- 

[Libreoffice-commits] core.git: include/svx svx/source xmloff/CppunitTest_xmloff_draw.mk xmloff/qa xmloff/source

2022-08-29 Thread Miklos Vajna (via logerrit)
 include/svx/unoshape.hxx   |2 +
 svx/source/unodraw/unoshap4.cxx|   25 +++
 xmloff/CppunitTest_xmloff_draw.mk  |3 +
 xmloff/qa/unit/data/video-snapshot.odp |binary
 xmloff/qa/unit/draw.cxx|   50 ++
 xmloff/source/draw/shapeexport.cxx |   54 -
 xmloff/source/draw/ximpshap.cxx|   14 +++-
 7 files changed, 146 insertions(+), 2 deletions(-)

New commits:
commit cbc6e67d3c88fb6ae39c304604a98eaa504f19cc
Author: Miklos Vajna 
AuthorDate: Mon Aug 29 09:23:22 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon Aug 29 10:40:41 2022 +0200

avmedia: implement video crop support in the ODP filter

And also import/export the video preview as well. The naming follows the
style used for table shape previews.

The preview is important, since the cropping is relative to the bitmap's
preferred logic size.

Change-Id: I6115284c1f4cf342b3296cd0ac3beb70a809fd1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138959
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index 923636d3b9c7..51b65e23ade9 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -858,6 +858,8 @@ private:
 // override these for special property handling in subcasses. Return true 
if property is handled
 virtual bool setPropertyValueImpl( const OUString& rName, const 
SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
 virtual bool getPropertyValueImpl( const OUString& rName, const 
SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
+bool getPropertyStateImpl(const SfxItemPropertyMapEntry* pProperty,
+  css::beans::PropertyState& rState) override;
 
 OUString referer_;
 };
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 482efb826117..ae26aaabeca6 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -1071,4 +1071,29 @@ bool SvxMediaShape::getPropertyValueImpl( const 
OUString& rName, const SfxItemPr
 }
 }
 
+bool SvxMediaShape::getPropertyStateImpl(const SfxItemPropertyMapEntry* 
pProperty,
+ css::beans::PropertyState& rState)
+{
+#if HAVE_FEATURE_AVMEDIA
+if (pProperty->nWID == SDRATTR_GRAFCROP)
+{
+auto pMedia = static_cast(GetSdrObject());
+const avmedia::MediaItem& rItem = pMedia->getMediaProperties();
+const text::GraphicCrop& rCrop = rItem.getCrop();
+if (rCrop.Bottom > 0 || rCrop.Left > 0 || rCrop.Right > 0 || rCrop.Top 
> 0)
+{
+// The media has a crop, expose it to UNO-based export filters.
+rState = beans::PropertyState_DIRECT_VALUE;
+}
+else
+{
+rState = beans::PropertyState_AMBIGUOUS_VALUE;
+}
+return true;
+}
+#endif
+
+return SvxShape::getPropertyStateImpl(pProperty, rState);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/CppunitTest_xmloff_draw.mk 
b/xmloff/CppunitTest_xmloff_draw.mk
index 42c7a9526661..a503cc9f2c1d 100644
--- a/xmloff/CppunitTest_xmloff_draw.mk
+++ b/xmloff/CppunitTest_xmloff_draw.mk
@@ -28,6 +28,9 @@ $(eval $(call gb_CppunitTest_use_libraries,xmloff_draw, \
 test \
 unotest \
 utl \
+avmedia \
+svxcore \
+vcl \
 ))
 
 $(eval $(call gb_CppunitTest_use_sdk_api,xmloff_draw))
diff --git a/xmloff/qa/unit/data/video-snapshot.odp 
b/xmloff/qa/unit/data/video-snapshot.odp
new file mode 100644
index ..ca3b7f21dc6c
Binary files /dev/null and b/xmloff/qa/unit/data/video-snapshot.odp differ
diff --git a/xmloff/qa/unit/draw.cxx b/xmloff/qa/unit/draw.cxx
index e8462ccc6181..6aab4c12a46f 100644
--- a/xmloff/qa/unit/draw.cxx
+++ b/xmloff/qa/unit/draw.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -31,6 +32,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -173,6 +177,52 @@ CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testThemeExport)
 assertXPath(pXmlDoc, 
"//style:master-page/loext:theme/loext:color-table/loext:color", 12);
 }
 
+CPPUNIT_TEST_FIXTURE(XmloffDrawTest, testVideoSnapshot)
+{
+// Execute ODP import:
+OUString aURL = 
m_directories.getURLFromSrc(u"xmloff/qa/unit/data/video-snapshot.odp");
+getComponent() = loadFromDesktop(aURL, 
"com.sun.star.presentation.PresentationDocument");
+uno::Reference 
xDrawPagesSupplier(getComponent(),
+   
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xDrawPagesSupplier.is());
+uno::Reference 
xDrawPages(xDrawPagesSupplier->getDrawPages());
+uno::Reference xDrawPage(xDrawPages->getByIndex(0), 
uno::UNO_QUERY_THROW);
+

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

2022-08-05 Thread Heiko Tietze (via logerrit)
 include/svx/strings.hrc |1 
 svx/source/dialog/docrecovery.cxx   |  140 +---
 svx/source/inc/docrecovery.hxx  |   12 ++
 svx/uiconfig/ui/docrecoveryrecoverdialog.ui |   83 +---
 4 files changed, 185 insertions(+), 51 deletions(-)

New commits:
commit a9c8ac0605fd1d19e1d79b54804b610a64a8a056
Author: Heiko Tietze 
AuthorDate: Wed Jul 6 15:11:28 2022 +0200
Commit: Caolán McNamara 
CommitDate: Fri Aug 5 16:25:46 2022 +0200

Resolves tdf#114508: Individual selection in recovery dialog

Based on work by Danie Truter at I397119a6e50c256e87e3a484a6c17a252f191981

Change-Id: I75fd321cbfeb7a92bd14e94b0c1ae0bb25be73cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136845
Tested-by: Jenkins
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index f800d8365cf5..f46663ccf669 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1020,6 +1020,7 @@
 #define RID_SVXSTR_RECOVFAILED  
NC_("RID_SVXSTR_RECOVFAILED", "Recovery failed")
 #define RID_SVXSTR_RECOVINPROGR 
NC_("RID_SVXSTR_RECOVINPROGR", "Recovery in progress")
 #define RID_SVXSTR_NOTRECOVYET  
NC_("RID_SVXSTR_NOTRECOVYET", "Not recovered yet")
+#define RID_SVXSTR_WILLDISCARD  
NC_("RID_SVXSTR_WILLDISCARD", "Will be discarded")
 #define RID_SVXSTR_RECOVERY_INPROGRESS  
NC_("RID_SVXSTR_RECOVERY_INPROGRESS", "%PRODUCTNAME %PRODUCTVERSION has begun 
recovering your documents. Depending on the size of the documents this process 
can take some time.")
 #define RID_SVXSTR_RECOVERYONLY_FINISH_DESCR
NC_("RID_SVXSTR_RECOVERYONLY_FINISH_DESCR", "Recovery of your documents was 
finished. Click 'Finish' to see your documents.")
 #define RID_SVXSTR_RECOVERYONLY_FINISH  
NC_("RID_SVXSTR_RECOVERYONLY_FINISH", "~Finish")
diff --git a/svx/source/dialog/docrecovery.cxx 
b/svx/source/dialog/docrecovery.cxx
index 61a2fedb4f8a..6675a05c64ea 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -47,6 +47,11 @@ namespace svx::DocRecovery
 
 using namespace ::osl;
 
+#define COLUMN_STANDARDIMAGE -1
+#define COLUMN_DISPLAYNAME 0
+#define COLUMN_STATUSIMAGE 1
+#define COLUMN_STATUSTEXT 2
+
 RecoveryCore::RecoveryCore(css::uno::Reference< css::uno::XComponentContext > 
xContext,
  bool  
  bUsedForSaving)
 : m_xContext(std::move( xContext))
@@ -190,6 +195,33 @@ void RecoveryCore::forgetBrokenTempEntries()
 }
 }
 
+// should only be called with valid m_xRealCore
+void RecoveryCore::forgetAllRecoveryEntriesMarkedForDiscard()
+{
+assert(m_xRealCore);
+
+// potential to move in a separate function
+css::util::URL aRemoveURL = 
impl_getParsedURL(RECOVERY_CMD_DO_ENTRY_CLEANUP);
+css::uno::Sequence lRemoveArgs(2);
+auto plRemoveArgs = lRemoveArgs.getArray();
+plRemoveArgs[0].Name = PROP_DISPATCHASYNCHRON;
+plRemoveArgs[0].Value <<= false;
+plRemoveArgs[1].Name = PROP_ENTRYID;
+
+// work on a copied list only ...
+// Reason: We will get notifications from the core for every
+// changed or removed element. And that will change our m_lURLs list.
+// That's not a good idea, if we use a stl iterator inbetween .-)
+TURLList lURLs = m_lURLs;
+for (const TURLInfo& rInfo : lURLs)
+{
+if (!rInfo.ShouldDiscard)
+continue;
+
+plRemoveArgs[1].Value <<= rInfo.ID;
+m_xRealCore->dispatch(aRemoveURL, lRemoveArgs);
+}
+}
 
 void RecoveryCore::forgetAllRecoveryEntries()
 {
@@ -293,6 +325,8 @@ void RecoveryCore::doRecovery()
 if (!m_xRealCore.is())
 return;
 
+forgetAllRecoveryEntriesMarkedForDiscard();
+
 css::util::URL aURL = impl_getParsedURL(RECOVERY_CMD_DO_RECOVERY);
 
 css::uno::Sequence< css::beans::PropertyValue > lArgs{
@@ -646,29 +680,31 @@ RecoveryDialog::RecoveryDialog(weld::Window* pParent, 
RecoveryCore* pCore)
 , m_eRecoveryState(RecoveryDialog::E_RECOVERY_PREPARED)
 , m_bWaitForCore(false)
 , m_bWasRecoveryStarted(false)
+//, m_aColumnOffset(0)
+, m_aToggleCount(0)
 , m_aSuccessRecovStr(SvxResId(RID_SVXSTR_SUCCESSRECOV))
 , m_aOrigDocRecovStr(SvxResId(RID_SVXSTR_ORIGDOCRECOV))
 , m_aRecovFailedStr(SvxResId(RID_SVXSTR_RECOVFAILED))
 , m_aRecovInProgrStr(SvxResId(RID_SVXSTR_RECOVINPROGR))
 , m_aNotRecovYetStr(SvxResId(RID_SVXSTR_NOTRECOVYET))
+, m_aWillBeDiscStr(SvxResId(RID_SVXSTR_WILLDISCARD))
 , m_xDescrFT(m_xBuilder->weld_label("desc"))
 , m_xProgressBar(m_xBuilder->weld_progress_bar("progress"))
 , m_xFileListLB(m_xBuilder->weld_tree_view("filelist"))
 , 

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

2022-07-01 Thread Noel Grandin (via logerrit)
 include/svx/svdpage.hxx   |2 ++
 svx/source/svdraw/svdpage.cxx |   30 +-
 2 files changed, 23 insertions(+), 9 deletions(-)

New commits:
commit 2fe50b2f11e2236ae7145fd633ad93342f5a0f6c
Author: Noel Grandin 
AuthorDate: Thu Jun 30 13:21:56 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Jul 1 11:27:50 2022 +0200

tdf#137544 ReformatAllEdgeObjects use recursion

rather than SdrObjListIter, which wants to build a vector of all the
child objects, of which there are a great many

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

diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 2ba7017a01a3..dde46e1cc61f 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -273,6 +273,8 @@ private:
 */
 void RemoveObjectFromContainer (
 const sal_uInt32 nObjectPosition);
+
+void ImplReformatAllEdgeObjects(const SdrObjList& );
 };
 
 // Used for all methods which return a page number
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index a98b88947b76..61a58b3dbc35 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -774,17 +774,29 @@ void SdrObjList::ReformatAllTextObjects()
 */
 void SdrObjList::ReformatAllEdgeObjects()
 {
-// #i120437# go over whole hierarchy, not only over object level null 
(seen from grouping)
-SdrObjListIter aIter(this, SdrIterMode::DeepNoGroups);
+ImplReformatAllEdgeObjects(*this);
+}
 
-while(aIter.IsMore())
+void SdrObjList::ImplReformatAllEdgeObjects(const SdrObjList& rObjList)
+{
+// #i120437# go over whole hierarchy, not only over object level null 
(seen from grouping)
+for(size_t nIdx(0), nCount(rObjList.GetObjCount()); nIdx < nCount; ++nIdx)
 {
-SdrObject* pObj = aIter.Next();
-if (pObj->GetObjIdentifier() != SdrObjKind::Edge)
-continue;
-
-SdrEdgeObj* pSdrEdgeObj = static_cast< SdrEdgeObj* >(pObj);
-pSdrEdgeObj->Reformat();
+SdrObject* pSdrObject(rObjList.GetObjectForNavigationPosition(nIdx));
+const SdrObjList* pChildren(pSdrObject->getChildrenOfSdrObject());
+const bool bIsGroup(nullptr != pChildren);
+if(!bIsGroup)
+{
+if (pSdrObject->GetObjIdentifier() == SdrObjKind::Edge)
+{
+SdrEdgeObj* pSdrEdgeObj = static_cast< SdrEdgeObj* 
>(pSdrObject);
+pSdrEdgeObj->Reformat();
+}
+}
+else
+{
+ImplReformatAllEdgeObjects(*pChildren);
+}
 }
 }
 


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

2022-06-30 Thread Noel Grandin (via logerrit)
 include/svx/ChildrenManager.hxx  |3 +-
 svx/source/accessibility/ChildrenManager.cxx |2 -
 svx/source/accessibility/ChildrenManagerImpl.cxx |   29 +--
 svx/source/accessibility/ChildrenManagerImpl.hxx |   10 +++
 4 files changed, 20 insertions(+), 24 deletions(-)

New commits:
commit c6f1659fa2be14f830fb4a8264b70420df22f7e0
Author: Noel Grandin 
AuthorDate: Wed Jun 29 20:49:03 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Jun 30 22:14:14 2022 +0200

tdf#137544 elide some UNO_QUERY

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

diff --git a/include/svx/ChildrenManager.hxx b/include/svx/ChildrenManager.hxx
index 0498b43fdff0..c14ae6c1c476 100644
--- a/include/svx/ChildrenManager.hxx
+++ b/include/svx/ChildrenManager.hxx
@@ -46,6 +46,7 @@ class XShapes;
 namespace accessibility
 {
 class AccessibleContextBase;
+class AccessibleShape;
 class AccessibleShapeTreeInfo;
 class ChildrenManagerImpl;
 
@@ -164,7 +165,7 @@ public:
 
 @param shape must be non-null
 */
-void 
AddAccessibleShape(css::uno::Reference const& 
shape);
+void AddAccessibleShape(rtl::Reference const& shape);
 
 /** Clear the list of accessible shapes which have been added by
 previous calls to AddAccessibleShape.
diff --git a/svx/source/accessibility/ChildrenManager.cxx 
b/svx/source/accessibility/ChildrenManager.cxx
index 71983f46e98c..d0e681b550f1 100644
--- a/svx/source/accessibility/ChildrenManager.cxx
+++ b/svx/source/accessibility/ChildrenManager.cxx
@@ -74,7 +74,7 @@ void ChildrenManager::SetShapeList (const 
css::uno::ReferenceSetShapeList (xShapeList);
 }
 
-void ChildrenManager::AddAccessibleShape 
(css::uno::Reference const & shape)
+void ChildrenManager::AddAccessibleShape (rtl::Reference 
const & shape)
 {
 mpImpl->AddAccessibleShape (shape);
 }
diff --git a/svx/source/accessibility/ChildrenManagerImpl.cxx 
b/svx/source/accessibility/ChildrenManagerImpl.cxx
index d22f81e76684..27647f70c097 100644
--- a/svx/source/accessibility/ChildrenManagerImpl.cxx
+++ b/svx/source/accessibility/ChildrenManagerImpl.cxx
@@ -24,6 +24,7 @@
 #include "ChildrenManagerImpl.hxx"
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -424,7 +425,7 @@ void ChildrenManagerImpl::CreateAccessibilityObjects (
 rChild.mbCreateEventPending = false;
 mrContext.CommitChange (
 AccessibleEventId::CHILD,
-uno::Any(rChild.mxAccessibleShape),
+
uno::Any(uno::Reference(rChild.mxAccessibleShape)),
 uno::Any());
 }
 ++nPos;
@@ -472,7 +473,7 @@ void ChildrenManagerImpl::AddShape (const 
Reference& rxShape)
 
 // Inform listeners about new child.
 uno::Any aNewShape;
-aNewShape <<= rDescriptor.mxAccessibleShape;
+aNewShape <<= uno::Reference(rDescriptor.mxAccessibleShape);
 aGuard.clear();
 mrContext.CommitChange (
 AccessibleEventId::CHILD,
@@ -517,7 +518,7 @@ void ChildrenManagerImpl::SetShapeList (const 
css::uno::Reference const & shape)
+void ChildrenManagerImpl::AddAccessibleShape (rtl::Reference 
const & shape)
 {
 assert(shape.is());
 maAccessibleShapes.push_back (shape);
@@ -547,7 +548,7 @@ void ChildrenManagerImpl::ClearAccessibleShapeList()
 for (auto& rChild : aLocalVisibleChildren)
 if ( rChild.mxAccessibleShape.is() && rChild.mxShape.is() )
 {
-::comphelper::disposeComponent(rChild.mxAccessibleShape);
+rChild.mxAccessibleShape->dispose();
 rChild.mxAccessibleShape = nullptr;
 }
 
@@ -556,7 +557,7 @@ void ChildrenManagerImpl::ClearAccessibleShapeList()
 if (rpShape.is())
 {
 // Dispose the object.
-::comphelper::disposeComponent(rpShape);
+rpShape->dispose();
 rpShape = nullptr;
 }
 }
@@ -748,7 +749,7 @@ bool ChildrenManagerImpl::ReplaceChild (
 mrContext.CommitChange (
 AccessibleEventId::CHILD,
 uno::Any(),
-uno::Any (I->mxAccessibleShape));
+uno::Any (uno::Reference(I->mxAccessibleShape)));
 
 // Replace with replacement and send an event about existence
 // of the new child.
@@ -764,7 +765,7 @@ bool ChildrenManagerImpl::ReplaceChild (
 I->mxAccessibleShape = pNewChild.get();
 mrContext.CommitChange (
 AccessibleEventId::CHILD,
-uno::Any (I->mxAccessibleShape),
+uno::Any (uno::Reference(I->mxAccessibleShape)),
 uno::Any());
 
 return true;
@@ -1026,7 +1027,7 @@ ChildDescriptor::ChildDescriptor (const 
Reference& xShape)
 }
 
 
-ChildDescriptor::ChildDescriptor (const Reference& 
rxAccessibleShape)
+ChildDescriptor::ChildDescriptor (const rtl::Reference& 
rxAccessibleShape)
 : 

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

2022-06-24 Thread Samuel Mehrbrodt (via logerrit)
 include/svx/sidebar/AreaPropertyPanelBase.hxx |2 
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx |  636 --
 2 files changed, 249 insertions(+), 389 deletions(-)

New commits:
commit adc536e9efc77690df62177aa722f9252bdbf96b
Author: Samuel Mehrbrodt 
AuthorDate: Thu Jun 23 10:10:11 2022 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Fri Jun 24 08:12:25 2022 +0200

tdf#128150 Properly show/hide widgets when "use slide background" is 
selected

And cleanup the logic a bit

Change-Id: I9d866fd63ea622ac5eb706185b3277c21f40d7cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136301
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx 
b/include/svx/sidebar/AreaPropertyPanelBase.hxx
index 00519eed91e6..ed028d7b8698 100644
--- a/include/svx/sidebar/AreaPropertyPanelBase.hxx
+++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx
@@ -162,10 +162,10 @@ protected:
 DECL_DLLPRIVATE_LINK(ClickImportBitmapHdl, weld::Button&, void);
 DECL_DLLPRIVATE_LINK(ToolbarHdl_Impl, const OString&, void);
 
-void Update();
 void ImpUpdateTransparencies();
 void SetTransparency(sal_uInt16 nVal);
 void SelectFillAttrHdl_Impl();
+void FillStyleChanged(bool bUpdateModel);
 };
 
 } // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx 
b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index f94264c210fa..d4e7e507f2ef 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -232,221 +232,7 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, 
ClickImportBitmapHdl, weld::Button&, void
 
 IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, weld::ComboBox&, 
void)
 {
-sal_Int32 nPos = static_cast(mxLbFillType->get_active());
-mxLbFillAttr->clear();
-SfxObjectShell* pSh = SfxObjectShell::Current();
-if(!pSh)
-return;
-
-// #i122676# Do no longer trigger two Execute calls, one for 
SID_ATTR_FILL_STYLE
-// and one for setting the fill attribute itself, but add two SfxPoolItems 
to the
-// call to get just one action at the SdrObject and to create only one 
Undo action, too.
-// Checked that this works in all apps.
-switch( nPos )
-{
-default:
-case NONE:
-{
-mxLbFillAttr->show();
-mxLbFillGradFrom->hide();
-mxLbFillGradTo->hide();
-mxGradientStyle->hide();
-mxMTRAngle->hide();
-mxToolBoxColor->hide();
-mxBmpImport->hide();
-mxLbFillAttr->set_sensitive(false);
-
-const XFillStyleItem aXFillStyleItem(drawing::FillStyle_NONE);
-// Need to disable the XFillUseSlideBackgroundItem
-const XFillUseSlideBackgroundItem 
aXFillUseSlideBackgroundItem(false);
-setFillUseBackground(, 
aXFillUseSlideBackgroundItem);
-break;
-}
-case SOLID:
-{
-mxLbFillAttr->hide();
-mxLbFillGradFrom->hide();
-mxLbFillGradTo->hide();
-mxGradientStyle->hide();
-mxMTRAngle->hide();
-mxBmpImport->hide();
-mxToolBoxColor->show();
-const Color aColor = mpColorItem ? mpColorItem->GetColorValue() : 
COL_AUTO;
-const XFillColorItem aXFillColorItem( "", aColor );
-
-// #i122676# change FillStyle and Color in one call
-XFillStyleItem aXFillStyleItem(drawing::FillStyle_SOLID);
-setFillStyleAndColor(, aXFillColorItem);
-break;
-}
-case GRADIENT:
-{
-mxLbFillAttr->hide();
-mxLbFillGradFrom->show();
-mxLbFillGradTo->show();
-mxGradientStyle->show();
-mxMTRAngle->show();
-mxToolBoxColor->hide();
-mxBmpImport->hide();
-
-mxLbFillAttr->set_sensitive(true);
-mxLbFillGradTo->set_sensitive(true);
-mxLbFillGradFrom->set_sensitive(true);
-mxGradientStyle->set_sensitive(true);
-mxMTRAngle->set_sensitive(true);
-mxLbFillAttr->clear();
-
-const SvxGradientListItem * pItem = 
pSh->GetItem(SID_GRADIENT_LIST);
-
-if(0 < pItem->GetGradientList()->Count())
-{
-const XGradient aGradient = 
pItem->GetGradientList()->GetGradient(0)->GetGradient();
-const OUString aName = 
pItem->GetGradientList()->GetGradient(0)->GetName();
-const XFillGradientItem aXFillGradientItem(aName, aGradient);
-
-// #i122676# change FillStyle and Gradient in one call
-XFillStyleItem aXFillStyleItem(drawing::FillStyle_GRADIENT);
-setFillStyleAndGradient(, aXFillGradientItem);
-mxLbFillGradFrom->SelectEntry(aGradient.GetStartColor());
-

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

2022-06-13 Thread Samuel Mehrbrodt (via logerrit)
 include/svx/xflbckit.hxx  |2 ++
 svx/source/xoutdev/xattr2.cxx |8 
 2 files changed, 10 insertions(+)

New commits:
commit 2fded499dfab88834bc91acba1b6ae0028937f4e
Author: Samuel Mehrbrodt 
AuthorDate: Thu Jun 9 16:03:51 2022 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Jun 13 10:18:49 2022 +0200

Add XFillBackgroundItem::dumpAsXml

Change-Id: I21aa5ded0c9c114199c9d503b48437ec1a6171eb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135691
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/svx/xflbckit.hxx b/include/svx/xflbckit.hxx
index 4033e6796913..59d4e940e551 100644
--- a/include/svx/xflbckit.hxx
+++ b/include/svx/xflbckit.hxx
@@ -40,6 +40,8 @@ public:
  MapUnit eCoreMetric,
  MapUnit ePresMetric,
  OUString , const 
IntlWrapper& ) const override;
+
+void dumpAsXml(xmlTextWriterPtr pWriter) const override;
 };
 
 #endif
diff --git a/svx/source/xoutdev/xattr2.cxx b/svx/source/xoutdev/xattr2.cxx
index 30517283c748..e4136c9280ab 100644
--- a/svx/source/xoutdev/xattr2.cxx
+++ b/svx/source/xoutdev/xattr2.cxx
@@ -693,4 +693,12 @@ bool XFillBackgroundItem::GetPresentation( 
SfxItemPresentation /*ePres*/, MapUni
 return true;
 }
 
+void XFillBackgroundItem::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("XFillBackgroundItem"));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), 
BAD_CAST(OString::number(Which()).getStr()));
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), 
BAD_CAST(OString::boolean(GetValue()).getStr()));
+(void)xmlTextWriterEndElement(pWriter);
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


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

2022-06-06 Thread Noel Grandin (via logerrit)
 include/svx/fontworkgallery.hxx |4 ++--
 svx/source/tbxctrls/fontworkgallery.cxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit d987918e811d71357a934684cb481ca06466f06e
Author: Noel Grandin 
AuthorDate: Mon Jun 6 13:36:50 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Jun 6 15:51:11 2022 +0200

improve field name

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

diff --git a/include/svx/fontworkgallery.hxx b/include/svx/fontworkgallery.hxx
index 7d9dd4ef9338..78e0370dbac5 100644
--- a/include/svx/fontworkgallery.hxx
+++ b/include/svx/fontworkgallery.hxx
@@ -49,7 +49,7 @@ class SAL_WARN_UNUSED SVXCORE_DLLPUBLIC FontWorkGalleryDialog 
final : public wel
 SdrView&mrSdrView;
 
 boolmbInsertIntoPage;
-SdrObject*  mppSdrObject;
+SdrObject*  mpSdrObject;
 SdrModel*   mpDestModel;
 
 std::vector> maFavoritesHorizontal;
@@ -70,7 +70,7 @@ public:
 
 // SJ: if the SdrObject** is set, the SdrObject is not inserted into the 
page when executing the dialog
 void SetSdrObjectRef( SdrModel* pModel );
-SdrObject* GetSdrObjectRef() { return mppSdrObject; }
+SdrObject* GetSdrObjectRef() { return mpSdrObject; }
 };
 
 }
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx 
b/svx/source/tbxctrls/fontworkgallery.cxx
index cc9c4631361d..802cc1f4fcb8 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -58,7 +58,7 @@ FontWorkGalleryDialog::FontWorkGalleryDialog(weld::Window* 
pParent, SdrView& rSd
 , mnThemeId(0x)
 , mrSdrView(rSdrView)
 , mbInsertIntoPage(true)
-, mppSdrObject(nullptr)
+, mpSdrObject(nullptr)
 , mpDestModel(nullptr)
 , maCtlFavorites(m_xBuilder->weld_icon_view("ctlFavoriteswin"))
 , mxOKButton(m_xBuilder->weld_button("ok"))
@@ -237,7 +237,7 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
 
 if (bUseSpecialCalcMode)
 {
-mppSdrObject = pNewObject;
+mpSdrObject = pNewObject;
 }
 else
 {


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

2022-05-06 Thread Tomaž Vajngerl (via logerrit)
 include/svx/unodraw/SvxTableShape.hxx |   44 ++
 svx/source/unodraw/shapeimpl.hxx  |   17 -
 svx/source/unodraw/tableshape.cxx |1 
 svx/source/unodraw/unopage.cxx|1 
 4 files changed, 46 insertions(+), 17 deletions(-)

New commits:
commit cc1be7312d9f6bd4a4ea742c6d1e3cb9293631cc
Author: Tomaž Vajngerl 
AuthorDate: Fri Apr 22 16:53:32 2022 +0900
Commit: Tomaž Vajngerl 
CommitDate: Fri May 6 10:51:18 2022 +0200

svx: move SvxTableShape into own file and externalize

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

diff --git a/include/svx/unodraw/SvxTableShape.hxx 
b/include/svx/unodraw/SvxTableShape.hxx
new file mode 100644
index ..518d3ac2c06a
--- /dev/null
+++ b/include/svx/unodraw/SvxTableShape.hxx
@@ -0,0 +1,44 @@
+/* -*- 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 
+
+class SVXCORE_DLLPUBLIC SvxTableShape : public SvxShape
+{
+protected:
+// override these for special property handling in subcasses. Return true 
if property is handled
+virtual bool setPropertyValueImpl(const OUString& rName,
+  const SfxItemPropertyMapEntry* pProperty,
+  const css::uno::Any& rValue) override;
+virtual bool getPropertyValueImpl(const OUString& rName,
+  const SfxItemPropertyMapEntry* pProperty,
+  css::uno::Any& rValue) override;
+
+virtual void lock() override;
+virtual void unlock() override;
+
+public:
+explicit SvxTableShape(SdrObject* pObj);
+virtual ~SvxTableShape() noexcept override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/shapeimpl.hxx b/svx/source/unodraw/shapeimpl.hxx
index 0ccf22071194..44b3bcdea0e2 100644
--- a/svx/source/unodraw/shapeimpl.hxx
+++ b/svx/source/unodraw/shapeimpl.hxx
@@ -84,23 +84,6 @@ public:
 virtual void Create( SdrObject* pNewOpj, SvxDrawPage* pNewPage ) override;
 };
 
-
-class SvxTableShape : public SvxShape
-{
-protected:
-// override these for special property handling in subcasses. Return true 
if property is handled
-virtual bool setPropertyValueImpl( const OUString& rName, const 
SfxItemPropertyMapEntry* pProperty, const css::uno::Any& rValue ) override;
-virtual bool getPropertyValueImpl( const OUString& rName, const 
SfxItemPropertyMapEntry* pProperty, css::uno::Any& rValue ) override;
-
-virtual void lock() override;
-virtual void unlock() override;
-
-public:
-
-explicit SvxTableShape(SdrObject* pObj);
-virtual ~SvxTableShape() noexcept override;
-};
-
 SvxUnoPropertyMapProvider& getSvxMapProvider();
 
 #endif
diff --git a/svx/source/unodraw/tableshape.cxx 
b/svx/source/unodraw/tableshape.cxx
index 69823ea3043b..b9220516411a 100644
--- a/svx/source/unodraw/tableshape.cxx
+++ b/svx/source/unodraw/tableshape.cxx
@@ -21,6 +21,7 @@
 
 #include "UnoGraphicExporter.hxx"
 #include "shapeimpl.hxx"
+#include 
 #include 
 #include 
 #include 
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index f676e743e548..ee91c36c9afe 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include "shapeimpl.hxx"
+#include 
 #include 
 #include 
 #include 


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

2022-03-11 Thread Luboš Luňák (via logerrit)
 include/svx/framelink.hxx   |   11 +++
 svx/source/dialog/framelink.cxx |5 -
 2 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 6e88e4edfba146f6163e7a1173dbd4644b21432e
Author: Luboš Luňák 
AuthorDate: Fri Mar 11 08:49:17 2022 +0100
Commit: Luboš Luňák 
CommitDate: Fri Mar 11 15:37:13 2022 +0100

make svx::frame::Style ctor inline

ScDocument: :FillInfo() may result in calling it often.
Change-Id: I05d0582befc57c4959c33fae6dec3d340b8a49ba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131338
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/include/svx/framelink.hxx b/include/svx/framelink.hxx
index 2ee2a6f556e0..ae35185a4eb6 100644
--- a/include/svx/framelink.hxx
+++ b/include/svx/framelink.hxx
@@ -167,6 +167,17 @@ public:
 
 inline bool operator>( const Style& rL, const Style& rR ) { return 
rR.operator<(rL); }
 
+inline Style::Style()
+: mfPrim(0)
+, mfDist(0)
+, mfSecn(0)
+, mfPatternScale(1.0)
+, meRefMode(RefMode::Centered)
+, mnType(SvxBorderLineStyle::SOLID)
+, mbWordTableCell(false)
+, mbUseGapColor(false)
+{}
+
 }
 
 
diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx
index 6400eb33d8b0..77098bd3e80d 100644
--- a/svx/source/dialog/framelink.cxx
+++ b/svx/source/dialog/framelink.cxx
@@ -31,11 +31,6 @@ using namespace editeng;
 namespace svx::frame
 {
 
-Style::Style()
-{
-Clear();
-}
-
 Style::Style( double nP, double nD, double nS, SvxBorderLineStyle nType, 
double fScale )
 {
 Clear();


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

2022-02-25 Thread Armin Le Grand (Allotropia) (via logerrit)
 include/svx/strings.hrc   |1 +
 svx/source/svdraw/svdogrp.cxx |7 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 419fa8b13eef10297a5fd44012e89fd7af53cf9d
Author: Armin Le Grand (Allotropia) 
AuthorDate: Fri Feb 25 15:08:00 2022 +0100
Commit: Armin Le Grand 
CommitDate: Fri Feb 25 18:09:04 2022 +0100

Advanced Diagram support: Support Diagram info at ObjName

Change-Id: I30b1ca95d09ec73d3c21503cc3506141e845bac3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130537
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index a368a4c77906..37b9359959b4 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -25,6 +25,7 @@
 #define STR_ObjNameSingulNONE   
NC_("STR_ObjNameSingulNONE", "Drawing object")
 #define STR_ObjNamePluralNONE   
NC_("STR_ObjNamePluralNONE", "Drawing objects")
 #define STR_ObjNameSingulGRUP   
NC_("STR_ObjNameSingulGRUP", "Group object")
+#define STR_ObjNameSingulDIAGRAM
NC_("STR_ObjNameSingulDIAGAM", "Diagram")
 #define STR_ObjNamePluralGRUP   
NC_("STR_ObjNamePluralGRUP", "Group objects")
 #define STR_ObjNameSingulGRUPEMPTY  
NC_("STR_ObjNameSingulGRUPEMPTY", "Blank group object")
 #define STR_ObjNamePluralGRUPEMPTY  
NC_("STR_ObjNamePluralGRUPEMPTY", "Blank group objects")
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index dae41c92b2e8..d4b7d08c3328 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -276,7 +276,10 @@ OUString SdrObjGroup::TakeObjNameSingul() const
 }
 else
 {
-sName = SvxResId(STR_ObjNameSingulGRUP);
+if(isDiagram())
+sName = SvxResId(STR_ObjNameSingulDIAGRAM);
+else
+sName = SvxResId(STR_ObjNameSingulGRUP);
 }
 
 const OUString aName(GetName());
@@ -292,6 +295,8 @@ OUString SdrObjGroup::TakeObjNamePlural() const
 {
 if(0 == GetObjCount())
 return SvxResId(STR_ObjNamePluralGRUPEMPTY);
+if(isDiagram())
+return SvxResId(RID_GALLERYSTR_THEME_DIAGRAMS);
 return SvxResId(STR_ObjNamePluralGRUP);
 }
 


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

2022-02-23 Thread Justin Luth (via logerrit)
 include/svx/ruler.hxx   |3 ++-
 svx/source/dialog/rlrcitem.cxx  |2 +-
 svx/source/dialog/svxruler.cxx  |   13 -
 sw/source/uibase/uiview/viewtab.cxx |   22 +++---
 4 files changed, 26 insertions(+), 14 deletions(-)

New commits:
commit e87f9b4fa158b917bb38fc00513bae7f94024e58
Author: Justin Luth 
AuthorDate: Tue Feb 15 14:26:35 2022 +0200
Commit: Justin Luth 
CommitDate: Thu Feb 24 07:36:57 2022 +0100

tdf#95882 svxruler: restore adjustment for borders

This restores the clause removed from
LO 3.6's commit 47a77d7dbc427e51421e2df8d59695834cb74980
Ruler: disable snapping, tooltips

[Because that removal left behind dead code,
 which was later cleared out, of course this patch
 restores that as well.
commit 8303e7ed668fbcbd0ba75bd9dd259f03073ffd46
Author: Noel Grandin on Fri Jun 14 10:41:11 2019 +0200
]

Basic borders on the paragraph itself
do not affect where LO ends the tabstop,
and thus the removal of that clause was partially justified.
But the table/frame/page/headers definitely need to be adjusted
in order for the tabstops to show in the correct position.

RightFrameMargin needed this as well,
especially now that RTL is supported by the ruler since LO 3.6,
although the Left/Right functions are very different.

[Frames never worked because the aCoreSet wasn't accepting
 RES_BOX items. Interesting error considering all of the
 other sections of code created a new CoreSet.]

Change-Id: Ic24839dbbd730e66d8b0d588bfbd73bc7cb260bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130125
Tested-by: Justin Luth 
Reviewed-by: Justin Luth 

diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx
index 374209a73f69..010af4b17936 100644
--- a/include/svx/ruler.hxx
+++ b/include/svx/ruler.hxx
@@ -91,6 +91,7 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener
 std::unique_ptr mxULSpaceItem;// upper and lower 
edge
 std::unique_ptr mxTabStopItem;// tab stops
 std::unique_ptr mxParaItem;   // paragraphs
+std::unique_ptr mxBorderItem; // border distance
 std::unique_ptr mxPagePosItem;// page distance to 
the rule
 std::unique_ptr  mxColumnItem; // columns
 std::unique_ptr  mxObjectItem; // object
@@ -140,7 +141,7 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public 
SfxListener
 // paragraph indentations
 void UpdatePara(const SvxLRSpaceItem* pItem);
 // Border distance
-void UpdateParaBorder();
+void UpdateBorder(const SvxLRSpaceItem* pItem);
 // Tabs
 void Update(const SvxTabStopItem* pItem);
 // page position and width
diff --git a/svx/source/dialog/rlrcitem.cxx b/svx/source/dialog/rlrcitem.cxx
index 873663b27e30..a73cd00bdac5 100644
--- a/svx/source/dialog/rlrcitem.cxx
+++ b/svx/source/dialog/rlrcitem.cxx
@@ -131,7 +131,7 @@ void SvxRulerItem::StateChangedAtToolBoxControl( sal_uInt16 
nSID, SfxItemState e
 {
 const SvxLRSpaceItem *pItem = dynamic_cast( 
pState );
 SAL_WARN_IF(pState != nullptr && pItem == nullptr, "svx.dialog", 
"SvxLRSpaceItem expected");
-rRuler.UpdateParaBorder();
+rRuler.UpdateBorder(pItem);
 }
 break;
 case SID_RULER_TEXT_RIGHT_TO_LEFT :
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 6e960a18433d..d676c3c1208f 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -881,11 +881,16 @@ void SvxRuler::UpdatePara(const SvxLRSpaceItem *pItem) // 
new value of paragraph
 }
 }
 
-void SvxRuler::UpdateParaBorder()
+void SvxRuler::UpdateBorder(const SvxLRSpaceItem * pItem)
 {
 /* Border distance */
 if(bActive)
 {
+if (pItem)
+mxBorderItem.reset(new SvxLRSpaceItem(*pItem));
+else
+mxBorderItem.reset();
+
 StartListening_Impl();
 }
 }
@@ -1206,6 +1211,9 @@ tools::Long SvxRuler::GetLeftFrameMargin() const
 nLeft = mxColumnItem->GetActiveColumnDescription().nStart;
 }
 
+if (mxBorderItem && (!mxColumnItem || mxColumnItem->IsTable()))
+nLeft += mxBorderItem->GetLeft();
+
 return nLeft;
 }
 
@@ -1257,6 +1265,9 @@ tools::Long SvxRuler::GetRightFrameMargin() const
 else if(!bHorz && mxULSpaceItem)
 lResult += mxULSpaceItem->GetLower();
 
+if (bHorz && mxBorderItem && (!mxColumnItem || mxColumnItem->IsTable()))
+lResult += mxBorderItem->GetRight();
+
 if(bHorz)
 lResult = mxPagePosItem->GetWidth() - lResult;
 else
diff --git a/sw/source/uibase/uiview/viewtab.cxx 
b/sw/source/uibase/uiview/viewtab.cxx
index 6bf269219d9a..c911971fd314 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1699,6 +1699,8 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 {
 

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

2022-02-20 Thread Heiko Tietze (via logerrit)
 include/svx/compressgraphicdialog.hxx   |3 +
 svx/source/dialog/compressgraphicdialog.cxx |   51 
 2 files changed, 54 insertions(+)

New commits:
commit 90546b02d70cb9a9c3ee88428d99635a2f7eb22a
Author: Heiko Tietze 
AuthorDate: Mon Feb 14 08:23:45 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sun Feb 20 22:17:57 2022 +0100

Resolves tdf#146929 - Remember user input for the compress dialog

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

diff --git a/include/svx/compressgraphicdialog.hxx 
b/include/svx/compressgraphicdialog.hxx
index 1ef8d387bf62..87556ecbce1d 100644
--- a/include/svx/compressgraphicdialog.hxx
+++ b/include/svx/compressgraphicdialog.hxx
@@ -51,6 +51,7 @@ private:
 std::unique_ptrm_xQualitySlider;
 std::unique_ptr   m_xBtnCalculate;
 std::unique_ptr m_xInterpolationCombo;
+std::unique_ptr   m_xBtnOkay;
 
 SdrGrafObj* m_xGraphicObj;
 Graphic m_aGraphic;
@@ -62,6 +63,7 @@ private:
 sal_Int32   m_aNativeSize;
 
 void Initialize();
+void recallParameter();
 
 DECL_DLLPRIVATE_LINK( SlideHdl, weld::Scale&, void );
 DECL_DLLPRIVATE_LINK( NewInterpolationModifiedHdl, weld::ComboBox&, void );
@@ -74,6 +76,7 @@ private:
 DECL_DLLPRIVATE_LINK( ToggleReduceResolutionRB, weld::Toggleable&, void );
 
 DECL_DLLPRIVATE_LINK( CalculateClickHdl, weld::Button&, void );
+DECL_DLLPRIVATE_LINK( OkayClickHdl, weld::Button&, void );
 
 void Update();
 void UpdateNewWidthMF();
diff --git a/svx/source/dialog/compressgraphicdialog.cxx 
b/svx/source/dialog/compressgraphicdialog.cxx
index 1eb6a32501f2..7c9a8a44be33 100644
--- a/svx/source/dialog/compressgraphicdialog.cxx
+++ b/svx/source/dialog/compressgraphicdialog.cxx
@@ -39,6 +39,23 @@
 #include 
 #include 
 
+// tdf#146929 - remember user settings within the currect session
+// memp is filled in dtor and restored after initialization
+namespace
+{
+struct memParam {
+bool ReduceResolutionCB = false;
+int  MFNewWidth = 1;
+int  MFNewHeight = 1;
+bool LosslessRB = true;
+bool JpegCompRB = false;
+int  CompressionMF = 6;
+int  QualityMF = 80;
+int  InterpolationCombo = 3;
+};
+memParam memp;
+}
+
 using namespace com::sun::star::uno;
 using namespace com::sun::star::beans;
 
@@ -66,12 +83,31 @@ CompressGraphicsDialog::CompressGraphicsDialog( 
weld::Window* pParent, Graphic c
 m_dResolution ( 300 )
 {
 Initialize();
+recallParameter();
 }
 
 CompressGraphicsDialog::~CompressGraphicsDialog()
 {
 }
 
+void CompressGraphicsDialog::recallParameter()
+{
+m_xReduceResolutionCB->set_active( memp.ReduceResolutionCB );
+if (memp.ReduceResolutionCB && (memp.MFNewWidth > 1))
+m_xMFNewWidth->set_value( memp.MFNewWidth );
+if (memp.ReduceResolutionCB && (memp.MFNewHeight > 1))
+m_xMFNewHeight->set_value( memp.MFNewHeight );
+
+m_xLosslessRB->set_active( memp.LosslessRB );
+m_xJpegCompRB->set_active( memp.JpegCompRB );
+m_xCompressionMF->set_value( memp.CompressionMF );
+m_xCompressionSlider->set_value( memp.CompressionMF );
+m_xQualityMF->set_value( memp.QualityMF );
+m_xQualitySlider->set_value( memp.QualityMF );
+
+m_xInterpolationCombo->set_active( memp.InterpolationCombo );
+}
+
 void CompressGraphicsDialog::Initialize()
 {
 m_xLabelGraphicType = m_xBuilder->weld_label("label-graphic-type");
@@ -91,6 +127,7 @@ void CompressGraphicsDialog::Initialize()
 m_xResolutionLB = m_xBuilder->weld_combo_box("combo-resolution");
 m_xBtnCalculate = m_xBuilder->weld_button("calculate");
 m_xInterpolationCombo = 
m_xBuilder->weld_combo_box("interpolation-method-combo");
+m_xBtnOkay = m_xBuilder->weld_button("ok");
 
 m_xInterpolationCombo->set_active_text("Lanczos");
 
@@ -115,6 +152,7 @@ void CompressGraphicsDialog::Initialize()
 m_xJpegCompRB->set_active(true);
 m_xReduceResolutionCB->set_active(true);
 
+m_xBtnOkay->connect_clicked( LINK( this, CompressGraphicsDialog, 
OkayClickHdl ) );
 UpdateNewWidthMF();
 UpdateNewHeightMF();
 UpdateResolutionLB();
@@ -235,6 +273,19 @@ void CompressGraphicsDialog::Compress(SvStream& aStream)
 rFilter.ExportGraphic( aScaledGraphic, "none", aStream, nFilterFormat, 
 );
 }
 
+IMPL_LINK_NOARG( CompressGraphicsDialog, OkayClickHdl, weld::Button&, void )
+{
+memp.ReduceResolutionCB = m_xReduceResolutionCB->get_active();
+memp.MFNewWidth = m_xMFNewWidth->get_value();
+memp.MFNewHeight =m_xMFNewHeight->get_value();
+memp.LosslessRB = m_xLosslessRB->get_active();
+memp.JpegCompRB = m_xJpegCompRB->get_active();
+memp.CompressionMF =  m_xCompressionMF->get_value();
+memp.QualityMF =  m_xQualityMF->get_value();
+

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

2022-02-10 Thread Noel Grandin (via logerrit)
 include/svx/shapepropertynotifier.hxx|   37 ---
 svx/source/unodraw/shapepropertynotifier.cxx |4 +-
 2 files changed, 14 insertions(+), 27 deletions(-)

New commits:
commit a2cee820e5e204058a721c59f2c5df8d8a2a3ca8
Author: Noel Grandin 
AuthorDate: Thu Feb 10 20:47:03 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 11 05:52:11 2022 +0100

merge IPropertyValueProvider into PropertyValueProvider

nothing directly extends IPropertyValueProvider

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

diff --git a/include/svx/shapepropertynotifier.hxx 
b/include/svx/shapepropertynotifier.hxx
index e736545b5ad8..a14fd1e597a3 100644
--- a/include/svx/shapepropertynotifier.hxx
+++ b/include/svx/shapepropertynotifier.hxx
@@ -54,32 +54,14 @@ namespace svx
 LAST = TextDocAnchor
 };
 
-//= IPropertyValueProvider
-
-/** a provider for a property value
-*/
-class SVXCORE_DLLPUBLIC IPropertyValueProvider
-{
-public:
-/** returns the name of the property which this provider is 
responsible for
-*/
-virtual const OUString & getPropertyName() const = 0;
-
-/** returns the current value of the property which the provider is 
responsible for
-*/
-virtual void getCurrentValue( css::uno::Any& _out_rValue ) const = 0;
-
-virtual ~IPropertyValueProvider();
-};
-
 //= PropertyValueProvider
 
-/** default implementation of an IPropertyValueProvider
+/** Default provider for a property value
 
 This default implementation queries the object which it is constructed 
with for the XPropertySet interface,
 and calls the getPropertyValue method.
 */
-class SVXCORE_DLLPUBLIC PropertyValueProvider   :public 
IPropertyValueProvider
+class SVXCORE_DLLPUBLIC PropertyValueProvider
 {
 public:
 PropertyValueProvider( ::cppu::OWeakObject& _rContext, const char* 
_pAsciiPropertyName )
@@ -87,9 +69,14 @@ namespace svx
 ,m_sPropertyName( OUString::createFromAscii( _pAsciiPropertyName ) 
)
 {
 }
+virtual ~PropertyValueProvider();
 
-virtual const OUString & getPropertyName() const override;
-virtual void getCurrentValue( css::uno::Any& _out_rValue ) const 
override;
+/** returns the name of the property which this provider is 
responsible for
+*/
+const OUString & getPropertyName() const;
+/** returns the current value of the property which the provider is 
responsible for
+*/
+virtual void getCurrentValue( css::uno::Any& _out_rValue ) const;
 
 protected:
 ::cppu::OWeakObject&getContext() const { return m_rContext; }
@@ -122,9 +109,9 @@ namespace svx
 void addPropertyChangeListener( const OUString& _rPropertyName, const 
css::uno::Reference< css::beans::XPropertyChangeListener >& _rxListener );
 void removePropertyChangeListener( const OUString& _rPropertyName, 
const css::uno::Reference< css::beans::XPropertyChangeListener >& _rxListener );
 
-/** registers an IPropertyValueProvider
+/** registers an PropertyValueProvider
 */
-voidregisterProvider( const ShapePropertyProviderId _eProperty, 
std::unique_ptr _rProvider );
+voidregisterProvider( const ShapePropertyProviderId _eProperty, 
std::unique_ptr _rProvider );
 
 /** notifies changes in the given property to all registered listeners
 
@@ -142,7 +129,7 @@ namespace svx
 PropertyChangeNotifier& operator=(const PropertyChangeNotifier&) = 
delete;
 
 ::cppu::OWeakObject&m_rContext;
-o3tl::enumarray>  m_aProviders;
+o3tl::enumarray>  m_aProviders;
 
comphelper::OMultiTypeInterfaceContainerHelperVar3 m_aPropertyChangeListeners;
 };
 
diff --git a/svx/source/unodraw/shapepropertynotifier.cxx 
b/svx/source/unodraw/shapepropertynotifier.cxx
index 7d1ca70c50ec..ef68a767c9c0 100644
--- a/svx/source/unodraw/shapepropertynotifier.cxx
+++ b/svx/source/unodraw/shapepropertynotifier.cxx
@@ -47,7 +47,7 @@ namespace svx
 using ::com::sun::star::lang::EventObject;
 using ::com::sun::star::beans::XPropertySet;
 
-IPropertyValueProvider::~IPropertyValueProvider()
+PropertyValueProvider::~PropertyValueProvider()
 {
 }
 
@@ -76,7 +76,7 @@ namespace svx
 {
 }
 
-void PropertyChangeNotifier::registerProvider(const 
ShapePropertyProviderId _eProperty, std::unique_ptr 
_rProvider)
+void PropertyChangeNotifier::registerProvider(const 
ShapePropertyProviderId _eProperty, std::unique_ptr 
_rProvider)
 {
 assert( _rProvider && "NULL factory not allowed." );
 


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

2022-02-10 Thread Noel Grandin (via logerrit)
 include/svx/shapepropertynotifier.hxx|4 ++--
 svx/source/unodraw/shapepropertynotifier.cxx |4 ++--
 svx/source/unodraw/unoshape.cxx  |4 ++--
 sw/source/core/unocore/unodraw.cxx   |4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 1db6e8b7760de1abd49d62df230d89480ffd2161
Author: Noel Grandin 
AuthorDate: Thu Feb 10 16:02:48 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 10 17:20:19 2022 +0100

no need to use shared_ptr in PropertyChangeNotifier

these things are never shared

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

diff --git a/include/svx/shapepropertynotifier.hxx 
b/include/svx/shapepropertynotifier.hxx
index b26525c63f7b..779eb66e9485 100644
--- a/include/svx/shapepropertynotifier.hxx
+++ b/include/svx/shapepropertynotifier.hxx
@@ -113,7 +113,7 @@ namespace svx
 
 /** registers an IPropertyValueProvider
 */
-voidregisterProvider( const ShapeProperty _eProperty, const 
std::shared_ptr& _rProvider );
+voidregisterProvider( const ShapeProperty _eProperty, 
std::unique_ptr _rProvider );
 
 /** notifies changes in the given property to all registered listeners
 
@@ -137,7 +137,7 @@ namespace svx
 return size_t( x );
 }
 };
-typedef std::unordered_map< ShapeProperty, 
std::shared_ptr, ShapePropertyHash  >
+typedef std::unordered_map< ShapeProperty, 
std::unique_ptr, ShapePropertyHash  >
 PropertyProviders;
 ::cppu::OWeakObject&m_rContext;
 PropertyProviders   m_aProviders;
diff --git a/svx/source/unodraw/shapepropertynotifier.cxx 
b/svx/source/unodraw/shapepropertynotifier.cxx
index 9151190c0cda..6b2262e044f1 100644
--- a/svx/source/unodraw/shapepropertynotifier.cxx
+++ b/svx/source/unodraw/shapepropertynotifier.cxx
@@ -76,14 +76,14 @@ namespace svx
 {
 }
 
-void PropertyChangeNotifier::registerProvider(const ShapeProperty 
_eProperty, const std::shared_ptr& _rProvider)
+void PropertyChangeNotifier::registerProvider(const ShapeProperty 
_eProperty, std::unique_ptr _rProvider)
 {
 ENSURE_OR_THROW( !!_rProvider, "NULL factory not allowed." );
 
 OSL_ENSURE( m_aProviders.find( _eProperty ) == m_aProviders.end(),
 "PropertyChangeNotifier::registerProvider: factory for this ID 
already present!" );
 
-m_aProviders[ _eProperty ] = _rProvider;
+m_aProviders.emplace( _eProperty, std::move(_rProvider));
 }
 
 void PropertyChangeNotifier::notifyPropertyChange( const ShapeProperty 
_eProperty ) const
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 4081e4d8128f..cb0aa12afd9a 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -325,9 +325,9 @@ svx::PropertyChangeNotifier& 
SvxShape::getShapePropertyChangeNotifier()
 void SvxShape::impl_construct()
 {
 mpImpl->maPropertyNotifier.registerProvider( svx::ShapeProperty::Position,
-std::make_shared( *mpImpl ) );
+std::make_unique( *mpImpl ) );
 mpImpl->maPropertyNotifier.registerProvider( svx::ShapeProperty::Size,
-std::make_shared( *mpImpl ) );
+std::make_unique( *mpImpl ) );
 
 if ( HasSdrObject() )
 {
diff --git a/sw/source/core/unocore/unodraw.cxx 
b/sw/source/core/unocore/unodraw.cxx
index 66deb6769321..31efe7812410 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -865,8 +865,8 @@ namespace
 {
 void lcl_addShapePropertyEventFactories( SdrObject& _rObj, SwXShape& 
_rShape )
 {
-auto pProvider = std::make_shared( 
_rShape, "AnchorType" );
-_rObj.getShapePropertyChangeNotifier().registerProvider( 
svx::ShapeProperty::TextDocAnchor, pProvider );
+auto pProvider = std::make_unique( 
_rShape, "AnchorType" );
+_rObj.getShapePropertyChangeNotifier().registerProvider( 
svx::ShapeProperty::TextDocAnchor, std::move(pProvider) );
 }
 }
 


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

2022-02-02 Thread Noel Grandin (via logerrit)
 include/svx/svxids.hrc  |4 ++--
 svx/source/sidebar/graphic/GraphicPropertyPanel.cxx |9 -
 2 files changed, 6 insertions(+), 7 deletions(-)

New commits:
commit 895a1e89e2b3e37eb1a2fd0dd494ddd385bd0456
Author: Noel Grandin 
AuthorDate: Wed Feb 2 13:24:47 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 3 08:15:31 2022 +0100

SID_ATTR_GRAF_TRANSPARENCE and SID_ATTR_GRAF_MODE have conflicting types

Meant to be SfxUInt16Item, until the below commit accidentally
introduced SfxInt16Item usage.

commit 4d814ec1518c98d2ca251a5a10287f40a427ea6e
Author: Armin Le Grand 
Date:   Wed Apr 24 09:50:54 2013 +
Related: #i122111# Adapted pState usages in NotifyItemUpdate methods

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

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index fb974d2af8b4..07d10bb1ee97 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -712,9 +712,9 @@ class XFillGradientItem;
 #define SID_ATTR_GRAF_GREEN ( SID_SVX_START + 866 )
 #define SID_ATTR_GRAF_BLUE  ( SID_SVX_START + 867 )
 #define SID_ATTR_GRAF_GAMMA ( SID_SVX_START + 868 )
-#define SID_ATTR_GRAF_TRANSPARENCE  ( SID_SVX_START + 869 )
+#define SID_ATTR_GRAF_TRANSPARENCE  
TypedWhichId( SID_SVX_START + 869 )
 #define SID_ATTR_GRAF_INVERT( SID_SVX_START + 870 )
-#define SID_ATTR_GRAF_MODE  ( SID_SVX_START + 871 )
+#define SID_ATTR_GRAF_MODE  
TypedWhichId( SID_SVX_START + 871 )
 
 // CAUTION! Range <877 .. 877> used by EditEngine (!)
 
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx 
b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
index 5fb1e4448c71..5503649551e6 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
@@ -108,7 +108,7 @@ IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyContrastHdl, 
weld::MetricSpinButton
 IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyTransHdl, 
weld::MetricSpinButton&, void )
 {
 const sal_Int16 nTrans = mxMtrTrans->get_value(FieldUnit::PERCENT);
-const SfxInt16Item aTransItem( SID_ATTR_GRAF_TRANSPARENCE, nTrans );
+const SfxUInt16Item aTransItem( SID_ATTR_GRAF_TRANSPARENCE, nTrans );
 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_TRANSPARENCE,
 SfxCallMode::RECORD, {  });
 }
@@ -117,7 +117,7 @@ IMPL_LINK_NOARG( GraphicPropertyPanel, ModifyTransHdl, 
weld::MetricSpinButton&,
 IMPL_LINK_NOARG( GraphicPropertyPanel, ClickColorModeHdl, weld::ComboBox&, 
void )
 {
 const sal_Int16 nTrans = mxLBColorMode->get_active();
-const SfxInt16Item aTransItem( SID_ATTR_GRAF_MODE, nTrans );
+const SfxUInt16Item aTransItem( SID_ATTR_GRAF_MODE, nTrans );
 GetBindings()->GetDispatcher()->ExecuteList(SID_ATTR_GRAF_MODE,
 SfxCallMode::RECORD, {  });
 }
@@ -218,11 +218,10 @@ void GraphicPropertyPanel::NotifyItemUpdate(
 if(eState >= SfxItemState::DEFAULT)
 {
 mxLBColorMode->set_sensitive(true);
-const SfxUInt16Item* pItem = dynamic_cast< const 
SfxUInt16Item* >(pState);
 
-if(pItem)
+if(pState)
 {
-const sal_Int64 nTrans = pItem->GetValue();
+const sal_uInt16 nTrans = static_cast< const 
SfxUInt16Item* >(pState)->GetValue();
 mxLBColorMode->set_active(nTrans);
 }
 }


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

2022-01-31 Thread Noel Grandin (via logerrit)
 include/svx/sdr/contact/viewcontactofsdrobj.hxx |3 +++
 svx/source/sdr/contact/viewcontactofsdrobj.cxx  |   14 ++
 2 files changed, 17 insertions(+)

New commits:
commit 36d75660ee5f3d2f9b433935e2c5d689767804fc
Author: Noel Grandin 
AuthorDate: Mon Jan 31 14:51:05 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 31 15:06:32 2022 +0100

tdf#146860 Vertical alignment of text inside grouped shapes textbox 
incorrect

some stupid side effect at work

regression from
commit c1916d3ab8f764e465f889334050ce7c863576b3
Author: Noel Grandin 
Date:   Wed Dec 8 12:25:58 2021 +0200
meRememberedAnimationKind is dead

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

diff --git a/include/svx/sdr/contact/viewcontactofsdrobj.hxx 
b/include/svx/sdr/contact/viewcontactofsdrobj.hxx
index d7c432643f92..788c8058d9f5 100644
--- a/include/svx/sdr/contact/viewcontactofsdrobj.hxx
+++ b/include/svx/sdr/contact/viewcontactofsdrobj.hxx
@@ -55,6 +55,9 @@ public:
 virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const override;
 virtual ViewContact* GetParentContact() const override;
 
+// React on changes of the object of this ViewContact
+virtual void ActionChanged() override;
+
 /// override for accessing the SdrObject
 virtual SdrObject* TryToGetSdrObject() const override;
 
diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx 
b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
index 3973f5349038..1483b57645f8 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
@@ -94,6 +94,20 @@ ViewContact* ViewContactOfSdrObj::GetParentContact() const
 return pRetval;
 }
 
+// React on changes of the object of this ViewContact
+void ViewContactOfSdrObj::ActionChanged()
+{
+// look for own changes
+if (SdrTextObj* pTextObj = dynamic_cast(()))
+{
+//  tdf#146860 no idea why, but calling this makes the text boxes 
render properly
+pTextObj->GetTextAniKind();
+}
+
+// call parent
+ViewContact::ActionChanged();
+}
+
 // override for accessing the SdrObject
 SdrObject* ViewContactOfSdrObj::TryToGetSdrObject() const
 {


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

2022-01-04 Thread Noel Grandin (via logerrit)
 include/svx/svdpage.hxx   |3 ++-
 svx/source/svdraw/svdpage.cxx |5 +
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 746127cf803070c5a695a7cb30a2ecdb5a777e75
Author: Noel Grandin 
AuthorDate: Tue Jan 4 14:07:13 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue Jan 4 16:06:08 2022 +0100

use deque in SdrObjList

which has much better performance for
(a) inserting stuff at the front
(b) appending large numbers of items

something that happens when constructing large charts - shaves 5% off
the load time for large sample bar chart

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

diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 065590e85b9a..83c0592f060e 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 
 // predefines
@@ -225,7 +226,7 @@ public:
 private:
 tools::RectanglemaSdrObjListOutRect;
 tools::RectanglemaSdrObjListSnapRect;
-std::vector maList;
+std::deque maList;
 /// This list, if it exists, defines the navigation order. If it does
 /// not exist then maList defines the navigation order.
 std::optional>> 
mxNavigationOrder;
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 99c6ab9d3185..d4322e3a8720 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -58,8 +58,6 @@
 
 using namespace ::com::sun::star;
 
-const sal_Int32 InitialObjectContainerCapacity (64);
-
 //
 
 SdrObjList::SdrObjList()
@@ -67,7 +65,6 @@ SdrObjList::SdrObjList()
 mbRectsDirty(false),
 mbIsNavigationOrderDirty(false)
 {
-maList.reserve(InitialObjectContainerCapacity);
 }
 
 void SdrObjList::impClearSdrObjList(bool bBroadcast)
@@ -641,7 +638,7 @@ void SdrObjList::sort( std::vector& sortOrder)
 // example maList [T T S T T] ( T T = shape with textbox, S = just a shape 
)
 // (shapes at positions 0 and 2 have a textbox)
 
-std::vector aNewList(maList.size());
+std::deque aNewList(maList.size());
 std::set aShapesWithTextbox;
 std::vector aIncrements;
 std::vector aDuplicates;


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

2021-12-30 Thread Armin Le Grand (Allotropia) (via logerrit)
 include/svx/framelinkarray.hxx   |3 
 svx/source/dialog/framelinkarray.cxx |  290 ---
 2 files changed, 235 insertions(+), 58 deletions(-)

New commits:
commit 11dd4c918749839867568651f0c62db30fdda297
Author: Armin Le Grand (Allotropia) 
AuthorDate: Wed Dec 29 18:01:05 2021 +0100
Commit: Armin Le Grand 
CommitDate: Thu Dec 30 16:00:43 2021 +0100

tdf#126269 Add clipping to diagonal border lines

See task for in-deep discussion. Needed to do some
re-arrangements to add clipping to diagonal border
lines. It is necessary to only clip visible geometry
but not touch vectors that get added to be able to
solve all that dynamic border line style start/end
overlapping.

Change-Id: I656a5cd63a011140ee1281873e44ab5e60606b67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127713
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/include/svx/framelinkarray.hxx b/include/svx/framelinkarray.hxx
index 46b17c025641..d46b3762a331 100644
--- a/include/svx/framelinkarray.hxx
+++ b/include/svx/framelinkarray.hxx
@@ -293,6 +293,9 @@ public:
 Returns total output range of merged ranges, if bExpandMerged is true. 
*/
 basegfx::B2DRange GetCellRange( sal_Int32 nCol, sal_Int32 nRow, bool 
bExpandMerged ) const;
 
+// return output range of given row/col range in logical coordinates
+basegfx::B2DRange GetB2DRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, 
sal_Int32 nLastCol, sal_Int32 nLastRow ) const;
+
 // mirroring
 
 /** Mirrors the entire array horizontally. */
diff --git a/svx/source/dialog/framelinkarray.cxx 
b/svx/source/dialog/framelinkarray.cxx
index 46d9629bf233..568043c7a8f8 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -28,6 +28,13 @@
 #include 
 #include 
 #include 
+#include 
+
+//#define OPTICAL_CHECK_CLIPRANGE_FOR_MERGED_CELL
+#ifdef OPTICAL_CHECK_CLIPRANGE_FOR_MERGED_CELL
+#include 
+#include 
+#endif
 
 namespace svx::frame {
 
@@ -43,6 +50,9 @@ private:
 Style   maTLBR;
 Style   maBLTR;
 
+basegfx::B2DHomMatrix HelperCreateB2DHomMatrixFromB2DRange(
+const basegfx::B2DRange& rRange ) const;
+
 public:
 sal_Int32mnAddLeft;
 sal_Int32mnAddRight;
@@ -78,55 +88,90 @@ public:
 
 voidMirrorSelfX();
 
-basegfx::B2DHomMatrix CreateCoordinateSystem(const Array& rArray, 
sal_Int32 nCol, sal_Int32 nRow, bool bExpandMerged) const;
+basegfx::B2DHomMatrix CreateCoordinateSystemSingleCell(
+const Array& rArray, sal_Int32 nCol, sal_Int32 nRow ) const;
+basegfx::B2DHomMatrix CreateCoordinateSystemMergedCell(
+const Array& rArray, sal_Int32 nColLeft, sal_Int32 nRowTop, sal_Int32 
nColRight, sal_Int32 nRowBottom ) const;
 };
 
 }
 
 typedef std::vector< Cell > CellVec;
 
-basegfx::B2DHomMatrix Cell::CreateCoordinateSystem(const Array& rArray, 
sal_Int32 nCol, sal_Int32 nRow, bool bExpandMerged) const
+basegfx::B2DHomMatrix Cell::HelperCreateB2DHomMatrixFromB2DRange(
+const basegfx::B2DRange& rRange ) const
 {
-basegfx::B2DHomMatrix aRetval;
-const basegfx::B2DRange aRange(rArray.GetCellRange(nCol, nRow, 
bExpandMerged));
+if( rRange.isEmpty() )
+return basegfx::B2DHomMatrix();
+
+basegfx::B2DPoint aOrigin(rRange.getMinimum());
+basegfx::B2DVector aX(rRange.getWidth(), 0.0);
+basegfx::B2DVector aY(0.0, rRange.getHeight());
 
-if(!aRange.isEmpty())
+if (IsRotated() && SvxRotateMode::SVX_ROTATE_MODE_STANDARD != meRotMode )
 {
-basegfx::B2DPoint aOrigin(aRange.getMinimum());
-basegfx::B2DVector aX(aRange.getWidth(), 0.0);
-basegfx::B2DVector aY(0.0, aRange.getHeight());
+// when rotated, adapt values. Get Skew (cos/sin == 1/tan)
+const double fSkew(aY.getY() * (cos(mfOrientation) / 
sin(mfOrientation)));
 
-if (IsRotated() && SvxRotateMode::SVX_ROTATE_MODE_STANDARD != 
meRotMode)
+switch (meRotMode)
 {
-// when rotated, adapt values. Get Skew (cos/sin == 1/tan)
-const double fSkew(aY.getY() * (cos(mfOrientation) / 
sin(mfOrientation)));
-
-switch (meRotMode)
-{
-case SvxRotateMode::SVX_ROTATE_MODE_TOP:
-// shear Y-Axis
-aY.setX(-fSkew);
-break;
-case SvxRotateMode::SVX_ROTATE_MODE_CENTER:
-// shear origin half, Y full
-aOrigin.setX(aOrigin.getX() + (fSkew * 0.5));
-aY.setX(-fSkew);
-break;
-case SvxRotateMode::SVX_ROTATE_MODE_BOTTOM:
-// shear origin full, Y full
-aOrigin.setX(aOrigin.getX() + fSkew);
-aY.setX(-fSkew);
-break;
-default: // SvxRotateMode::SVX_ROTATE_MODE_STANDARD, already 
excluded above
-break;
-  

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

2021-12-29 Thread Noel Grandin (via logerrit)
 include/svx/sidebar/SelectionChangeHandler.hxx |   10 --
 svx/source/sidebar/SelectionChangeHandler.cxx  |5 ++---
 2 files changed, 6 insertions(+), 9 deletions(-)

New commits:
commit b66bc8fb918acd19ee0bd02312e7506db43d8317
Author: Noel Grandin 
AuthorDate: Wed Dec 29 08:23:12 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Dec 29 17:58:05 2021 +0100

use comphelper::WeakComponentImplHelper in 
svx::sidebar::SelectionChangeHandler

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

diff --git a/include/svx/sidebar/SelectionChangeHandler.hxx 
b/include/svx/sidebar/SelectionChangeHandler.hxx
index 4f5c5b818b5f..a4d5dbc32f96 100644
--- a/include/svx/sidebar/SelectionChangeHandler.hxx
+++ b/include/svx/sidebar/SelectionChangeHandler.hxx
@@ -24,8 +24,7 @@
 #include 
 #include 
 
-#include 
-#include 
+#include 
 
 #include 
 
@@ -34,13 +33,12 @@ class SdrMarkView;
 
 namespace svx::sidebar {
 
-typedef cppu::WeakComponentImplHelper<
+typedef comphelper::WeakComponentImplHelper<
 css::view::XSelectionChangeListener
 > SelectionChangeHandlerInterfaceBase;
 
 class SVX_DLLPUBLIC SelectionChangeHandler final
-: private ::cppu::BaseMutex,
-  public SelectionChangeHandlerInterfaceBase
+: public SelectionChangeHandlerInterfaceBase
 {
 public:
 SelectionChangeHandler (
@@ -53,7 +51,7 @@ public:
 
 virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent) 
override;
 
-virtual void SAL_CALL disposing() override;
+virtual void disposing(std::unique_lock&) override;
 
 void Connect();
 void Disconnect();
diff --git a/svx/source/sidebar/SelectionChangeHandler.cxx 
b/svx/source/sidebar/SelectionChangeHandler.cxx
index c015578e8671..f4ef4d8934d1 100644
--- a/svx/source/sidebar/SelectionChangeHandler.cxx
+++ b/svx/source/sidebar/SelectionChangeHandler.cxx
@@ -33,8 +33,7 @@ SelectionChangeHandler::SelectionChangeHandler (
 const std::function& rSelectionChangeCallback,
 const Reference& rxController,
 const vcl::EnumContext::Context eDefaultContext)
-: SelectionChangeHandlerInterfaceBase(m_aMutex),
-  maSelectionChangeCallback(rSelectionChangeCallback),
+: maSelectionChangeCallback(rSelectionChangeCallback),
   mxController(rxController),
   meDefaultContext(eDefaultContext),
   mbIsConnected(false)
@@ -67,7 +66,7 @@ void SAL_CALL SelectionChangeHandler::disposing (const 
lang::EventObject&)
 }
 
 
-void SAL_CALL SelectionChangeHandler::disposing()
+void SelectionChangeHandler::disposing(std::unique_lock&)
 {
 if (mbIsConnected)
 Disconnect();


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

2021-12-26 Thread Noel Grandin (via logerrit)
 include/svx/xmleohlp.hxx|8 +++-
 svx/source/xml/xmleohlp.cxx |   16 
 sw/source/filter/xml/wrtxml.cxx |1 +
 sw/source/filter/xml/xmlexp.cxx |1 +
 4 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 7313b9ecf2285768563d82c19715d34b7c66d5ef
Author: Noel Grandin 
AuthorDate: Fri Dec 24 10:09:09 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Dec 26 10:25:12 2021 +0100

use comphelper::WeakComponentImplHelper in SvXMLEmbeddedObjectHelper

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

diff --git a/include/svx/xmleohlp.hxx b/include/svx/xmleohlp.hxx
index aa3c6764ebde..55682f16c51a 100644
--- a/include/svx/xmleohlp.hxx
+++ b/include/svx/xmleohlp.hxx
@@ -20,8 +20,7 @@
 #ifndef INCLUDED_SVX_XMLEOHLP_HXX
 #define INCLUDED_SVX_XMLEOHLP_HXX
 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -44,8 +43,7 @@ class OutputStorageWrapper_Impl;
 
 
 class SVXCORE_DLLPUBLIC SvXMLEmbeddedObjectHelper final :
-public cppu::BaseMutex,
-public cppu::WeakComponentImplHelper< 
css::document::XEmbeddedObjectResolver, css::container::XNameAccess >
+public comphelper::WeakComponentImplHelper< 
css::document::XEmbeddedObjectResolver, css::container::XNameAccess >
 {
 OUString maCurContainerStorageName;
 
@@ -88,7 +86,7 @@ class SVXCORE_DLLPUBLIC SvXMLEmbeddedObjectHelper final :
   ::comphelper::IEmbeddedHelper& 
rDocPersist,
   SvXMLEmbeddedObjectHelperMode 
eCreateMode );
 
-virtual void SAL_CALL   disposing() override;
+virtual voiddisposing(std::unique_lock&) 
override;
 
 public:
 SvXMLEmbeddedObjectHelper(
diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx
index 0f33e96c03a1..fdb43fdd6fd2 100644
--- a/svx/source/xml/xmleohlp.cxx
+++ b/svx/source/xml/xmleohlp.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -120,14 +121,12 @@ void SAL_CALL OutputStorageWrapper_Impl::closeOutput()
 }
 
 SvXMLEmbeddedObjectHelper::SvXMLEmbeddedObjectHelper() :
-WeakComponentImplHelper< XEmbeddedObjectResolver, XNameAccess >( m_aMutex 
),
 mpDocPersist( nullptr ),
 meCreateMode( SvXMLEmbeddedObjectHelperMode::Read )
 {
 }
 
 SvXMLEmbeddedObjectHelper::SvXMLEmbeddedObjectHelper( 
::comphelper::IEmbeddedHelper& rDocPersist, SvXMLEmbeddedObjectHelperMode 
eCreateMode ) :
-WeakComponentImplHelper< XEmbeddedObjectResolver, XNameAccess >( m_aMutex 
),
 mpDocPersist( nullptr ),
 meCreateMode( SvXMLEmbeddedObjectHelperMode::Read )
 {
@@ -138,11 +137,12 @@ SvXMLEmbeddedObjectHelper::~SvXMLEmbeddedObjectHelper()
 {
 }
 
-void SAL_CALL SvXMLEmbeddedObjectHelper::disposing()
+void SvXMLEmbeddedObjectHelper::disposing(std::unique_lock&)
 {
 if( mxTempStorage.is() )
 {
 mxTempStorage->dispose();
+mxTempStorage.clear();
 }
 }
 
@@ -546,7 +546,7 @@ rtl::Reference 
SvXMLEmbeddedObjectHelper::Create(
 
 OUString SAL_CALL SvXMLEmbeddedObjectHelper::resolveEmbeddedObjectURL(const 
OUString& rURL)
 {
-MutexGuard  aGuard( m_aMutex );
+std::unique_lock  aGuard( m_aMutex );
 
 OUString sRet;
 try
@@ -571,7 +571,7 @@ OUString SAL_CALL 
SvXMLEmbeddedObjectHelper::resolveEmbeddedObjectURL(const OUSt
 Any SAL_CALL SvXMLEmbeddedObjectHelper::getByName(
 const OUString& rURLStr )
 {
-MutexGuard  aGuard( m_aMutex );
+std::unique_lock  aGuard( m_aMutex );
 Any aRet;
 if( SvXMLEmbeddedObjectHelperMode::Read == meCreateMode )
 {
@@ -672,7 +672,7 @@ Sequence< OUString > SAL_CALL 
SvXMLEmbeddedObjectHelper::getElementNames()
 
 sal_Bool SAL_CALL SvXMLEmbeddedObjectHelper::hasByName( const OUString& 
rURLStr )
 {
-MutexGuard  aGuard( m_aMutex );
+std::unique_lock  aGuard( m_aMutex );
 if( SvXMLEmbeddedObjectHelperMode::Read == meCreateMode )
 {
 return true;
@@ -694,7 +694,7 @@ sal_Bool SAL_CALL SvXMLEmbeddedObjectHelper::hasByName( 
const OUString& rURLStr
 // XNameAccess
 Type SAL_CALL SvXMLEmbeddedObjectHelper::getElementType()
 {
-MutexGuard  aGuard( m_aMutex );
+std::unique_lock  aGuard( m_aMutex );
 if( SvXMLEmbeddedObjectHelperMode::Read == meCreateMode )
 return cppu::UnoType::get();
 else
@@ -703,7 +703,7 @@ Type SAL_CALL SvXMLEmbeddedObjectHelper::getElementType()
 
 sal_Bool SAL_CALL SvXMLEmbeddedObjectHelper::hasElements()
 {
-MutexGuard  aGuard( m_aMutex );
+std::unique_lock  aGuard( m_aMutex );
 if( SvXMLEmbeddedObjectHelperMode::Read == meCreateMode )
 {
 return true;
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 

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

2021-12-24 Thread Noel Grandin (via logerrit)
 include/svx/xmlgrhlp.hxx|8 ++--
 svx/source/xml/xmlgrhlp.cxx |   16 +++-
 2 files changed, 5 insertions(+), 19 deletions(-)

New commits:
commit 4621e719c283cb24ec6b884b55a6719a321336f3
Author: Noel Grandin 
AuthorDate: Fri Dec 24 10:06:17 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 24 18:42:25 2021 +0100

use comphelper::WeakComponentImplHelper in SvXMLGraphicHelper

and remove unused disposing() override

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

diff --git a/include/svx/xmlgrhlp.hxx b/include/svx/xmlgrhlp.hxx
index 8a72664a5b55..0e54e1cb102b 100644
--- a/include/svx/xmlgrhlp.hxx
+++ b/include/svx/xmlgrhlp.hxx
@@ -20,8 +20,7 @@
 #ifndef INCLUDED_SVX_XMLGRHLP_HXX
 #define INCLUDED_SVX_XMLGRHLP_HXX
 
-#include 
-#include 
+#include 
 #include 
 #include 
 
@@ -47,8 +46,7 @@ struct SvxGraphicHelperStream_Impl
 };
 
 class SVXCORE_DLLPUBLIC SvXMLGraphicHelper final :
-public cppu::BaseMutex,
-public 
cppu::WeakComponentImplHelper
 {
@@ -82,8 +80,6 @@ private:
   SvXMLGraphicHelperMode eCreateMode,
   const OUString& rGraphicMimeType = 
OUString() );
 
-virtual void SAL_CALL   disposing() override;
-
 SVX_DLLPRIVATE OUString 
implSaveGraphic(css::uno::Reference const & rxGraphic,
 OUString & rOutMimeType,
 std::u16string_view rRequestName);
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index 35d3a247c56a..96be71b78769 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -367,18 +367,12 @@ const GraphicObject& 
SvXMLGraphicOutputStream::GetGraphicObject()
 }
 
 SvXMLGraphicHelper::SvXMLGraphicHelper(SvXMLGraphicHelperMode eCreateMode)
-: cppu::WeakComponentImplHelper(m_aMutex)
 {
 Init( nullptr, eCreateMode );
 }
 
 SvXMLGraphicHelper::SvXMLGraphicHelper()
-: cppu::WeakComponentImplHelper(m_aMutex)
-, meCreateMode(SvXMLGraphicHelperMode::Read)
+: meCreateMode(SvXMLGraphicHelperMode::Read)
 {
 }
 
@@ -386,10 +380,6 @@ SvXMLGraphicHelper::~SvXMLGraphicHelper()
 {
 }
 
-void SAL_CALL SvXMLGraphicHelper::disposing()
-{
-}
-
 bool SvXMLGraphicHelper::ImplGetStreamNames( const OUString& rURLStr,
  OUString& rPictureStorageName,
  OUString& rPictureStreamName )
@@ -580,7 +570,7 @@ OUString SAL_CALL 
SvXMLGraphicHelper::resolveGraphicObjectURL( const OUString& /
 // XGraphicStorageHandler
 uno::Reference SAL_CALL 
SvXMLGraphicHelper::loadGraphic(OUString const & rURL)
 {
-osl::MutexGuard aGuard(m_aMutex);
+std::unique_lock aGuard(m_aMutex);
 
 uno::Reference xGraphic;
 
@@ -612,7 +602,7 @@ uno::Reference SAL_CALL 
SvXMLGraphicHelper::loadGraphic(OUStr
 
 uno::Reference SAL_CALL 
SvXMLGraphicHelper::loadGraphicFromOutputStream(uno::Reference
 const & rxOutputStream)
 {
-osl::MutexGuard aGuard(m_aMutex);
+std::unique_lock aGuard(m_aMutex);
 
 uno::Reference xGraphic;
 


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

2021-12-23 Thread Noel Grandin (via logerrit)
 include/svx/sdr/contact/viewobjectcontact.hxx |3 --
 svx/source/sdr/contact/viewobjectcontact.cxx  |   27 +-
 2 files changed, 6 insertions(+), 24 deletions(-)

New commits:
commit 5e6d6be86bf29896e030af5c0f770f2b389d7e8a
Author: Noel Grandin 
AuthorDate: Thu Dec 23 21:45:19 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 24 08:21:18 2021 +0100

tdf#146132 tdf#146327 tdf#146330

regression from
commit fe6a140a537eda1b6703c44ff5ee49d2ba875b81
Author: Noel Grandin 
Date:   Tue Dec 7 14:55:13 2021 +0200
used cache value in ViewObjectContact::getPrimitive2DSequence

Unfortunately various things like scrolling/zooming/moving item
to new page do not seem to invalidate the VOC, and I can't
track down the right place to do that, so just revert.

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

diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx 
b/include/svx/sdr/contact/viewobjectcontact.hxx
index 1be4cac81052..f13f247e55c2 100644
--- a/include/svx/sdr/contact/viewobjectcontact.hxx
+++ b/include/svx/sdr/contact/viewobjectcontact.hxx
@@ -59,9 +59,6 @@ private:
 // possible on-demand calculated GridOffset for non-linear ViewToDevice 
transformation (calc)
 basegfx::B2DVector  maGridOffset;
 
-// used to detect ActionChanged() during primitive construction
-int mnActionChangedCount;
-
 // This bool gets set when the object gets invalidated by ActionChanged() 
and
 // can be used from the OC to late-invalidates
 boolmbLazyInvalidate : 1;
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 79b2d03e625c..1dd8fef29415 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -147,7 +147,6 @@ ViewObjectContact::ViewObjectContact(ObjectContact& 
rObjectContact, ViewContact&
 :   mrObjectContact(rObjectContact),
 mrViewContact(rViewContact),
 maGridOffset(0.0, 0.0),
-mnActionChangedCount(0),
 mbLazyInvalidate(false)
 {
 // make the ViewContact remember me
@@ -194,7 +193,7 @@ const basegfx::B2DRange& 
ViewObjectContact::getObjectRange() const
 {
 // if range is not computed (new or LazyInvalidate objects), force 
it
 const DisplayInfo aDisplayInfo;
-const drawinglayer::primitive2d::Primitive2DContainer& 
xSequence(getPrimitive2DSequence(aDisplayInfo));
+const drawinglayer::primitive2d::Primitive2DContainer 
xSequence(getPrimitive2DSequence(aDisplayInfo));
 
 if(!xSequence.empty())
 {
@@ -209,10 +208,6 @@ const basegfx::B2DRange& 
ViewObjectContact::getObjectRange() const
 
 void ViewObjectContact::ActionChanged()
 {
-// clear cached primitives
-mxPrimitive2DSequence.clear();
-++mnActionChangedCount;
-
 if(mbLazyInvalidate)
 return;
 
@@ -335,9 +330,6 @@ void ViewObjectContact::createPrimitive2DSequence(const 
DisplayInfo& rDisplayInf
 
 drawinglayer::primitive2d::Primitive2DContainer const & 
ViewObjectContact::getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
 {
-if (!mxPrimitive2DSequence.empty())
-return mxPrimitive2DSequence;
-
 /**
 This method is weird because
 (1) we have to re-walk the primitive tree because the flushing is 
unreliable
@@ -423,28 +415,21 @@ void 
ViewObjectContact::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInf
 if(!isPrimitiveVisible(rDisplayInfo))
 return;
 
-getPrimitive2DSequence(rDisplayInfo);
-if(mxPrimitive2DSequence.empty())
+drawinglayer::primitive2d::Primitive2DContainer xRetval = 
getPrimitive2DSequence(rDisplayInfo);
+if(xRetval.empty())
 return;
 
 // get ranges
 const drawinglayer::geometry::ViewInformation2D& 
rViewInformation2D(GetObjectContact().getViewInformation2D());
+const basegfx::B2DRange 
aObjectRange(xRetval.getB2DRange(rViewInformation2D));
 const basegfx::B2DRange& aViewRange(rViewInformation2D.getViewport());
 
 // check geometrical visibility
-bool bVisible = aViewRange.isEmpty() || aViewRange.overlaps(maObjectRange);
+bool bVisible = aViewRange.isEmpty() || aViewRange.overlaps(aObjectRange);
 if(!bVisible)
 return;
 
-// temporarily take over the mxPrimitive2DSequence, in case it gets 
invalidated while we want to iterate over it
-auto tmp = 
std::move(const_cast(this)->mxPrimitive2DSequence);
-int nPrevCount = mnActionChangedCount;
-
-rVisitor.visit(tmp);
-
-// if we received ActionChanged() calls while walking the primitives, then 
leave it empty, otherwise move it back
-if (mnActionChangedCount == nPrevCount)
-   

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

2021-12-18 Thread Noel Grandin (via logerrit)
 include/svx/unoshape.hxx|   14 +-
 svx/source/unodraw/unoshape.cxx |8 
 2 files changed, 9 insertions(+), 13 deletions(-)

New commits:
commit 3cdab0587977927b781a631dd8e2d43a3faa3c07
Author: Noel Grandin 
AuthorDate: Sat Dec 18 10:01:32 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Dec 18 20:50:58 2021 +0100

use more cppu::BaseMutex

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

diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx
index 3d3d5bea3a9b..381a2a723b90 100644
--- a/include/svx/unoshape.hxx
+++ b/include/svx/unoshape.hxx
@@ -56,6 +56,7 @@
 
 #include 
 
+#include 
 #include 
 
 class SfxItemSet;
@@ -70,12 +71,6 @@ namespace basegfx
 class B2DPolyPolygon;
 } // end of namespace basegfx
 
-class SvxShapeMutex
-{
-protected:
-::osl::Mutex maMutex;
-};
-
 struct SvxShapeImpl;
 class SvxShapeMaster;
 class SvxItemPropertySet;
@@ -103,9 +98,10 @@ typedef ::cppu::WeakAggImplHelper12<
 css::document::XActionLockable,
 css::beans::XMultiPropertyStates> SvxShape_UnoImplHelper;
 
-class SVXCORE_DLLPUBLIC SvxShape : public SvxShape_UnoImplHelper,
- public SfxListener,
- public SvxShapeMutex
+class SVXCORE_DLLPUBLIC SvxShape :
+ public cppu::BaseMutex,
+ public SvxShape_UnoImplHelper,
+ public SfxListener
 {
 private:
 css::awt::Size maSize;
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index eed9f89f2116..86b3d875d64a 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -194,7 +194,7 @@ sal_Int16 GetTextFitToSizeScale(SdrObject* pObject)
 
 SvxShape::SvxShape( SdrObject* pObject )
 :   maSize(100,100)
-,   mpImpl( new SvxShapeImpl( *this, maMutex ) )
+,   mpImpl( new SvxShapeImpl( *this, m_aMutex ) )
 ,   mbIsMultiPropertyCall(false)
 ,   mpPropSet(getSvxMapProvider().GetPropertySet(SVXMAP_SHAPE, 
SdrObject::GetGlobalDrawObjectItemPool()))
 ,   maPropMapEntries(getSvxMapProvider().GetMap(SVXMAP_SHAPE))
@@ -207,7 +207,7 @@ SvxShape::SvxShape( SdrObject* pObject )
 
 SvxShape::SvxShape( SdrObject* pObject, const SfxItemPropertyMapEntry* 
pEntries, const SvxItemPropertySet* pPropertySet )
 :   maSize(100,100)
-,   mpImpl( new SvxShapeImpl( *this, maMutex ) )
+,   mpImpl( new SvxShapeImpl( *this, m_aMutex ) )
 ,   mbIsMultiPropertyCall(false)
 ,   mpPropSet(pPropertySet)
 ,   maPropMapEntries(pEntries)
@@ -1353,14 +1353,14 @@ Reference< beans::XPropertySetInfo > const &
 
 void SAL_CALL SvxShape::addPropertyChangeListener( const OUString& 
_propertyName, const Reference< beans::XPropertyChangeListener >& _listener  )
 {
-::osl::MutexGuard aGuard( maMutex );
+::osl::MutexGuard aGuard( m_aMutex );
 mpImpl->maPropertyNotifier.addPropertyChangeListener( _propertyName, 
_listener );
 }
 
 
 void SAL_CALL SvxShape::removePropertyChangeListener( const OUString& 
_propertyName, const Reference< beans::XPropertyChangeListener >& _listener  )
 {
-::osl::MutexGuard aGuard( maMutex );
+::osl::MutexGuard aGuard( m_aMutex );
 mpImpl->maPropertyNotifier.removePropertyChangeListener( _propertyName, 
_listener );
 }
 


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

2021-12-17 Thread Noel Grandin (via logerrit)
 include/svx/sdr/contact/viewobjectcontact.hxx |3 +++
 svx/source/sdr/contact/viewobjectcontact.cxx  |   18 ++
 2 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit b33a4d3c4acc37b9284c611c661d2fe34db8
Author: Noel Grandin 
AuthorDate: Fri Dec 17 10:54:59 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 17 11:21:25 2021 +0100

fix for crash converting ooo31011-1.sxw and tdf#146132

./instdir/program/soffice.bin --headless --convert-to odt
./ooo31011-1.sxw

regression from
commit 681e10eecf67a1a01bdec2cc9b834e0345e25206
Author: Noel Grandin 
Date:   Thu Dec 9 11:12:49 2021 +0200
tdf#146137 tdf#146132 image redrawing

It is because we cache high-level primitives, and then during paint, we
decompose those high-level primitives, and that triggers layout,
which triggers an invalidate i.e. an ActionChanged(), which blows
away the cached data we are iterating over.

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

diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx 
b/include/svx/sdr/contact/viewobjectcontact.hxx
index f13f247e55c2..7cee496afdb2 100644
--- a/include/svx/sdr/contact/viewobjectcontact.hxx
+++ b/include/svx/sdr/contact/viewobjectcontact.hxx
@@ -59,6 +59,9 @@ private:
 // possible on-demand calculated GridOffset for non-linear ViewToDevice 
transformation (calc)
 basegfx::B2DVector  maGridOffset;
 
+// used to to detect ActionChanged() during primitive construction
+int mnActionChangedCount;
+
 // This bool gets set when the object gets invalidated by ActionChanged() 
and
 // can be used from the OC to late-invalidates
 boolmbLazyInvalidate : 1;
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 9dcac9eb153c..8b8f0c3250d7 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -147,6 +147,7 @@ ViewObjectContact::ViewObjectContact(ObjectContact& 
rObjectContact, ViewContact&
 :   mrObjectContact(rObjectContact),
 mrViewContact(rViewContact),
 maGridOffset(0.0, 0.0),
+mnActionChangedCount(0),
 mbLazyInvalidate(false)
 {
 // make the ViewContact remember me
@@ -210,6 +211,7 @@ void ViewObjectContact::ActionChanged()
 {
 // clear cached primitives
 mxPrimitive2DSequence.clear();
+++mnActionChangedCount;
 
 if(mbLazyInvalidate)
 return;
@@ -345,7 +347,7 @@ drawinglayer::primitive2d::Primitive2DContainer const & 
ViewObjectContact::getPr
 drawinglayer::primitive2d::Primitive2DContainer xNewPrimitiveSequence;
 
 // take care of redirectors and create new list
-ViewObjectContactRedirector* pRedirector = 
GetObjectContact().GetViewObjectContactRedirector();
+ViewObjectContactRedirector* pRedirector = 
GetObjectContact().GetViewObjectContactRedirector();\
 
 if(pRedirector)
 {
@@ -421,8 +423,8 @@ void 
ViewObjectContact::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInf
 if(!isPrimitiveVisible(rDisplayInfo))
 return;
 
-const drawinglayer::primitive2d::Primitive2DContainer& xRetval = 
getPrimitive2DSequence(rDisplayInfo);
-if(xRetval.empty())
+getPrimitive2DSequence(rDisplayInfo);
+if(mxPrimitive2DSequence.empty())
 return;
 
 // get ranges
@@ -434,7 +436,15 @@ void 
ViewObjectContact::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInf
 if(!bVisible)
 return;
 
-rVisitor.visit(xRetval);
+// temporarily take over the mxPrimitive2DSequence, in case it gets 
invalidated while we want to iterate over it
+auto tmp = 
std::move(const_cast(this)->mxPrimitive2DSequence);
+int nPrevCount = mnActionChangedCount;
+
+rVisitor.visit(tmp);
+
+// if we received ActionChanged() calls while walking the primitives, then 
leave it empty, otherwise move it back
+if (mnActionChangedCount == nPrevCount)
+const_cast(this)->mxPrimitive2DSequence = 
std::move(tmp);
 }
 
 void ViewObjectContact::getPrimitive2DSequenceSubHierarchy(DisplayInfo& 
rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& 
rVisitor) const


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

2021-12-09 Thread Noel Grandin (via logerrit)
 include/svx/sdr/contact/viewcontactofsdrobj.hxx |7 --
 svx/source/sdr/contact/viewcontactofsdrobj.cxx  |   25 
 2 files changed, 1 insertion(+), 31 deletions(-)

New commits:
commit c1916d3ab8f764e465f889334050ce7c863576b3
Author: Noel Grandin 
AuthorDate: Wed Dec 8 12:25:58 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Dec 9 12:02:43 2021 +0100

meRememberedAnimationKind is dead

and removing it actually makes chart loading faster, because we now
avoid always instantiaing the ObjectItemSet

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

diff --git a/include/svx/sdr/contact/viewcontactofsdrobj.hxx 
b/include/svx/sdr/contact/viewcontactofsdrobj.hxx
index a20dde7bb4b6..65b353f41be4 100644
--- a/include/svx/sdr/contact/viewcontactofsdrobj.hxx
+++ b/include/svx/sdr/contact/viewcontactofsdrobj.hxx
@@ -38,10 +38,6 @@ protected:
 // to be changed in any way.
 SdrObject&  mrObject;
 
-// Remember AnimationKind of object. Used to find out if that kind
-// has changed in ActionChanged()
-SdrTextAniKind  meRememberedAnimationKind;
-
 // Create an Object-Specific ViewObjectContact, set ViewContact and
 // ObjectContact. Always needs to return something.
 virtual ViewObjectContact& 
CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
@@ -62,9 +58,6 @@ public:
 virtual ViewContact& GetViewContact(sal_uInt32 nIndex) const override;
 virtual ViewContact* GetParentContact() const override;
 
-// React on changes of the object of this ViewContact
-virtual void ActionChanged() override;
-
 /// override for accessing the SdrObject
 virtual SdrObject* TryToGetSdrObject() const override;
 
diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx 
b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
index 16c54ec069e7..3973f5349038 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
@@ -41,14 +41,8 @@ ViewObjectContact& 
ViewContactOfSdrObj::CreateObjectSpecificViewObjectContact(Ob
 }
 
 ViewContactOfSdrObj::ViewContactOfSdrObj(SdrObject& rObj)
-:   mrObject(rObj),
-meRememberedAnimationKind(SdrTextAniKind::NONE)
+:   mrObject(rObj)
 {
-// init AnimationKind
-if(auto pTextObj = dynamic_cast( () ))
-{
-meRememberedAnimationKind = pTextObj->GetTextAniKind();
-}
 }
 
 ViewContactOfSdrObj::~ViewContactOfSdrObj()
@@ -100,23 +94,6 @@ ViewContact* ViewContactOfSdrObj::GetParentContact() const
 return pRetval;
 }
 
-// React on changes of the object of this ViewContact
-void ViewContactOfSdrObj::ActionChanged()
-{
-// look for own changes
-if (SdrTextObj* pTextObj = dynamic_cast(()))
-{
-if (pTextObj->GetTextAniKind() != meRememberedAnimationKind)
-{
-// #i38135# now remember new type
-meRememberedAnimationKind = pTextObj->GetTextAniKind();
-}
-}
-
-// call parent
-ViewContact::ActionChanged();
-}
-
 // override for accessing the SdrObject
 SdrObject* ViewContactOfSdrObj::TryToGetSdrObject() const
 {


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

2021-12-08 Thread Noel Grandin (via logerrit)
 include/svx/sdr/contact/viewcontact.hxx |5 +
 svx/source/sdr/contact/viewcontact.cxx  |   14 +-
 2 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 829510594b394d00ca2b4acb0ed64c6bda0f311c
Author: Noel Grandin 
AuthorDate: Wed Dec 8 11:14:47 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Dec 8 11:46:42 2021 +0100

tdf#146108 Calc slow to change cell focus..

in a document with a big background image

Revert "tdf#136058: remove some caching"
This reverts commit 57c40329a2b469813a1f357de355a37c8e3077ae.

And add some comments for future would-be optimisers.

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

diff --git a/include/svx/sdr/contact/viewcontact.hxx 
b/include/svx/sdr/contact/viewcontact.hxx
index 238d188d6e5b..ffdc6d055008 100644
--- a/include/svx/sdr/contact/viewcontact.hxx
+++ b/include/svx/sdr/contact/viewcontact.hxx
@@ -46,6 +46,11 @@ private:
 // Registering and de-registering is done in the VOC 
constructors/destructors.
 std::vector maViewObjectContactVector;
 
+// Primitive2DContainer of the ViewContact. This contains all necessary 
information
+// for the graphical visualisation and needs to be supported by all VCs 
which
+// can be visualized.
+drawinglayer::primitive2d::Primitive2DContainer 
mxViewIndependentPrimitive2DSequence;
+
 // A new ViewObjectContact was created and shall be remembered.
 void AddViewObjectContact(ViewObjectContact& rVOContact);
 
diff --git a/svx/source/sdr/contact/viewcontact.cxx 
b/svx/source/sdr/contact/viewcontact.cxx
index 3c1c875acba3..3f13933b742d 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -101,7 +101,9 @@ void 
ViewContact::RemoveViewObjectContact(ViewObjectContact& rVOContact)
 maViewObjectContactVector.begin(), maViewObjectContactVector.end(), 
);
 
 if (aFindResult != maViewObjectContactVector.end())
+{
 maViewObjectContactVector.erase(aFindResult);
+}
 }
 
 // Test if this ViewContact has ViewObjectContacts at all. This can
@@ -223,6 +225,9 @@ void ViewContact::createViewIndependentPrimitive2DSequence(
 void ViewContact::getViewIndependentPrimitive2DContainer(
 drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const
 {
+/* Local up-to-date checks. Create new list and compare.
+We cannot just always use the new data because the old data has cached 
bitmaps in it e.g. see the document in tdf#146108.
+*/
 drawinglayer::primitive2d::Primitive2DContainer xNew;
 createViewIndependentPrimitive2DSequence(xNew);
 
@@ -232,7 +237,14 @@ void ViewContact::getViewIndependentPrimitive2DContainer(
 xNew = embedToObjectSpecificInformation(std::move(xNew));
 }
 
-rVisitor.visit(xNew);
+if (mxViewIndependentPrimitive2DSequence != xNew)
+{
+// has changed, copy content
+const_cast(this)->mxViewIndependentPrimitive2DSequence = 
std::move(xNew);
+}
+
+// return current Primitive2DContainer
+rVisitor.visit(mxViewIndependentPrimitive2DSequence);
 }
 
 // add Gluepoints (if available)


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

2021-12-06 Thread Noel Grandin (via logerrit)
 include/svx/sdr/contact/viewobjectcontact.hxx|   12 -
 svx/source/sdr/contact/viewobjectcontact.cxx |   32 ++-
 svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx |6 ++
 3 files changed, 39 insertions(+), 11 deletions(-)

New commits:
commit d2b03c4bfa284efbb45cb4904122e97439d3ee06
Author: Noel Grandin 
AuthorDate: Mon Dec 6 15:58:19 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Dec 6 19:46:10 2021 +0100

Revert "lose the caching in ViewObjectContact" because it breaks...

bitmap caching. Added some notes for future would-be optimizers.

This reverts commit 7f02cb80ac2075b65ee1adee4e29d1d5c4819424.

Change-Id: I39c41ea95d23d4a65edd3cef46a5d86fab48a044
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126425
Reviewed-by: Luboš Luňák 
Tested-by: Jenkins

diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx 
b/include/svx/sdr/contact/viewobjectcontact.hxx
index 56deadd59afe..f13f247e55c2 100644
--- a/include/svx/sdr/contact/viewobjectcontact.hxx
+++ b/include/svx/sdr/contact/viewobjectcontact.hxx
@@ -48,6 +48,11 @@ private:
 // This range defines the object's BoundRect
 basegfx::B2DRange   maObjectRange;
 
+// PrimitiveSequence of the ViewContact. This contains all necessary 
information
+// for the graphical visualisation and needs to be supported by all VCs 
which
+// can be visualized.
+drawinglayer::primitive2d::Primitive2DContainer  mxPrimitive2DSequence;
+
 // the PrimitiveAnimation if Primitive2DContainer contains animations
 std::unique_ptr mpPrimitiveAnimation;
 
@@ -64,7 +69,7 @@ protected:
 
 // Called from getPrimitive2DSequence() when vector has changed. Evaluate 
object animation
 // and setup accordingly
-void checkForPrimitive2DAnimations(const 
drawinglayer::primitive2d::Primitive2DContainer& );
+void checkForPrimitive2DAnimations();
 
 // This method is responsible for creating the graphical visualisation 
data which is
 // stored/cached in the local primitive. Default gets view-independent 
Primitive
@@ -73,6 +78,9 @@ protected:
 // This method will not handle included hierarchies and not check 
geometric visibility.
 virtual void createPrimitive2DSequence(const DisplayInfo& rDisplayInfo, 
drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const;
 
+// method for flushing Primitive2DContainer for VOC implementations
+void flushPrimitive2DSequence() { mxPrimitive2DSequence.clear(); }
+
 public:
 // basic constructor.
 ViewObjectContact(ObjectContact& rObjectContact, ViewContact& 
rViewContact);
@@ -103,7 +111,7 @@ public:
 // access to the local primitive. This will ensure that the local 
primitive is
 // current in comparing the local one with a fresh created incarnation
 // This method will not handle included hierarchies and not check 
visibility.
-drawinglayer::primitive2d::Primitive2DContainer 
getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+drawinglayer::primitive2d::Primitive2DContainer const & 
getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
 
 // test this VOC for visibility concerning model-view stuff like e.g. Layer
 virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index c72c34dfaccb..1dd8fef29415 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -263,13 +263,13 @@ void ViewObjectContact::ActionChildInserted(ViewContact& 
rChild)
 // GetObjectContact().InvalidatePartOfView(rChildVOC.getObjectRange());
 }
 
-void ViewObjectContact::checkForPrimitive2DAnimations(const 
drawinglayer::primitive2d::Primitive2DContainer& xPrimitive2DSequence)
+void ViewObjectContact::checkForPrimitive2DAnimations()
 {
 // remove old one
 mpPrimitiveAnimation.reset();
 
 // check for animated primitives
-if(xPrimitive2DSequence.empty())
+if(mxPrimitive2DSequence.empty())
 return;
 
 const bool 
bTextAnimationAllowed(GetObjectContact().IsTextAnimationAllowed());
@@ -279,7 +279,7 @@ void ViewObjectContact::checkForPrimitive2DAnimations(const 
drawinglayer::primit
 {
 AnimatedExtractingProcessor2D 
aAnimatedExtractor(GetObjectContact().getViewInformation2D(),
 bTextAnimationAllowed, bGraphicAnimationAllowed);
-aAnimatedExtractor.process(xPrimitive2DSequence);
+aAnimatedExtractor.process(mxPrimitive2DSequence);
 
 if(!aAnimatedExtractor.getPrimitive2DSequence().empty())
 {
@@ -328,8 +328,14 @@ void ViewObjectContact::createPrimitive2DSequence(const 
DisplayInfo& rDisplayInf
 rVisitor.visit(xRetval);
 }
 
-drawinglayer::primitive2d::Primitive2DContainer 
ViewObjectContact::getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const

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

2021-12-06 Thread Noel Grandin (via logerrit)
 include/svx/shapepropertynotifier.hxx|4 ++--
 svx/source/unodraw/shapepropertynotifier.cxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 79824cea8add8dfd69a284800f5b365fc20bece9
Author: Noel Grandin 
AuthorDate: Wed Dec 1 21:43:52 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Dec 4 12:34:12 2021 +0100

use OMultiTypeInterfaceContainerHelperVar3 in PropertyChangeNotifier

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

diff --git a/include/svx/shapepropertynotifier.hxx 
b/include/svx/shapepropertynotifier.hxx
index 8e994e15d21d..b26525c63f7b 100644
--- a/include/svx/shapepropertynotifier.hxx
+++ b/include/svx/shapepropertynotifier.hxx
@@ -22,7 +22,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -141,7 +141,7 @@ namespace svx
 PropertyProviders;
 ::cppu::OWeakObject&m_rContext;
 PropertyProviders   m_aProviders;
-comphelper::OMultiTypeInterfaceContainerHelperVar2 
m_aPropertyChangeListeners;
+
comphelper::OMultiTypeInterfaceContainerHelperVar3 m_aPropertyChangeListeners;
 };
 
 
diff --git a/svx/source/unodraw/shapepropertynotifier.cxx 
b/svx/source/unodraw/shapepropertynotifier.cxx
index 29ad15f2358f..9151190c0cda 100644
--- a/svx/source/unodraw/shapepropertynotifier.cxx
+++ b/svx/source/unodraw/shapepropertynotifier.cxx
@@ -95,8 +95,8 @@ namespace svx
 
 OUString sPropertyName( provPos->second->getPropertyName() );
 
-::comphelper::OInterfaceContainerHelper2* pPropListeners = 
m_aPropertyChangeListeners.getContainer( sPropertyName );
-::comphelper::OInterfaceContainerHelper2* pAllListeners = 
m_aPropertyChangeListeners.getContainer( OUString() );
+::comphelper::OInterfaceContainerHelper3* 
pPropListeners = m_aPropertyChangeListeners.getContainer( sPropertyName );
+::comphelper::OInterfaceContainerHelper3* 
pAllListeners = m_aPropertyChangeListeners.getContainer( OUString() );
 if ( !pPropListeners && !pAllListeners )
 return;
 


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

2021-12-03 Thread Noel Grandin (via logerrit)
 include/svx/framelinkarray.hxx   |  104 +--
 svx/source/dialog/framelinkarray.cxx |  316 +--
 svx/source/dialog/frmsel.cxx |4 
 3 files changed, 212 insertions(+), 212 deletions(-)

New commits:
commit 7563216425c1a43166db083d809073b268f7884f
Author: Noel Grandin 
AuthorDate: Fri Dec 3 09:42:07 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 3 13:08:55 2021 +0100

sal_Int32 is sufficient for svx::frame::Array

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

diff --git a/include/svx/framelinkarray.hxx b/include/svx/framelinkarray.hxx
index 7cdfd90d794b..46b17c025641 100644
--- a/include/svx/framelinkarray.hxx
+++ b/include/svx/framelinkarray.hxx
@@ -71,57 +71,57 @@ public:
 // array size and column/row indexes
 
 /** Reinitializes the array with the specified size. Clears all styles. */
-voidInitialize( size_t nWidth, size_t nHeight );
+voidInitialize( sal_Int32 nWidth, sal_Int32 nHeight );
 
 /** Returns the number of columns in the array. */
-size_t  GetColCount() const;
+sal_Int32   GetColCount() const;
 
 /** Returns the number of rows in the array. */
-size_t  GetRowCount() const;
+sal_Int32   GetRowCount() const;
 
 /** Returns the number of cells in the array. */
-size_t  GetCellCount() const;
+sal_Int32   GetCellCount() const;
 
 /** Returns the cell index from the cell address (nCol,nRow). */
-size_t  GetCellIndex( size_t nCol, size_t nRow, bool bRTL) 
const;
+sal_Int32   GetCellIndex( sal_Int32 nCol, sal_Int32 nRow, bool 
bRTL) const;
 
 // cell border styles
 
 /** Sets the left frame style of the cell (nCol,nRow). Ignores merged 
ranges. */
-voidSetCellStyleLeft( size_t nCol, size_t nRow, const 
Style& rStyle );
+voidSetCellStyleLeft( sal_Int32 nCol, sal_Int32 nRow, 
const Style& rStyle );
 
 /** Sets the right frame style of the cell (nCol,nRow). Ignores merged 
ranges. */
-voidSetCellStyleRight( size_t nCol, size_t nRow, const 
Style& rStyle );
+voidSetCellStyleRight( sal_Int32 nCol, sal_Int32 nRow, 
const Style& rStyle );
 
 /** Sets the top frame style of the cell (nCol,nRow). Ignores merged 
ranges. */
-voidSetCellStyleTop( size_t nCol, size_t nRow, const 
Style& rStyle );
+voidSetCellStyleTop( sal_Int32 nCol, sal_Int32 nRow, const 
Style& rStyle );
 
 /** Sets the bottom frame style of the specified cell (nCol,nRow). Ignores 
merged ranges. */
-voidSetCellStyleBottom( size_t nCol, size_t nRow, const 
Style& rStyle );
+voidSetCellStyleBottom( sal_Int32 nCol, sal_Int32 nRow, 
const Style& rStyle );
 
 /** Sets the top-left to bottom-right frame style of the cell (nCol,nRow). 
Ignores merged ranges. */
-voidSetCellStyleTLBR( size_t nCol, size_t nRow, const 
Style& rStyle );
+voidSetCellStyleTLBR( sal_Int32 nCol, sal_Int32 nRow, 
const Style& rStyle );
 
 /** Sets the bottom-left to top-right frame style of the cell (nCol,nRow). 
Ignores merged ranges. */
-voidSetCellStyleBLTR( size_t nCol, size_t nRow, const 
Style& rStyle );
+voidSetCellStyleBLTR( sal_Int32 nCol, sal_Int32 nRow, 
const Style& rStyle );
 
 /** Sets both diagonal frame styles of the specified cell (nCol,nRow). 
Ignores merged ranges. */
-voidSetCellStyleDiag( size_t nCol, size_t nRow, const 
Style& rTLBR, const Style& rBLTR );
+voidSetCellStyleDiag( sal_Int32 nCol, sal_Int32 nRow, 
const Style& rTLBR, const Style& rBLTR );
 
 /** Sets the left frame style of the specified column. Ignores merged 
ranges. */
-voidSetColumnStyleLeft( size_t nCol, const Style& rStyle );
+voidSetColumnStyleLeft( sal_Int32 nCol, const Style& 
rStyle );
 
 /** Sets the right frame style of the specified column. Ignores merged 
ranges. */
-voidSetColumnStyleRight( size_t nCol, const Style& rStyle 
);
+voidSetColumnStyleRight( sal_Int32 nCol, const Style& 
rStyle );
 
 /** Sets the top frame style of the specified row. Ignores merged ranges. 
*/
-voidSetRowStyleTop( size_t nRow, const Style& rStyle );
+voidSetRowStyleTop( sal_Int32 nRow, const Style& rStyle );
 
 /** Sets the bottom frame style of the specified row. Ignores merged 
ranges. */
-voidSetRowStyleBottom( size_t nRow, const Style& rStyle );
+voidSetRowStyleBottom( sal_Int32 nRow, const Style& rStyle 
);
 
 /** Sets the rotation 

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

2021-12-03 Thread Noel Grandin (via logerrit)
 include/svx/sdr/contact/viewobjectcontact.hxx|   12 +-
 svx/source/sdr/contact/viewobjectcontact.cxx |   26 +--
 svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx |6 ---
 3 files changed, 11 insertions(+), 33 deletions(-)

New commits:
commit 7f02cb80ac2075b65ee1adee4e29d1d5c4819424
Author: Noel Grandin 
AuthorDate: Thu Dec 2 14:42:05 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 3 10:46:56 2021 +0100

lose the caching in ViewObjectContact

we reload the data every time anyway, so the caching is useless

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

diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx 
b/include/svx/sdr/contact/viewobjectcontact.hxx
index 453cfb2d90ea..de80fec63ef8 100644
--- a/include/svx/sdr/contact/viewobjectcontact.hxx
+++ b/include/svx/sdr/contact/viewobjectcontact.hxx
@@ -48,11 +48,6 @@ private:
 // This range defines the object's BoundRect
 basegfx::B2DRange   maObjectRange;
 
-// PrimitiveSequence of the ViewContact. This contains all necessary 
information
-// for the graphical visualisation and needs to be supported by all VCs 
which
-// can be visualized.
-drawinglayer::primitive2d::Primitive2DContainer  mxPrimitive2DSequence;
-
 // the PrimitiveAnimation if Primitive2DContainer contains animations
 std::unique_ptr mpPrimitiveAnimation;
 
@@ -69,7 +64,7 @@ protected:
 
 // Called from getPrimitive2DSequence() when vector has changed. Evaluate 
object animation
 // and setup accordingly
-void checkForPrimitive2DAnimations();
+void checkForPrimitive2DAnimations(const 
drawinglayer::primitive2d::Primitive2DContainer& );
 
 // This method is responsible for creating the graphical visualisation 
data which is
 // stored/cached in the local primitive. Default gets view-independent 
Primitive
@@ -78,9 +73,6 @@ protected:
 // This method will not handle included hierarchies and not check 
geometric visibility.
 virtual drawinglayer::primitive2d::Primitive2DContainer 
createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
 
-// method for flushing Primitive2DContainer for VOC implementations
-void flushPrimitive2DSequence() { mxPrimitive2DSequence.clear(); }
-
 public:
 // basic constructor.
 ViewObjectContact(ObjectContact& rObjectContact, ViewContact& 
rViewContact);
@@ -111,7 +103,7 @@ public:
 // access to the local primitive. This will ensure that the local 
primitive is
 // current in comparing the local one with a fresh created incarnation
 // This method will not handle included hierarchies and not check 
visibility.
-drawinglayer::primitive2d::Primitive2DContainer const & 
getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
+drawinglayer::primitive2d::Primitive2DContainer 
getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
 
 // test this VOC for visibility concerning model-view stuff like e.g. Layer
 virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 23ee410628ab..f2baca7e5e73 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -263,13 +263,13 @@ void ViewObjectContact::ActionChildInserted(ViewContact& 
rChild)
 // GetObjectContact().InvalidatePartOfView(rChildVOC.getObjectRange());
 }
 
-void ViewObjectContact::checkForPrimitive2DAnimations()
+void ViewObjectContact::checkForPrimitive2DAnimations(const 
drawinglayer::primitive2d::Primitive2DContainer& xPrimitive2DSequence)
 {
 // remove old one
 mpPrimitiveAnimation.reset();
 
 // check for animated primitives
-if(mxPrimitive2DSequence.empty())
+if(xPrimitive2DSequence.empty())
 return;
 
 const bool 
bTextAnimationAllowed(GetObjectContact().IsTextAnimationAllowed());
@@ -279,7 +279,7 @@ void ViewObjectContact::checkForPrimitive2DAnimations()
 {
 AnimatedExtractingProcessor2D 
aAnimatedExtractor(GetObjectContact().getViewInformation2D(),
 bTextAnimationAllowed, bGraphicAnimationAllowed);
-aAnimatedExtractor.process(mxPrimitive2DSequence);
+aAnimatedExtractor.process(xPrimitive2DSequence);
 
 if(!aAnimatedExtractor.getPrimitive2DSequence().empty())
 {
@@ -327,7 +327,7 @@ drawinglayer::primitive2d::Primitive2DContainer 
ViewObjectContact::createPrimiti
 return xRetval;
 }
 
-drawinglayer::primitive2d::Primitive2DContainer const & 
ViewObjectContact::getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
+drawinglayer::primitive2d::Primitive2DContainer 
ViewObjectContact::getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
 {
 

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

2021-12-02 Thread Noel Grandin (via logerrit)
 include/svx/sdr/contact/viewobjectcontact.hxx |2 
 svx/source/sdr/contact/viewobjectcontact.cxx  |7 ---
 svx/source/sdr/contact/viewobjectcontactofgroup.cxx   |   23 --
 svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx |   38 +-
 4 files changed, 8 insertions(+), 62 deletions(-)

New commits:
commit 085f15acfdb96155011d60b6127ea6f6e4a9a263
Author: Noel Grandin 
AuthorDate: Thu Dec 2 11:28:27 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Dec 3 08:40:23 2021 +0100

no need to create Primitive2DContainer here

we can just use the visitor API and skip a whole bunch of object
creation

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

diff --git a/include/svx/sdr/contact/viewobjectcontact.hxx 
b/include/svx/sdr/contact/viewobjectcontact.hxx
index dd949cf075c7..453cfb2d90ea 100644
--- a/include/svx/sdr/contact/viewobjectcontact.hxx
+++ b/include/svx/sdr/contact/viewobjectcontact.hxx
@@ -124,7 +124,7 @@ public:
 virtual void getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, 
drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const;
 
 // just process the sub-hierarchy, used as tooling from 
getPrimitive2DSequenceHierarchy
-drawinglayer::primitive2d::Primitive2DContainer 
getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo) const;
+void getPrimitive2DSequenceSubHierarchy(DisplayInfo& rDisplayInfo, 
drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const;
 
 // interface to support GridOffset for non-linear ViewToDevice 
transformation (calc)
 const basegfx::B2DVector& getGridOffset() const;
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx 
b/svx/source/sdr/contact/viewobjectcontact.cxx
index 22eb52a99af4..5da24f86a54d 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -425,19 +425,16 @@ void 
ViewObjectContact::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInf
 rVisitor.append(xRetval);
 }
 
-drawinglayer::primitive2d::Primitive2DContainer 
ViewObjectContact::getPrimitive2DSequenceSubHierarchy(DisplayInfo& 
rDisplayInfo) const
+void ViewObjectContact::getPrimitive2DSequenceSubHierarchy(DisplayInfo& 
rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& 
rVisitor) const
 {
 const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
-drawinglayer::primitive2d::Primitive2DContainer xSeqRetval;
 
 for(sal_uInt32 a(0); a < nSubHierarchyCount; a++)
 {
 const ViewObjectContact& 
rCandidate(GetViewContact().GetViewContact(a).GetViewObjectContact(GetObjectContact()));
 
-rCandidate.getPrimitive2DSequenceHierarchy(rDisplayInfo, xSeqRetval);
+rCandidate.getPrimitive2DSequenceHierarchy(rDisplayInfo, rVisitor);
 }
-
-return xSeqRetval;
 }
 
 // Support getting a GridOffset per object and view for non-linear ViewToDevice
diff --git a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx 
b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
index a8465df9d587..8469a00c1e45 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
@@ -41,8 +41,6 @@ namespace sdr::contact
 
 void 
ViewObjectContactOfGroup::getPrimitive2DSequenceHierarchy(DisplayInfo& 
rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& 
rVisitor) const
 {
-drawinglayer::primitive2d::Primitive2DContainer xRetval;
-
 // check model-view visibility
 if(!isPrimitiveVisible(rDisplayInfo))
 return;
@@ -60,30 +58,13 @@ namespace sdr::contact
 rDisplayInfo.ClearGhostedDrawMode();
 }
 
-// create object hierarchy
-xRetval = getPrimitive2DSequenceSubHierarchy(rDisplayInfo);
-
-if(!xRetval.empty())
-{
-// get ranges
-const drawinglayer::geometry::ViewInformation2D& 
rViewInformation2D(GetObjectContact().getViewInformation2D());
-const ::basegfx::B2DRange 
aObjectRange(xRetval.getB2DRange(rViewInformation2D));
-const basegfx::B2DRange& 
aViewRange(rViewInformation2D.getViewport());
-
-// check geometrical visibility
-if(!aViewRange.isEmpty() && 
!aViewRange.overlaps(aObjectRange))
-{
-// not visible, release
-xRetval.clear();
-}
-}
+// visit object hierarchy
+getPrimitive2DSequenceSubHierarchy(rDisplayInfo, rVisitor);
 
 if(bDoGhostedDisplaying)
 {
 

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

2021-12-01 Thread Michael Stahl (via logerrit)
 include/svx/svdundo.hxx   |   19 
 svx/source/svdraw/svdpage.cxx |   12 --
 svx/source/svdraw/svdundo.cxx |   48 ++
 3 files changed, 68 insertions(+), 11 deletions(-)

New commits:
commit 25a368c30acb54e0819d2b2b890a3fd1530d8a76
Author: Michael Stahl 
AuthorDate: Tue Nov 30 20:27:24 2021 +0100
Commit: Michael Stahl 
CommitDate: Wed Dec 1 13:52:24 2021 +0100

tdf#145928 svx: fix undo of sorting shapes

The problem is that in sw there are these obnoxious virtual SdrObjects
that are created and destroyed by the layout.

0  SdrObject::~SdrObject()
3  SwVirtFlyDrawObj::~SwVirtFlyDrawObj()
5  SwFlyFrame::FinitDrawObj()
12 SwFrame::DestroyFrame(SwFrame*)
13 SwFrameFormat::DelFrames()
14 SwUndoFlyBase::DelFly(SwDoc*)
15 SwUndoDelLayFormat::SwUndoDelLayFormat(SwFrameFormat*)
16 SwHistoryTextFlyCnt::SwHistoryTextFlyCnt(SwFrameFormat*)

This misdesign means that SdrUndoObj::pObj may point to a deleted
object.

Commit 9bc6160e0acbc78be998129ea55ed7e4529959fa may create SdrUnoObj
when saving the document, so that is now an additional way to introduce
the problem.

Try to work around it by not using a SdrUndoObj subclass in this case,
but create a new SdrUndoAction subclass that uses SdrPage::sort() and
stores no pointers.

There is still the problem that changes in the layout or view settings
like "Hide tracked changes" could cause different virtual SdrObjects to
exist between when the Undo was recorded and when it is activated, in
which case nothing is done.

But that really requires a larger refactoring such as having a SdrPage
for the model that never contains virtual SdrObjects, and another
SdrPage for the view that does contain virtual SdrObjects to fix.

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

diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx
index 67ca464b5b4c..5bb4e26c1a43 100644
--- a/include/svx/svdundo.hxx
+++ b/include/svx/svdundo.hxx
@@ -377,6 +377,24 @@ public:
 virtual OUString GetComment() const override;
 };
 
+class SdrUndoSort final : public SdrUndoAction
+{
+private:
+::std::vector m_OldSortOrder;
+::std::vector m_NewSortOrder;
+sal_uInt16 const m_nPage;
+
+void Do(::std::vector & rSortOrder);
+
+public:
+SdrUndoSort(SdrPage & rPage,
+::std::vector const& rSortOrder);
+
+virtual void Undo() override;
+virtual void Redo() override;
+
+virtual OUString GetComment() const override;
+};
 
 // #i11702#
 
@@ -732,6 +750,7 @@ public:
 virtual std::unique_ptr CreateUndoNewPage(SdrPage& rPage);
 virtual std::unique_ptr CreateUndoCopyPage(SdrPage& rPage);
 virtual std::unique_ptr CreateUndoSetPageNum(SdrPage& 
rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1);
+virtual std::unique_ptr CreateUndoSort(SdrPage& rPage, 
::std::vector const& rSortOrder);
 
 // Master page
 virtual std::unique_ptr 
CreateUndoPageRemoveMasterPage(SdrPage& rChangedPage);
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 7167f69c5c12..334bde8e5450 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -718,25 +718,15 @@ void SdrObjList::sort( std::vector& sortOrder)
 bool const isUndo(rModel.IsUndoEnabled());
 if (isUndo)
 {
-rModel.BegUndo(SvxResId(STR_SortShapes));
+
rModel.AddUndo(rModel.GetSdrUndoFactory().CreateUndoSort(*getSdrPageFromSdrObjList(),
 sortOrder));
 }
 
 for (size_t i = 0; i < aNewSortOrder.size(); ++i)
 {
 aNewList[i] = maList[ aNewSortOrder[i] ];
-if (isUndo && i != sal::static_int_cast(aNewSortOrder[i]))
-{
-rModel.AddUndo(rModel.GetSdrUndoFactory().CreateUndoObjectOrdNum(
-*aNewList[i], aNewSortOrder[i], i));
-}
 aNewList[i]->SetOrdNum(i);
 }
 
-if (isUndo)
-{
-rModel.EndUndo();
-}
-
 std::swap(aNewList, maList);
 }
 
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 116c5e479a13..d26a27339541 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 
@@ -970,6 +971,48 @@ OUString SdrUndoObjOrdNum::GetComment() const
 return ImpGetDescriptionStr(STR_UndoObjOrdNum);
 }
 
+SdrUndoSort::SdrUndoSort(SdrPage & rPage,
+::std::vector const& rSortOrder)
+: SdrUndoAction(rPage.getSdrModelFromSdrPage())
+, m_OldSortOrder(rSortOrder.size())
+, m_NewSortOrder(rSortOrder)
+, m_nPage(rPage.GetPageNum())
+{
+// invert order
+for (size_t i = 0; i < rSortOrder.size(); ++i)
+{
+m_OldSortOrder[rSortOrder[i]] = i;
+}
+}
+

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

2021-11-30 Thread László Németh (via logerrit)
 include/svx/sidebar/InspectorTextPanel.hxx|2 
 svx/source/sidebar/inspector/InspectorTextPanel.cxx   |   13 +-
 sw/qa/uitest/styleInspector/styleInspector.py |   43 +++---
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |  111 +++---
 sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx |1 
 5 files changed, 132 insertions(+), 38 deletions(-)

New commits:
commit 47e65fc0baf8f671733fbf9b5ce8d735328cfb44
Author: László Németh 
AuthorDate: Mon Nov 29 15:58:14 2021 +0100
Commit: László Németh 
CommitDate: Tue Nov 30 09:57:01 2021 +0100

tdf#30709 sw Style Inspector: show section and parent metadata

Show text:section RDF metadata under the node "Sections"
in the Style Inspector. Also show parent metadata of nested
annotated text ranges (and sections) at the cursor
position, not only metadata of the innermost.

Show metadata fields (text:meta-field) and annotated text
ranges (text:meta) under the new category "Fields" instead
of at "Character Direct Formatting".

Put section and other metadata in front of the other style
settings text. Hide their empty categories "Sections",
"Bookmarks" and "Fields", if there is no associated RDF
metadata.

Follow-up of commit db7ef0a9ed21b0271345249b97a7a10d60d259e6
"tdf#30709 sw Style Inspector: show bookmark data".

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

diff --git a/include/svx/sidebar/InspectorTextPanel.hxx 
b/include/svx/sidebar/InspectorTextPanel.hxx
index ce4eecf8ad64..f6ef0234ade1 100644
--- a/include/svx/sidebar/InspectorTextPanel.hxx
+++ b/include/svx/sidebar/InspectorTextPanel.hxx
@@ -50,7 +50,7 @@ public:
 
 InspectorTextPanel(weld::Widget* pParent);
 
-void updateEntries(const std::vector& rStore);
+void updateEntries(const std::vector& rStore, const sal_Int32 
nParIdx);
 
 private:
 std::unique_ptr mpListBoxStyles;
diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx 
b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
index bdd87eef538d..69ed0f071015 100644
--- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx
+++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
@@ -132,7 +132,7 @@ static void FillBox_Impl(weld::TreeView& rListBoxStyles, 
const TreeNode& rCurren
 FillBox_Impl(rListBoxStyles, rChildNode, pResult.get());
 }
 
-void InspectorTextPanel::updateEntries(const std::vector& rStore)
+void InspectorTextPanel::updateEntries(const std::vector& rStore, 
const sal_Int32 nParIdx)
 {
 mpListBoxStyles->freeze();
 mpListBoxStyles->clear();
@@ -149,12 +149,21 @@ void InspectorTextPanel::updateEntries(const 
std::vector& rStore)
 return false;
 });
 
+// Collapse "Default Paragraph Style"
+
 std::unique_ptr pEntry = mpListBoxStyles->make_iterator();
 if (!mpListBoxStyles->get_iter_first(*pEntry))
 return;
+// skip the optional metadata items before "Default Paragraph Style"
+for (sal_Int32 i = 0; i < nParIdx; ++i)
+{
+if (!mpListBoxStyles->iter_next_sibling(*pEntry))
+return;
+}
 if (!mpListBoxStyles->iter_next(*pEntry))
 return;
-mpListBoxStyles->collapse_row(*pEntry); // Collapse "Default Paragraph 
Style"
+
+mpListBoxStyles->collapse_row(*pEntry);
 }
 
 InspectorTextPanel::~InspectorTextPanel() {}
diff --git a/sw/qa/uitest/styleInspector/styleInspector.py 
b/sw/qa/uitest/styleInspector/styleInspector.py
index f95ca9b0cfae..7cfabce07dcc 100644
--- a/sw/qa/uitest/styleInspector/styleInspector.py
+++ b/sw/qa/uitest/styleInspector/styleInspector.py
@@ -171,10 +171,10 @@ class styleNavigator(UITestCase):
 self.xUITest.executeCommand(".uno:GoRight")
 
 # The cursor is on text with annotated text range
-xDirFormatting = xListBox.getChild('3')
-self.assertEqual(2, len(xDirFormatting.getChildren()))
+xDirFormatting = xListBox.getChild('0')
+self.assertEqual("Fields\t", 
get_state_as_dict(xListBox.getChild('0'))['Text'])
+self.assertEqual(1, len(xDirFormatting.getChildren()))
 self.assertEqual("Metadata Reference\t", 
get_state_as_dict(xDirFormatting.getChild('0'))['Text'])
-self.assertEqual("Nested Text Content\tAnnotated text range", 
get_state_as_dict(xDirFormatting.getChild('1'))['Text'])
 
 xMetadata = xDirFormatting.getChild('0')
 self.assertEqual(4, len(xMetadata.getChildren()))
@@ -183,8 +183,12 @@ class styleNavigator(UITestCase):
 
self.assertEqual("http://www.w3.org/2000/01/rdf-schema#comment\tComment...;, 
get_state_as_dict(xMetadata.getChild('2'))['Text'])
 
self.assertEqual("http://www.w3.org/2000/01/rdf-schema#label\tAnnotated 
paragraph portion", 

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

2021-11-27 Thread Noel Grandin (via logerrit)
 include/svx/fmgridif.hxx   |   10 +-
 svx/source/fmcomp/fmgridif.cxx |   14 +++---
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 1fcd79fb083a2db9cb56f09e0c7407f437177b0c
Author: Noel Grandin 
AuthorDate: Mon Nov 22 21:32:24 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 27 13:57:01 2021 +0100

use more OInterfaceContainerHelper3 in FmX*Multiplexer

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

diff --git a/include/svx/fmgridif.hxx b/include/svx/fmgridif.hxx
index b98c8ac98c13..e0f43fcf069c 100644
--- a/include/svx/fmgridif.hxx
+++ b/include/svx/fmgridif.hxx
@@ -73,7 +73,7 @@ public:
 // FmXModifyMultiplexer
 
 class SAL_WARN_UNUSED FmXModifyMultiplexer final : public OWeakSubObject
-,public ::comphelper::OInterfaceContainerHelper2
+,public 
::comphelper::OInterfaceContainerHelper3
 ,public css::util::XModifyListener
 {
 public:
@@ -96,7 +96,7 @@ public:
 // FmXUpdateMultiplexer
 
 class SAL_WARN_UNUSED FmXUpdateMultiplexer final : public OWeakSubObject,
- public ::comphelper::OInterfaceContainerHelper2,
+ public 
::comphelper::OInterfaceContainerHelper3,
  public css::form::XUpdateListener
 {
 public:
@@ -121,7 +121,7 @@ public:
 // FmXSelectionMultiplexer
 
 class SAL_WARN_UNUSED FmXSelectionMultiplexer final : public OWeakSubObject
-,public 
::comphelper::OInterfaceContainerHelper2
+,public 
::comphelper::OInterfaceContainerHelper3
 ,public css::view::XSelectionChangeListener
 {
 public:
@@ -145,7 +145,7 @@ public:
 // FmXGridControlMultiplexer
 
 class SAL_WARN_UNUSED FmXGridControlMultiplexer final : public OWeakSubObject
-,public 
::comphelper::OInterfaceContainerHelper2
+,public 
::comphelper::OInterfaceContainerHelper3
 ,public css::form::XGridControlListener
 {
 public:
@@ -169,7 +169,7 @@ public:
 // FmXContainerMultiplexer
 
 class SAL_WARN_UNUSED FmXContainerMultiplexer final : public OWeakSubObject,
-public 
::comphelper::OInterfaceContainerHelper2,
+public 
::comphelper::OInterfaceContainerHelper3,
 public css::container::XContainerListener
 {
 public:
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index f20c8fca5a86..bc008f01f7ce 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -127,7 +127,7 @@ static vcl::Font ImplCreateFont( const 
css::awt::FontDescriptor& rDescr )
 
 FmXModifyMultiplexer::FmXModifyMultiplexer( ::cppu::OWeakObject& rSource, 
::osl::Mutex& _rMutex )
 :OWeakSubObject( rSource )
-,OInterfaceContainerHelper2( _rMutex )
+,OInterfaceContainerHelper3( _rMutex )
 {
 }
 
@@ -160,7 +160,7 @@ void FmXModifyMultiplexer::modified(const EventObject& e)
 
 FmXUpdateMultiplexer::FmXUpdateMultiplexer( ::cppu::OWeakObject& rSource, 
::osl::Mutex& _rMutex )
 :OWeakSubObject( rSource )
-,OInterfaceContainerHelper2( _rMutex )
+,OInterfaceContainerHelper3( _rMutex )
 {
 }
 
@@ -192,9 +192,9 @@ sal_Bool FmXUpdateMultiplexer::approveUpdate(const 
EventObject )
 bool bResult = true;
 if (getLength())
 {
-::comphelper::OInterfaceIteratorHelper2 aIter(*this);
+::comphelper::OInterfaceIteratorHelper3 aIter(*this);
 while ( bResult && aIter.hasMoreElements() )
-bResult = static_cast< XUpdateListener* >( aIter.next() 
)->approveUpdate( aMulti );
+bResult = aIter.next()->approveUpdate( aMulti );
 }
 
 return bResult;
@@ -210,7 +210,7 @@ void FmXUpdateMultiplexer::updated(const EventObject )
 
 FmXSelectionMultiplexer::FmXSelectionMultiplexer( ::cppu::OWeakObject& 
rSource, ::osl::Mutex& _rMutex )
 :OWeakSubObject( rSource )
-,OInterfaceContainerHelper2( _rMutex )
+,OInterfaceContainerHelper3( _rMutex )
 {
 }
 
@@ -243,7 +243,7 @@ void SAL_CALL FmXSelectionMultiplexer::selectionChanged( 
const EventObject& _rEv
 
 FmXContainerMultiplexer::FmXContainerMultiplexer( ::cppu::OWeakObject& 
rSource, ::osl::Mutex& _rMutex )
 :OWeakSubObject( rSource )
-,OInterfaceContainerHelper2( _rMutex )
+,OInterfaceContainerHelper3( _rMutex )
 {
 }
 
@@ -291,7 +291,7 @@ void FmXContainerMultiplexer::elementReplaced(const 
ContainerEvent& e)
 
 FmXGridControlMultiplexer::FmXGridControlMultiplexer( ::cppu::OWeakObject& 
rSource, ::osl::Mutex& _rMutex 

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

2021-11-24 Thread Julien Nabet (via logerrit)
 include/svx/strings.hrc   |4 
 svx/source/svdraw/svdattr.cxx |   14 +++---
 2 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit be31a1de5c53e997ea6af5af51baa28e1e183733
Author: Julien Nabet 
AuthorDate: Wed Nov 24 18:26:30 2021 +0100
Commit: Julien Nabet 
CommitDate: Wed Nov 24 21:27:05 2021 +0100

tdf#145833: Remove ITEMVALMEASURETEXTTYPES part in SdrMeasureTextHPosItem 
(svx)

There's no need to use translations since it's only internal use
See comments in the bugtracker to read the discussion

Change-Id: Ic249081630640ad3ac306babe943f43ef8163901
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125785
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index a18d9d305e3d..8505c410a3df 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -300,10 +300,6 @@
 #define STR_ItemValEDGE_BEZIER  
NC_("STR_ItemValEDGE_BEZIER", "Curved Connector")
 #define STR_ItemValMEASURE_STD  
NC_("STR_ItemValMEASURE_STD", "Standard")
 #define STR_ItemValMEASURE_RADIUS   
NC_("STR_ItemValMEASURE_RADIUS", "Radius")
-#define STR_ItemValMEASURE_TEXTHAUTO
NC_("STR_ItemValMEASURE_TEXTHAUTO", "automatic")
-#define STR_ItemValMEASURE_TEXTLEFTOUTSIDE  
NC_("STR_ItemValMEASURE_TEXTLEFTOUTSIDE", "left outside")
-#define STR_ItemValMEASURE_TEXTINSIDE   
NC_("STR_ItemValMEASURE_TEXTINSIDE", "inside (centered)")
-#define STR_ItemValMEASURE_TEXTRIGHTOUTSID  
NC_("STR_ItemValMEASURE_TEXTRIGHTOUTSID", "right outside")
 #define STR_ItemValMEASURE_TEXTVAUTO
NC_("STR_ItemValMEASURE_TEXTVAUTO", "automatic")
 #define STR_ItemValMEASURE_ABOVE
NC_("STR_ItemValMEASURE_ABOVE", "on the line")
 #define STR_ItemValMEASURETEXT_BREAKEDLINE  
NC_("STR_ItemValMEASURETEXT_BREAKEDLINE", "broken line")
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 982e6d7e8c18..b0df93a13855 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -1603,15 +1603,15 @@ sal_uInt16 SdrMeasureTextHPosItem::GetValueCount() 
const { return 4; }
 
 OUString SdrMeasureTextHPosItem::GetValueTextByPos(sal_uInt16 nPos)
 {
-static TranslateId ITEMVALMEASURETEXTTYPES[] =
+static std::array aMeasureTextHPosItem
 {
-STR_ItemValMEASURE_TEXTHAUTO,
-STR_ItemValMEASURE_TEXTLEFTOUTSIDE,
-STR_ItemValMEASURE_TEXTINSIDE,
-STR_ItemValMEASURE_TEXTRIGHTOUTSID
+"automatic",
+"left outside",
+"inside (centered)",
+"right outside"
 };
-assert(nPos < SAL_N_ELEMENTS(ITEMVALMEASURETEXTTYPES) && "wrong pos!");
-return SvxResId(ITEMVALMEASURETEXTTYPES[nPos]);
+assert(nPos < aMeasureTextHPosItem.size() && "wrong pos!");
+return aMeasureTextHPosItem[nPos];
 }
 
 bool SdrMeasureTextHPosItem::GetPresentation(SfxItemPresentation ePres,


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

2021-11-17 Thread Sarper Akdemir (via logerrit)
 include/svx/ColorSets.hxx   |   23 +
 include/svx/svdmodel.hxx|7 +
 svx/source/styles/ColorSets.cxx |   53 
 svx/source/svdraw/svdmodel.cxx  |   11 
 4 files changed, 94 insertions(+)

New commits:
commit 3171d185f8c17799f0b85f5931aa59101cbc6b4e
Author: Sarper Akdemir 
AuthorDate: Wed Jul 28 02:03:12 2021 +0300
Commit: Miklos Vajna 
CommitDate: Wed Nov 17 13:26:45 2021 +0100

make colorsets work outside of styles and with direct formatting

[ Miklos: picked only the document model bits, now in SdrModel, next to
styles. ]

(cherry picked from commit 1647d34d8573f4940c0cbb7fb6cd9c6b4e5a4a15,
from the feature/themesupport2 branch)

Change-Id: I80f9e0b205b8b4a6914f851bdc63e3e0ca6706e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125313
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index 361fe47c622e..eee992da94b5 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -18,6 +18,8 @@
 #include 
 #include 
 
+typedef struct _xmlTextWriter* xmlTextWriterPtr;
+
 namespace svx
 {
 
@@ -41,6 +43,8 @@ public:
 {
 return maColors[nIndex];
 }
+
+void dumpAsXml(xmlTextWriterPtr pWriter) const;
 };
 
 class SVXCORE_DLLPUBLIC ColorSets
@@ -64,6 +68,25 @@ public:
 const ColorSet& getColorSet(std::u16string_view rName);
 };
 
+/// A named theme has a named color set.
+class SVXCORE_DLLPUBLIC Theme
+{
+OUString maName;
+std::unique_ptr mpColorSet;
+
+public:
+Theme(OUString const& rName);
+~Theme();
+
+void SetColorSet(std::unique_ptr pColorSet);
+ColorSet* GetColorSet();
+
+void SetName(const OUString& rName);
+const OUString& GetName() const;
+
+void dumpAsXml(xmlTextWriterPtr pWriter) const;
+};
+
 } // end of namespace svx
 
 #endif // INCLUDED_SVX_COLORSETS_HXX
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 73fc9f646f43..ab9578a7bc93 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -90,6 +90,10 @@ namespace com::sun::star::beans {
 struct PropertyValue;
 }
 
+namespace svx
+{
+class Theme;
+}
 
 constexpr const sal_Unicode DEGREE_CHAR = u'\x00B0'; /* U+00B0 DEGREE SIGN */
 
@@ -536,6 +540,9 @@ public:
 SfxStyleSheetBasePool* GetStyleSheetPool() const { return 
mxStyleSheetPool.get(); }
 void SetStyleSheetPool(SfxStyleSheetBasePool* pPool) { 
mxStyleSheetPool=pPool; }
 
+void SetTheme(std::unique_ptr pTheme);
+svx::Theme* GetTheme();
+
 voidSetStarDrawPreviewMode(bool bPreview);
 boolIsStarDrawPreviewMode() const { return m_bStarDrawPreviewMode; }
 
diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx
index 7a04eb4e6314..91a44f1782ea 100644
--- a/svx/source/styles/ColorSets.cxx
+++ b/svx/source/styles/ColorSets.cxx
@@ -10,6 +10,10 @@
 
 #include 
 
+#include 
+
+#include 
+
 namespace svx
 {
 
@@ -21,6 +25,25 @@ ColorSet::ColorSet(OUString const & aColorSetName)
 ColorSets::ColorSets()
 {}
 
+void ColorSet::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("ColorSet"));
+(void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", 
this);
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("maColorSetName"),
+  
BAD_CAST(maColorSetName.toUtf8().getStr()));
+
+for (const auto& rColor : maColors)
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("Color"));
+std::stringstream ss;
+ss << rColor;
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"), 
BAD_CAST(ss.str().c_str()));
+(void)xmlTextWriterEndElement(pWriter);
+}
+
+(void)xmlTextWriterEndElement(pWriter);
+}
+
 ColorSets::~ColorSets()
 {}
 
@@ -102,6 +125,36 @@ const ColorSet& ColorSets::getColorSet(std::u16string_view 
rName)
 return maColorSets[0];
 }
 
+Theme::Theme(const OUString& rName)
+: maName(rName)
+{
+}
+
+Theme::~Theme() {}
+
+void Theme::SetColorSet(std::unique_ptr pColorSet) { mpColorSet = 
std::move(pColorSet); }
+
+ColorSet* Theme::GetColorSet() { return mpColorSet.get(); }
+
+void Theme::SetName(const OUString& rName) { maName = rName; }
+
+const OUString& Theme::GetName() const { return maName; }
+
+void Theme::dumpAsXml(xmlTextWriterPtr pWriter) const
+{
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST("Theme"));
+(void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", 
this);
+(void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("maName"),
+  BAD_CAST(maName.toUtf8().getStr()));
+
+if (mpColorSet)
+{
+mpColorSet->dumpAsXml(pWriter);
+}
+
+(void)xmlTextWriterEndElement(pWriter);
+}
+
 } // end of namespace svx
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff 

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

2021-11-05 Thread Noel Grandin (via logerrit)
 include/svx/svdedxv.hxx   |4 -
 svx/source/svdraw/svdedxv.cxx |   89 ++
 2 files changed, 50 insertions(+), 43 deletions(-)

New commits:
commit 8dcdad359207c237155292b74b2db77365a3c8ff
Author: Noel Grandin 
AuthorDate: Fri Nov 5 09:37:47 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Nov 5 09:54:46 2021 +0100

rename mxTextEditObj -> mxWeakTextEditObj

because it helps me keep the referencing counting strategy in my head
when reading the code

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

diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index ef2936c944eb..ed8f0c08939a 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -80,7 +80,7 @@ class SVXCORE_DLLPUBLIC SdrObjEditView : public 
SdrGlueEditView, public EditView
 
 protected:
 // TextEdit
-tools::WeakReference mxTextEditObj; // current object in 
TextEdit
+tools::WeakReference mxWeakTextEditObj; // current object in 
TextEdit
 SdrPageView* mpTextEditPV;
 std::unique_ptr mpTextEditOutliner; // outliner for the 
TextEdit
 OutlinerView* mpTextEditOutlinerView; // current view of the outliners
@@ -230,7 +230,7 @@ public:
 bool IsTextEditInSelectionMode() const;
 
 // If sb needs the object out of the TextEdit:
-SdrTextObj* GetTextEditObject() const { return mxTextEditObj.get(); }
+SdrTextObj* GetTextEditObject() const { return mxWeakTextEditObj.get(); }
 
 // info about TextEditPageView. Default is 0L.
 SdrPageView* GetTextEditPageView() const;
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index c10d8573c1bd..f046fb185057 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -242,13 +242,13 @@ void SdrObjEditView::Notify(SfxBroadcaster& rBC, const 
SfxHint& rHint)
 void SdrObjEditView::ModelHasChanged()
 {
 SdrGlueEditView::ModelHasChanged();
-if (mxTextEditObj.is() && !mxTextEditObj->IsInserted())
+if (mxWeakTextEditObj.is() && !mxWeakTextEditObj->IsInserted())
 SdrEndTextEdit(); // object deleted
 // TextEditObj changed?
 if (!IsTextEdit())
 return;
 
-SdrTextObj* pTextObj = mxTextEditObj.get();
+SdrTextObj* pTextObj = mxWeakTextEditObj.get();
 if (pTextObj != nullptr)
 {
 size_t nOutlViewCnt = mpTextEditOutliner->GetViewCount();
@@ -855,7 +855,7 @@ OutlinerView* 
SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, OutlinerVie
 {
 // background
 Color aBackground(GetTextEditBackgroundColor(*this));
-SdrTextObj* pText = mxTextEditObj.get();
+SdrTextObj* pText = mxWeakTextEditObj.get();
 bool bTextFrame = pText != nullptr && pText->IsTextFrame();
 bool bContourFrame = pText != nullptr && pText->IsContourTextFrame();
 // create OutlinerView
@@ -910,7 +910,7 @@ IMPL_LINK(SdrObjEditView, ImpOutlinerStatusEventHdl, 
EditStatus&, rEditStat, voi
 {
 if (mpTextEditOutliner)
 {
-SdrTextObj* pTextObj = mxTextEditObj.get();
+SdrTextObj* pTextObj = mxWeakTextEditObj.get();
 if (pTextObj)
 {
 pTextObj->onEditOutlinerStatusEvent();
@@ -923,7 +923,7 @@ void SdrObjEditView::ImpChainingEventHdl()
 if (!mpTextEditOutliner)
 return;
 
-SdrTextObj* pTextObj = mxTextEditObj.get();
+SdrTextObj* pTextObj = mxWeakTextEditObj.get();
 OutlinerView* pOLV = GetTextEditOutlinerView();
 if (pTextObj && pOLV)
 {
@@ -999,10 +999,10 @@ IMPL_LINK_NOARG(SdrObjEditView, 
ImpAfterCutOrPasteChainingEventHdl, LinkParamNon
 
 void SdrObjEditView::ImpMoveCursorAfterChainingEvent(TextChainCursorManager* 
pCursorManager)
 {
-if (!mxTextEditObj.is() || !pCursorManager)
+if (!mxWeakTextEditObj.is() || !pCursorManager)
 return;
 
-SdrTextObj* pTextObj = mxTextEditObj.get();
+SdrTextObj* pTextObj = mxWeakTextEditObj.get();
 
 // Check if it has links to move it to
 if (!pTextObj || !pTextObj->IsChainable())
@@ -1022,7 +1022,7 @@ IMPL_LINK(SdrObjEditView, ImpOutlinerCalcFieldValueHdl, 
EditFieldInfo*, pFI, voi
 bool bOk = false;
 OUString& rStr = pFI->GetRepresentation();
 rStr.clear();
-SdrTextObj* pTextObj = mxTextEditObj.get();
+SdrTextObj* pTextObj = mxWeakTextEditObj.get();
 if (pTextObj != nullptr)
 {
 std::optional pTxtCol;
@@ -1142,7 +1142,7 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, 
SdrPageView* pPV, vcl::W
 {
 mpTextEditWin = pWin;
 mpTextEditPV = pPV;
-mxTextEditObj.reset(pObj);
+mxWeakTextEditObj.reset(pObj);
 if (pGivenOutliner)
 {
 mpTextEditOutliner.reset(pGivenOutliner);
@@ -1150,7 +1150,7 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, 
SdrPageView* pPV, vcl::W
 }
 else
 mpTextEditOutliner 

  1   2   3   4   5   6   7   >