core.git: include/svx svx/source
include/svx/svdundo.hxx |8 svx/source/svdraw/svdundo.cxx | 38 +++--- 2 files changed, 23 insertions(+), 23 deletions(-) New commits: commit 84bd222947aeea27cf7705bdde615f5417e57ce4 Author: Miklos Vajna AuthorDate: Mon Jul 29 08:02:51 2024 +0200 Commit: Miklos Vajna CommitDate: Mon Jul 29 10:22:54 2024 +0200 svx: prefix members of SdrUndoObjSetText See tdf#94879 for motivation. Change-Id: I414fc94c35dc9caa2619b92eeaa436ad17fae5ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171168 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 8b172dec5d4e..60c79d3bf7c3 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -421,11 +421,11 @@ public: class SVXCORE_DLLPUBLIC SdrUndoObjSetText : public SdrUndoObj { std::optional -pOldText; +m_pOldText; std::optional -pNewText; -boolbNewTextAvailable; -boolbEmptyPresObj; +m_pNewText; +boolm_bNewTextAvailable; +boolm_bEmptyPresObj; sal_Int32 mnText; public: diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index ea55c6cea40a..a0454fc5c860 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -983,38 +983,38 @@ OUString SdrUndoSort::GetComment() const SdrUndoObjSetText::SdrUndoObjSetText(SdrObject& rNewObj, sal_Int32 nText) : SdrUndoObj(rNewObj) -, bNewTextAvailable(false) -, bEmptyPresObj(false) +, m_bNewTextAvailable(false) +, m_bEmptyPresObj(false) , mnText(nText) { SdrText* pText = static_cast< SdrTextObj*>( )->getText(mnText); if( pText && pText->GetOutlinerParaObject() ) -pOldText = *pText->GetOutlinerParaObject(); +m_pOldText = *pText->GetOutlinerParaObject(); -bEmptyPresObj = rNewObj.IsEmptyPresObj(); +m_bEmptyPresObj = rNewObj.IsEmptyPresObj(); } SdrUndoObjSetText::~SdrUndoObjSetText() { -pOldText.reset(); -pNewText.reset(); +m_pOldText.reset(); +m_pNewText.reset(); } bool SdrUndoObjSetText::IsDifferent() const { -if (!pOldText || !pNewText) -return pOldText || pNewText; -return *pOldText != *pNewText; +if (!m_pOldText || !m_pNewText) +return m_pOldText || m_pNewText; +return *m_pOldText != *m_pNewText; } void SdrUndoObjSetText::AfterSetText() { -if (!bNewTextAvailable) +if (!m_bNewTextAvailable) { SdrText* pText = static_cast< SdrTextObj*>( mxObj.get() )->getText(mnText); if( pText && pText->GetOutlinerParaObject() ) -pNewText = *pText->GetOutlinerParaObject(); -bNewTextAvailable=true; +m_pNewText = *pText->GetOutlinerParaObject(); +m_bNewTextAvailable=true; } } @@ -1033,7 +1033,7 @@ void SdrUndoObjSetText::Undo() ImpShowPageOfThisObject(); // save old text for Redo -if(!bNewTextAvailable) +if(!m_bNewTextAvailable) { AfterSetText(); } @@ -1042,10 +1042,10 @@ void SdrUndoObjSetText::Undo() if (pText) { // copy text for Undo, because the original now belongs to SetOutlinerParaObject() -pTarget->NbcSetOutlinerParaObjectForText(pOldText, pText); +pTarget->NbcSetOutlinerParaObjectForText(m_pOldText, pText); } -pTarget->SetEmptyPresObj(bEmptyPresObj); +pTarget->SetEmptyPresObj(m_bEmptyPresObj); pTarget->ActionChanged(); // #i124389# if it's a table, also need to relayout TextFrame @@ -1075,7 +1075,7 @@ void SdrUndoObjSetText::Redo() if (pText) { // copy text for Undo, because the original now belongs to SetOutlinerParaObject() -pTarget->NbcSetOutlinerParaObjectForText( pNewText, pText ); +pTarget->NbcSetOutlinerParaObjectForText( m_pNewText, pText ); } pTarget->ActionChanged(); @@ -1108,7 +1108,7 @@ OUString SdrUndoObjSetText::GetSdrRepeatComment() const void SdrUndoObjSetText::SdrRepeat(SdrView& rView) { const SdrMarkList& rMarkList = rView.GetMarkedObjectList(); -if (!(bNewTextAvailable && rMarkList.GetMarkCount() != 0)) +if (!(m_bNewTextAvailable && rMarkList.GetMarkCount() != 0)) return; const SdrMarkList& rML=rView.GetMarkedObjectList(); @@ -1130,7 +1130,7 @@ void SdrUndoObjSetText::SdrRepeat(SdrView& rView) if( bUndo ) rView.AddUndo(std::make_unique(*pTextObj,0)); -pTextObj->SetOutlinerParaObject(pNewText); +pTextObj->SetOutlinerParaObject(m_pNewText); } } @@ -1142,7 +1142,7 @@ bool SdrUndoObjSetText::CanSdrRepeat(SdrView& rView) const { bool bOk = false; const SdrMarkList& rMarkList =
core.git: include/svx svx/source
include/svx/svdobj.hxx|4 include/svx/svdoole2.hxx |2 ++ svx/source/svdraw/svdmrkv.cxx |2 +- svx/source/svdraw/svdobj.cxx |9 + 4 files changed, 16 insertions(+), 1 deletion(-) New commits: commit 0ee4b0339c3f3fd2f39f7193e2cf54df63a071b6 Author: Noel Grandin AuthorDate: Fri Jul 19 13:23:41 2024 +0200 Commit: Noel Grandin CommitDate: Fri Jul 19 20:47:20 2024 +0200 reduce cost of dynamic casting in SdrMarkView::CheckSingleSdrObjectHit which shows up when navigating large complex documents with lots of shapes Change-Id: I0631daf1365387f1192815402921ada191ab6046 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170760 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 8ddad97135ef..4692c2d36d59 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -51,6 +51,7 @@ class SdrItemPool; class SdrModel; class SdrObjList; class SdrObject; +class SdrOle2Obj; class SdrPage; class SdrPageView; class SdrTextObj; @@ -749,6 +750,7 @@ public: void SetMarkProtect(bool bProt); bool IsMarkProtect() const { return m_bMarkProt;} virtual bool IsSdrTextObj() const { return false; } +virtual bool IsSdrOle2Obj() const { return false; } virtual bool IsTextPath() const { return false ; } /// Whether the aspect ratio should be kept by default when resizing. @@ -988,6 +990,8 @@ SVXCORE_DLLPUBLIC E3dObject* DynCastE3dObject(SdrObject*); inline const E3dObject* DynCastE3dObject(const SdrObject* p) { return DynCastE3dObject(const_cast(p)); } SVXCORE_DLLPUBLIC SdrTextObj* DynCastSdrTextObj(SdrObject*); inline const SdrTextObj* DynCastSdrTextObj(const SdrObject* p) { return DynCastSdrTextObj(const_cast(p)); } +SVXCORE_DLLPUBLIC SdrOle2Obj* DynCastSdrOle2Obj(SdrObject*); +inline const SdrOle2Obj* DynCastSdrOle2Obj(const SdrObject* p) { return DynCastSdrOle2Obj(const_cast(p)); } struct SdrObjCreatorParams diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx index 43ea27fd3752..ec9a0f6b4d0e 100644 --- a/include/svx/svdoole2.hxx +++ b/include/svx/svdoole2.hxx @@ -183,6 +183,8 @@ public: // #i118485# missing converter added virtual rtl::Reference DoConvertToPolyObj(bool bBezier, bool bAddText) const override; + +virtual bool IsSdrOle2Obj() const final { return true; } }; class SVXCORE_DLLPUBLIC SdrEmbedObjectLink final : public sfx2::SvBaseLink diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index b94721c85e24..a39796d8081f 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -2433,7 +2433,7 @@ SdrObject* SdrMarkView::CheckSingleSdrObjectHit(const Point& rPnt, sal_uInt16 nT const bool bCheckIfMarkable(nOptions & SdrSearchOptions::TESTMARKABLE); const bool bDeep(nOptions & SdrSearchOptions::DEEP); -const bool bOLE(dynamic_cast< const SdrOle2Obj* >(pObj) != nullptr); +const bool bOLE(DynCastSdrOle2Obj(pObj) != nullptr); auto pTextObj = DynCastSdrTextObj( pObj); const bool bTXT(pTextObj && pTextObj->IsTextFrame()); SdrObject* pRet=nullptr; diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index f4c168522b6f..1db55afe2be6 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -3242,6 +3242,15 @@ SdrTextObj* DynCastSdrTextObj(SdrObject* pObj) return nullptr; } +SdrOle2Obj* DynCastSdrOle2Obj(SdrObject* pObj) +{ +// SdrTextObj has subclasses, with lots of SdrObjKind identifiers, so use a virtual method +// to be safer. +if( pObj && pObj->IsSdrOle2Obj() ) +return static_cast(pObj); +return nullptr; +} + rtl::Reference SdrObjFactory::CreateObjectFromFactory(SdrModel& rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier) { SdrObjCreatorParams aParams { nInventor, nObjIdentifier, rSdrModel };
core.git: include/svx svx/source
include/svx/EnhancedCustomShape2d.hxx |9 +- svx/source/customshapes/EnhancedCustomShape2d.cxx | 90 +++--- 2 files changed, 50 insertions(+), 49 deletions(-) New commits: commit c4e96e685c553327e83dc46f937d44b9f7c0c004 Author: Noel Grandin AuthorDate: Mon Jul 15 14:06:35 2024 +0200 Commit: Noel Grandin CommitDate: Mon Jul 15 18:46:40 2024 +0200 delay parsing of formula in EnhancedCustomShape2d We create a bunch of temporary copies of these during layout in writer, and we don't appear to need the equation results at that point. Speeds up display of a complex DOCX file load by 10% Change-Id: Ic5870931caba13cd79b07617d04b70616f06c5b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170498 Reviewed-by: Noel Grandin Tested-by: Jenkins diff --git a/include/svx/EnhancedCustomShape2d.hxx b/include/svx/EnhancedCustomShape2d.hxx index 3947da9c31c4..ba638b0be900 100644 --- a/include/svx/EnhancedCustomShape2d.hxx +++ b/include/svx/EnhancedCustomShape2d.hxx @@ -104,12 +104,13 @@ class SVXCORE_DLLPUBLIC EnhancedCustomShape2d final : public SfxItemSet */ struct SAL_DLLPRIVATE EquationResult { -bool bReady; -double fValue; +mutable bool bParsed = false; +bool bReady = false; +double fValue = 0; +mutable std::shared_ptr< EnhancedCustomShape::ExpressionNode > xNode; }; css::uno::Sequence< OUString > m_seqEquations; -std::vector< std::shared_ptr< EnhancedCustomShape::ExpressionNode > > m_vNodesSharedPtr; -std::vector< EquationResult > m_vEquationResults; +std::vector< EquationResult > m_vEquationResults; css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > m_seqSegments; css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> m_seqCoordinates; diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 8bbd3a2bd555..bc640da6af2d 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -853,23 +853,7 @@ EnhancedCustomShape2d::EnhancedCustomShape2d(SdrObjCustomShape& rSdrObjCustomSha if ( !nLength ) return; -m_vNodesSharedPtr.resize( nLength ); m_vEquationResults.resize( nLength ); -for ( sal_Int32 i = 0; i < nLength; i++ ) -{ -m_vEquationResults[ i ].bReady = false; -try -{ -m_vNodesSharedPtr[ i ] = EnhancedCustomShape::FunctionParser::parseFunction( m_seqEquations[ i ], *this ); -} -catch ( EnhancedCustomShape::ParseError& ) -{ -SAL_INFO( -"svx", -"error: equation number: " << i << ", parser failed (" -<< m_seqEquations[i] << ")"); -} -} } using EnhancedCustomShape::ExpressionFunct; @@ -916,39 +900,55 @@ double EnhancedCustomShape2d::GetEquationValueAsDouble( const sal_Int32 nIndex ) { double fNumber = 0.0; static sal_uInt32 nLevel = 0; -if ( nIndex < static_cast(m_vNodesSharedPtr.size()) ) +if ( nIndex >= static_cast(m_vEquationResults.size()) ) +return fNumber; + +if (!m_vEquationResults[nIndex].bParsed) { -if ( m_vNodesSharedPtr[ nIndex ] ) { -nLevel ++; -try -{ -if ( m_vEquationResults[ nIndex ].bReady ) -fNumber = m_vEquationResults[ nIndex ].fValue; -else { -// cast to non const, so that we can optimize by caching -// equation results, without changing all the const in the stack -struct EquationResult = const_cast(this)->m_vEquationResults[ nIndex ]; - -fNumber = aResult.fValue = (*m_vNodesSharedPtr[ nIndex ])(); -aResult.bReady = true; - -SAL_INFO("svx", "equation " << nLevel << " (level: " << m_seqEquations[nIndex] << "): " - << fNumber << " --> " << 180.0*fNumber/1080.0); -} -if ( !std::isfinite( fNumber ) ) -fNumber = 0.0; -} -catch ( ... ) -{ -SAL_WARN("svx", "EnhancedCustomShape2d::GetEquationValueAsDouble failed"); +m_vEquationResults[nIndex].bParsed = true; +try +{ +m_vEquationResults[nIndex].xNode = EnhancedCustomShape::FunctionParser::parseFunction( m_seqEquations[ nIndex ], *this ); +} +catch ( EnhancedCustomShape::ParseError& ) +{ +SAL_INFO( +
core.git: include/svx svx/source sw/source
include/svx/svdobj.hxx |4 svx/source/svdraw/svdobj.cxx | 30 ++ sw/source/core/doc/textboxhelper.cxx |9 + 3 files changed, 35 insertions(+), 8 deletions(-) New commits: commit f98f684d22e6323185104ca9c082241c53dfc2b3 Author: Noel Grandin AuthorDate: Sat Jul 13 18:50:34 2024 +0200 Commit: Noel Grandin CommitDate: Mon Jul 15 11:19:50 2024 +0200 remove RecalcObjOrdNums in DoTextBoxZOrderCorrection (1) We already do this recalculation automatically using a dirty flag. (2) Add a custom method so we don't trigger that recalculation here Speeds up display of a complex DOCX file load by 10% Change-Id: I2a8c975ba0711172bc3e0c20c0e89f08351b6126 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170431 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index f1bee52e87ec..0cae8296c478 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -376,6 +376,10 @@ public: /// SdrObjects in the SdrObjList. sal_uInt32 GetOrdNum() const; +/// Ensure this object is sorted immediatedly after rFirst +/// ie. rFirst.GetOrdNum() + 1 == this->GetOrdNum() +void ensureSortedImmediatelyAfter(const SdrObject& rFirst); + // setting the order number should only happen from the model or from the page void SetOrdNum(sal_uInt32 nNum); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index fe95f30b6532..f4c168522b6f 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -888,6 +888,36 @@ void SdrObject::SetOrdNum(sal_uInt32 nNum) m_nOrdNum = nNum; } +/// Try to ensure the desired result __without__ triggering RecalcObjOrdNums +void SdrObject::ensureSortedImmediatelyAfter(const SdrObject& rFirst) +{ +SdrObjList* pParentList = getParentSdrObjListFromSdrObject(); +assert(pParentList == rFirst.getParentSdrObjListFromSdrObject()); +bool bDirty = pParentList->IsObjOrdNumsDirty(); +if (!bDirty) +{ +pParentList->SetObjectOrdNum(GetOrdNum(), rFirst.GetOrdNum() + 1); +} +else +{ +std::optionalbegin())> itFound1, itFound2; +for (auto it = pParentList->begin(), itEnd = pParentList->end(); it != itEnd; ++it) +{ +if (*it == this) +itFound1 = it; +else if (*it == ) +itFound2 = it; +if (itFound1 && itFound2) +{ +auto ord1 = std::distance(pParentList->begin(), *itFound1); +auto ord2 = std::distance(pParentList->begin(), *itFound2); +pParentList->SetObjectOrdNum(ord1, ord2 + 1); +break; +} +} +} +} + void SdrObject::GetGrabBagItem(css::uno::Any& rVal) const { if (m_pGrabBagItem != nullptr) diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx index 4bc8b08092e6..084caf0af2aa 100644 --- a/sw/source/core/doc/textboxhelper.cxx +++ b/sw/source/core/doc/textboxhelper.cxx @@ -1533,17 +1533,10 @@ bool SwTextBoxHelper::DoTextBoxZOrderCorrection(SwFrameFormat* pShape, const Sdr if (pDrawModel) { // Not really sure this will work on all pages, but it seems it will. -auto pPage = pDrawModel->GetPage(0); -// Recalc all Z-orders -pPage->RecalcObjOrdNums(); // If the shape is behind the frame, is good, but if there are some objects // between of them that is wrong so put the frame exactly one level higher // than the shape. -if (pFrmObj->GetOrdNum() != pShpObj->GetOrdNum() + 1) -{ -pPage->SetObjectOrdNum(pFrmObj->GetOrdNum(), pShpObj->GetOrdNum() + 1); -pPage->RecalcObjOrdNums(); -} +pFrmObj->ensureSortedImmediatelyAfter(*pShpObj); return true; // Success } SAL_WARN("sw.core", "SwTextBoxHelper::DoTextBoxZOrderCorrection(): "
core.git: include/svx svx/source
include/svx/svdundo.hxx |4 ++-- svx/source/svdraw/svdundo.cxx |8 2 files changed, 6 insertions(+), 6 deletions(-) New commits: commit 3e1b67dabf585e04a34e82810387ae943b38ee41 Author: Miklos Vajna AuthorDate: Mon Jul 15 08:22:27 2024 +0200 Commit: Miklos Vajna CommitDate: Mon Jul 15 09:59:06 2024 +0200 svx: prefix members of SdrUndoObjOrdNum See tdf#94879 for motivation. Change-Id: I0ab21ca5171b5d5b66542dbf7157db0c156e45b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170487 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 95504986d1e1..8b172dec5d4e 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -373,8 +373,8 @@ public: class SdrUndoObjOrdNum final : public SdrUndoObj { -sal_uInt32 nOldOrdNum; -sal_uInt32 nNewOrdNum; +sal_uInt32 m_nOldOrdNum; +sal_uInt32 m_nNewOrdNum; public: SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1); diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index b711a5f4398a..ea55c6cea40a 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -900,8 +900,8 @@ void SdrUndoObjectLayerChange::Redo() SdrUndoObjOrdNum::SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1) : SdrUndoObj(rNewObj) -, nOldOrdNum(nOldOrdNum1) -, nNewOrdNum(nNewOrdNum1) +, m_nOldOrdNum(nOldOrdNum1) +, m_nNewOrdNum(nNewOrdNum1) { } @@ -916,7 +916,7 @@ void SdrUndoObjOrdNum::Undo() OSL_FAIL("UndoObjOrdNum: mxObj does not have an ObjList."); return; } -pOL->SetObjectOrdNum(nNewOrdNum,nOldOrdNum); +pOL->SetObjectOrdNum(m_nNewOrdNum,m_nOldOrdNum); } void SdrUndoObjOrdNum::Redo() @@ -927,7 +927,7 @@ void SdrUndoObjOrdNum::Redo() OSL_FAIL("RedoObjOrdNum: mxObj does not have an ObjList."); return; } -pOL->SetObjectOrdNum(nOldOrdNum,nNewOrdNum); +pOL->SetObjectOrdNum(m_nOldOrdNum,m_nNewOrdNum); // Trigger PageChangeCall ImpShowPageOfThisObject();
core.git: include/svx svx/source
include/svx/svdobj.hxx |2 +- svx/source/svdraw/svdedxv.cxx |6 +- svx/source/svdraw/svdobj.cxx|2 +- svx/source/svdraw/svdoedge.cxx |4 ++-- svx/source/unodraw/unoshtxt.cxx | 12 +--- 5 files changed, 14 insertions(+), 12 deletions(-) New commits: commit 4d0ba0badeb5a83d8eb5373ba5d7ef931dcf62c9 Author: Noel Grandin AuthorDate: Wed Jun 26 11:18:47 2024 +0200 Commit: Noel Grandin CommitDate: Wed Jun 26 18:53:12 2024 +0200 reduce number of SvxTextEditSourceImpl listeners on SdrModel when we have a lot of shapes, the number of listeners attached to SdrModel becomes a serious bottleneck because of the number of broadcast/notify function calls. But SvxTextEditSourceImpl can just as well listen to the SdrObject, which achieves the same end, and reduces the bottleneck on the SdrModel. We do have to adjust some of the broadcast sites to broadcast the event to the SdrObject listeners as well as the SdrModel listeners. Possibly as another change we can remove the broadcasting to the SdrModel listeners. This shaves 10% off the load time of a large DOCX with lots of shapes. Noting that we do no need to listen to SdrHintKind::ModelCleared because we will get called via SvxTextEditSourceImpl::ObjectInDestruction when the model is destroyed. Change-Id: I3f7f6aa2a2146e4c4f59c974aa3fed92becf5eca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169565 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 8dd17bdc00f5..f1bee52e87ec 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -409,7 +409,7 @@ public: void BroadcastObjectChange() const; -const SfxBroadcaster* GetBroadcaster() const; +SfxBroadcaster* GetBroadcaster() const; // set modified-flag in the model virtual void SetChanged(); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 6071fbc042bd..fe647da817a1 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -1577,6 +1577,8 @@ bool SdrObjEditView::SdrBeginTextEdit(SdrObject* pObj_, SdrPageView* pPV, vcl::W SdrHint aHint(SdrHintKind::BeginEdit, *pTextObj); GetModel().Broadcast(aHint); +if (auto pBroadcaster = pTextObj->GetBroadcaster()) +pBroadcaster->Broadcast(aHint); mpTextEditOutliner->setVisualizedPage(nullptr); @@ -1715,6 +1717,8 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally) { SdrHint aHint(SdrHintKind::EndEdit, *pTextEditObj); GetModel().Broadcast(aHint); +if (auto pBroadcaster = pTextEditObj->GetBroadcaster()) +pBroadcaster->Broadcast(aHint); } // if new mechanism was used, clean it up. At cleanup no need to check @@ -1895,7 +1899,7 @@ SdrEndTextEditKind SdrObjEditView::SdrEndTextEdit(bool bDontDeleteReally) if (pTEObj && !pTEObj->getSdrModelFromSdrObject().isLocked() && pTEObj->GetBroadcaster()) { SdrHint aHint(SdrHintKind::EndEdit, *pTEObj); - const_cast(pTEObj->GetBroadcaster())->Broadcast(aHint); +pTEObj->GetBroadcaster()->Broadcast(aHint); } if (pUndoEditUndoManager) diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index a598517d6893..6c8330185f0a 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -684,7 +684,7 @@ void SdrObject::RemoveListener(SfxListener& rListener) } } -const SfxBroadcaster* SdrObject::GetBroadcaster() const +SfxBroadcaster* SdrObject::GetBroadcaster() const { return m_pPlusData!=nullptr ? m_pPlusData->pBroadcast.get() : nullptr; } diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 948b39a1d3b5..b37385a93c73 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -1708,13 +1708,13 @@ void SdrEdgeObj::Reformat() if( nullptr != m_aCon1.m_pSdrObj ) { SfxHint aHint( SfxHintId::DataChanged ); -Notify( *const_cast(m_aCon1.m_pSdrObj->GetBroadcaster()), aHint ); +Notify( *m_aCon1.m_pSdrObj->GetBroadcaster(), aHint ); } if( nullptr != m_aCon2.m_pSdrObj ) { SfxHint aHint( SfxHintId::DataChanged ); -Notify( *const_cast(m_aCon2.m_pSdrObj->GetBroadcaster()), aHint ); +Notify( *m_aCon2.m_pSdrObj->GetBroadcaster(), aHint ); } } diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 37314e6f1bb6..33c5a5dc0c29 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -175,11 +175,11 @@ SvxTextEditSourceImpl::SvxTextEditSourceImpl( SdrObject* pObject, SdrText* pText mpText = pTextObj->getText( 0 ); } -if( mpModel ) -StartListening( *mpModel ); - if( mpObject ) +{ +
core.git: include/svx svx/source
include/svx/svdundo.hxx |4 ++-- svx/source/svdraw/svdundo.cxx |6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) New commits: commit 23f7ef1c6d06262d1557f8978b48c5275b3d9585 Author: Miklos Vajna AuthorDate: Mon Jun 24 08:58:03 2024 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 24 16:47:04 2024 +0200 svx: prefix members of SdrUndoMoveObj See tdf#94879 for motivation. Change-Id: If81831d76617da9b9d6ac5aef2e223065e939c4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169446 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 743afaced0e3..95504986d1e1 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -188,10 +188,10 @@ public: class SVXCORE_DLLPUBLIC SdrUndoMoveObj final : public SdrUndoObj { -Size aDistance; // Distance by which we move +Size m_aDistance; // Distance by which we move public: -SdrUndoMoveObj(SdrObject& rNewObj, const Size& rDist): SdrUndoObj(rNewObj),aDistance(rDist) {} +SdrUndoMoveObj(SdrObject& rNewObj, const Size& rDist): SdrUndoObj(rNewObj),m_aDistance(rDist) {} virtual ~SdrUndoMoveObj() override; virtual void Undo() override; diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index defe2b362f79..b711a5f4398a 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -521,12 +521,12 @@ void SdrUndoMoveObj::Undo() // Trigger PageChangeCall ImpShowPageOfThisObject(); -mxObj->Move(Size(-aDistance.Width(),-aDistance.Height())); +mxObj->Move(Size(-m_aDistance.Width(),-m_aDistance.Height())); } void SdrUndoMoveObj::Redo() { -mxObj->Move(Size(aDistance.Width(),aDistance.Height())); +mxObj->Move(Size(m_aDistance.Width(),m_aDistance.Height())); // Trigger PageChangeCall ImpShowPageOfThisObject(); @@ -539,7 +539,7 @@ OUString SdrUndoMoveObj::GetComment() const void SdrUndoMoveObj::SdrRepeat(SdrView& rView) { -rView.MoveMarkedObj(aDistance); +rView.MoveMarkedObj(m_aDistance); } bool SdrUndoMoveObj::CanSdrRepeat(SdrView& rView) const
core.git: include/svx svx/source sw/source
include/svx/ruler.hxx |7 +++ svx/source/dialog/svxruler.cxx| 48 ++ sw/source/uibase/inc/swruler.hxx |5 -- sw/source/uibase/misc/swruler.cxx | 68 -- 4 files changed, 54 insertions(+), 74 deletions(-) New commits: commit 66247fe7bdb089a897f9a02b96c888b92b67154d Author: Tomaž Vajngerl AuthorDate: Thu May 16 19:52:32 2024 +0900 Commit: Tomaž Vajngerl CommitDate: Thu Jun 20 04:53:18 2024 +0200 svx: move lok's NotifyKit in the ruler to the SvxRuler super-class We want to make the ruler work in other components and also not only for horizontal orientation. For this we want the NotifyKit already in the SvxRuler, which is used by all rulers. This change moves the functionality to the from SwCommentRuler to SvxRuler and partially reverts the previous attempt as changing the ruler instance for vertical ruelr to SwCommentRuler caused test failures. Change-Id: Ie618b5dc5b936f9dc53d09b624eefdbc506d98f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167740 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna (cherry picked from commit 9f26e04c8f97af9139e2f4be335fe6999d26a387) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168985 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/svx/ruler.hxx b/include/svx/ruler.hxx index 486515f1822a..f9d91412b229 100644 --- a/include/svx/ruler.hxx +++ b/include/svx/ruler.hxx @@ -40,6 +40,7 @@ class SfxRectangleItem; class SvxObjectItem; class SfxBoolItem; struct SvxRuler_Impl; +namespace tools { class JsonWriter; } enum class RulerChangeType { @@ -162,6 +163,8 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener void UpdateColumns(); void UpdateObject(); +void NotifyKit(); + // Convert position to stick to ruler ticks tools::Long MakePositionSticky(tools::Long rValue, tools::Long aPointOfReference, bool aSnapToFrameMargin = true) const; @@ -230,6 +233,8 @@ class SVX_DLLPUBLIC SvxRuler: public Ruler, public SfxListener void UpdateParaContents_Impl(tools::Long lDiff, UpdateType); protected: +bool isHorizontal() { return bHorz; } + virtual voidCommand( const CommandEvent& rCEvt ) override; virtual voidClick() override; virtual boolStartDrag() override; @@ -275,6 +280,8 @@ public: Update(); } +void CreateJsonNotification(tools::JsonWriter& rJsonWriter); + //#i24363# tab stops relative to indent void SetTabsRelativeToIndent( bool bRel ); void SetValues(RulerChangeType type, tools::Long value); diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx index d1824a25d469..e0b84b9ad1ba 100644 --- a/svx/source/dialog/svxruler.cxx +++ b/svx/source/dialog/svxruler.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -44,7 +45,10 @@ #include #include #include - +#include +#include +#include +#include #include "rlrcitem.hxx" #include @@ -1141,6 +1145,46 @@ void SvxRuler::SetNullOffsetLogic(tools::Long lVal) // Setting of the logic Null Update(); } +void SvxRuler::CreateJsonNotification(tools::JsonWriter& rJsonWriter) +{ +rJsonWriter.put("margin1", convertTwipToMm100(GetMargin1())); +rJsonWriter.put("margin2", convertTwipToMm100(GetMargin2())); +rJsonWriter.put("leftOffset", convertTwipToMm100(GetNullOffset())); +rJsonWriter.put("pageOffset", convertTwipToMm100(GetPageOffset())); + +rJsonWriter.put("pageWidth", convertTwipToMm100(GetPageWidth())); +{ +auto tabsNode = rJsonWriter.startNode("tabs"); + +// The RulerTab array elements that GetTabs() returns have their nPos field in twips. So these +// too are actual mm100. +for (auto const& tab : GetTabs()) +{ +auto tabNode = rJsonWriter.startNode(""); +rJsonWriter.put("position", convertTwipToMm100(tab.nPos)); +rJsonWriter.put("style", tab.nStyle); +} +} + +RulerUnitData aUnitData = GetCurrentRulerUnit(); +rJsonWriter.put("unit", aUnitData.aUnitStr); +} + +void SvxRuler::NotifyKit() +{ +if (!comphelper::LibreOfficeKit::isActive()) +return; +SfxViewShell* pViewShell = SfxViewShell::Current(); +if (!pViewShell) +return; + +tools::JsonWriter aJsonWriter; +CreateJsonNotification(aJsonWriter); +OString pJsonData = aJsonWriter.finishAndGetAsOString(); +LibreOfficeKitCallbackType eType = isHorizontal() ? LOK_CALLBACK_RULER_UPDATE : LOK_CALLBACK_VERTICAL_RULER_UPDATE; +pViewShell->libreOfficeKitViewCallback(eType, pJsonData); +} + void SvxRuler::Update() { /* Perform update of view */ @@ -1159,6 +1203,8 @@ void SvxRuler::Update() if(nFlags & SvxRulerSupportFlags::TABS) UpdateTabs(); + +NotifyKit(); } tools::Long SvxRuler::GetPageWidth()
core.git: include/svx svx/source
include/svx/svdundo.hxx | 12 ++-- svx/source/svdraw/svdundo.cxx | 10 +- 2 files changed, 11 insertions(+), 11 deletions(-) New commits: commit 279246a6e8058d4b0125e5a59c46974af7f09d73 Author: Miklos Vajna AuthorDate: Mon Jun 17 08:04:35 2024 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 17 13:24:41 2024 +0200 svx: prefix members of SdrUndoGroup See tdf#94879 for motivation. Change-Id: I9aa439b2fba8c10710ea0f491272a5f9823a27a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168979 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index bc15932fd81c..743afaced0e3 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -94,10 +94,10 @@ class SVXCORE_DLLPUBLIC SdrUndoGroup final : public SdrUndoAction std::vector> maActions; // No expanded description of the Action (contains %O) -OUString aComment; -OUString aObjDescription; +OUString m_aComment; +OUString m_aObjDescription; -SdrRepeatFunc eFunction; +SdrRepeatFunc m_eFunction; public: SdrUndoGroup(SdrModel& rNewMod); @@ -107,8 +107,8 @@ public: SdrUndoAction* GetAction(sal_Int32 nNum) const { return maActions[nNum].get(); } void AddAction(std::unique_ptr pAct); -void SetComment(const OUString& rStr) { aComment=rStr; } -void SetObjDescription(const OUString& rStr) { aObjDescription=rStr; } +void SetComment(const OUString& rStr) { m_aComment=rStr; } +void SetObjDescription(const OUString& rStr) { m_aObjDescription=rStr; } virtual OUString GetComment() const override; virtual OUString GetSdrRepeatComment() const override; @@ -117,7 +117,7 @@ public: virtual bool CanSdrRepeat(SdrView& rView) const override; virtual void SdrRepeat(SdrView& rView) override; -void SetRepeatFunction(SdrRepeatFunc eFunc) { eFunction=eFunc; } +void SetRepeatFunction(SdrRepeatFunc eFunc) { m_eFunction=eFunc; } }; /** diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 7d98d21b7cb4..defe2b362f79 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -110,7 +110,7 @@ ViewShellId SdrUndoAction::GetViewShellId() const SdrUndoGroup::SdrUndoGroup(SdrModel& rNewMod) : SdrUndoAction(rNewMod), -eFunction(SdrRepeatFunc::NONE) +m_eFunction(SdrRepeatFunc::NONE) {} SdrUndoGroup::~SdrUndoGroup() @@ -136,12 +136,12 @@ void SdrUndoGroup::Redo() OUString SdrUndoGroup::GetComment() const { -return aComment.replaceAll("%1", aObjDescription); +return m_aComment.replaceAll("%1", m_aObjDescription); } bool SdrUndoGroup::CanSdrRepeat(SdrView& rView) const { -switch (eFunction) +switch (m_eFunction) { case SdrRepeatFunc::NONE : return false; case SdrRepeatFunc::Delete : return rView.GetMarkedObjectList().GetMarkCount() != 0; @@ -166,7 +166,7 @@ bool SdrUndoGroup::CanSdrRepeat(SdrView& rView) const void SdrUndoGroup::SdrRepeat(SdrView& rView) { -switch (eFunction) +switch (m_eFunction) { case SdrRepeatFunc::NONE: break; case SdrRepeatFunc::Delete : rView.DeleteMarked(); break; @@ -190,7 +190,7 @@ void SdrUndoGroup::SdrRepeat(SdrView& rView) OUString SdrUndoGroup::GetSdrRepeatComment() const { -return aComment.replaceAll("%1", SvxResId(STR_ObjNameSingulPlural)); +return m_aComment.replaceAll("%1", SvxResId(STR_ObjNameSingulPlural)); } SdrUndoObj::SdrUndoObj(SdrObject& rNewObj)
core.git: include/svx svx/source
include/svx/strings.hrc | 11 +-- svx/source/dialog/charmap.cxx |2 +- 2 files changed, 6 insertions(+), 7 deletions(-) New commits: commit 1f3c82e3b0171bac89cbc7d1ec1ca89fac1c7eec Author: Taichi Haradaguchi <20001...@ymail.ne.jp> AuthorDate: Sun Apr 28 15:35:56 2024 +0900 Commit: <20001...@ymail.ne.jp> CommitDate: Wed Jun 12 13:03:54 2024 +0200 Fix Unicode block names === Unicode block names === * Change "Basic Greek" to "Greek and Coptic". * Change "Canadian..." to "Unified Canadian...". * Change "C1 Controls and Latin-1 Supplement" to "Latin-1 Supplement" because "Latin-1 Supplement" is the more commonly used name. These modified Unicode block names are based on the descriptions on the following pages: https://www.unicode.org/charts/PDF/U0370.pdf https://www.unicode.org/charts/PDF/U1400.pdf https://www.unicode.org/charts/PDF/U18B0.pdf https://www.unicode.org/charts/PDF/U11AB0.pdf https://www.unicode.org/charts/ https://en.wikipedia.org/wiki/Latin-1_Supplement === Others === * Remove unused RID_SUBSETSTR_GREEK_SYMS_COPTIC. * Change RID_SUBSETSTR_BASIC_GREEK to RID_SUBSETSTR_GREEK. Change-Id: I91573a825a7b34349f29143ea8940da2383b260f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166790 Tested-by: Jenkins Reviewed-by: <20001...@ymail.ne.jp> diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index b8e69dc3dbe1..2b46e77b6b66 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -1464,14 +1464,13 @@ #define RID_SVXSTR_SAVE_MODIFIED_IMAGE NC_("RID_SVXSTR_SAVE_MODIFIED_IMAGE", "The image has been modified. By default the original image will be saved. Do you want to save the modified version instead?") #define RID_SUBSETSTR_BASIC_LATIN NC_("RID_SUBSETMAP", "Basic Latin") -#define RID_SUBSETSTR_LATIN_1_SUPPLEMENT NC_("RID_SUBSETMAP", "C1 Controls and Latin-1 Supplement") +#define RID_SUBSETSTR_LATIN_1_SUPPLEMENT NC_("RID_SUBSETMAP", "Latin-1 Supplement") #define RID_SUBSETSTR_LATIN_EXTENDED_A NC_("RID_SUBSETMAP", "Latin Extended-A") #define RID_SUBSETSTR_LATIN_EXTENDED_B NC_("RID_SUBSETMAP", "Latin Extended-B") #define RID_SUBSETSTR_IPA_EXTENSIONS NC_("RID_SUBSETMAP", "IPA Extensions") #define RID_SUBSETSTR_SPACING_MODIFIERS NC_("RID_SUBSETMAP", "Spacing Modifier Letters") #define RID_SUBSETSTR_COMB_DIACRITICAL NC_("RID_SUBSETMAP", "Combining Diacritical Marks") -#define RID_SUBSETSTR_BASIC_GREEK NC_("RID_SUBSETMAP", "Basic Greek") -#define RID_SUBSETSTR_GREEK_SYMS_COPTIC NC_("RID_SUBSETMAP", "Greek Symbols And Coptic") +#define RID_SUBSETSTR_GREEK NC_("RID_SUBSETMAP", "Greek and Coptic") #define RID_SUBSETSTR_CYRILLIC NC_("RID_SUBSETMAP", "Cyrillic") #define RID_SUBSETSTR_ARMENIAN NC_("RID_SUBSETMAP", "Armenian") #define RID_SUBSETSTR_BASIC_HEBREW NC_("RID_SUBSETMAP", "Basic Hebrew") @@ -1571,7 +1570,7 @@ #define RID_SUBSETSTR_THAANA NC_("RID_SUBSETMAP", "Thaana") #define RID_SUBSETSTR_ETHIOPIC NC_("RID_SUBSETMAP", "Ethiopic") #define RID_SUBSETSTR_CHEROKEE NC_("RID_SUBSETMAP", "Cherokee") -#define RID_SUBSETSTR_CANADIAN_ABORIGINAL NC_("RID_SUBSETMAP", "Canadian Aboriginal Syllables") +#define RID_SUBSETSTR_CANADIAN_ABORIGINAL NC_("RID_SUBSETMAP", "Unified Canadian Aboriginal Syllables") #define RID_SUBSETSTR_MONGOLIAN NC_("RID_SUBSETMAP", "Mongolian") #define RID_SUBSETSTR_MISC_MATH_SYMS_A NC_("RID_SUBSETMAP", "Miscellaneous Mathematical Symbols-A") #define RID_SUBSETSTR_SUPPL_ARROWS_A NC_("RID_SUBSETMAP", "Supplemental Arrows-A") @@ -1638,7 +1637,7 @@ #define RID_SUBSETSTR_MAHJONG_TILES NC_("RID_SUBSETMAP", "Mahjong Tiles") #define RID_SUBSETSTR_DOMINO_TILES NC_("RID_SUBSETMAP", "Domino Tiles") #define RID_SUBSETSTR_SAMARITAN NC_("RID_SUBSETMAP", "Samaritan") -#define RID_SUBSETSTR_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED NC_("RID_SUBSETMAP", "Canadian Aboriginal Syllabics Extended") +#define RID_SUBSETSTR_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED NC_("RID_SUBSETMAP", "Unified Canadian Aboriginal Syllabics Extended") #define RID_SUBSETSTR_TAI_THAM NC_("RID_SUBSETMAP", "Tai Tham") #define RID_SUBSETSTR_VEDIC_EXTENSIONS NC_("RID_SUBSETMAP", "Vedic Extensions") #define RID_SUBSETSTR_LISU
core.git: include/svx svx/source
include/svx/svdograf.hxx | 14 ++--- svx/source/svdraw/svdograf.cxx | 104 - 2 files changed, 59 insertions(+), 59 deletions(-) New commits: commit fd7418c1f75e855a19078c6288a024b1b465f614 Author: Miklos Vajna AuthorDate: Mon Jun 10 08:41:56 2024 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 10 09:54:14 2024 +0200 svx: prefix members of SdrGrafObj See tdf#94879 for motivation. Change-Id: Icc587c31582fb5fdfbdfe375005b96ea219bf4a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168597 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx index ec2c94ab3f45..88296f4a2629 100644 --- a/include/svx/svdograf.hxx +++ b/include/svx/svdograf.hxx @@ -79,14 +79,14 @@ private: SAL_DLLPRIVATE virtual std::unique_ptr CreateObjectSpecificProperties() override; SAL_DLLPRIVATE void ImpSetAttrToGrafInfo(); // Copy values from the pool -GraphicAttr aGrafInfo; +GraphicAttr m_aGrafInfo; -OUString aFileName; // If it's a Link, the filename can be found in here -OUString aFilterName; +OUString m_aFileName; // If it's a Link, the filename can be found in here +OUString m_aFilterName; std::unique_ptr mpGraphicObject; // In order to speed up output of bitmaps, especially rotated ones std::unique_ptr mpReplacementGraphicObject; -SdrGraphicLink* pGraphicLink; // And here a pointer for linked graphics -bool bMirrored:1; // True: the graphic is horizontal, which means it's mirrored along the y-axis +SdrGraphicLink* m_pGraphicLink; // And here a pointer for linked graphics +bool m_bMirrored:1; // True: the graphic is horizontal, which means it's mirrored along the y-axis // Flag for allowing text animation. Default is true. bool mbGrafAnimationAllowed:1; @@ -157,7 +157,7 @@ public: voidReleaseGraphicLink(); bool IsLinkedGraphic() const; -const OUString& GetFileName() const { return aFileName;} +const OUString& GetFileName() const { return m_aFileName;} voidStartAnimation(); @@ -192,7 +192,7 @@ public: SAL_DLLPRIVATE virtual voidNotify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; -bool IsMirrored() const { return bMirrored;} +bool IsMirrored() const { return m_bMirrored;} SAL_DLLPRIVATE void SetMirrored( bool _bMirrored ); virtual bool shouldKeepAspectRatio() const override { return true; } diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 1e09eccab766..a0c97cc3dde9 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -86,7 +86,7 @@ SdrGraphicLink::SdrGraphicLink(SdrGrafObj& rObj) if( pLinkManager && rValue.hasValue() ) { -sfx2::LinkManager::GetDisplayNames( this, nullptr, , nullptr, ); +sfx2::LinkManager::GetDisplayNames( this, nullptr, _aFileName, nullptr, _aFilterName ); Graphic aGraphic; if (pLinkManager->GetGraphicFromAny(rMimeType, rValue, aGraphic, nullptr)) @@ -106,7 +106,7 @@ void SdrGraphicLink::Closed() { // close connection; set pLink of the object to NULL, as link instance is just about getting destructed. rGrafObj.ForceSwapIn(); -rGrafObj.pGraphicLink=nullptr; +rGrafObj.m_pGraphicLink=nullptr; rGrafObj.ReleaseGraphicLink(); SvBaseLink::Closed(); } @@ -181,8 +181,8 @@ void SdrGrafObj::onGraphicChanged() SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel) : SdrRectObj(rSdrModel) ,mpGraphicObject(new GraphicObject) -,pGraphicLink(nullptr) -,bMirrored(false) +,m_pGraphicLink(nullptr) +,m_bMirrored(false) ,mbIsSignatureLine(false) ,mbIsSignatureLineShowSignDate(true) ,mbIsSignatureLineCanAddComment(false) @@ -205,7 +205,7 @@ SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel) SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel, SdrGrafObj const & rSource) : SdrRectObj(rSdrModel, rSource) ,mpGraphicObject(new GraphicObject) -,pGraphicLink(nullptr) +,m_pGraphicLink(nullptr) { onGraphicChanged(); @@ -220,8 +220,8 @@ SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel, SdrGrafObj const & rSource) // #i25616# mbSupportTextIndentingOnLineWidthChange = false; -aFileName = rSource.aFileName; -bMirrored = rSource.bMirrored; +m_aFileName = rSource.m_aFileName; +m_bMirrored = rSource.m_bMirrored; mbIsSignatureLine = rSource.mbIsSignatureLine; maSignatureLineId = rSource.maSignatureLineId; @@ -250,7 +250,7 @@ SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel, SdrGrafObj const & rSource) if( rSource.IsLinkedGraphic() ) { -SetGraphicLink( aFileName ); +SetGraphicLink( m_aFileName ); } ImpSetAttrToGrafInfo(); @@ -262,8 +262,8 @@ SdrGrafObj::SdrGrafObj( const tools::Rectangle& rRect) : SdrRectObj(rSdrModel, rRect)
core.git: include/svx svx/source
include/svx/annotation/ObjectAnnotationData.hxx | 25 ++ include/svx/svdobj.hxx |9 +++ svx/source/svdraw/svdobj.cxx| 58 +++- 3 files changed, 71 insertions(+), 21 deletions(-) New commits: commit 4cd2737d829e8a3413ad3d60a17dded4dcc8938c Author: Tomaž Vajngerl AuthorDate: Wed Jun 5 17:23:22 2024 +0900 Commit: Tomaž Vajngerl CommitDate: Wed Jun 5 15:00:54 2024 +0200 annot: prepare SdrObject to represent an annotation Change-Id: Iabcc2166ea20cbeac6d2ada7120700a4e8b19303 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168428 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins diff --git a/include/svx/annotation/ObjectAnnotationData.hxx b/include/svx/annotation/ObjectAnnotationData.hxx new file mode 100644 index ..bdba8ab5a5b9 --- /dev/null +++ b/include/svx/annotation/ObjectAnnotationData.hxx @@ -0,0 +1,25 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +#include + +namespace sdr::annotation +{ +/** Contains the annotation data for a SdrObject */ +class ObjectAnnotationData +{ +public: +bool mbIsAnnotation : 1 = false; +rtl::Reference mxAnnotation; +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 4e03abf18da3..1dd8dd52eb59 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -87,7 +87,7 @@ namespace basegfx namespace sdr { class ObjectUser; } namespace sdr::properties { class BaseProperties; } namespace sdr::contact { class ViewContact; } - +namespace sdr::annotation { class ObjectAnnotationData; } namespace com::sun::star::drawing { class XShape; } namespace svx::diagram { class IDiagramHelper; } @@ -359,6 +359,11 @@ public: virtual void SetDecorative(bool isDecorative); virtual bool IsDecorative() const; +// Object representing an annotation +bool isAnnotationObject() const; +void setAsAnnotationObject(bool bSetAnnotation); +std::unique_ptr& getAnnotationData(); + // for group objects bool IsGroupObject() const; virtual SdrObjList* GetSubList() const; @@ -895,6 +900,8 @@ protected: // #i25616# boolmbSupportTextIndentingOnLineWidthChange : 1; +std::unique_ptr mpAnnotationData; + virtual ~SdrObject() override; virtual std::unique_ptr CreateObjectSpecificProperties() = 0; diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index b5cd832c096b..9da8c5662f12 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -336,16 +337,17 @@ void impRemoveIncarnatedSdrObjectToSdrModel(SdrObject& rSdrObject, SdrModel& rSd #endif SdrObject::SdrObject(SdrModel& rSdrModel) -: mpFillGeometryDefiningShape(nullptr) -,mrSdrModelFromSdrObject(rSdrModel) -,m_pUserCall(nullptr) -,mpImpl(new Impl) -,mpParentOfSdrObject(nullptr) -,m_nOrdNum(0) -,mnNavigationPosition(SAL_MAX_UINT32) -,mnLayerID(0) -,mpSvxShape( nullptr ) -,mbDoNotInsertIntoPageAutomatically(false) +: mpFillGeometryDefiningShape(nullptr) +, mrSdrModelFromSdrObject(rSdrModel) +, m_pUserCall(nullptr) +, mpAnnotationData(new sdr::annotation::ObjectAnnotationData) +, mpImpl(new Impl) +, mpParentOfSdrObject(nullptr) +, m_nOrdNum(0) +, mnNavigationPosition(SAL_MAX_UINT32) +, mnLayerID(0) +, mpSvxShape( nullptr ) +, mbDoNotInsertIntoPageAutomatically(false) { m_bVirtObj =false; m_bSnapRectDirty =true; @@ -374,16 +376,17 @@ SdrObject::SdrObject(SdrModel& rSdrModel) } SdrObject::SdrObject(SdrModel& rSdrModel, SdrObject const & rSource) -: mpFillGeometryDefiningShape(nullptr) -,mrSdrModelFromSdrObject(rSdrModel) -,m_pUserCall(nullptr) -,mpImpl(new Impl) -,mpParentOfSdrObject(nullptr) -,m_nOrdNum(0) -,mnNavigationPosition(SAL_MAX_UINT32) -,mnLayerID(0) -,mpSvxShape( nullptr ) -,mbDoNotInsertIntoPageAutomatically(false) +: mpFillGeometryDefiningShape(nullptr) +, mrSdrModelFromSdrObject(rSdrModel) +, m_pUserCall(nullptr) +, mpAnnotationData(new sdr::annotation::ObjectAnnotationData) +, mpImpl(new Impl) +, mpParentOfSdrObject(nullptr) +, m_nOrdNum(0) +, mnNavigationPosition(SAL_MAX_UINT32) +, mnLayerID(0) +, mpSvxShape( nullptr ) +, mbDoNotInsertIntoPageAutomatically(false) { m_bVirtObj =false; m_bSnapRectDirty =true; @@ -889,6 +892,21 @@ bool SdrObject::IsDecorative() const
core.git: include/svx svx/source
include/svx/svdundo.hxx |6 +++--- svx/source/svdraw/svdundo.cxx | 28 ++-- 2 files changed, 17 insertions(+), 17 deletions(-) New commits: commit 61f5006c18b3194f6aaa03e260425dc878cfff79 Author: Miklos Vajna AuthorDate: Mon Jun 3 09:32:38 2024 +0200 Commit: Miklos Vajna CommitDate: Mon Jun 3 12:24:08 2024 +0200 svx: prefix members of SdrUndoGeoObj See tdf#94879 for motivation. Change-Id: Ic34b5e1c7a1b73d688cc4dfc87c03417fe8e987b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168357 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index e1b778064e6d..bc15932fd81c 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -211,10 +211,10 @@ public: class SVXCORE_DLLPUBLIC SdrUndoGeoObj : public SdrUndoObj { -std::unique_ptr pUndoGeo; -std::unique_ptr pRedoGeo; +std::unique_ptr m_pUndoGeo; +std::unique_ptr m_pRedoGeo; // If we have a group object: -std::unique_ptr pUndoGroup; +std::unique_ptr m_pUndoGroup; /// If we have a table object, should its layout change? bool mbSkipChangeLayout; diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index c7bb38d81ada..7d98d21b7cb4 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -564,21 +564,21 @@ SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj) // this is a group object! // If this were 3D scene, we'd only add an Undo for the scene itself // (which we do elsewhere). -pUndoGroup.reset(new SdrUndoGroup(mxObj->getSdrModelFromSdrObject())); +m_pUndoGroup.reset(new SdrUndoGroup(mxObj->getSdrModelFromSdrObject())); for (const rtl::Reference& pObj : *pOL) -pUndoGroup->AddAction(std::make_unique(*pObj)); +m_pUndoGroup->AddAction(std::make_unique(*pObj)); } else { -pUndoGeo = mxObj->GetGeoData(); +m_pUndoGeo = mxObj->GetGeoData(); } } SdrUndoGeoObj::~SdrUndoGeoObj() { -pUndoGeo.reset(); -pRedoGeo.reset(); -pUndoGroup.reset(); +m_pUndoGeo.reset(); +m_pRedoGeo.reset(); +m_pUndoGroup.reset(); } void SdrUndoGeoObj::Undo() @@ -586,21 +586,21 @@ void SdrUndoGeoObj::Undo() // Trigger PageChangeCall ImpShowPageOfThisObject(); -if(pUndoGroup) +if(m_pUndoGroup) { -pUndoGroup->Undo(); +m_pUndoGroup->Undo(); // only repaint, no objectchange mxObj->ActionChanged(); } else { -pRedoGeo = mxObj->GetGeoData(); +m_pRedoGeo = mxObj->GetGeoData(); auto pTableObj = dynamic_cast(mxObj.get()); if (pTableObj && mbSkipChangeLayout) pTableObj->SetSkipChangeLayout(true); -mxObj->SetGeoData(*pUndoGeo); +mxObj->SetGeoData(*m_pUndoGeo); if (pTableObj && mbSkipChangeLayout) pTableObj->SetSkipChangeLayout(false); } @@ -608,17 +608,17 @@ void SdrUndoGeoObj::Undo() void SdrUndoGeoObj::Redo() { -if(pUndoGroup) +if(m_pUndoGroup) { -pUndoGroup->Redo(); +m_pUndoGroup->Redo(); // only repaint, no objectchange mxObj->ActionChanged(); } else { -pUndoGeo = mxObj->GetGeoData(); -mxObj->SetGeoData(*pRedoGeo); +m_pUndoGeo = mxObj->GetGeoData(); +mxObj->SetGeoData(*m_pRedoGeo); } // Trigger PageChangeCall
core.git: include/svx svx/source
include/svx/svdmrkv.hxx|2 +- svx/source/svdraw/svdedtv1.cxx |9 +++-- svx/source/svdraw/svdmrkv.cxx | 25 +++-- 3 files changed, 23 insertions(+), 13 deletions(-) New commits: commit cb982975c16e380f88282f03d07f8cfb8421ed77 Author: Xisco Fauli AuthorDate: Fri May 31 13:47:04 2024 +0200 Commit: Xisco Fauli CommitDate: Sun Jun 2 20:45:56 2024 +0200 svx: use SAL_RET_MAYBENULL in GetSfxViewShell() Change-Id: I05e66544c08a1ed55a5571f6061b23346235224e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168293 Reviewed-by: Xisco Fauli Tested-by: Jenkins diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx index 4cffc9c3de88..b4958bb3f7fd 100644 --- a/include/svx/svdmrkv.hxx +++ b/include/svx/svdmrkv.hxx @@ -438,7 +438,7 @@ public: const Point& GetRef2() const { return maRef2; } SAL_DLLPRIVATE void SetRef2(const Point& rPt); /// Get access to the view shell owning this draw view, if any. -virtual SfxViewShell* GetSfxViewShell() const; +SAL_RET_MAYBENULL virtual SfxViewShell* GetSfxViewShell() const; }; diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index cff6238b8005..bf1cc6f9a638 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1035,8 +1035,13 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con } if (!sPayload.isEmpty()) - GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, -OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US)); +{ +if (SfxViewShell* pViewShell = GetSfxViewShell()) +{ + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, +OUStringToOString(sPayload, RTL_TEXTENCODING_ASCII_US)); +} +} } nWhich = aIter.NextWhich(); diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 1b44fb021edf..d79a899de4c8 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -257,12 +257,15 @@ void SdrMarkView::modelHasChangedLOKit() const vcl::Window* pWin = pOut ? pOut->GetOwnerWindow() : nullptr; if (pWin && pWin->IsChart()) { -const vcl::Window* pViewShellWindow = GetSfxViewShell()->GetEditWindowForActiveOLEObj(); -if (pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin)) +if (SfxViewShell* pViewShell = GetSfxViewShell()) { -Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow); -Point aLogicOffset = pWin->PixelToLogic(aOffsetPx); -aSelection.Move(aLogicOffset.getX(), aLogicOffset.getY()); +const vcl::Window* pViewShellWindow = pViewShell->GetEditWindowForActiveOLEObj(); +if (pViewShellWindow && pViewShellWindow->IsAncestorOf(*pWin)) +{ +Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow); +Point aLogicOffset = pWin->PixelToLogic(aOffsetPx); +aSelection.Move(aLogicOffset.getX(), aLogicOffset.getY()); +} } } } @@ -881,7 +884,8 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S } // hide the text selection too -pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, ""_ostr); +if (pViewShell) + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, ""_ostr); } { @@ -1022,7 +1026,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S + "]"); // polygon approximating the pie segment or donut segment -if (pO->GetObjIdentifier() == SdrObjKind::PathFill) +if (pViewShell && pO->GetObjIdentifier() == SdrObjKind::PathFill) { const basegfx::B2DPolyPolygon aPolyPolygon(pO->TakeXorPoly()); if (aPolyPolygon.count() == 1) @@ -1199,7 +1203,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S { sSelectionText = "EMPTY"_ostr; sSelectionTextView = "EMPTY"_ostr; -if (!pOtherShell) +if (!pOtherShell && pViewShell) pViewShell->NotifyOtherViews(LOK_CALLBACK_TEXT_VIEW_SELECTION, "selection"_ostr, OString()); } @@ -1214,9 +1218,10 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const &
core.git: include/svx svx/source
include/svx/fmview.hxx | 10 ++-- svx/source/form/fmview.cxx | 106 ++--- 2 files changed, 58 insertions(+), 58 deletions(-) New commits: commit 2ef33247b7a3c07dde18d3cd6fd989fcb8ea4ddc Author: Miklos Vajna AuthorDate: Mon May 27 08:11:33 2024 +0200 Commit: Miklos Vajna CommitDate: Mon May 27 10:45:40 2024 +0200 svx: prefix members of FmFormView See tdf#94879 for motivation. Change-Id: I142e2259e150fd0247193dcb941fb2fe37018486 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168083 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx index a1a08de5e56b..e601047eff00 100644 --- a/include/svx/fmview.hxx +++ b/include/svx/fmview.hxx @@ -53,8 +53,8 @@ namespace com::sun::star::form { class SVXCORE_DLLPUBLIC FmFormView : public E3dView { -rtl::Reference pImpl; -FmFormShell*pFormShell; +rtl::Reference m_pImpl; +FmFormShell*m_pFormShell; void Init(); @@ -128,11 +128,11 @@ public: SVX_DLLPRIVATE void ChangeDesignMode(bool bDesign); -SVX_DLLPRIVATE FmXFormView* GetImpl() const { return pImpl.get(); } -SVX_DLLPRIVATE FmFormShell* GetFormShell() const { return pFormShell; } +SVX_DLLPRIVATE FmXFormView* GetImpl() const { return m_pImpl.get(); } +SVX_DLLPRIVATE FmFormShell* GetFormShell() const { return m_pFormShell; } struct FormShellAccess { friend class FmFormShell; private: FormShellAccess() { } }; - void SetFormShell( FmFormShell* pShell, FormShellAccess ) { pFormShell = pShell; } + void SetFormShell( FmFormShell* pShell, FormShellAccess ) { m_pFormShell = pShell; } struct ImplAccess { friend class FmXFormView; private: ImplAccess() { } }; void SetMoveOutside( bool _bMoveOutside, ImplAccess ) { E3dView::SetMoveOutside( _bMoveOutside ); } diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index 2a07073d66b9..a26895653833 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -72,8 +72,8 @@ FmFormView::FmFormView( void FmFormView::Init() { -pFormShell = nullptr; -pImpl = new FmXFormView(this); +m_pFormShell = nullptr; +m_pImpl = new FmXFormView(this); // set model SdrModel* pModel = (); @@ -114,10 +114,10 @@ void FmFormView::Init() FmFormView::~FmFormView() { -if (pFormShell) -suppress_fun_call_w_exception(pFormShell->SetView(nullptr)); +if (m_pFormShell) +suppress_fun_call_w_exception(m_pFormShell->SetView(nullptr)); -pImpl->notifyViewDying(); +m_pImpl->notifyViewDying(); } FmFormPage* FmFormView::GetCurPage() @@ -131,23 +131,23 @@ void FmFormView::MarkListHasChanged() { E3dView::MarkListHasChanged(); -if ( !(pFormShell && IsDesignMode()) ) +if ( !(m_pFormShell && IsDesignMode()) ) return; FmFormObj* pObj = getMarkedGrid(); -if ( pImpl->m_pMarkedGrid && pImpl->m_pMarkedGrid != pObj ) +if ( m_pImpl->m_pMarkedGrid && m_pImpl->m_pMarkedGrid != pObj ) { -pImpl->m_pMarkedGrid = nullptr; -if ( pImpl->m_xWindow.is() ) +m_pImpl->m_pMarkedGrid = nullptr; +if ( m_pImpl->m_xWindow.is() ) { -pImpl->m_xWindow->removeFocusListener(pImpl); -pImpl->m_xWindow = nullptr; +m_pImpl->m_xWindow->removeFocusListener(m_pImpl); +m_pImpl->m_xWindow = nullptr; } SetMoveOutside(false); //OLMRefreshAllIAOManagers(); } -pFormShell->GetImpl()->SetSelectionDelayed_Lock(); +m_pFormShell->GetImpl()->SetSelectionDelayed_Lock(); } namespace @@ -179,7 +179,7 @@ void FmFormView::AddDeviceToPaintView(OutputDevice& rNewDev, vcl::Window* pWindo // #i39269# / 2004-12-20 / frank.schoenh...@sun.com const SdrPageWindow* pPageWindow = findPageWindow( this, ); if ( pPageWindow ) -pImpl->addWindow( *pPageWindow ); +m_pImpl->addWindow( *pPageWindow ); } @@ -187,7 +187,7 @@ void FmFormView::DeleteDeviceFromPaintView(OutputDevice& rNewDev) { const SdrPageWindow* pPageWindow = findPageWindow( this, ); if ( pPageWindow ) -pImpl->removeWindow( pPageWindow->GetControlContainer() ); +m_pImpl->removeWindow( pPageWindow->GetControlContainer() ); E3dView::DeleteDeviceFromPaintView(rNewDev); } @@ -211,10 +211,10 @@ void FmFormView::ChangeDesignMode(bool bDesign) DeactivateControls( GetSdrPageView() ); // --- 2. simulate a deactivation (the shell will handle some things there ...?) -if ( pFormShell && pFormShell->GetImpl() ) -pFormShell->GetImpl()->viewDeactivated_Lock(*this); +if ( m_pFormShell && m_pFormShell->GetImpl() ) +m_pFormShell->GetImpl()->viewDeactivated_Lock(*this); else -pImpl->Deactivate(); +m_pImpl->Deactivate(); // --- 3. activate all controls, if we're switching to alive mode if (
core.git: include/svx svx/source
include/svx/gridctrl.hxx | 15 - svx/source/fmcomp/gridctrl.cxx | 112 +++-- 2 files changed, 100 insertions(+), 27 deletions(-) New commits: commit f0960e05c2f540c99062867236419c2a70c1160b Author: Caolán McNamara AuthorDate: Sun May 19 20:29:26 2024 +0100 Commit: Caolán McNamara CommitDate: Sun May 26 20:21:10 2024 +0200 Resolves: tdf#155364 resize buttons and change widget font sizes on zoom Change-Id: Ied951e6c96881bd56a40ae01077cd7f76f9b7853 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168071 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx index 27d7f25c7cf2..09c2a609a483 100644 --- a/include/svx/gridctrl.hxx +++ b/include/svx/gridctrl.hxx @@ -161,6 +161,7 @@ enum class DbGridControlNavigationBarState class FmXGridSourcePropListener; class DisposeListenerGridBridge; +class DbGridControl; // NavigationBar class NavigationBar final : public InterimItemWindow @@ -195,21 +196,26 @@ class NavigationBar final : public InterimItemWindow std::shared_ptr m_xPrevRepeater; std::shared_ptr m_xNextRepeater; +Size m_aLastAllocSize; + sal_Int32m_nCurrentPos; bool m_bPositioning; // protect PositionDataSource against recursion public: -NavigationBar(vcl::Window* pParent); +NavigationBar(DbGridControl* pParent); virtual ~NavigationBar() override; virtual void dispose() override; +DECL_LINK(SizeAllocHdl, const Size&, void); + // Status methods for Controls void InvalidateAll(sal_Int32 nCurrentPos, bool bAll = false); void InvalidateState(DbGridControlNavigationBarState nWhich) {SetState(nWhich);} void SetState(DbGridControlNavigationBarState nWhich); bool GetState(DbGridControlNavigationBarState nWhich) const; -sal_uInt16 ArrangeControls(); +void SetPointFontAndZoom(const vcl::Font& rFont, const Fraction& rZoom); +sal_uInt16 GetPreferredWidth() const; private: @@ -278,6 +284,8 @@ private: osl::Mutex m_aDestructionSafety; osl::Mutex m_aAdjustSafety; +Idlem_aRearrangeIdle; + css::util::Date m_aNullDate;// NullDate of the Numberformatter; @@ -552,6 +560,8 @@ public: css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId ) override; +void RearrangeAtIdle(); + protected: void RecalcRows(sal_Int32 nNewTopRow, sal_uInt16 nLinesOnScreen, bool bUpdateCursor); bool SeekCursor(sal_Int32 nRow, bool bAbsolute = false); @@ -588,6 +598,7 @@ protected: protected: void ImplInitWindow( const InitWindowFacet _eInitWhat ); DECL_DLLPRIVATE_LINK(OnDelete, void*, void); +DECL_DLLPRIVATE_LINK(RearrangeHdl, Timer*, void); DECL_DLLPRIVATE_LINK(OnAsyncAdjust, void*, void); // if the param is != NULL, AdjustRows will be called, else AdjustDataSource diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index e6e3f8b40bc2..faedec67aa66 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -302,7 +303,7 @@ void NavigationBar::PositionDataSource(sal_Int32 nRecord) m_bPositioning = false; } -NavigationBar::NavigationBar(vcl::Window* pParent) +NavigationBar::NavigationBar(DbGridControl* pParent) : InterimItemWindow(pParent, u"svx/ui/navigationbar.ui"_ustr, u"NavigationBar"_ustr) , m_xRecordText(m_xBuilder->weld_label(u"recordtext"_ustr)) , m_xAbsolute(new NavigationBar::AbsolutePos(m_xBuilder->weld_entry(u"entry-noframe"_ustr), this)) @@ -318,13 +319,6 @@ NavigationBar::NavigationBar(vcl::Window* pParent) , m_nCurrentPos(-1) , m_bPositioning(false) { -vcl::Font aApplFont(Application::GetSettings().GetStyleSettings().GetToolFont()); -m_xAbsolute->set_font(aApplFont); -aApplFont.SetTransparent(true); -m_xRecordText->set_font(aApplFont); -m_xRecordOf->set_font(aApplFont); -m_xRecordCount->set_font(aApplFont); - m_xFirstBtn->set_help_id(HID_GRID_TRAVEL_FIRST); m_xPrevBtn->set_help_id(HID_GRID_TRAVEL_PREV); m_xNextBtn->set_help_id(HID_GRID_TRAVEL_NEXT); @@ -342,9 +336,18 @@ NavigationBar::NavigationBar(vcl::Window* pParent) m_xRecordOf->set_label(SvxResId(RID_STR_REC_FROM_TEXT)); m_xRecordCount->set_label(OUString('?')); -auto nReserveWidth = m_xRecordCount->get_approximate_digit_width() * nReserveNumDigits; -m_xAbsolute->GetWidget()->set_size_request(nReserveWidth, -1); -m_xRecordCount->set_size_request(nReserveWidth, -1); +vcl::Font aApplFont(Application::GetSettings().GetStyleSettings().GetToolFont()); +SetPointFontAndZoom(aApplFont, Fraction(1, 1)); + +
core.git: include/svx svx/source
include/svx/svdundo.hxx |2 +- svx/source/svdraw/svdundo.cxx | 10 +- 2 files changed, 6 insertions(+), 6 deletions(-) New commits: commit f2ba39c5e7ae28a832e707667a0a61736f65ebda Author: Miklos Vajna AuthorDate: Tue May 21 08:32:27 2024 +0200 Commit: Miklos Vajna CommitDate: Tue May 21 13:05:42 2024 +0200 svx: prefix members of SdrUndoDelPage See tdf#94879 for motivation. Change-Id: I6ef4ca1df66f22e4fb6a13a7b39ca0152484fd6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167883 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 5af5c584eda1..e1b778064e6d 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -594,7 +594,7 @@ class SVXCORE_DLLPUBLIC SdrUndoDelPage final : public SdrUndoPageList { // When deleting a MasterPage, we remember all relations of the // Character Page with the MasterPage in this UndoGroup. -std::unique_ptr pUndoGroup; +std::unique_ptr m_pUndoGroup; std::unique_ptr mpFillBitmapItem; bool mbHasFillBitmap; diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 1b52ee945957..bec090c6339c 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -1408,12 +1408,12 @@ SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg) if(mxPage.get() == ) { -if(!pUndoGroup) +if(!m_pUndoGroup) { -pUndoGroup.reset( new SdrUndoGroup(m_rMod) ); +m_pUndoGroup.reset( new SdrUndoGroup(m_rMod) ); } - pUndoGroup->AddAction(m_rMod.GetSdrUndoFactory().CreateUndoPageRemoveMasterPage(*pDrawPage)); + m_pUndoGroup->AddAction(m_rMod.GetSdrUndoFactory().CreateUndoPageRemoveMasterPage(*pDrawPage)); } } } @@ -1428,10 +1428,10 @@ void SdrUndoDelPage::Undo() if (bool(mpFillBitmapItem)) restoreFillBitmap(); ImpInsertPage(nPageNum); -if (pUndoGroup!=nullptr) +if (m_pUndoGroup!=nullptr) { // recover master page relationships -pUndoGroup->Undo(); +m_pUndoGroup->Undo(); } }
core.git: include/svx svx/source
include/svx/svdundo.hxx | 10 +++ svx/source/svdraw/svdundo.cxx | 56 +- 2 files changed, 33 insertions(+), 33 deletions(-) New commits: commit 74bd51629eed7eb34aef9acbb93c110525f8ef7d Author: Miklos Vajna AuthorDate: Mon May 13 08:33:27 2024 +0200 Commit: Miklos Vajna CommitDate: Mon May 13 10:32:50 2024 +0200 svx: prefix members of SdrUndoAttrObj See tdf#94879 for motivation. Change-Id: Icecf1b75055c9f487d35ae72589ccb6197cfeaff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167566 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 824f36f06efc..5af5c584eda1 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -155,17 +155,17 @@ class SVXCORE_DLLPUBLIC SdrUndoAttrObj : public SdrUndoObj // FIXME: Or should we better remember the StyleSheetNames? rtl::Reference< SfxStyleSheet > mxUndoStyleSheet; rtl::Reference< SfxStyleSheet > mxRedoStyleSheet; -bool bStyleSheet; -bool bHaveToTakeRedoSet; +bool m_bStyleSheet; +bool m_bHaveToTakeRedoSet; // When assigning TextItems to a drawing object with text: -std::optional pTextUndo; +std::optional m_pTextUndo; // #i8508# // The text rescue mechanism needs also to be implemented for redo actions. -std::optional pTextRedo; +std::optional m_pTextRedo; // If we have a group object: -std::unique_ptr pUndoGroup; +std::unique_ptr m_pUndoGroup; protected: // Helper to ensure StyleSheet is in pool (provided by SdrModel from SdrObject) diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 18b248ba5960..1b52ee945957 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -250,9 +250,9 @@ void SdrUndoAttrObj::ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool& rSt SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSaveText) : SdrUndoObj(rNewObj) -, bHaveToTakeRedoSet(true) +, m_bHaveToTakeRedoSet(true) { -bStyleSheet = bStyleSheet1; +m_bStyleSheet = bStyleSheet1; SdrObjList* pOL = rNewObj.GetSubList(); bool bIsGroup(pOL!=nullptr && pOL->GetObjCount()); @@ -261,11 +261,11 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSave if(bIsGroup) { // it's a group object! -pUndoGroup.reset(new SdrUndoGroup(mxObj->getSdrModelFromSdrObject())); +m_pUndoGroup.reset(new SdrUndoGroup(mxObj->getSdrModelFromSdrObject())); for (const rtl::Reference& pObj : *pOL) { -pUndoGroup->AddAction( +m_pUndoGroup->AddAction( std::make_unique(*pObj, bStyleSheet1)); } } @@ -275,14 +275,14 @@ SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSave moUndoSet.emplace( mxObj->GetMergedItemSet() ); -if(bStyleSheet) +if(m_bStyleSheet) mxUndoStyleSheet = mxObj->GetStyleSheet(); if(bSaveText) { auto p = mxObj->GetOutlinerParaObject(); if(p) -pTextUndo = *p; +m_pTextUndo = *p; } } @@ -290,9 +290,9 @@ SdrUndoAttrObj::~SdrUndoAttrObj() { moUndoSet.reset(); moRedoSet.reset(); -pUndoGroup.reset(); -pTextUndo.reset(); -pTextRedo.reset(); +m_pUndoGroup.reset(); +m_pTextUndo.reset(); +m_pTextRedo.reset(); } void SdrUndoAttrObj::Undo() @@ -303,27 +303,27 @@ void SdrUndoAttrObj::Undo() // Trigger PageChangeCall ImpShowPageOfThisObject(); -if(!pUndoGroup || bIs3DScene) +if(!m_pUndoGroup || bIs3DScene) { -if(bHaveToTakeRedoSet) +if(m_bHaveToTakeRedoSet) { -bHaveToTakeRedoSet = false; +m_bHaveToTakeRedoSet = false; moRedoSet.emplace( mxObj->GetMergedItemSet() ); -if(bStyleSheet) +if(m_bStyleSheet) mxRedoStyleSheet = mxObj->GetStyleSheet(); -if(pTextUndo) +if(m_pTextUndo) { // #i8508# auto p = mxObj->GetOutlinerParaObject(); if(p) -pTextRedo = *p; +m_pTextRedo = *p; } } -if(bStyleSheet) +if(m_bStyleSheet) { mxRedoStyleSheet = mxObj->GetStyleSheet(); SfxStyleSheet* pSheet = mxUndoStyleSheet.get(); @@ -392,15 +392,15 @@ void SdrUndoAttrObj::Undo() mxObj->GetProperties().BroadcastItemChange(aItemChange); -if(pTextUndo) +if(m_pTextUndo) { -mxObj->SetOutlinerParaObject(*pTextUndo); +mxObj->SetOutlinerParaObject(*m_pTextUndo); } } -if(pUndoGroup) +if(m_pUndoGroup) { -pUndoGroup->Undo(); +m_pUndoGroup->Undo(); } } @@
core.git: include/svx svx/source sw/source
include/svx/svdobj.hxx |8 include/svx/svdovirt.hxx |4 svx/source/svdraw/svdobj.cxx | 10 ++ svx/source/svdraw/svdovirt.cxx | 20 sw/source/core/draw/dcontact.cxx |5 +++-- 5 files changed, 41 insertions(+), 6 deletions(-) New commits: commit 9fb9bd54a82ee20f5916aa68e428e0fb67f02ed6 Author: Michael Stahl AuthorDate: Wed May 8 14:20:26 2024 +0200 Commit: Michael Stahl CommitDate: Fri May 10 10:08:20 2024 +0200 tdf#156484 svx,sw: fix visibility of shapes in header/footer Similar to commit ae132145ff42a95dc24fb124847c04af4b8c8dab, also forward IsVisible() and IsPrintable() from SdrVirtObj to its real object; evidently the properties aren't copied when creating SdrVirtObj but there is no reason for that to have these properties independent. This triggers an assert in VOCOfDrawVirtObj::createPrimitive2DSequence() because that is called during layout from getObjectRange(); the assert was added in commit ae3ec0d53a22ae5d2b7fb244a6056d0627b71873 and intended for painting, but this isn't painting, and it's not easily possible to detect if the function is called during painting, so remove the assert. Change-Id: Id2a04a5d07f43b86eb9c524b30ba74ecaf6a95c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167350 Reviewed-by: Michael Stahl Tested-by: Jenkins diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 2951d41e8904..4e03abf18da3 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -732,10 +732,10 @@ public: bool IsMoveProtect() const { return m_bMovProt;} void SetResizeProtect(bool bProt); bool IsResizeProtect() const { return m_bSizProt;} -void SetPrintable(bool bPrn); -bool IsPrintable() const { return !m_bNoPrint;} -void SetVisible(bool bVisible); -bool IsVisible() const { return mbVisible;} +virtual void SetPrintable(bool isPrintable); +virtual bool IsPrintable() const; +virtual void SetVisible(bool isVisible); +virtual bool IsVisible() const; void SetMarkProtect(bool bProt); bool IsMarkProtect() const { return m_bMarkProt;} virtual bool IsSdrTextObj() const { return false; } diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx index 17c869313067..ca5f6858ecaa 100644 --- a/include/svx/svdovirt.hxx +++ b/include/svx/svdovirt.hxx @@ -61,6 +61,10 @@ public: const SdrObject& GetReferencedObj() const; virtual void NbcSetAnchorPos(const Point& rAnchorPos) override; +virtual void SetPrintable(bool isPrintable) override; +virtual bool IsPrintable() const override; +virtual void SetVisible(bool isVisible) override; +virtual bool IsVisible() const override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; virtual SdrInventor GetObjInventor() const override; virtual SdrObjKind GetObjIdentifier() const override; diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index ccc79daed1dd..43bc417163cf 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2665,6 +2665,11 @@ void SdrObject::SetResizeProtect(bool bProt) } } +bool SdrObject::IsPrintable() const +{ +return !m_bNoPrint; +} + void SdrObject::SetPrintable(bool bPrn) { if( bPrn == m_bNoPrint ) @@ -2679,6 +2684,11 @@ void SdrObject::SetPrintable(bool bPrn) } } +bool SdrObject::IsVisible() const +{ +return mbVisible; +} + void SdrObject::SetVisible(bool bVisible) { if( bVisible != mbVisible ) diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index b1fe6f5cb9bb..2e1641d3864e 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -97,6 +97,26 @@ void SdrVirtObj::NbcSetAnchorPos(const Point& rAnchorPos) m_aAnchor=rAnchorPos; } +bool SdrVirtObj::IsPrintable() const +{ +return mxRefObj->IsPrintable(); +} + +void SdrVirtObj::SetPrintable(bool const isPrintable) +{ +mxRefObj->SetPrintable(isPrintable); +} + +bool SdrVirtObj::IsVisible() const +{ +return mxRefObj->IsVisible(); +} + +void SdrVirtObj::SetVisible(bool const isVisible) +{ +mxRefObj->SetVisible(isVisible); +} + void SdrVirtObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const { mxRefObj->TakeObjInfo(rInfo); diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 9ccd019181ea..138470ee11f9 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -2220,8 +2220,9 @@ namespace sdr::contact void VOCOfDrawVirtObj::createPrimitive2DSequence(const DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const { -// tdf#91260 have already checked top-level one is on the right page -assert(isPrimitiveVisible(rDisplayInfo)); +// this may be called for painting
core.git: include/svx svx/source
include/svx/svdlayer.hxx |4 ++-- svx/source/svdraw/svdlayer.cxx | 30 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) New commits: commit 5a61b590ae51ccf28e501bb943f1cf4a3e9835a1 Author: Miklos Vajna AuthorDate: Mon Apr 29 08:15:16 2024 +0200 Commit: Miklos Vajna CommitDate: Mon Apr 29 10:10:37 2024 +0200 svx: prefix members of SdrLayerAdmin See tdf#94879 for motivation. Change-Id: I8ea80a3f2121c5c29168aa185e6278d924874c72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166815 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/svx/svdlayer.hxx b/include/svx/svdlayer.hxx index d2d9f7e7c164..8201478a2fd8 100644 --- a/include/svx/svdlayer.hxx +++ b/include/svx/svdlayer.hxx @@ -105,8 +105,8 @@ friend class SdrModel; friend class SdrPage; std::vector> maLayers; -SdrLayerAdmin* pParent; // The page's admin knows the doc's admin -SdrModel* pModel; // For broadcasting +SdrLayerAdmin* m_pParent; // The page's admin knows the doc's admin +SdrModel* m_pModel; // For broadcasting OUString maControlLayerName; // Find a LayerID which is not in use yet. If all have been used up, // we return 0. diff --git a/svx/source/svdraw/svdlayer.cxx b/svx/source/svdraw/svdlayer.cxx index 200dccd2f520..c48ff9641e55 100644 --- a/svx/source/svdraw/svdlayer.cxx +++ b/svx/source/svdraw/svdlayer.cxx @@ -99,15 +99,15 @@ bool SdrLayer::operator==(const SdrLayer& rCmpLayer) const } SdrLayerAdmin::SdrLayerAdmin(SdrLayerAdmin* pNewParent): -pParent(pNewParent), -pModel(nullptr), +m_pParent(pNewParent), +m_pModel(nullptr), maControlLayerName("controls") { } SdrLayerAdmin::SdrLayerAdmin(const SdrLayerAdmin& rSrcLayerAdmin): -pParent(nullptr), -pModel(nullptr), +m_pParent(nullptr), +m_pModel(nullptr), maControlLayerName("controls") { *this = rSrcLayerAdmin; @@ -127,7 +127,7 @@ SdrLayerAdmin& SdrLayerAdmin::operator=(const SdrLayerAdmin& rSrcLayerAdmin) if (this != ) { maLayers.clear(); -pParent=rSrcLayerAdmin.pParent; +m_pParent=rSrcLayerAdmin.m_pParent; sal_uInt16 i; sal_uInt16 nCount=rSrcLayerAdmin.GetLayerCount(); for (i=0; iBroadcast(aHint); -pModel->SetChanged(); +m_pModel->Broadcast(aHint); +m_pModel->SetChanged(); } } void SdrLayerAdmin::InsertLayer(std::unique_ptr pLayer, sal_uInt16 nPos) { -pLayer->SetModel(pModel); +pLayer->SetModel(m_pModel); if(nPos==0x) maLayers.push_back(std::move(pLayer)); else @@ -180,7 +180,7 @@ SdrLayer* SdrLayerAdmin::NewLayer(const OUString& rName, sal_uInt16 nPos) { SdrLayerID nID=GetUniqueLayerID(); SdrLayer* pLay=new SdrLayer(nID,rName); -pLay->SetModel(pModel); +pLay->SetModel(m_pModel); if(nPos==0x) maLayers.push_back(std::unique_ptr(pLay)); else @@ -220,9 +220,9 @@ const SdrLayer* SdrLayerAdmin::GetLayer(const OUString& rName) const i++; } -if(!pLay && pParent) +if(!pLay && m_pParent) { -pLay = pParent->GetLayer(rName); +pLay = m_pParent->GetLayer(rName); } return pLay; @@ -256,7 +256,7 @@ SdrLayerID SdrLayerAdmin::GetUniqueLayerID() const aSet.Set(GetLayer(j)->GetID()); } sal_uInt8 i; -if (pParent != nullptr) +if (m_pParent != nullptr) { i = 254; while (i && aSet.IsSet(SdrLayerID(i)))
core.git: include/svx svx/source
include/svx/nbdtmg.hxx|1 - svx/source/sidebar/nbdtmg.cxx | 11 ++- 2 files changed, 2 insertions(+), 10 deletions(-) New commits: commit a600cb4865f2b4bce872a000c2614cf6478b1ee0 Author: Samuel Mehrbrodt AuthorDate: Thu Apr 25 09:06:57 2024 +0200 Commit: Samuel Mehrbrodt CommitDate: Thu Apr 25 13:47:04 2024 +0200 Remove unused fields Unused since f944648e0f5d52605a267ed50bba4bfc035aecc6 Change-Id: Id5f5a77df8afdf15d99989b86bb04179d86ae92b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166614 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/include/svx/nbdtmg.hxx b/include/svx/nbdtmg.hxx index 81ef80223496..894304e4c37d 100644 --- a/include/svx/nbdtmg.hxx +++ b/include/svx/nbdtmg.hxx @@ -72,7 +72,6 @@ class SVX_DLLPUBLIC BulletsSettings { public: vcl::Font aFont; -OUStringsDescription; sal_UCS4cBulletChar; boolbIsCustomized; BulletsSettings() : cBulletChar(0), bIsCustomized(false) {} diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index ced78fe6bc61..26e26c8a3152 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -341,16 +341,9 @@ void BulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 } } -OUString BulletsTypeMgr::GetDescription(sal_uInt16 nIndex, bool /*isDefault*/) +OUString BulletsTypeMgr::GetDescription(sal_uInt16 /*nIndex*/, bool /*isDefault*/) { -OUString sRet; - -if ( nIndex >= DEFAULT_BULLET_TYPES ) -return sRet; -else -sRet = pActualBullets[nIndex]->sDescription; - -return sRet; +return OUString(); } bool BulletsTypeMgr::IsCustomized(sal_uInt16 nIndex)
core.git: include/svx svx/source
include/svx/strings.hrc |2 +- svx/source/dialog/charmap.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 3bfd7ae3d414cae3bb4e582c2a2562d7b08887cb Author: Taichi Haradaguchi <20001...@ymail.ne.jp> AuthorDate: Thu Apr 18 19:59:41 2024 +0900 Commit: Eike Rathke CommitDate: Sat Apr 20 21:23:44 2024 +0200 Fix Unicode block name See https://unicode.org/charts/PDF/U0080.pdf Change-Id: I6bc3117abb486cc2cc38870ed91185c62eaa9361 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166243 Reviewed-by: Eike Rathke Tested-by: Jenkins diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index f26dbe3bd558..13f896f04eeb 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -1464,7 +1464,7 @@ #define RID_SVXSTR_SAVE_MODIFIED_IMAGE NC_("RID_SVXSTR_SAVE_MODIFIED_IMAGE", "The image has been modified. By default the original image will be saved. Do you want to save the modified version instead?") #define RID_SUBSETSTR_BASIC_LATIN NC_("RID_SUBSETMAP", "Basic Latin") -#define RID_SUBSETSTR_LATIN_1 NC_("RID_SUBSETMAP", "Latin-1") +#define RID_SUBSETSTR_LATIN_1_SUPPLEMENT NC_("RID_SUBSETMAP", "C1 Controls and Latin-1 Supplement") #define RID_SUBSETSTR_LATIN_EXTENDED_A NC_("RID_SUBSETMAP", "Latin Extended-A") #define RID_SUBSETSTR_LATIN_EXTENDED_B NC_("RID_SUBSETMAP", "Latin Extended-B") #define RID_SUBSETSTR_IPA_EXTENSIONS NC_("RID_SUBSETMAP", "IPA Extensions") diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index dcb1205584d7..9b87fe3666a7 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -952,7 +952,7 @@ void SubsetMap::InitList() aAllSubsets.emplace_back( 0x, 0x007F, SvxResId(RID_SUBSETSTR_BASIC_LATIN) ); break; case UBLOCK_LATIN_1_SUPPLEMENT: -aAllSubsets.emplace_back( 0x0080, 0x00FF, SvxResId(RID_SUBSETSTR_LATIN_1) ); +aAllSubsets.emplace_back( 0x0080, 0x00FF, SvxResId(RID_SUBSETSTR_LATIN_1_SUPPLEMENT) ); break; case UBLOCK_LATIN_EXTENDED_A: aAllSubsets.emplace_back( 0x0100, 0x017F, SvxResId(RID_SUBSETSTR_LATIN_EXTENDED_A) );
core.git: include/svx svx/source
include/svx/xtable.hxx|4 ++-- svx/source/xoutdev/xtable.cxx |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) New commits: commit a44e066c9e587dc87fd2563f3e9454e9e92dcde7 Author: Miklos Vajna AuthorDate: Tue Apr 2 08:16:27 2024 +0200 Commit: Miklos Vajna CommitDate: Tue Apr 2 10:28:27 2024 +0200 svx: prefix members of XLineEndEntry See tdf#94879 for motivation. Change-Id: I901e231f8112dea28bdccfb79b17470f1436c0db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165665 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx index ca2c0518b876..43ea9820d5a1 100644 --- a/include/svx/xtable.hxx +++ b/include/svx/xtable.hxx @@ -56,7 +56,7 @@ public: class SVXCORE_DLLPUBLIC XLineEndEntry final : public XPropertyEntry { private: -basegfx::B2DPolyPolygon aB2DPolyPolygon; +basegfx::B2DPolyPolygon m_aB2DPolyPolygon; public: XLineEndEntry(basegfx::B2DPolyPolygon aB2DPolyPolygon, const OUString& rName); @@ -64,7 +64,7 @@ public: const basegfx::B2DPolyPolygon& GetLineEnd() const { -return aB2DPolyPolygon; +return m_aB2DPolyPolygon; } }; diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index 715d2ff3d083..e640c18b64e9 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -38,13 +38,13 @@ XColorEntry::XColorEntry(const Color& rColor, const OUString& rName) XLineEndEntry::XLineEndEntry(basegfx::B2DPolyPolygon _aB2DPolyPolygon, const OUString& rName) : XPropertyEntry(rName), -aB2DPolyPolygon(std::move(_aB2DPolyPolygon)) +m_aB2DPolyPolygon(std::move(_aB2DPolyPolygon)) { } XLineEndEntry::XLineEndEntry(const XLineEndEntry& rOther) : XPropertyEntry(rOther), -aB2DPolyPolygon(rOther.aB2DPolyPolygon) +m_aB2DPolyPolygon(rOther.m_aB2DPolyPolygon) { }
core.git: include/svx svx/source
include/svx/xtable.hxx|4 ++-- svx/source/xoutdev/xtable.cxx |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) New commits: commit 4a7bd4798f3f79c813e940504463c0af7bf9e985 Author: Miklos Vajna AuthorDate: Mon Mar 25 08:37:27 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Mar 25 10:28:10 2024 +0100 svx: prefix members of XHatchEntry See tdf#94879 for motivation. Change-Id: I1edd4bf9c3b7369898f500f9eb5c483be133ed67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165267 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx index 15775d01ef2a..ca2c0518b876 100644 --- a/include/svx/xtable.hxx +++ b/include/svx/xtable.hxx @@ -86,7 +86,7 @@ public: class SVXCORE_DLLPUBLIC XHatchEntry final : public XPropertyEntry { private: -XHatch aHatch; +XHatch m_aHatch; public: XHatchEntry(const XHatch& rHatch, const OUString& rName); @@ -94,7 +94,7 @@ public: const XHatch& GetHatch() const { -return aHatch; +return m_aHatch; } }; diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index fea229ec74dc..715d2ff3d083 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -62,13 +62,13 @@ m_aDash(rOther.m_aDash) XHatchEntry::XHatchEntry(const XHatch& rHatch, const OUString& rName) : XPropertyEntry(rName), -aHatch(rHatch) +m_aHatch(rHatch) { } XHatchEntry::XHatchEntry(const XHatchEntry& rOther) : XPropertyEntry(rOther), -aHatch(rOther.aHatch) +m_aHatch(rOther.m_aHatch) { }
core.git: include/svx svx/source
include/svx/svdlayer.hxx |8 svx/source/svdraw/svdlayer.cxx | 10 +- 2 files changed, 9 insertions(+), 9 deletions(-) New commits: commit 0f1194bff86f2b34df624c0a67b211ab98bcf729 Author: Miklos Vajna AuthorDate: Mon Mar 18 08:26:57 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Mar 18 12:42:55 2024 +0100 svx: prefix members of SdrLayer See tdf#94879 for motivation. Change-Id: I35c1b90b472a27b34a3ca31cd81cd1fa65b24843 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164963 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdlayer.hxx b/include/svx/svdlayer.hxx index de453a6bf8c2..88cfabddb9c0 100644 --- a/include/svx/svdlayer.hxx +++ b/include/svx/svdlayer.hxx @@ -62,11 +62,11 @@ class SVXCORE_DLLPUBLIC SdrLayer OUString maName; OUString maTitle; OUString maDescription; -SdrModel* pModel; // For broadcasting +SdrModel* m_pModel; // For broadcasting bool mbVisibleODF; // corresponds to ODF draw:display bool mbPrintableODF; // corresponds to ODF draw:display bool mbLockedODF; // corresponds to ODF draw:protected -SdrLayerID nID; +SdrLayerID m_nID; SdrLayer(SdrLayerID nNewID, OUString aNewName); @@ -91,8 +91,8 @@ public: void SetLockedODF(bool bLockedODF) { mbLockedODF = bLockedODF; } bool IsLockedODF() const { return mbLockedODF; } -SdrLayerIDGetID() const { return nID; } -void SetModel(SdrModel* pNewModel) { pModel=pNewModel; } +SdrLayerIDGetID() const { return m_nID; } +void SetModel(SdrModel* pNewModel) { m_pModel=pNewModel; } }; #define SDRLAYER_MAXCOUNT 255 diff --git a/svx/source/svdraw/svdlayer.cxx b/svx/source/svdraw/svdlayer.cxx index 74d5222f92b1..200dccd2f520 100644 --- a/svx/source/svdraw/svdlayer.cxx +++ b/svx/source/svdraw/svdlayer.cxx @@ -69,7 +69,7 @@ void SdrLayerIDSet::PutValue( const css::uno::Any & rAny ) } SdrLayer::SdrLayer(SdrLayerID nNewID, OUString aNewName) : -maName(std::move(aNewName)), pModel(nullptr), nID(nNewID) +maName(std::move(aNewName)), m_pModel(nullptr), m_nID(nNewID) { // ODF default values mbVisibleODF = true; @@ -84,17 +84,17 @@ void SdrLayer::SetName(const OUString& rNewName) maName = rNewName; -if (pModel) +if (m_pModel) { SdrHint aHint(SdrHintKind::LayerChange); -pModel->Broadcast(aHint); -pModel->SetChanged(); +m_pModel->Broadcast(aHint); +m_pModel->SetChanged(); } } bool SdrLayer::operator==(const SdrLayer& rCmpLayer) const { -return (nID == rCmpLayer.nID +return (m_nID == rCmpLayer.m_nID && maName == rCmpLayer.maName); }
core.git: include/svx svx/source
include/svx/xhatch.hxx | 26 +- svx/source/xoutdev/xattr.cxx | 16 2 files changed, 21 insertions(+), 21 deletions(-) New commits: commit da6a23840d44c40da3989e7c2372b2b6d9ae95b5 Author: Miklos Vajna AuthorDate: Mon Mar 11 08:41:15 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Mar 11 14:03:30 2024 +0100 svx: prefix members of XHatch See tdf#94879 for motivation. Change-Id: I65f69d6fb334b0d376a304cd1bc1437fd116c9a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164643 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/xhatch.hxx b/include/svx/xhatch.hxx index 1553141e5950..dc56f20a8107 100644 --- a/include/svx/xhatch.hxx +++ b/include/svx/xhatch.hxx @@ -31,27 +31,27 @@ class SVXCORE_DLLPUBLIC XHatch final { -css::drawing::HatchStyle eStyle; -Color aColor; -tools::Long nDistance; -Degree10nAngle; +css::drawing::HatchStyle m_eStyle; +Color m_aColor; +tools::Long m_nDistance; +Degree10m_nAngle; public: -XHatch() : eStyle(css::drawing::HatchStyle_SINGLE), nDistance(0), nAngle(0) {} +XHatch() : m_eStyle(css::drawing::HatchStyle_SINGLE), m_nDistance(0), m_nAngle(0) {} XHatch(const Color& rCol, css::drawing::HatchStyle eStyle = css::drawing::HatchStyle_SINGLE, tools::Long nDistance = 20, Degree10 nAngle = 0_deg10); bool operator==(const XHatch& rHatch) const; -voidSetHatchStyle(css::drawing::HatchStyle eNewStyle) { eStyle = eNewStyle; } -voidSetColor(const Color& rColor) { aColor = rColor; } -voidSetDistance(tools::Long nNewDistance) { nDistance = nNewDistance; } -voidSetAngle(Degree10 nNewAngle) { nAngle = nNewAngle; } +voidSetHatchStyle(css::drawing::HatchStyle eNewStyle) { m_eStyle = eNewStyle; } +voidSetColor(const Color& rColor) { m_aColor = rColor; } +voidSetDistance(tools::Long nNewDistance) { m_nDistance = nNewDistance; } +voidSetAngle(Degree10 nNewAngle) { m_nAngle = nNewAngle; } -css::drawing::HatchStyle GetHatchStyle() const { return eStyle; } -const Color&GetColor() const { return aColor; } -tools::Long GetDistance() const { return nDistance; } -Degree10GetAngle() const { return nAngle; } +css::drawing::HatchStyle GetHatchStyle() const { return m_eStyle; } +const Color&GetColor() const { return m_aColor; } +tools::Long GetDistance() const { return m_nDistance; } +Degree10GetAngle() const { return m_nAngle; } }; #endif diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 5db227e9fca7..22f8f62bbeaa 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2649,19 +2649,19 @@ boost::property_tree::ptree XFillFloatTransparenceItem::dumpAsJSON() const XHatch::XHatch(const Color& rCol, css::drawing::HatchStyle eTheStyle, tools::Long nTheDistance, Degree10 nTheAngle) : -eStyle(eTheStyle), -aColor(rCol), -nDistance(nTheDistance), -nAngle(nTheAngle) +m_eStyle(eTheStyle), +m_aColor(rCol), +m_nDistance(nTheDistance), +m_nAngle(nTheAngle) { } bool XHatch::operator==(const XHatch& rHatch) const { -return ( eStyle == rHatch.eStyle&& - aColor == rHatch.aColor&& - nDistance == rHatch.nDistance && - nAngle == rHatch.nAngle ); +return ( m_eStyle == rHatch.m_eStyle&& + m_aColor == rHatch.m_aColor&& + m_nDistance == rHatch.m_nDistance && + m_nAngle == rHatch.m_nAngle ); }
core.git: include/svx svx/source
include/svx/xtable.hxx|4 ++-- svx/source/xoutdev/xtable.cxx |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) New commits: commit 3372d5c37e07a9862fadc0041587e30759ad0379 Author: Miklos Vajna AuthorDate: Mon Mar 4 08:23:53 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Mar 4 18:49:47 2024 +0100 svx: prefix members of XGradientEntry See tdf#94879 for motivation. Change-Id: Ib00e0ea61ad421eb1d02d973ab8dc8c79b006a64 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164326 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx index 273cc918210e..15775d01ef2a 100644 --- a/include/svx/xtable.hxx +++ b/include/svx/xtable.hxx @@ -101,7 +101,7 @@ public: class SVXCORE_DLLPUBLIC XGradientEntry final : public XPropertyEntry { private: -basegfx::BGradient aGradient; +basegfx::BGradient m_aGradient; public: XGradientEntry(const basegfx::BGradient& rGradient, const OUString& rName); @@ -109,7 +109,7 @@ public: const basegfx::BGradient& GetGradient() const { -return aGradient; +return m_aGradient; } }; diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index 26316acf9ad8..fea229ec74dc 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -74,13 +74,13 @@ XHatchEntry::XHatchEntry(const XHatchEntry& rOther) XGradientEntry::XGradientEntry(const basegfx::BGradient& rGradient, const OUString& rName) : XPropertyEntry(rName), -aGradient(rGradient) +m_aGradient(rGradient) { } XGradientEntry::XGradientEntry(const XGradientEntry& rOther) : XPropertyEntry(rOther), -aGradient(rOther.aGradient) +m_aGradient(rOther.m_aGradient) { }
core.git: include/svx svx/source xmloff/source
include/svx/svx3ditems.hxx |4 +- include/svx/unoshprp.hxx |4 +- svx/source/engine3d/float3d.cxx | 27 --- svx/source/engine3d/svx3ditems.cxx |6 ++-- svx/source/sdr/primitive3d/sdrattributecreator3d.cxx | 15 ++ xmloff/source/draw/sdpropls.cxx | 11 --- 6 files changed, 34 insertions(+), 33 deletions(-) New commits: commit 458f4c9b489d92947c4122e7c450f65f90aa4efe Author: Julien Nabet AuthorDate: Tue Feb 27 08:16:00 2024 +0100 Commit: Julien Nabet CommitDate: Wed Feb 28 10:55:45 2024 +0100 tdf#159874: Inspection of 3D object in Dev Tools crashes LO (take 2) To not trigger tdf#159911 (FILEOPEN: 3D object is displayed as black/white) Let's initialize Svx3DTextureKindItem to 2 which corresponds to COLOR in TextureKind2.idl (see https://opengrok.libreoffice.org/xref/core/offapi/com/sun/star/drawing/TextureKind2.idl?r=5687eba4) but now to avoid the crash, we must replace all uses of TextureKind by TextureKind2 Anyway, TextureKind has been deprecated since 2000 (see https://cgit.freedesktop.org/libreoffice/core/commit/?id=4f9e6d84feb36ab3072dafbab0ba4ae46d264f9b "#80594# added a new TextureKind2 enum because of missing value in TextureKind") + use css::drawing::TextureKind2_LUMINANCE + css::drawing::TextureKind2_COLOR instead of wrong numbers Change-Id: I969bd9ba1c6752111a6e6f5cd2c6c608568e43e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163998 Tested-by: Jenkins Reviewed-by: Julien Nabet diff --git a/include/svx/svx3ditems.hxx b/include/svx/svx3ditems.hxx index 7cb5eae6e399..c749b7eab112 100644 --- a/include/svx/svx3ditems.hxx +++ b/include/svx/svx3ditems.hxx @@ -119,9 +119,9 @@ inline SfxUInt16Item makeSvx3DMaterialSpecularIntensityItem(sal_uInt16 nVal) { class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) Svx3DTextureKindItem final : public SfxUInt16Item { public: -Svx3DTextureKindItem(sal_uInt16 nVal = 3); +Svx3DTextureKindItem(sal_uInt16 nVal = 2); -// use drawing::TextureKind +// use drawing::TextureKind2 SVX_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; SVX_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; SVX_DLLPRIVATE virtual Svx3DTextureKindItem* Clone(SfxItemPool* pPool = nullptr) const override; diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx index 53561015804b..0bf49b7a3e8c 100644 --- a/include/svx/unoshprp.hxx +++ b/include/svx/unoshprp.hxx @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #include #include @@ -529,7 +529,7 @@ { UNO_NAME_3D_NORMALS_KIND ,SDRATTR_3DOBJ_NORMALS_KIND , ::cppu::UnoType::get(), 0, 0}, \ { UNO_NAME_3D_SHADOW_3D,SDRATTR_3DOBJ_SHADOW_3D , cppu::UnoType::get(), 0, 0}, \ { UNO_NAME_3D_TEXTURE_FILTER ,SDRATTR_3DOBJ_TEXTURE_FILTER , cppu::UnoType::get(), 0, 0}, \ -{ UNO_NAME_3D_TEXTURE_KIND ,SDRATTR_3DOBJ_TEXTURE_KIND , ::cppu::UnoType::get(), 0, 0}, \ +{ UNO_NAME_3D_TEXTURE_KIND ,SDRATTR_3DOBJ_TEXTURE_KIND , ::cppu::UnoType::get(), 0, 0}, \ { UNO_NAME_3D_TEXTURE_MODE ,SDRATTR_3DOBJ_TEXTURE_MODE , ::cppu::UnoType::get(), 0, 0}, \ { UNO_NAME_3D_TEXTURE_PROJ_X ,SDRATTR_3DOBJ_TEXTURE_PROJ_X , ::cppu::UnoType::get(), 0, 0}, \ { UNO_NAME_3D_TEXTURE_PROJ_Y ,SDRATTR_3DOBJ_TEXTURE_PROJ_Y , ::cppu::UnoType::get(), 0, 0}, \ diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 035ca293faa6..aa27d5319a3c 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -50,6 +50,7 @@ #include #include +#include #include @@ -1349,12 +1350,13 @@ void Svx3DWin::Update( SfxItemSet const & rAttrs ) if( eState != SfxItemState::DONTCARE ) { sal_uInt16 nValue = rAttrs.Get(SDRATTR_3DOBJ_TEXTURE_KIND).GetValue(); +drawing::TextureKind2 objTextKind = static_cast(nValue); -if( ( !m_xBtnTexLuminance->get_active() && nValue == 1 ) || -( !m_xBtnTexColor->get_active() && nValue == 3 ) ) +if( ( !m_xBtnTexLuminance->get_active() && objTextKind == css::drawing::TextureKind2_LUMINANCE ) || +( !m_xBtnTexColor->get_active() && objTextKind == css::drawing::TextureKind2_COLOR ) ) { -m_xBtnTexLuminance->set_active( nValue == 1 ); -m_xBtnTexColor->set_active( nValue == 3 ); +m_xBtnTexLuminance->set_active( objTextKind == css::drawing::TextureKind2_LUMINANCE ); +m_xBtnTexColor->set_active( objTextKind ==
core.git: include/svx svx/source sw/source
include/svx/sidebar/ValueSetWithTextControl.hxx |1 - svx/source/sidebar/tools/ValueSetWithTextControl.cxx | 11 --- sw/source/uibase/sidebar/PageSizeControl.cxx |1 - 3 files changed, 13 deletions(-) New commits: commit 7c3cdc88337959ddbb9799c4cee57901e94719f3 Author: Justin Luth AuthorDate: Mon Feb 26 11:09:59 2024 -0500 Commit: Justin Luth CommitDate: Mon Feb 26 18:55:51 2024 +0100 tdf#159865 Revert "tdf#136905 NBB: let ValueSetWithTextControl set optimal" ...height This reverts my 24.2 commit 1876feb8a8805b2f80537e2828c152ccbdf67fe2 (as well as my initial attempt to fix it in 24.8). Change-Id: I70c3668393a13992f9ce489e86b07860218445b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163954 Tested-by: Justin Luth Reviewed-by: Justin Luth diff --git a/include/svx/sidebar/ValueSetWithTextControl.hxx b/include/svx/sidebar/ValueSetWithTextControl.hxx index 407e9606757f..ac397f9fdab6 100644 --- a/include/svx/sidebar/ValueSetWithTextControl.hxx +++ b/include/svx/sidebar/ValueSetWithTextControl.hxx @@ -40,7 +40,6 @@ 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 d55740315c99..cddd7b0aa801 100644 --- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx +++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx @@ -42,17 +42,6 @@ void ValueSetWithTextControl::SetDrawingArea(weld::DrawingArea* pDrawingArea) SetColCount(); } -void ValueSetWithTextControl::SetOptimalDrawingAreaHeight() -{ -const vcl::Font aFont(Application::GetSettings().GetStyleSettings().GetLabelFont()); -double fRowHeight = aFont.GetFontSize().Height() * 9 / 4.0; // see UserDraw() -// It still looks too small. Probably the height specified should be the leading point size? -fRowHeight *= 1.2; // add 20% leading -const Size aSize(GetOutputSizePixel().Width(), fRowHeight * 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 2591ffd99718..37ed1835e972 100644 --- a/sw/source/uibase/sidebar/PageSizeControl.cxx +++ b/sw/source/uibase/sidebar/PageSizeControl.cxx @@ -168,7 +168,6 @@ PageSizeControl::PageSizeControl(PageSizePopup* pControl, weld::Widget* pParent) } mxSizeValueSet->SetNoSelection(); mxSizeValueSet->SetSelectHdl( LINK(this, PageSizeControl, ImplSizeHdl ) ); -mxSizeValueSet->SetOptimalDrawingAreaHeight(); mxSizeValueSet->Show(); mxSizeValueSet->Resize();
core.git: include/svx svx/source
include/svx/xflhtit.hxx |4 +- svx/source/xoutdev/xattr.cxx | 60 +-- 2 files changed, 32 insertions(+), 32 deletions(-) New commits: commit d3b548fdd01d73778c8ae2512e9db024e47c52d2 Author: Miklos Vajna AuthorDate: Mon Feb 26 08:25:46 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Feb 26 09:31:49 2024 +0100 svx: prefix members of XFillHatchItem See tdf#94879 for motivation. Change-Id: I4e2251aa5488c76a270e01f48ed4ccc12fc56332 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163930 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/xflhtit.hxx b/include/svx/xflhtit.hxx index 9eb8805415aa..92ce362fc0fa 100644 --- a/include/svx/xflhtit.hxx +++ b/include/svx/xflhtit.hxx @@ -31,7 +31,7 @@ class SdrModel; class SVXCORE_DLLPUBLIC XFillHatchItem final : public NameOrIndex { -XHatch aHatch; +XHatch m_aHatch; public: static SfxPoolItem* CreateDefault(); @@ -52,7 +52,7 @@ public: virtual boolHasMetrics() const override; virtual voidScaleMetrics(tools::Long nMul, tools::Long nDiv) override; -const XHatch& GetHatchValue() const { return aHatch;} // GetValue -> GetHatchValue +const XHatch& GetHatchValue() const { return m_aHatch;} // GetValue -> GetHatchValue static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ); std::unique_ptr checkForUniqueItem( SdrModel* pModel ) const; diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index b1747eea65ba..5db227e9fca7 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2670,19 +2670,19 @@ SfxPoolItem* XFillHatchItem::CreateDefault() { return new XFillHatchItem; } XFillHatchItem::XFillHatchItem(const OUString& rName, const XHatch& rTheHatch) : NameOrIndex(XATTR_FILLHATCH, rName), -aHatch(rTheHatch) +m_aHatch(rTheHatch) { } XFillHatchItem::XFillHatchItem(const XFillHatchItem& rItem) : NameOrIndex(rItem), -aHatch(rItem.aHatch) +m_aHatch(rItem.m_aHatch) { } XFillHatchItem::XFillHatchItem(const XHatch& rTheHatch) : NameOrIndex( XATTR_FILLHATCH, -1 ), -aHatch(rTheHatch) +m_aHatch(rTheHatch) { } @@ -2694,7 +2694,7 @@ XFillHatchItem* XFillHatchItem::Clone(SfxItemPool* /*pPool*/) const bool XFillHatchItem::operator==(const SfxPoolItem& rItem) const { return ( NameOrIndex::operator==(rItem) && - aHatch == static_cast(rItem).aHatch ); + m_aHatch == static_cast(rItem).m_aHatch ); } bool XFillHatchItem::GetPresentation @@ -2716,7 +2716,7 @@ bool XFillHatchItem::HasMetrics() const void XFillHatchItem::ScaleMetrics(tools::Long nMul, tools::Long nDiv) { -aHatch.SetDistance( BigInt::Scale( aHatch.GetDistance(), nMul, nDiv ) ); +m_aHatch.SetDistance( BigInt::Scale( m_aHatch.GetDistance(), nMul, nDiv ) ); } bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) const @@ -2729,10 +2729,10 @@ bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons { css::drawing::Hatch aUnoHatch; -aUnoHatch.Style = aHatch.GetHatchStyle(); -aUnoHatch.Color = sal_Int32(aHatch.GetColor()); -aUnoHatch.Distance = aHatch.GetDistance(); -aUnoHatch.Angle = aHatch.GetAngle().get(); +aUnoHatch.Style = m_aHatch.GetHatchStyle(); +aUnoHatch.Color = sal_Int32(m_aHatch.GetColor()); +aUnoHatch.Distance = m_aHatch.GetDistance(); +aUnoHatch.Angle = m_aHatch.GetAngle().get(); uno::Sequence< beans::PropertyValue > aPropSeq{ comphelper::makePropertyValue("Name", SvxUnogetApiNameForItem(Which(), GetName())), @@ -2746,10 +2746,10 @@ bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons { css::drawing::Hatch aUnoHatch; -aUnoHatch.Style = aHatch.GetHatchStyle(); -aUnoHatch.Color = sal_Int32(aHatch.GetColor()); -aUnoHatch.Distance = aHatch.GetDistance(); -aUnoHatch.Angle = aHatch.GetAngle().get(); +aUnoHatch.Style = m_aHatch.GetHatchStyle(); +aUnoHatch.Color = sal_Int32(m_aHatch.GetColor()); +aUnoHatch.Distance = m_aHatch.GetDistance(); +aUnoHatch.Angle = m_aHatch.GetAngle().get(); rVal <<= aUnoHatch; break; } @@ -2761,13 +2761,13 @@ bool XFillHatchItem::QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId ) cons } case MID_HATCH_STYLE: -rVal <<= aHatch.GetHatchStyle(); break; +rVal <<= m_aHatch.GetHatchStyle(); break; case MID_HATCH_COLOR: -rVal <<= aHatch.GetColor(); break; +rVal <<= m_aHatch.GetColor(); break; case
core.git: include/svx svx/source svx/uiconfig
include/svx/strings.hrc |1 - svx/source/tbxctrls/bulletsnumbering.cxx |2 -- svx/uiconfig/ui/numberingwindow.ui |3 ++- 3 files changed, 2 insertions(+), 4 deletions(-) New commits: commit fe4cd0cebdbf9412e26f8182e79f97bb844d94af Author: Samuel Mehrbrodt AuthorDate: Thu Feb 22 14:09:12 2024 +0100 Commit: Samuel Mehrbrodt CommitDate: Mon Feb 26 07:41:02 2024 +0100 Set button label directly in ui file Change-Id: If9e22982f4f7c276d19167ff365e1b4e290e3de7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163748 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index c43bf8203981..eb8e06f0c4c7 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -1108,7 +1108,6 @@ #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_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 e1a55a112346..e7ccc6238800 100644 --- a/svx/source/tbxctrls/bulletsnumbering.cxx +++ b/svx/source/tbxctrls/bulletsnumbering.cxx @@ -107,7 +107,6 @@ NumberingPopup::NumberingPopup(NumberingToolBoxControl& rController, mxValueSet->SetOutputSizePixel(aSize); mxValueSet->SetColor(Application::GetSettings().GetStyleSettings().GetFieldColor()); -OUString aMoreItemText = SvxResId( RID_SVXSTR_CUSTOMIZE ); if ( mePageType == NumberingPageType::BULLET ) AddStatusListener( ".uno:CurrentBulletListType" ); else if ( mePageType == NumberingPageType::SINGLENUM ) @@ -117,7 +116,6 @@ NumberingPopup::NumberingPopup(NumberingToolBoxControl& rController, auto xImage = vcl::CommandInfoProvider::GetXGraphicForCommand(".uno:OutlineBullet", mrController.getFrameInterface()); mxMoreButton->set_image(xImage); -mxMoreButton->set_label(aMoreItemText); mxMoreButton->connect_clicked(LINK(this, NumberingPopup, VSButtonClickSetHdl)); mxValueSet->SetSelectHdl(LINK(this, NumberingPopup, VSSelectValueSetHdl)); diff --git a/svx/uiconfig/ui/numberingwindow.ui b/svx/uiconfig/ui/numberingwindow.ui index e303830fc01e..db44aeee4d8c 100644 --- a/svx/uiconfig/ui/numberingwindow.ui +++ b/svx/uiconfig/ui/numberingwindow.ui @@ -1,5 +1,5 @@ - + @@ -51,6 +51,7 @@ +Customize... True True True
core.git: include/svx svx/source
include/svx/xflgrit.hxx |4 ++-- svx/source/xoutdev/xattr.cxx | 16 2 files changed, 10 insertions(+), 10 deletions(-) New commits: commit e3c0aeec8385cba90b4fb21d2c9032efa61a8e82 Author: Miklos Vajna AuthorDate: Mon Feb 19 08:00:48 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Feb 19 09:11:25 2024 +0100 svx: prefix members of XFillGradientItem See tdf#94879 for motivation. Change-Id: I3d951d553d524cedc876330a70e6fe94edba0173 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163579 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/xflgrit.hxx b/include/svx/xflgrit.hxx index c8594753e5c0..97c0b072352c 100644 --- a/include/svx/xflgrit.hxx +++ b/include/svx/xflgrit.hxx @@ -30,7 +30,7 @@ class SdrModel; class SVXCORE_DLLPUBLIC XFillGradientItem : public NameOrIndex { -basegfx::BGradient aGradient; +basegfx::BGradient m_aGradient; public: static SfxPoolItem* CreateDefault(); @@ -50,7 +50,7 @@ public: MapUnit ePresMetric, OUString , const IntlWrapper& ) const override; const basegfx::BGradient&GetGradientValue() const; // GetValue -> GetGradientValue -voidSetGradientValue(const basegfx::BGradient& rNew) { aGradient = rNew; Detach(); } // SetValue -> SetGradientValue +voidSetGradientValue(const basegfx::BGradient& rNew) { m_aGradient = rNew; Detach(); } // SetValue -> SetGradientValue static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 ); std::unique_ptr checkForUniqueItem( SdrModel* pModel ) const; diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index c4dd3d292b00..b1747eea65ba 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2212,26 +2212,26 @@ SfxPoolItem* XFillGradientItem::CreateDefault() { return new XFillGradientItem; XFillGradientItem::XFillGradientItem(sal_Int32 nIndex, const basegfx::BGradient& rTheGradient) : NameOrIndex(XATTR_FILLGRADIENT, nIndex), -aGradient(rTheGradient) +m_aGradient(rTheGradient) { } XFillGradientItem::XFillGradientItem(const OUString& rName, const basegfx::BGradient& rTheGradient, TypedWhichId nWhich) : NameOrIndex(nWhich, rName) -, aGradient(rTheGradient) +, m_aGradient(rTheGradient) { } XFillGradientItem::XFillGradientItem(const XFillGradientItem& rItem) : NameOrIndex(rItem), -aGradient(rItem.aGradient) +m_aGradient(rItem.m_aGradient) { } XFillGradientItem::XFillGradientItem( const basegfx::BGradient& rTheGradient ) : NameOrIndex( XATTR_FILLGRADIENT, -1 ), -aGradient(rTheGradient) +m_aGradient(rTheGradient) { } @@ -2243,16 +2243,16 @@ XFillGradientItem* XFillGradientItem::Clone(SfxItemPool* /*pPool*/) const bool XFillGradientItem::operator==(const SfxPoolItem& rItem) const { return ( NameOrIndex::operator==(rItem) && - aGradient == static_cast(rItem).aGradient ); + m_aGradient == static_cast(rItem).m_aGradient ); } const basegfx::BGradient& XFillGradientItem::GetGradientValue() const // GetValue -> GetGradientValue { if (!IsIndex()) -return aGradient; +return m_aGradient; // ToDo: This should fail. We never called this code with a table so this should always // have failed. Thus, I'm thinking that XFillGradientItem can't be an Index. -return aGradient; +return m_aGradient; } bool XFillGradientItem::GetPresentation @@ -2485,7 +2485,7 @@ std::unique_ptr XFillGradientItem::checkForUniqueItem( SdrMod // if the given name is not valid, replace it! if( aUniqueName != GetName() ) -return std::make_unique( aUniqueName, aGradient, TypedWhichId(Which()) ); +return std::make_unique( aUniqueName, m_aGradient, TypedWhichId(Which()) ); } return nullptr;
core.git: include/svx svx/source
include/svx/svdhlpln.hxx | 16 svx/source/svdraw/svdhlpln.cxx |6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) New commits: commit 207501b8385818a5d413b9f4001e0d24aaa4f2a9 Author: Miklos Vajna AuthorDate: Mon Feb 12 08:17:14 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Feb 12 10:34:34 2024 +0100 svx: prefix members of SdrHelpLineList See tdf#94879 for motivation. Change-Id: I172aad9fe63589a6a6bbbce77173a6fe24291ae5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163235 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/include/svx/svdhlpln.hxx b/include/svx/svdhlpln.hxx index 0eed874adf3a..218f36e46bf8 100644 --- a/include/svx/svdhlpln.hxx +++ b/include/svx/svdhlpln.hxx @@ -59,7 +59,7 @@ public: #define SDRHELPLINE_NOTFOUND 0x class SVXCORE_DLLPUBLIC SdrHelpLineList { -std::vector> aList; +std::vector> m_aList; public: SdrHelpLineList() {} @@ -67,21 +67,21 @@ public: SdrHelpLineList& operator=(const SdrHelpLineList& rSrcList); bool operator==(const SdrHelpLineList& rCmp) const; bool operator!=(const SdrHelpLineList& rCmp) const { return !operator==(rCmp); } -sal_uInt16 GetCount() const{ return sal_uInt16(aList.size()); } -void Insert(const SdrHelpLine& rHL) { aList.emplace_back(new SdrHelpLine(rHL)); } +sal_uInt16 GetCount() const{ return sal_uInt16(m_aList.size()); } +void Insert(const SdrHelpLine& rHL) { m_aList.emplace_back(new SdrHelpLine(rHL)); } void Insert(const SdrHelpLine& rHL, sal_uInt16 nPos) { if(nPos==0x) -aList.emplace_back(new SdrHelpLine(rHL)); +m_aList.emplace_back(new SdrHelpLine(rHL)); else -aList.emplace(aList.begin() + nPos, new SdrHelpLine(rHL)); +m_aList.emplace(m_aList.begin() + nPos, new SdrHelpLine(rHL)); } void Delete(sal_uInt16 nPos) { -aList.erase(aList.begin() + nPos); +m_aList.erase(m_aList.begin() + nPos); } -SdrHelpLine& operator[](sal_uInt16 nPos) { return *aList[nPos]; } -const SdrHelpLine& operator[](sal_uInt16 nPos) const { return *aList[nPos]; } +SdrHelpLine& operator[](sal_uInt16 nPos) { return *m_aList[nPos]; } +const SdrHelpLine& operator[](sal_uInt16 nPos) const { return *m_aList[nPos]; } sal_uInt16 HitTest(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const; }; diff --git a/svx/source/svdraw/svdhlpln.cxx b/svx/source/svdraw/svdhlpln.cxx index c42aefd4e816..58d0eb10c400 100644 --- a/svx/source/svdraw/svdhlpln.cxx +++ b/svx/source/svdraw/svdhlpln.cxx @@ -73,7 +73,7 @@ tools::Rectangle SdrHelpLine::GetBoundRect(const OutputDevice& rOut) const SdrHelpLineList& SdrHelpLineList::operator=(const SdrHelpLineList& rSrcList) { -aList.clear(); +m_aList.clear(); sal_uInt16 nCount=rSrcList.GetCount(); for (sal_uInt16 i=0; i0;) { i--; -if (aList[i]->IsHit(rPnt,nTolLog,rOut)) return i; +if (m_aList[i]->IsHit(rPnt,nTolLog,rOut)) return i; } return SDRHELPLINE_NOTFOUND; }
core.git: include/svx svx/source
include/svx/xtable.hxx|4 ++-- svx/source/xoutdev/xtable.cxx |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) New commits: commit 4259b451c26eec782eb15c7603f6fbb06fc3787e Author: Miklos Vajna AuthorDate: Mon Feb 5 08:09:53 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Feb 5 11:50:50 2024 +0100 svx: prefix members of XDashEntry See tdf#94879 for motivation. Change-Id: I9506823a9d9f3b11496ff6211943b72a81a77165 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162981 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx index eb015497a9e4..273cc918210e 100644 --- a/include/svx/xtable.hxx +++ b/include/svx/xtable.hxx @@ -71,7 +71,7 @@ public: class SVXCORE_DLLPUBLIC XDashEntry final : public XPropertyEntry { private: -XDash aDash; +XDash m_aDash; public: XDashEntry(const XDash& rDash, const OUString& rName); @@ -79,7 +79,7 @@ public: const XDash& GetDash() const { -return aDash; +return m_aDash; } }; diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index 87850e6f25b8..26316acf9ad8 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -50,13 +50,13 @@ XLineEndEntry::XLineEndEntry(const XLineEndEntry& rOther) XDashEntry::XDashEntry(const XDash& rDash, const OUString& rName) : XPropertyEntry(rName), -aDash(rDash) +m_aDash(rDash) { } XDashEntry::XDashEntry(const XDashEntry& rOther) : XPropertyEntry(rOther), -aDash(rOther.aDash) +m_aDash(rOther.m_aDash) { }
core.git: include/svx svx/source
include/svx/tbcontrl.hxx | 65 --- svx/source/tbxctrls/tbcontrl.cxx | 168 +-- 2 files changed, 42 insertions(+), 191 deletions(-) New commits: commit 8cccfc82a3038bc28864ae9e94418a141b4aa545 Author: Tomaž Vajngerl AuthorDate: Tue Jan 30 22:59:11 2024 +0900 Commit: Tomaž Vajngerl CommitDate: Wed Jan 31 09:03:39 2024 +0100 Revert "store last five MRU currencies in the currency drop-down" This reverts commit dc6b93011cc5435f367666e43e354c6ab97bbc90. Change-Id: Ia56cb2e906303d6d59061df3e21954306bee2298 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162754 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/include/svx/tbcontrl.hxx b/include/svx/tbcontrl.hxx index 11d41ee4ddde..9fffced835cb 100644 --- a/include/svx/tbcontrl.hxx +++ b/include/svx/tbcontrl.hxx @@ -249,73 +249,11 @@ public: /** Popup controller for currency combo widget **/ class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SvxCurrencyToolBoxControl final : public svt::PopupWindowController { -public: -/** -* 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 most recently used list **/ -void addMruCurrency(sal_Int16 currencyPosition); - -/** -* 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 @@ -328,9 +266,6 @@ public: 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; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 9a3669aac56a..192bf6c6fdd5 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -112,10 +112,6 @@ #define COMBO_WIDTH_IN_CHARS18 -#define MAX_MRU_CURRENCIES 5 - -#define INVALID_CURRENCYsal_uInt16(-2) - // namespaces using namespace ::editeng; using namespace ::com::sun::star; @@ -3915,13 +3911,15 @@ 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(); -const SvxCurrencyToolBoxControl::SvxCurrencyVect_t =
core.git: include/svx svx/source
include/svx/xdash.hxx| 36 ++-- svx/source/xoutdev/xattr.cxx | 24 2 files changed, 30 insertions(+), 30 deletions(-) New commits: commit 1a4e52c0d985138d483af288c547f8cea6c96667 Author: Miklos Vajna AuthorDate: Mon Jan 22 08:09:36 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Jan 22 09:13:38 2024 +0100 svx: prefix members of XDash See tdf#94879 for motivation. Change-Id: I78a3b52001cc61728fe568623acf13b86f43c449 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162361 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/xdash.hxx b/include/svx/xdash.hxx index eef7d2f7fb2d..6b6771a9fa35 100644 --- a/include/svx/xdash.hxx +++ b/include/svx/xdash.hxx @@ -30,12 +30,12 @@ class SVXCORE_DLLPUBLIC XDash final { -css::drawing::DashStyle eDash; -sal_uInt16 nDots; -sal_uInt16 nDashes; -double nDotLen; -double nDashLen; -double nDistance; +css::drawing::DashStyle m_eDash; +sal_uInt16 m_nDots; +sal_uInt16 m_nDashes; +double m_nDotLen; +double m_nDashLen; +double m_nDistance; public: XDash(css::drawing::DashStyle eDash = css::drawing::DashStyle_RECT, @@ -44,19 +44,19 @@ public: bool operator==(const XDash& rDash) const; -void SetDashStyle(css::drawing::DashStyle eNewStyle) { eDash = eNewStyle; } -void SetDots(sal_uInt16 nNewDots){ nDots = nNewDots; } -void SetDotLen(double nNewDotLen){ nDotLen = nNewDotLen; } -void SetDashes(sal_uInt16 nNewDashes){ nDashes = nNewDashes; } -void SetDashLen(double nNewDashLen) { nDashLen = nNewDashLen; } -void SetDistance(double nNewDistance){ nDistance = nNewDistance; } +void SetDashStyle(css::drawing::DashStyle eNewStyle) { m_eDash = eNewStyle; } +void SetDots(sal_uInt16 nNewDots){ m_nDots = nNewDots; } +void SetDotLen(double nNewDotLen){ m_nDotLen = nNewDotLen; } +void SetDashes(sal_uInt16 nNewDashes){ m_nDashes = nNewDashes; } +void SetDashLen(double nNewDashLen) { m_nDashLen = nNewDashLen; } +void SetDistance(double nNewDistance){ m_nDistance = nNewDistance; } -css::drawing::DashStyle GetDashStyle() const{ return eDash; } -sal_uInt16 GetDots() const { return nDots; } -double GetDotLen() const { return nDotLen; } -sal_uInt16 GetDashes() const { return nDashes; } -double GetDashLen() const { return nDashLen; } -double GetDistance() const { return nDistance; } +css::drawing::DashStyle GetDashStyle() const{ return m_eDash; } +sal_uInt16 GetDots() const { return m_nDots; } +double GetDotLen() const { return m_nDotLen; } +sal_uInt16 GetDashes() const { return m_nDashes; } +double GetDashLen() const { return m_nDashLen; } +double GetDistance() const { return m_nDistance; } // XDash is translated into an array of doubles which describe the lengths of the // dashes, dots and empty passages. It returns the complete length of the full DashDot diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index e712be7632f2..68b40d539cd0 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -487,23 +487,23 @@ sal_uInt16 XLineStyleItem::GetValueCount() const XDash::XDash(css::drawing::DashStyle eTheDash, sal_uInt16 nTheDots, double nTheDotLen, sal_uInt16 nTheDashes, double nTheDashLen, double nTheDistance) : -eDash(eTheDash), -nDots(nTheDots), -nDashes(nTheDashes), -nDotLen(nTheDotLen), -nDashLen(nTheDashLen), -nDistance(nTheDistance) +m_eDash(eTheDash), +m_nDots(nTheDots), +m_nDashes(nTheDashes), +m_nDotLen(nTheDotLen), +m_nDashLen(nTheDashLen), +m_nDistance(nTheDistance) { } bool XDash::operator==(const XDash& rDash) const { -return ( eDash == rDash.eDash && - nDots == rDash.nDots && - nDotLen== rDash.nDotLen&& - nDashes== rDash.nDashes&& - nDashLen == rDash.nDashLen && - nDistance == rDash.nDistance ); +return ( m_eDash == rDash.m_eDash && + m_nDots == rDash.m_nDots && + m_nDotLen== rDash.m_nDotLen&& + m_nDashes== rDash.m_nDashes&& + m_nDashLen ==
core.git: include/svx svx/source
include/svx/deflt3d.hxx | 68 svx/source/engine3d/deflt3d.cxx | 30 - 2 files changed, 49 insertions(+), 49 deletions(-) New commits: commit b6f7ad722ec668e9c9324f82044e768af2cdf766 Author: Miklos Vajna AuthorDate: Mon Jan 15 08:10:06 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Jan 15 09:34:25 2024 +0100 svx: prefix members of E3dDefaultAttributes See tdf#94879 for motivation. Change-Id: Icfa7f881de446095067c0f3a4a601cfd5da3228c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162073 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/deflt3d.hxx b/include/svx/deflt3d.hxx index f3312afd5fd8..573378b46414 100644 --- a/include/svx/deflt3d.hxx +++ b/include/svx/deflt3d.hxx @@ -35,27 +35,27 @@ class SAL_WARN_UNUSED UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) E3dDefaultAttributes { private: // Cube object -basegfx::B3DPoint aDefaultCubePos; -basegfx::B3DVector aDefaultCubeSize; -boolbDefaultCubePosIsCenter; +basegfx::B3DPoint m_aDefaultCubePos; +basegfx::B3DVector m_aDefaultCubeSize; +boolm_bDefaultCubePosIsCenter; // Sphere object -basegfx::B3DPoint aDefaultSphereCenter; -basegfx::B3DVector aDefaultSphereSize; +basegfx::B3DPoint m_aDefaultSphereCenter; +basegfx::B3DVector m_aDefaultSphereSize; // Lathe object -boolbDefaultLatheSmoothed; -boolbDefaultLatheSmoothFrontBack; -boolbDefaultLatheCharacterMode; -boolbDefaultLatheCloseFront; -boolbDefaultLatheCloseBack; +boolm_bDefaultLatheSmoothed; +boolm_bDefaultLatheSmoothFrontBack; +boolm_bDefaultLatheCharacterMode; +boolm_bDefaultLatheCloseFront; +boolm_bDefaultLatheCloseBack; // Extrude object -boolbDefaultExtrudeSmoothed; -boolbDefaultExtrudeSmoothFrontBack; -boolbDefaultExtrudeCharacterMode; -boolbDefaultExtrudeCloseFront; -boolbDefaultExtrudeCloseBack; +boolm_bDefaultExtrudeSmoothed; +boolm_bDefaultExtrudeSmoothFrontBack; +boolm_bDefaultExtrudeCharacterMode; +boolm_bDefaultExtrudeCloseFront; +boolm_bDefaultExtrudeCloseBack; public: // Constructor @@ -65,31 +65,31 @@ public: void Reset(); // Cube object -const basegfx::B3DPoint& GetDefaultCubePos() const { return aDefaultCubePos; } -const basegfx::B3DVector& GetDefaultCubeSize() const { return aDefaultCubeSize; } -bool GetDefaultCubePosIsCenter() const { return bDefaultCubePosIsCenter; } +const basegfx::B3DPoint& GetDefaultCubePos() const { return m_aDefaultCubePos; } +const basegfx::B3DVector& GetDefaultCubeSize() const { return m_aDefaultCubeSize; } +bool GetDefaultCubePosIsCenter() const { return m_bDefaultCubePosIsCenter; } // Sphere object -const basegfx::B3DPoint& GetDefaultSphereCenter() const { return aDefaultSphereCenter; } -const basegfx::B3DVector& GetDefaultSphereSize() const { return aDefaultSphereSize; } +const basegfx::B3DPoint& GetDefaultSphereCenter() const { return m_aDefaultSphereCenter; } +const basegfx::B3DVector& GetDefaultSphereSize() const { return m_aDefaultSphereSize; } // Lathe object -bool GetDefaultLatheSmoothed() const { return bDefaultLatheSmoothed; } -bool GetDefaultLatheSmoothFrontBack() const { return bDefaultLatheSmoothFrontBack; } -bool GetDefaultLatheCharacterMode() const { return bDefaultLatheCharacterMode; } -void SetDefaultLatheCharacterMode(const bool bNew) { bDefaultLatheCharacterMode = bNew; } -bool GetDefaultLatheCloseFront() const { return bDefaultLatheCloseFront; } -bool GetDefaultLatheCloseBack() const { return bDefaultLatheCloseBack; } +bool GetDefaultLatheSmoothed() const { return m_bDefaultLatheSmoothed; } +bool GetDefaultLatheSmoothFrontBack() const { return m_bDefaultLatheSmoothFrontBack; } +bool GetDefaultLatheCharacterMode() const { return m_bDefaultLatheCharacterMode; } +void SetDefaultLatheCharacterMode(const bool bNew) { m_bDefaultLatheCharacterMode = bNew; } +bool GetDefaultLatheCloseFront() const { return m_bDefaultLatheCloseFront; } +bool GetDefaultLatheCloseBack() const { return m_bDefaultLatheCloseBack; } // Extrude object -bool GetDefaultExtrudeSmoothed() const { return bDefaultExtrudeSmoothed; } -bool GetDefaultExtrudeSmoothFrontBack() const { return bDefaultExtrudeSmoothFrontBack; } -bool GetDefaultExtrudeCharacterMode() const { return bDefaultExtrudeCharacterMode; } -void SetDefaultExtrudeCharacterMode(const bool bNew) {
core.git: include/svx svx/source
include/svx/svdhlpln.hxx | 18 +- svx/source/svdraw/svdhlpln.cxx | 16 2 files changed, 17 insertions(+), 17 deletions(-) New commits: commit b2fe01ef6154aab63c33706be2739ce2540212c2 Author: Miklos Vajna AuthorDate: Mon Jan 8 08:27:31 2024 +0100 Commit: Miklos Vajna CommitDate: Mon Jan 8 17:56:39 2024 +0100 svx: prefix members of SdrHelpLine See tdf#94879 for motivation. Change-Id: I340040c28aaf64ad79c0d0433686a40b38e351c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161781 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svdhlpln.hxx b/include/svx/svdhlpln.hxx index aa850773c4e2..0eed874adf3a 100644 --- a/include/svx/svdhlpln.hxx +++ b/include/svx/svdhlpln.hxx @@ -36,19 +36,19 @@ enum class SdrHelpLineKind { Point, Vertical, Horizontal }; #define SDRHELPLINE_POINT_PIXELSIZE 15 /* actual size = PIXELSIZE*2+1 */ class SdrHelpLine { -PointaPos; // X or Y may be unimportant, depending on the value of eKind -SdrHelpLineKind eKind; +Pointm_aPos; // X or Y may be unimportant, depending on the value of eKind +SdrHelpLineKind m_eKind; public: -explicit SdrHelpLine(SdrHelpLineKind eNewKind=SdrHelpLineKind::Point): eKind(eNewKind) {} -SdrHelpLine(SdrHelpLineKind eNewKind, const Point& rNewPos): aPos(rNewPos), eKind(eNewKind) {} -bool operator==(const SdrHelpLine& rCmp) const { return aPos==rCmp.aPos && eKind==rCmp.eKind; } +explicit SdrHelpLine(SdrHelpLineKind eNewKind=SdrHelpLineKind::Point): m_eKind(eNewKind) {} +SdrHelpLine(SdrHelpLineKind eNewKind, const Point& rNewPos): m_aPos(rNewPos), m_eKind(eNewKind) {} +bool operator==(const SdrHelpLine& rCmp) const { return m_aPos==rCmp.m_aPos && m_eKind==rCmp.m_eKind; } bool operator!=(const SdrHelpLine& rCmp) const { return !operator==(rCmp); } -voidSetKind(SdrHelpLineKind eNewKind) { eKind=eNewKind; } -SdrHelpLineKind GetKind() const { return eKind; } -voidSetPos(const Point& rPnt) { aPos=rPnt; } -const Point&GetPos() const{ return aPos; } +voidSetKind(SdrHelpLineKind eNewKind) { m_eKind=eNewKind; } +SdrHelpLineKind GetKind() const { return m_eKind; } +voidSetPos(const Point& rPnt) { m_aPos=rPnt; } +const Point&GetPos() const{ return m_aPos; } PointerStyleGetPointer() const; boolIsHit(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const; diff --git a/svx/source/svdraw/svdhlpln.cxx b/svx/source/svdraw/svdhlpln.cxx index 0d515191ed34..c42aefd4e816 100644 --- a/svx/source/svdraw/svdhlpln.cxx +++ b/svx/source/svdraw/svdhlpln.cxx @@ -26,7 +26,7 @@ PointerStyle SdrHelpLine::GetPointer() const { -switch (eKind) { +switch (m_eKind) { case SdrHelpLineKind::Vertical : return PointerStyle::ESize; case SdrHelpLineKind::Horizontal: return PointerStyle::SSize; default: return PointerStyle::Move; @@ -36,16 +36,16 @@ PointerStyle SdrHelpLine::GetPointer() const bool SdrHelpLine::IsHit(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const { Size a1Pix(rOut.PixelToLogic(Size(1,1))); -bool bXHit=rPnt.X()>=aPos.X()-nTolLog && rPnt.X()<=aPos.X()+nTolLog+a1Pix.Width(); -bool bYHit=rPnt.Y()>=aPos.Y()-nTolLog && rPnt.Y()<=aPos.Y()+nTolLog+a1Pix.Height(); -switch (eKind) { +bool bXHit=rPnt.X()>=m_aPos.X()-nTolLog && rPnt.X()<=m_aPos.X()+nTolLog+a1Pix.Width(); +bool bYHit=rPnt.Y()>=m_aPos.Y()-nTolLog && rPnt.Y()<=m_aPos.Y()+nTolLog+a1Pix.Height(); +switch (m_eKind) { case SdrHelpLineKind::Vertical : return bXHit; case SdrHelpLineKind::Horizontal: return bYHit; case SdrHelpLineKind::Point: { if (bXHit || bYHit) { Size aRad(rOut.PixelToLogic(Size(SDRHELPLINE_POINT_PIXELSIZE,SDRHELPLINE_POINT_PIXELSIZE))); -return rPnt.X()>=aPos.X()-aRad.Width() && rPnt.X()<=aPos.X()+aRad.Width()+a1Pix.Width() && - rPnt.Y()>=aPos.Y()-aRad.Height() && rPnt.Y()<=aPos.Y()+aRad.Height()+a1Pix.Height(); +return rPnt.X()>=m_aPos.X()-aRad.Width() && rPnt.X()<=m_aPos.X()+aRad.Width()+a1Pix.Width() && + rPnt.Y()>=m_aPos.Y()-aRad.Height() && rPnt.Y()<=m_aPos.Y()+aRad.Height()+a1Pix.Height(); } } break; } // switch @@ -54,10 +54,10 @@ bool SdrHelpLine::IsHit(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevic tools::Rectangle SdrHelpLine::GetBoundRect(const OutputDevice& rOut) const { -tools::Rectangle aRet(aPos,aPos); +tools::Rectangle aRet(m_aPos,m_aPos); Point aOfs(rOut.GetMapMode().GetOrigin()); Size aSiz(rOut.GetOutputSize()); -switch (eKind) { +switch (m_eKind) { case
core.git: include/svx svx/source
include/svx/compressgraphicdialog.hxx |1 + svx/source/dialog/compressgraphicdialog.cxx | 16 +++- 2 files changed, 12 insertions(+), 5 deletions(-) New commits: commit 79018bac2ed73fbfaacf661ae1272086e3ddd342 Author: Heiko Tietze AuthorDate: Thu Jan 4 14:45:13 2024 +0100 Commit: Heiko Tietze CommitDate: Fri Jan 5 07:36:33 2024 +0100 Resolves tdf#158780 - Disable resolution controls initially Change-Id: I80e620085868925643d4b7561cd7aeff2d9c930f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161620 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/include/svx/compressgraphicdialog.hxx b/include/svx/compressgraphicdialog.hxx index 088d0b6fd45e..d46220d17a1f 100644 --- a/include/svx/compressgraphicdialog.hxx +++ b/include/svx/compressgraphicdialog.hxx @@ -79,6 +79,7 @@ private: DECL_DLLPRIVATE_LINK( OkayClickHdl, weld::Button&, void ); void Update(); +void UpdateSensitivity(const bool bSensitive); void UpdateNewWidthMF(); void UpdateNewHeightMF(); void UpdateResolutionLB(); diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index 35899bec2f5f..df1d3a8c3db6 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -108,6 +108,8 @@ void CompressGraphicsDialog::recallParameter() m_xQualitySlider->set_value( memp.QualityMF ); m_xInterpolationCombo->set_active( memp.InterpolationCombo ); + +UpdateSensitivity(m_xReduceResolutionCB->get_active()); } void CompressGraphicsDialog::Initialize() @@ -207,6 +209,14 @@ void CompressGraphicsDialog::Update() m_xFixedText6->set_label("??"); } +void CompressGraphicsDialog::UpdateSensitivity(const bool bSensitive) +{ +m_xMFNewWidth->set_sensitive(bSensitive); +m_xMFNewHeight->set_sensitive(bSensitive); +m_xResolutionLB->set_sensitive(bSensitive); +m_xInterpolationCombo->set_sensitive(bSensitive); +} + void CompressGraphicsDialog::UpdateNewWidthMF() { int nPixelX = static_cast( GetViewWidthInch() * m_dResolution ); @@ -353,11 +363,7 @@ IMPL_LINK_NOARG( CompressGraphicsDialog, ToggleCompressionRB, weld::Toggleable&, IMPL_LINK_NOARG( CompressGraphicsDialog, ToggleReduceResolutionRB, weld::Toggleable&, void ) { -bool choice = m_xReduceResolutionCB->get_active(); -m_xMFNewWidth->set_sensitive(choice); -m_xMFNewHeight->set_sensitive(choice); -m_xResolutionLB->set_sensitive(choice); -m_xInterpolationCombo->set_sensitive(choice); +UpdateSensitivity(m_xReduceResolutionCB->get_active()); Update(); }
core.git: include/svx svx/source
include/svx/xcolit.hxx |4 ++-- svx/source/xoutdev/xattr.cxx | 14 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) New commits: commit cdde4687ea0da4d101567a64fa0d60103f353d68 Author: Miklos Vajna AuthorDate: Tue Jan 2 09:05:24 2024 +0100 Commit: Miklos Vajna CommitDate: Tue Jan 2 09:58:18 2024 +0100 svx: prefix members of XColorItem See tdf#94879 for motivation. Change-Id: I7e945c6c0d1ff13445255125732c3d3a02cda350 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161534 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/xcolit.hxx b/include/svx/xcolit.hxx index 26941279490c..a89a1f37e97f 100644 --- a/include/svx/xcolit.hxx +++ b/include/svx/xcolit.hxx @@ -30,7 +30,7 @@ class XColorList; class SVXCORE_DLLPUBLIC XColorItem : public NameOrIndex { -Color aColor; +Color m_aColor; model::ComplexColor maComplexColor; public: @@ -47,7 +47,7 @@ public: virtual XColorItem* Clone(SfxItemPool* pPool = nullptr) const override; const Color&GetColorValue() const; -voidSetColorValue(const Color& rNew) { aColor = rNew; Detach(); } +voidSetColorValue(const Color& rNew) { m_aColor = rNew; Detach(); } void setComplexColor(model::ComplexColor const& rComplexColor) { maComplexColor = rComplexColor; } const model::ComplexColor& getComplexColor() const { return maComplexColor; } diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 2404a59edb50..957f6d0ffb26 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -265,25 +265,25 @@ SfxPoolItem* XColorItem::CreateDefault() { return new XColorItem; } XColorItem::XColorItem(TypedWhichId _nWhich, sal_Int32 nIndex, const Color& rTheColor) : NameOrIndex(_nWhich, nIndex), -aColor(rTheColor) +m_aColor(rTheColor) { } XColorItem::XColorItem(TypedWhichId _nWhich, const OUString& rName, const Color& rTheColor) : NameOrIndex(_nWhich, rName), -aColor(rTheColor) +m_aColor(rTheColor) { } XColorItem::XColorItem(TypedWhichId _nWhich, const Color& rTheColor) : NameOrIndex(_nWhich, OUString()) -, aColor(rTheColor) +, m_aColor(rTheColor) { } XColorItem::XColorItem(const XColorItem& rItem) : NameOrIndex(rItem), -aColor(rItem.aColor), +m_aColor(rItem.m_aColor), maComplexColor(rItem.maComplexColor) { } @@ -296,14 +296,14 @@ XColorItem* XColorItem::Clone(SfxItemPool* /*pPool*/) const bool XColorItem::operator==(const SfxPoolItem& rItem) const { return ( NameOrIndex::operator==(rItem) && -static_cast(rItem).aColor == aColor ) && +static_cast(rItem).m_aColor == m_aColor ) && static_cast(rItem).maComplexColor == maComplexColor; } const Color& XColorItem::GetColorValue() const { assert(!IsIndex()); -return aColor; +return m_aColor; } @@ -386,7 +386,7 @@ void XColorItem::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("whichId"), BAD_CAST("XATTR_FILLCOLOR")); } (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("aColor"), - BAD_CAST(aColor.AsRGBHexString().toUtf8().getStr())); + BAD_CAST(m_aColor.AsRGBHexString().toUtf8().getStr())); NameOrIndex::dumpAsXml(pWriter);
core.git: include/svx svx/source
include/svx/obj3d.hxx|1 include/svx/svdgeodata.hxx | 48 +++ include/svx/svdobj.hxx | 22 --- include/svx/svdotext.hxx |1 svx/source/svdraw/svdobj.cxx | 14 5 files changed, 56 insertions(+), 30 deletions(-) New commits: commit 44d0a0ac2ed91228d817a9e4e863eb444c5c3cc8 Author: Noel Grandin AuthorDate: Mon Dec 18 12:52:35 2023 +0200 Commit: Noel Grandin CommitDate: Mon Dec 18 16:06:22 2023 +0100 unique_ptr->optional in SdrObjGeoData and move it to its own header file to make the include dependencies easier to handle Change-Id: I9449ebd70d83be332e47e1786422697f76175e53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160905 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/obj3d.hxx b/include/svx/obj3d.hxx index 13ffc73c9879..54919a49c931 100644 --- a/include/svx/obj3d.hxx +++ b/include/svx/obj3d.hxx @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/include/svx/svdgeodata.hxx b/include/svx/svdgeodata.hxx new file mode 100644 index ..7f5a8b9713a4 --- /dev/null +++ b/include/svx/svdgeodata.hxx @@ -0,0 +1,48 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include +#include +#include +#include +#include + +/** + * All geometrical data of an arbitrary object for use in undo/redo + */ +class SVXCORE_DLLPUBLIC SdrObjGeoData +{ +public: +tools::Rectangle aBoundRect; +Point aAnchor; +std::optional moGluePoints; +bool bMovProt; +bool bSizProt; +bool bNoPrint; +bool bClosedObj; +bool mbVisible; +SdrLayerID mnLayerID; + +public: +SdrObjGeoData(); +virtual ~SdrObjGeoData(); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 892beb56668c..2951d41e8904 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -76,6 +76,7 @@ class Fraction; enum class PointerStyle; class Graphic; class SvxShape; +class SdrObjGeoData; namespace basegfx { class B2DPoint; @@ -163,27 +164,6 @@ public: sal_uInt16 GetId() const { return m_nIdentifier;} }; -/** - * All geometrical data of an arbitrary object for use in undo/redo - */ -class SVXCORE_DLLPUBLIC SdrObjGeoData -{ -public: -tools::Rectangle aBoundRect; -Point aAnchor; -std::unique_ptr -pGPL; -boolbMovProt; -boolbSizProt; -boolbNoPrint; -boolbClosedObj; -boolmbVisible; -SdrLayerID mnLayerID; - -public: -SdrObjGeoData(); -virtual ~SdrObjGeoData(); -}; /** * Provides information about various ZObject properties diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index d9c0908e505b..84aea85fdeff 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index f4d13219db0d..652d965e4c3e 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1903,13 +1903,9 @@ void SdrObject::SaveGeoData(SdrObjGeoData& rGeo) const // user-defined gluepoints if (m_pPlusData!=nullptr && m_pPlusData->pGluePoints!=nullptr) { -if (rGeo.pGPL!=nullptr) { -*rGeo.pGPL=*m_pPlusData->pGluePoints; -} else { -rGeo.pGPL.reset( new SdrGluePointList(*m_pPlusData->pGluePoints) ); -} +rGeo.moGluePoints = *m_pPlusData->pGluePoints; } else { -rGeo.pGPL.reset(); +rGeo.moGluePoints.reset(); } } @@ -1926,12 +1922,12 @@ void SdrObject::RestoreGeoData(const SdrObjGeoData& rGeo) mnLayerID = rGeo.mnLayerID; // user-defined gluepoints -if (rGeo.pGPL!=nullptr) { +if (rGeo.moGluePoints) { ImpForcePlusData(); if (m_pPlusData->pGluePoints!=nullptr) { -
core.git: include/svx svx/source
include/svx/xtable.hxx|4 ++-- svx/source/xoutdev/xtable.cxx |2 +- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 3930366328042b0fe8d63bc8a2eb827fd7e230a6 Author: Miklos Vajna AuthorDate: Mon Dec 18 08:18:29 2023 +0100 Commit: Miklos Vajna CommitDate: Mon Dec 18 12:51:41 2023 +0100 svx: prefix members of XColorEntry See tdf#94879 for motivation. Change-Id: I5f666424a2f9cd2206f37b4440d54452e339e3e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160891 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx index e84f459511e2..eb015497a9e4 100644 --- a/include/svx/xtable.hxx +++ b/include/svx/xtable.hxx @@ -42,14 +42,14 @@ class SVXCORE_DLLPUBLIC XColorEntry final : public XPropertyEntry { private: -Color aColor; +Color m_aColor; public: XColorEntry(const Color& rColor, const OUString& rName); const Color& GetColor() const { -return aColor; +return m_aColor; } }; diff --git a/svx/source/xoutdev/xtable.cxx b/svx/source/xoutdev/xtable.cxx index 9818fd1939f4..87850e6f25b8 100644 --- a/svx/source/xoutdev/xtable.cxx +++ b/svx/source/xoutdev/xtable.cxx @@ -32,7 +32,7 @@ using namespace com::sun::star; XColorEntry::XColorEntry(const Color& rColor, const OUString& rName) : XPropertyEntry(rName), -aColor(rColor) +m_aColor(rColor) { }
core.git: include/svx svx/source
include/svx/svddrag.hxx | 116 +- svx/source/svdraw/svddrag.cxx | 66 +++ 2 files changed, 91 insertions(+), 91 deletions(-) New commits: commit 3db4228c59f8dbcf2143c24553d7c75cd0bf1e7a Author: Miklos Vajna AuthorDate: Mon Dec 11 08:18:28 2023 +0100 Commit: Miklos Vajna CommitDate: Mon Dec 11 10:10:42 2023 +0100 svx: prefix members of SdrDragStat See tdf#94879 for motivation. Change-Id: Ie3870e511a95c8b2862424cf538cebb0f5fce5dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160558 Reviewed-by: Miklos Vajna Tested-by: Jenkins diff --git a/include/svx/svddrag.hxx b/include/svx/svddrag.hxx index 5a1d8d16af48..fb01f9599b1b 100644 --- a/include/svx/svddrag.hxx +++ b/include/svx/svddrag.hxx @@ -45,34 +45,34 @@ struct SdrDragStatUserData class SVXCORE_DLLPUBLIC SdrDragStat final { -SdrHdl* pHdl; // The Handle for the User -SdrView* pView; -SdrPageView* pPageView; +SdrHdl* m_pHdl; // The Handle for the User +SdrView* m_pView; +SdrPageView* m_pPageView; std::vector mvPnts; // All previous Points: [0]=Start, [Count()-2]=Prev -Point aRef1; // Referencepoint: Resize fixed point, (axis of rotation, -Point aRef2; // axis of reflection, ...) -Point aPos0; // Position at the last Event -Point aRealNow; // Current dragging position without Snap, Ortho and Limit -tools::Rectangle aActionRect; - -bool bEndDragChangesAttributes; -bool bEndDragChangesGeoAndAttributes; +Point m_aRef1; // Referencepoint: Resize fixed point, (axis of rotation, +Point m_aRef2; // axis of reflection, ...) +Point m_aPos0; // Position at the last Event +Point m_aRealNow; // Current dragging position without Snap, Ortho and Limit +tools::Rectangle m_aActionRect; + +bool m_bEndDragChangesAttributes; +bool m_bEndDragChangesGeoAndAttributes; /// Table row drag: table will re-layout itself later. bool mbEndDragChangesLayout; -bool bMouseIsUp; +bool m_bMouseIsUp; -bool bShown;// Xor visible? -sal_uInt16nMinMov; // So much has to be minimally moved first -bool bMinMoved; // MinMove surpassed? +bool m_bShown;// Xor visible? +sal_uInt16m_nMinMov; // So much has to be minimally moved first +bool m_bMinMoved; // MinMove surpassed? -bool bHorFixed; // Dragging only vertical -bool bVerFixed; // Dragging only horizontal -bool bWantNoSnap; // To decide if pObj-> MovCreate () should use NoSnapPos or not. +bool m_bHorFixed; // Dragging only vertical +bool m_bVerFixed; // Dragging only horizontal +bool m_bWantNoSnap; // To decide if pObj-> MovCreate () should use NoSnapPos or not. // Therefore, NoSnapPos is written into the buffer. -bool bOrtho4; -bool bOrtho8; +bool m_bOrtho4; +bool m_bOrtho8; -SdrDragMethod* pDragMethod; +SdrDragMethod* m_pDragMethod; std::unique_ptr mpUserData; // Userdata void Clear(); @@ -93,62 +93,62 @@ public: SdrDragStat(){ Reset(); } ~SdrDragStat(); void Reset(); -SdrView* GetView() const { return pView; } -void SetView(SdrView* pV){ pView=pV; } -SdrPageView* GetPageView() const { return pPageView; } -void SetPageView(SdrPageView* pPV) { pPageView=pPV; } +SdrView* GetView() const { return m_pView; } +void SetView(SdrView* pV){ m_pView=pV; } +SdrPageView* GetPageView() const { return m_pPageView; } +void SetPageView(SdrPageView* pPV) { m_pPageView=pPV; } const Point& GetPoint(sal_Int32 nNum) const { return mvPnts[nNum]; } sal_Int32GetPointCount() const { return mvPnts.size(); } const Point& GetStart() const{ return mvPnts[0]; } const Point& GetPrev() const { return mvPnts[GetPrevPos()]; } -const Point& GetPos0() const { return aPos0; } +const Point& GetPos0() const { return m_aPos0; } const Point& GetNow() const { return mvPnts.back(); } void SetNow(Point const ) { mvPnts.back() = pt; } -const Point& GetRef1() const { return aRef1; } -void SetRef1(const Point ){ aRef1 = pt; } -const Point& GetRef2() const { return aRef2; } -void SetRef2(const Point ){ aRef2 = pt; } -constSdrHdl* GetHdl() const { return pHdl; } -void SetHdl(SdrHdl* pH) {
core.git: include/svx svx/source
include/svx/EnhancedCustomShapeGeometry.hxx |3 svx/source/customshapes/EnhancedCustomShapeGeometry.cxx | 376 svx/source/svdraw/svdoashp.cxx | 18 3 files changed, 198 insertions(+), 199 deletions(-) New commits: commit abdb93ce28febd7c4b4e5dad164ee8a394b499b9 Author: Dr. David Alan Gilbert AuthorDate: Mon Jul 3 15:42:09 2023 +0100 Commit: Hossein CommitDate: Sat Dec 9 00:51:23 2023 +0100 tdf#147021 Use std::span to avoid SAL_N_ELEMENTS in CustomShape as for previous set, this time for TextRectangles Again the data is mechanically search/replaced. Change-Id: I836a0c8384d08da6d8c05cfc6ef9f55c1c90fc12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153885 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/include/svx/EnhancedCustomShapeGeometry.hxx b/include/svx/EnhancedCustomShapeGeometry.hxx index c776daff606a..b95501c288c3 100644 --- a/include/svx/EnhancedCustomShapeGeometry.hxx +++ b/include/svx/EnhancedCustomShapeGeometry.hxx @@ -75,8 +75,7 @@ struct mso_CustomShape sal_uInt32 nElements; std::span pCalculation; sal_Int32* pDefData; -SvxMSDffTextRectangles* pTextRect; -sal_uInt32 nTextRect; +std::span pTextRect; sal_Int32 nCoordWidth; sal_Int32 nCoordHeight; sal_Int32 nXRef; diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index 31085c48b9a2..a70b25292e33 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -131,7 +131,7 @@ const mso_CustomShape msoArc = const_cast(mso_sptArcSegm), sizeof( mso_sptArcSegm ) >> 1, std::span(mso_sptArcCalc), const_cast(mso_sptArcDefault), -nullptr, 0, +std::span(), 21600, 21600, MIN_INT32, MIN_INT32, std::span(), @@ -148,7 +148,7 @@ const mso_CustomShape msoTextSimple = nullptr, 0, std::span(), nullptr, -nullptr, 0, +std::span(), 21600, 21600, MIN_INT32, MIN_INT32, std::span(), @@ -165,7 +165,7 @@ const mso_CustomShape msoRectangle = nullptr, 0, std::span(), nullptr, -nullptr, 0, +std::span(), 21600, 21600, MIN_INT32, MIN_INT32, std::span(), @@ -210,7 +210,7 @@ const mso_CustomShape msoRoundRectangle = const_cast(mso_sptRoundRectangleSegm), sizeof( mso_sptRoundRectangleSegm ) >> 1, std::span(mso_sptRoundRectangleCalc), const_cast(mso_sptDefault3600), -const_cast(mso_sptRoundRectangleTextRect), SAL_N_ELEMENTS( mso_sptRoundRectangleTextRect ), +std::span(mso_sptRoundRectangleTextRect), 21600, 21600, 10800, 10800, std::span(), @@ -235,7 +235,7 @@ const mso_CustomShape msoRightTriangle = nullptr, 0, std::span(), nullptr, -const_cast(mso_sptRightTriangleTextRect), SAL_N_ELEMENTS( mso_sptRightTriangleTextRect ), +std::span(mso_sptRightTriangleTextRect), 21600, 21600, MIN_INT32, MIN_INT32, std::span(mso_sptRightTriangleGluePoints), @@ -264,7 +264,7 @@ const mso_CustomShape msoEllipse = const_cast(mso_sptEllipseSegm), sizeof( mso_sptEllipseSegm ) >> 1, std::span(), nullptr, -const_cast(mso_sptEllipseTextRect), SAL_N_ELEMENTS( mso_sptEllipseTextRect ), +std::span(mso_sptEllipseTextRect), 21600, 21600, MIN_INT32, MIN_INT32, std::span(mso_sptEllipseGluePoints), @@ -315,7 +315,7 @@ const mso_CustomShape msoParallelogram = const_cast(mso_sptParallelogramSegm), sizeof( mso_sptParallelogramSegm ) >> 1, std::span(mso_sptParallelogramCalc), const_cast(mso_sptDefault5400), -const_cast(mso_sptParallelogramTextRect), SAL_N_ELEMENTS( mso_sptParallelogramTextRect ), +std::span(mso_sptParallelogramTextRect), 21600, 21600, MIN_INT32, MIN_INT32, std::span(mso_sptParallelogramGluePoints), @@ -336,7 +336,7 @@ const mso_CustomShape msoDiamond = nullptr, 0, std::span(), nullptr, -const_cast(mso_sptDiamondTextRect), SAL_N_ELEMENTS( mso_sptDiamondTextRect ), +std::span(mso_sptDiamondTextRect), 21600, 21600, MIN_INT32, MIN_INT32, std::span(mso_sptStandardGluePoints), @@ -380,7 +380,7 @@ const mso_CustomShape msoTrapezoid = const_cast(mso_sptTrapezoidSegm), sizeof( mso_sptTrapezoidSegm ) >> 1, std::span(mso_sptTrapezoidCalc), const_cast(mso_sptDefault5400), -const_cast(mso_sptTrapezoidTextRect), SAL_N_ELEMENTS( mso_sptTrapezoidTextRect ), +std::span(mso_sptTrapezoidTextRect), 21600, 21600, MIN_INT32, MIN_INT32, std::span(mso_sptTrapezoidGluePoints), @@ -471,7 +471,7 @@ const mso_CustomShape msoOctagon = const_cast(mso_sptOctagonSegm),
core.git: include/svx svx/source
include/svx/EnhancedCustomShapeGeometry.hxx |3 svx/source/customshapes/EnhancedCustomShapeGeometry.cxx | 377 +++- svx/source/svdraw/svdoashp.cxx | 22 3 files changed, 202 insertions(+), 200 deletions(-) New commits: commit 4a49d7a3a98ccdca52ea0a4475d05235a111ec0a Author: Dr. David Alan Gilbert AuthorDate: Mon Jul 3 15:30:04 2023 +0100 Commit: Hossein CommitDate: Sat Dec 9 00:47:13 2023 +0100 tdf#147021 Use std::span to avoid SAL_N_ELEMENTS in CustomShape as for previous set, this time for Calculations. Again the size is mostly mechanical: In vim load into a: :+4,+4s/const_cast[(]\([^)]*\)[)],.*/o3tl::span(\1),/ :+4,+4s/nullptr, 0/o3tl::span() and run :%g/^const mso_C.*=/@a (But has had some fixups after conversion from o3tl to std) Change-Id: I11cdfffdfb61678c173d3136a8e948fd0c224af7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153884 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/include/svx/EnhancedCustomShapeGeometry.hxx b/include/svx/EnhancedCustomShapeGeometry.hxx index 3191f1e5d14f..c776daff606a 100644 --- a/include/svx/EnhancedCustomShapeGeometry.hxx +++ b/include/svx/EnhancedCustomShapeGeometry.hxx @@ -73,8 +73,7 @@ struct mso_CustomShape std::span pVertices; sal_uInt16* pElements; sal_uInt32 nElements; -SvxMSDffCalculationData*pCalculation; -sal_uInt32 nCalculation; +std::span pCalculation; sal_Int32* pDefData; SvxMSDffTextRectangles* pTextRect; sal_uInt32 nTextRect; diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index ad87e34d5da3..31085c48b9a2 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include #include @@ -130,7 +129,7 @@ const mso_CustomShape msoArc = { std::span(mso_sptArcVert), const_cast(mso_sptArcSegm), sizeof( mso_sptArcSegm ) >> 1, -const_cast(mso_sptArcCalc), SAL_N_ELEMENTS( mso_sptArcCalc ), +std::span(mso_sptArcCalc), const_cast(mso_sptArcDefault), nullptr, 0, 21600, 21600, @@ -147,7 +146,7 @@ const mso_CustomShape msoTextSimple = { std::span(mso_sptTextSimpleVert), nullptr, 0, -nullptr, 0, +std::span(), nullptr, nullptr, 0, 21600, 21600, @@ -164,7 +163,7 @@ const mso_CustomShape msoRectangle = { std::span(mso_sptRectangleVert), nullptr, 0, -nullptr, 0, +std::span(), nullptr, nullptr, 0, 21600, 21600, @@ -209,7 +208,7 @@ const mso_CustomShape msoRoundRectangle = { std::span(mso_sptRoundRectangleVert), const_cast(mso_sptRoundRectangleSegm), sizeof( mso_sptRoundRectangleSegm ) >> 1, -const_cast(mso_sptRoundRectangleCalc), SAL_N_ELEMENTS( mso_sptRoundRectangleCalc ), +std::span(mso_sptRoundRectangleCalc), const_cast(mso_sptDefault3600), const_cast(mso_sptRoundRectangleTextRect), SAL_N_ELEMENTS( mso_sptRoundRectangleTextRect ), 21600, 21600, @@ -234,7 +233,7 @@ const mso_CustomShape msoRightTriangle = { std::span(mso_sptRightTriangleVert), nullptr, 0, -nullptr, 0, +std::span(), nullptr, const_cast(mso_sptRightTriangleTextRect), SAL_N_ELEMENTS( mso_sptRightTriangleTextRect ), 21600, 21600, @@ -263,7 +262,7 @@ const mso_CustomShape msoEllipse = { std::span(mso_sptEllipseVert), const_cast(mso_sptEllipseSegm), sizeof( mso_sptEllipseSegm ) >> 1, -nullptr, 0, +std::span(), nullptr, const_cast(mso_sptEllipseTextRect), SAL_N_ELEMENTS( mso_sptEllipseTextRect ), 21600, 21600, @@ -314,7 +313,7 @@ const mso_CustomShape msoParallelogram = { std::span(mso_sptParallelogramVert), const_cast(mso_sptParallelogramSegm), sizeof( mso_sptParallelogramSegm ) >> 1, -const_cast(mso_sptParallelogramCalc), SAL_N_ELEMENTS( mso_sptParallelogramCalc ), +std::span(mso_sptParallelogramCalc), const_cast(mso_sptDefault5400), const_cast(mso_sptParallelogramTextRect), SAL_N_ELEMENTS( mso_sptParallelogramTextRect ), 21600, 21600, @@ -335,7 +334,7 @@ const mso_CustomShape msoDiamond = { std::span(mso_sptDiamondVert), nullptr, 0, -nullptr, 0, +std::span(), nullptr, const_cast(mso_sptDiamondTextRect), SAL_N_ELEMENTS( mso_sptDiamondTextRect ), 21600, 21600, @@ -379,7 +378,7 @@ const mso_CustomShape msoTrapezoid = { std::span(mso_sptTrapezoidVert), const_cast(mso_sptTrapezoidSegm), sizeof( mso_sptTrapezoidSegm ) >> 1, -const_cast(mso_sptTrapezoidCalc), SAL_N_ELEMENTS(
core.git: include/svx svx/source
include/svx/EnhancedCustomShapeGeometry.hxx |3 svx/source/customshapes/EnhancedCustomShapeGeometry.cxx | 379 svx/source/svdraw/svdoashp.cxx | 10 3 files changed, 196 insertions(+), 196 deletions(-) New commits: commit 82f30ac55a90a0f0915d4016c760c5c38db087f1 Author: Dr. David Alan Gilbert AuthorDate: Mon Jul 3 15:05:03 2023 +0100 Commit: Hossein CommitDate: Sat Dec 9 00:46:06 2023 +0100 tdf#147021 Use std::span to avoid SAL_N_ELEMENTS in CustomShape as for previous set, this time the GluePoints. Again the size is mostly mechanical: In vim into the A register: :+9,+9s/const_cast[(]\([^)]*\)[)],.*/o3tl::span(\1),/ :+9,+9s/nullptr, 0/o3tl::span() and then: :%g/^const mso_C.*=/@a for the tables. (But has had some fixups since switching from o3tl to std) Change-Id: I966275caf38a6af469d334a0161053159e726f22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153883 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/include/svx/EnhancedCustomShapeGeometry.hxx b/include/svx/EnhancedCustomShapeGeometry.hxx index db8fe5a5944f..3191f1e5d14f 100644 --- a/include/svx/EnhancedCustomShapeGeometry.hxx +++ b/include/svx/EnhancedCustomShapeGeometry.hxx @@ -82,8 +82,7 @@ struct mso_CustomShape sal_Int32 nCoordHeight; sal_Int32 nXRef; sal_Int32 nYRef; -SvxMSDffVertPair* pGluePoints; -sal_uInt32 nGluePoints; +std::span pGluePoints; SvxMSDffHandle* pHandles; sal_uInt32 nHandles; }; diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index 2fa97e30b32d..ad87e34d5da3 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + #include #include @@ -134,7 +135,7 @@ const mso_CustomShape msoArc = nullptr, 0, 21600, 21600, MIN_INT32, MIN_INT32, -nullptr, 0, +std::span(), const_cast(mso_sptArcHandle), SAL_N_ELEMENTS( mso_sptArcHandle )// handles }; @@ -151,7 +152,7 @@ const mso_CustomShape msoTextSimple = nullptr, 0, 21600, 21600, MIN_INT32, MIN_INT32, -nullptr, 0, +std::span(), nullptr, 0 // handles }; @@ -168,7 +169,7 @@ const mso_CustomShape msoRectangle = nullptr, 0, 21600, 21600, MIN_INT32, MIN_INT32, -nullptr, 0, +std::span(), nullptr, 0 // handles }; @@ -213,7 +214,7 @@ const mso_CustomShape msoRoundRectangle = const_cast(mso_sptRoundRectangleTextRect), SAL_N_ELEMENTS( mso_sptRoundRectangleTextRect ), 21600, 21600, 10800, 10800, -nullptr, 0, +std::span(), const_cast(mso_sptRoundRectangleHandle), SAL_N_ELEMENTS( mso_sptRoundRectangleHandle ) // handles }; @@ -238,7 +239,7 @@ const mso_CustomShape msoRightTriangle = const_cast(mso_sptRightTriangleTextRect), SAL_N_ELEMENTS( mso_sptRightTriangleTextRect ), 21600, 21600, MIN_INT32, MIN_INT32, -const_cast(mso_sptRightTriangleGluePoints), SAL_N_ELEMENTS( mso_sptRightTriangleGluePoints ), +std::span(mso_sptRightTriangleGluePoints), nullptr, 0 // handles }; @@ -267,7 +268,7 @@ const mso_CustomShape msoEllipse = const_cast(mso_sptEllipseTextRect), SAL_N_ELEMENTS( mso_sptEllipseTextRect ), 21600, 21600, MIN_INT32, MIN_INT32, -const_cast(mso_sptEllipseGluePoints), SAL_N_ELEMENTS( mso_sptEllipseGluePoints ), +std::span(mso_sptEllipseGluePoints), nullptr, 0 // handles }; @@ -318,7 +319,7 @@ const mso_CustomShape msoParallelogram = const_cast(mso_sptParallelogramTextRect), SAL_N_ELEMENTS( mso_sptParallelogramTextRect ), 21600, 21600, MIN_INT32, MIN_INT32, -const_cast(mso_sptParallelogramGluePoints), SAL_N_ELEMENTS( mso_sptParallelogramGluePoints ), +std::span(mso_sptParallelogramGluePoints), const_cast(mso_sptParallelogramHandle), SAL_N_ELEMENTS( mso_sptParallelogramHandle )// handles }; @@ -339,7 +340,7 @@ const mso_CustomShape msoDiamond = const_cast(mso_sptDiamondTextRect), SAL_N_ELEMENTS( mso_sptDiamondTextRect ), 21600, 21600, MIN_INT32, MIN_INT32, -const_cast(mso_sptStandardGluePoints), SAL_N_ELEMENTS( mso_sptStandardGluePoints ), +std::span(mso_sptStandardGluePoints), nullptr, 0 // handles }; @@ -383,7 +384,7 @@ const mso_CustomShape msoTrapezoid = const_cast(mso_sptTrapezoidTextRect), SAL_N_ELEMENTS( mso_sptTrapezoidTextRect ), 21600, 21600, MIN_INT32, MIN_INT32, -const_cast(mso_sptTrapezoidGluePoints), SAL_N_ELEMENTS(
core.git: include/svx svx/source
include/svx/EnhancedCustomShapeGeometry.hxx |3 svx/source/customshapes/EnhancedCustomShapeGeometry.cxx | 377 svx/source/svdraw/svdoashp.cxx | 10 3 files changed, 195 insertions(+), 195 deletions(-) New commits: commit 9924561a094f1b3b2b78700bd1f1638d9608f881 Author: Dr. David Alan Gilbert AuthorDate: Mon Jul 3 13:16:42 2023 +0100 Commit: Hossein CommitDate: Fri Dec 8 17:13:53 2023 +0100 tdf#147021 Use std::span to avoid SAL_N_ELEMENTS in CustomShape EnhancedCustomShapeGeometry has a set of predefined shapes defined with classic arrays and each is used in a structure initialisation like: const mso_CustomShape msoArc = { -const_cast(mso_sptArcVert), SAL_N_ELEMENTS( mso_sptArcVert ), by using a span we can turn that into: +std::span(mso_sptArcVert), There's potential to get rid of some numbered loops later as well. The patch is large mostly because of mechanical replacement Loading EnhancedCustomShapeGeometry.cxx into vim then: into register A put: :+2,+2s/const_cast[(]\([^)]*\)[)],.*/o3tl::span(\1),/ and do: :%g/^const mso_C.*=/@a (since fixed up to std:: ) Change-Id: Ia670b6aa7cc9f662650de2af76ee271a4469f1f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153882 Tested-by: Jenkins Reviewed-by: Hossein diff --git a/include/svx/EnhancedCustomShapeGeometry.hxx b/include/svx/EnhancedCustomShapeGeometry.hxx index a52dc4820b6e..db8fe5a5944f 100644 --- a/include/svx/EnhancedCustomShapeGeometry.hxx +++ b/include/svx/EnhancedCustomShapeGeometry.hxx @@ -70,8 +70,7 @@ struct SvxMSDffHandle }; struct mso_CustomShape { -SvxMSDffVertPair* pVertices; -sal_uInt32 nVertices; +std::span pVertices; sal_uInt16* pElements; sal_uInt32 nElements; SvxMSDffCalculationData*pCalculation; diff --git a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx index 8e9ee89fb716..2fa97e30b32d 100644 --- a/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeGeometry.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -126,7 +127,7 @@ const SvxMSDffHandle mso_sptArcHandle[] = }; const mso_CustomShape msoArc = { -const_cast(mso_sptArcVert), SAL_N_ELEMENTS( mso_sptArcVert ), +std::span(mso_sptArcVert), const_cast(mso_sptArcSegm), sizeof( mso_sptArcSegm ) >> 1, const_cast(mso_sptArcCalc), SAL_N_ELEMENTS( mso_sptArcCalc ), const_cast(mso_sptArcDefault), @@ -143,7 +144,7 @@ const SvxMSDffVertPair mso_sptTextSimpleVert[] = }; const mso_CustomShape msoTextSimple = { -const_cast(mso_sptTextSimpleVert), SAL_N_ELEMENTS( mso_sptTextSimpleVert ), +std::span(mso_sptTextSimpleVert), nullptr, 0, nullptr, 0, nullptr, @@ -160,7 +161,7 @@ const SvxMSDffVertPair mso_sptRectangleVert[] = }; const mso_CustomShape msoRectangle = { -const_cast(mso_sptRectangleVert), SAL_N_ELEMENTS( mso_sptRectangleVert ), +std::span(mso_sptRectangleVert), nullptr, 0, nullptr, 0, nullptr, @@ -205,7 +206,7 @@ const SvxMSDffHandle mso_sptRoundRectangleHandle[] = }; const mso_CustomShape msoRoundRectangle = { -const_cast(mso_sptRoundRectangleVert), SAL_N_ELEMENTS( mso_sptRoundRectangleVert ), +std::span(mso_sptRoundRectangleVert), const_cast(mso_sptRoundRectangleSegm), sizeof( mso_sptRoundRectangleSegm ) >> 1, const_cast(mso_sptRoundRectangleCalc), SAL_N_ELEMENTS( mso_sptRoundRectangleCalc ), const_cast(mso_sptDefault3600), @@ -230,7 +231,7 @@ const SvxMSDffVertPair mso_sptRightTriangleGluePoints[] = }; const mso_CustomShape msoRightTriangle = { -const_cast(mso_sptRightTriangleVert), SAL_N_ELEMENTS( mso_sptRightTriangleVert ), +std::span(mso_sptRightTriangleVert), nullptr, 0, nullptr, 0, nullptr, @@ -259,7 +260,7 @@ const SvxMSDffVertPair mso_sptEllipseGluePoints[] = }; const mso_CustomShape msoEllipse = { -const_cast(mso_sptEllipseVert), SAL_N_ELEMENTS( mso_sptEllipseVert ), +std::span(mso_sptEllipseVert), const_cast(mso_sptEllipseSegm), sizeof( mso_sptEllipseSegm ) >> 1, nullptr, 0, nullptr, @@ -310,7 +311,7 @@ const SvxMSDffHandle mso_sptParallelogramHandle[] = }; const mso_CustomShape msoParallelogram = { -const_cast(mso_sptParallelogramVert), SAL_N_ELEMENTS( mso_sptParallelogramVert ), +std::span(mso_sptParallelogramVert), const_cast(mso_sptParallelogramSegm), sizeof( mso_sptParallelogramSegm ) >> 1, const_cast(mso_sptParallelogramCalc), SAL_N_ELEMENTS( mso_sptParallelogramCalc ), const_cast(mso_sptDefault5400), @@ -331,7 +332,7 @@ const SvxMSDffTextRectangles
[Libreoffice-commits] core.git: include/svx svx/source
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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: */